[
  {
    "path": ".gitignore",
    "content": "*~\nbin\nobj\n*.user\n*.suo\n*.bak\n*.sln.cache\n_ReSharper*\nReports\n*/build\n*/test-results\n*.pidb\n*.usertasks\n*.userprefs\n*.orig\ntest-results\ndist\nbuild\nSharedAssemblyInfo.cs\nVersionAssemblyInfo.cs"
  },
  {
    "path": "ChangeLog",
    "content": "2008-12-06  Miguel de Icaza  <miguel@novell.com>\n\n\t* Lib/Constants.cs: Add a handful of extra contants.\n\n\t* Lib/Codec.cs: Put here the coding/encoding routines that were\n\toriginally in egit's lib/Constants.java class\n\n\t* Lib/*: Align some API doc comments, add some API docs.\n\n\t* Lib/RefDatabase.cs (Peel): Implement.\n\n\t* Lib/Constants.cs: Put all the constants here (not sure where\n\tsome new constants should have gone). \n\n\t* Lib/Ref.cs: Update to support `Peeled' property and\n\t`OriginalName' from newer eGits.\n\n2008-12-03  Miguel de Icaza  <miguel@novell.com>\n\n\t* test.cs: make the sample program dump all the refs.\n\n\t* Lib/Repository.cs: Expose GetAllRefs.\n\n\t* Lib/RefDatabase.cs (ReadOneLooseRef): Do not crash if the\n\trefName is not present in the looseKeys.\n\n\t(RefreshPackedRefs): If the packed-refs file does not exist, do\n\tnot try to continue, it would otherwise crash.\n\n\t* Lib/WindowedFile.cs: Implement another file from the original\n\tJava implementation.\n\n\t* Lib/PackIndex.cs: Fix indentation of comment.\n\n\t* Lib/WindowCursor.cs: Implement.\n\n2008-12-02  Miguel de Icaza  <miguel@novell.com>\n\n\t* Lib/ByteArrayWindow.cs: Implement the functionality for\n\tByteArrayWindow, do not derive from ByteWindow which is a design\n\tin the original Java implementation to use two different backends\n\tfor storage.\n\n\tWe could achieve the same in a cleaner way than the original\n\timplementation if we choose to do so using an interface. \n\n"
  },
  {
    "path": "Demo.txt",
    "content": "Git# demo browser (Windows only) has been moved to http://github.com/henon/GitSharp.Demo/tree"
  },
  {
    "path": "Git/CmdParserOptionSet.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic; \nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    public class CmdParserOptionSet : OptionSet\n    {\n        protected override void InsertItem(int index, Option item) \n        {\n            base.InsertItem (index, item);     \n        }     \n        \n        protected override OptionContext CreateOptionContext()\n        {         \n            return new OptionContext (this);     \n        }     \n        \n        protected override bool Parse(string option, OptionContext c)     \n        {         \n            string f, n, s, v;         \n            bool haveParts = GetOptionParts (option, out f, out n, out s, out v);         \n            Option nextOption = null;         \n            string newOption  = option;   \n      \n            if (haveParts) \n            {             \n                nextOption = Contains (n) ? this [n] : null;             \n                newOption = f + n + (v != null ? s + v : \"\");         \n            }   \n      \n            if (c.Option != null) \n            {             \n                // Prevent --a --b             \n                if (c.Option != null && haveParts) \n                {                 \n                    throw new OptionException (                         \n                        string.Format (\"Found option `{0}' as value for option `{1}'.\",                             \n                        option, c.OptionName), c.OptionName);             \n                }             \n\n                // have a option w/ required value; try to concat values.             \n                if (AppendValue (option, c)) \n                {                 \n                    if (!option.EndsWith (\"\\\\\") &&                          \n                        c.Option.MaxValueCount == c.OptionValues.Count) \n                    {                     \n                        c.Option.Invoke (c);                 \n                    }                 \n                    \n                    return true;             \n                }             \n                else                 \n                    base.Parse (newOption, c);         \n            }         \n            if (!haveParts || v == null) \n            {             \n                // Not an option; let base handle as a non-option argument.             \n                return base.Parse (newOption, c);         \n            }         \n            if (nextOption.OptionValueType != OptionValueType.None &&                  \n                v.EndsWith (\"\\\\\")) \n            {             \n                c.Option = nextOption;             \n                c.OptionValues.Add (v);             \n                c.OptionName = f + n;             \n                return true;         \n            }         \n            return base.Parse (newOption, c);     \n        }     \n        \n        private bool AppendValue(string value, OptionContext c)     \n        {         \n            bool added = false;         \n            string[] seps = c.Option.GetValueSeparators ();\n            foreach (var o in seps.Length != 0 ? value.Split(seps, StringSplitOptions.None) : new string[] { value })\n            {\n                int idx = c.OptionValues.Count - 1;\n                if (idx == -1 || !c.OptionValues[idx].EndsWith(\"\\\\\"))\n                {\n                    c.OptionValues.Add(o);\n                    added = true;\n                }\n                else\n                {\n                    c.OptionValues[idx] += value;\n                    added = true;\n                }\n            }         \n            return added;     \n        } \n    }\n}\n"
  },
  {
    "path": "Git/Command.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\n   /**\n     * Annotation to document a {@link TextBuiltin}.\n     * \n     * This is an optional annotation for TextBuiltin subclasses and it carries\n     * documentation forward into the runtime system describing what the command is\n     * and why users may want to invoke it.\n     */\n    [AttributeUsage(AttributeTargets.All, AllowMultiple = false)]\n    public class Command : Attribute\n    {\n        public bool complete;\n        public string usage;\n        public bool common;\n        public string helpUrl;\n        public bool requiresRepository;\n\n        public Command()\n        {\n            this.complete = false;\n            this.common = false;\n            this.usage = \"\";\n            this.helpUrl = \"\";\n            this.requiresRepository = false;\n        }\n    }\n"
  },
  {
    "path": "Git/CommandCatalog.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Reflection;\nusing System.Text;\nusing System.Xml;\nusing GitSharp;\n\nnamespace GitSharp.CLI\n{\n\n    /// <summary>\n    ///  List of all commands known by the command line tools.\n    ///  Commands are implementations of the TextBuiltin class, with a required\n    ///  command attribute to insert additional documentation and add some extra\n    ///  information such as if the command is common and completed.\n    ///  \n    ///  Commands may be registered by adding them to the Commands.xml file.\n    ///  The Commands.xml file should contain:\n    ///      a. The command name including namespace.\n    ///      b. The website address for command specific online help.(optional)\n    /// </summary>\n    public class CommandCatalog\n    {\n        /// <summary>\n        /// Stores the command catalog.\n        /// </summary>\n        private SortedList<String, CommandRef> commands = new SortedList<string, CommandRef>();\n\n        /// <summary>\n        /// Creates the command catalog from the Commands.xml file.\n        /// </summary>\n        public CommandCatalog()\n        {\n            const string commandsXmlPath = \"GitSharp.CLI.Resources.Commands.xml\";\n            Stream fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(commandsXmlPath);\n            var doc = new XmlDocument();\n            doc.Load(fileStream);\n\n            XmlNodeList xmlNodeList = doc.SelectNodes(\"/root/CommandList/Command\");\n            foreach (XmlNode node in xmlNodeList)\n            {\n                XmlElement nameElement = node[\"Name\"];\n                XmlElement helpElement = node[\"Help\"];\n                if (nameElement != null)\n                    Load(nameElement.InnerText, helpElement.InnerText);\n            }\n        }\n\n        /// <summary>\n        /// Returns all commands starting with a specified string, sorted by command name.\n        /// </summary>\n        public List<CommandRef> StartsWith(String s)\n        {\n            List<CommandRef> matches = new List<CommandRef>();\n            foreach (CommandRef c in commands.Values)\n            {\n                if (c.getName().StartsWith(s))\n                    matches.Add(c);\n            }\n\n            return toSortedArray(matches);\n        }\n\n        /// <summary>\n        /// Create and loads the command name into the command catalog.\n        /// </summary>\n        /// <param name=\"commandName\">Specifies the command name to load.</param>\n        /// <param name=\"commandHelp\">Specifies the command's website for faster reference.</param>\n        public void Load(String commandName, String commandHelp)\n        {\n            TextBuiltin clazz;\n\n            Type commandType = Type.GetType(commandName);\n            if (commandType == null)\n                return;\n\n            clazz = Activator.CreateInstance(commandType) as TextBuiltin;\n            if (clazz == null)\n                return;\n\n            int index = clazz.ToString().LastIndexOf(\".\");\n            string cmdName = clazz.ToString().Substring(index + 1).ToLower();\n            clazz.setCommandName(cmdName);\n            clazz.setCommandHelp(commandHelp);\n\n            CommandRef cr = new CommandRef(clazz);\n            if (cr != null)\n                commands.Add(cr.getName(), cr);\n        }\n\n        /// <summary>\n        /// Locates a single command by its user friendly name.\n        /// </summary>\n        /// <param name=\"name\">Specifies the name of the command.</param>\n        /// <returns>Returns the CommandRef containing the command's information.</returns>\n        public CommandRef Get(String name)\n        {\n            CommandRef value = null;\n            commands.TryGetValue(name, out value);\n            return value;\n        }\n\n        /// <summary>\n        /// Returns all known commands, sorted by command name.\n        /// </summary>\n        public IList<CommandRef> All()\n        {\n            return commands.Values;\n        }\n\n        /// <summary>\n        /// Returns all common commands, sorted by command name.\n        /// </summary>\n        public List<CommandRef> Common()\n        {\n            List<CommandRef> common = new List<CommandRef>();\n            foreach (CommandRef c in commands.Values)\n            {\n                if (c.isCommon())\n                    common.Add(c);\n            }\n\n            return toSortedArray(common);\n        }\n\n        /// <summary>\n        /// Returns all incomplete commands, sorted by command name.\n        /// </summary>\n        public List<CommandRef> Incomplete()\n        {\n            List<CommandRef> incomplete = new List<CommandRef>();\n            foreach (CommandRef c in commands.Values)\n            {\n                if (!c.isComplete())\n                    incomplete.Add(c);\n            }\n\n            return toSortedArray(incomplete);\n        }\n\n        /// <summary>\n        /// Returns all complete commands, sorted by command name.\n        /// </summary>\n        public List<CommandRef> Complete()\n        {\n            List<CommandRef> complete = new List<CommandRef>();\n            foreach (CommandRef c in commands.Values)\n            {\n                if (c.isComplete())\n                    complete.Add(c);\n            }\n\n            return toSortedArray(complete);\n        }\n\n        /// <summary>\n        /// Sorts a list of specified commands by command name.\n        /// </summary>\n        /// <param name=\"c\">Specifies the list of commands to be sorted.</param>\n        /// <returns>Returns the sorted list of commands.</returns>\n        private List<CommandRef> toSortedArray(List<CommandRef> c)\n        {\n            c.Sort(\n                delegate(CommandRef ref1, CommandRef ref2)\n                {\n                    return ref1.getName().CompareTo(ref2.getName());\n                }\n            );\n            return c;\n        }\n    }\n}\n"
  },
  {
    "path": "Git/CommandRef.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\n\n\nnamespace GitSharp.CLI\n{\n\n    /// <summary>\n    /// Description of a command subcommand.\n    ///\n    /// These descriptions are lightweight compared to creating a command instance\n    /// and are therefore suitable for catalogs of \"known\" commands without linking\n    /// the command's implementation and creating a dummy instance of the command.\n    /// </summary>\n    public class CommandRef\n    {\n        private TextBuiltin impl;\n        private String name;\n        private String usage;\n        private String cmdHelp;\n        private bool requiresRepository;\n        bool complete;\n        bool common;\n\n        public CommandRef(TextBuiltin clazz)\n            : this(clazz, clazz.getCommandName())\n        {\n\n        }\n\n        public CommandRef(TextBuiltin clazz, String cn) \n        {\n            impl = (TextBuiltin)clazz;\n            name = cn;\n            Command cmd = impl.GetCommand();\n            if (cmd != null)\n            {\n                common = cmd.common;\n                complete = cmd.complete;\n                usage = cmd.usage;\n                cmdHelp = clazz.getCommandHelp();\n                requiresRepository = cmd.requiresRepository;\n            }\n        }\n\n        /// <summary>\n        /// Returns the friendly command name. The command as invoked from the command line.\n        /// </summary>\n        public String getName()\n        {\n            return name;\n        }\n\n        /// <summary>\n        /// Returns a one line description of the command's feature set.\n        /// </summary>\n        public String getUsage()\n        {\n            return usage;\n        }\n         \n        /// <summary>\n        /// Returns true if this command is considered to be commonly used.\n        /// </summary>\n        /// <returns></returns>\n        public bool isCommon()\n        {\n            return common;\n        }\n\n        /// <summary>\n        /// Returns true if this command is considered to be completed.\n        /// </summary>\n        /// <returns></returns>\n        public bool isComplete()\n        {\n            return complete;\n        }\n\n        /// <summary>\n        /// Returns true if this command requires a repository.\n        /// </summary>\n        /// <returns></returns>\n        public bool RequiresRepository()\n        {\n            return requiresRepository;\n        }\n\n        /// <summary>\n        /// Returns the name of the class which implements this command.\n        /// </summary>\n        /// <returns></returns>\n        public String getImplementationClassName()\n        {\n            return impl.ToString();\n        }\n\n        /// <summary>\n        /// Returns a new instance of the command implementation.\n        /// </summary>\n        /// <returns></returns>\n        public TextBuiltin Create()\n        {\n            TextBuiltin c = Activator.CreateInstance(Type.GetType(impl.ToString())) as TextBuiltin;\n            if (c != null)\n            {\n                c.setCommandHelp(cmdHelp);\n                c.RequiresRepository = requiresRepository;\n                return c;\n            }\n            else\n            {\n                return null;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Git/Commands/Add.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, requiresRepository = true, usage = \"Add file contents to the index\")]\n    class Add : TextBuiltin\n    {\n        private AddCommand cmd = new AddCommand();\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isDryRun = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isForced = false;\n        private static Boolean isInteractive = false;\n        private static Boolean isUpdateKnown = false;\n        private static Boolean isUpdateAll = false;\n        private static Boolean isIntentToAdd = false;\n        private static Boolean isRefreshOnly = false;\n        private static Boolean isIgnoreErrors = false;\n#endif\n\n        override public void Run(String[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                { \"n|dry-run\", \"Don't actually add the files, just show if they exist.\", v=>{isDryRun = true;}},\n                { \"v|verbose\", \"Be verbose.\", v=> {isVerbose = true;}},\n                { \"f|force\", \"Allow adding otherwise ignored files.\", v=> {isForced = true;}},\n                { \"i|interactive\", \"Interactive picking.\", v=>{isInteractive = true;}},\n                { \"p|patch\", \"Interactive patching.\", v=>DoPatch()},\n                { \"e|edit\", \"Open the diff vs. the index in an editor and let the user edit it.\", v=>DoEdit()},\n                { \"u|update\", \"Update tracked files.\", v=> {isUpdateKnown = true;}},\n                { \"A|all\", \"Add all files, noticing removal of tracked files.\", v=>{isUpdateAll = true;}},\n                { \"N|intent-to-add\", \"Record only the fact the path will be added later.\", v=>{isIntentToAdd = true;}},\n                { \"refresh\", \"Don't add the files, only refresh the index.\", v=> {isRefreshOnly = true;}},\n                { \"ignore-errors\", \"Just skip files which cannot be added because of errors.\", v=>{isIgnoreErrors = true;}},\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    //Add the file(s)\n                    //DoAdd(arguments);\n                    try\n                    {\n                        cmd.Arguments = arguments;\n                        cmd.Execute();\n                    }\n                    catch (ArgumentException e)\n                    {\n                        Console.WriteLine(\"Path does not exist: \" + e.ParamName);\n                        Console.WriteLine(\"Adding path(s) has been aborted.\");\n                    }\n                }\n                else if (args.Length <= 0)\n                {\n                    //Display the modified files for the existing repository\n                    Console.WriteLine(\"Nothing specified, nothing added.\");\n                    Console.WriteLine(\"Maybe you wanted to say 'git add .'?\");\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git add [options] [--] <filepattern>...\"); \n                Console.WriteLine(); \n                options.WriteOptionDescriptions(Console.Out); \n            }\n        }\n\n        private void DoAdd(List<String> filesAdded)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n\n        private void DoEdit()\n        {\n            Console.WriteLine(\"This option still needs to be implemented.\");\n        }\n\n        private void DoPatch()\n        {\n            Console.WriteLine(\"This option still needs to be implemented.\");\n        }\n\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Checkout.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, requiresRepository = true, usage = \"Checkout a branch or paths to the working tree\")]\n    public class Checkout : TextBuiltin\n    {\n        private CheckoutCommand cmd = new CheckoutCommand();\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isQuiet = false;\n        private static Boolean isForced = false;\n        private static Boolean isTracked = false;\n        private static Boolean isNoTrack = false;\n        private static Boolean isMerging = false;\n        private static Boolean isOurs = false;\n        private static Boolean isTheirs = false;\n        private static Boolean isConflict = false;\n        private static string branchName = \"\";\n#endif\n\n        override public void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n                { \"q|quiet\", \"Quiet, suppress feedback messages\", v => cmd.Quiet = false },\n#if ported\n                { \"f|force\", \"Force checkout and ignore unmerged changes\", v=>{isForced = true;}},\n                { \"ours\", \"For unmerged paths, checkout stage #2 from the index\", v=>{isOurs = true;}},\n                { \"theirs\", \"For unmerged paths, checkout stage #3 from the index\", v=>{isTheirs = true;}},\n                { \"b|branch=\", \"Create a new {branch}\",(string v) => branchName = v },\n                { \"t|track\", \"Set the upstream configuration\", v=>{isTracked = true;}},\n                { \"no-track\", \"Do not set the upstream configuration\", v=>{isNoTrack = true;}},\n                { \"l\", \"Create the new branch's reflog\", v=>RefLog()},\n                { \"m|merge\", \"Perform a three-way merge between the current branch, your working tree contents \" +\n                    \"and the new branch\", v=>{isMerging = true;}},\n                { \"conflict\",\"Same as merge above, but changes how the conflicting hunks are presented\", isConflict = true},\n                { \"p|patch\", \"Creates a diff and applies it in reverse order to the working tree\", v=>Patch()}\n\n               // [Mr Happy] this should be compatible w/ the CommandStub, haven't checked yet tho.\n               //{ \"f|force\", \"When switching branches, proceed even if the index or the working tree differs from HEAD\", v => cmd.Force = true },\n               //{ \"ours\", \"When checking out paths from the index, check out stage #2 ('ours') or #3 ('theirs') for unmerged paths\", v => cmd.Ours = true },\n               //{ \"theirs\", \"When checking out paths from the index, check out stage #2 ('ours') or #3 ('theirs') for unmerged paths\", v => cmd.Theirs = true },\n               //{ \"b=\", \"Create a new branch named <new_branch> and start it at <start_point>; see linkgit:git-branch[1] for details\", v => cmd.B = v },\n               //{ \"t|track\", \"When creating a new branch, set up \"upstream\" configuration\", v => cmd.Track = true },\n               //{ \"no-track\", \"Do not set up \"upstream\" configuration, even if the branch\", v => cmd.NoTrack = true },\n               //{ \"l\", \"Create the new branch's reflog; see linkgit:git-branch[1] for details\", v => cmd.L = true },\n               //{ \"m|merge\", \"When switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to preserve your modifications in context\", v => cmd.Merge = true },\n               //{ \"conflict=\", \"The same as --merge option above, but changes the way the conflicting hunks are presented, overriding the merge\", v => cmd.Conflict = v },\n               //{ \"p|patch\", \"Interactively select hunks in the difference between the <tree-ish> (or the index, if unspecified) and the working tree\", v => cmd.Patch = true },\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if ((arguments.Count > 0) || (args.Length <=0))\n                {\n                    //Checkout the new repository\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                    \n                    if (!cmd.Quiet)\n                    {\n                        //Display FileNotFound errors, but process checkout request for all found files first.\n                        foreach (string file in cmd.Results.FileNotFoundList)\n                            OutputStream.WriteLine(\"error: pathspec '\" + file + \"' did not match any file(s) known to GitSharp.\");\n                    }\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            } catch (OptionException e) {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage:\");\n                Console.WriteLine(\"       git checkout [-q] [-f] [-m] [<branch>]\");\n                Console.WriteLine(\"       git checkout [-q] [-f] [-m] [-b <new_branch>] [<start_point>]\");\n                Console.WriteLine(\"       git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...\");\n                Console.WriteLine(\"       git checkout --patch [<tree-ish>] [--] [<paths>...]\");\n                Console.WriteLine(\"\\nThe available options for this command are:\\n\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                Console.WriteLine();\n            }\n        }\n\n        private void RefLog()\n        {\n        }\n\n        private void Patch(String treeish)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Clone.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2008, Caytchen \n * Copyright (C) 2008, Rolenun\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\r\nusing GitSharp.Commands;\r\nusing NDesk.Options;\n\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=false, usage = \"Clone a repository into a new directory\")]\n    public class Clone : TextBuiltin\n    {\n        private CloneCommand cmd = new CloneCommand();\n\n        /*\n         * private static Boolean isHelp = false;              //Complete        \n        private static Boolean isQuiet = false;        \n        private static Boolean isVerbose = false;        \n        private static Boolean isNoCheckout = false;        //Complete        \n        private static Boolean isCreateBareRepo = false;    //In progress        \n        private static Boolean isCreateMirrorRepo = false;  //More info needed        \n        private static Boolean isNoHardLinks = false;       //Unimplemented        \n        private static Boolean isShared = false;            //Unimplemented        \n        private static String templateRepo = \"\";            //More info needed        \n        private static String referenceRepo = \"\";           //More info needed        \n        private static String optionOrigin = \"\";            //Complete        \n        private static String uploadPack = \"\";              //More info needed        \n        private static Int32 depth = 0;                     //More info needed\n        */\n        private static Boolean isHelp = false;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n                { \"q|quiet\", \"Be quiet\", v => cmd.Quiet = true},\n                { \"v|verbose\", \"Be verbose\", v => cmd.Quiet = false},\n                { \"n|no-checkout\", \"Don't create a checkout\", v => cmd.NoCheckout = true},\n                { \"bare\", \"Create a bare repository\", v=> cmd.Bare = true},\n                { \"naked\", \"Create a bare repository\", v => cmd.Bare = true},\n                { \"mirror\", \"Create a mirror repository (implies bare)\", v => cmd.Mirror = true},\n                { \"l|local\", \"To clone from a local repository\", v => {}}, // was: die(\"--local is the default behavior. This option is no-op.\").  [henon] I think we should silently ignore that switch instead of exiting.\n                { \"no-hardlinks\", \"(No-op) Do not use hard links, always copy\", v => die(\"--no-hardlinks is not supported\")},\n                { \"s|shared\", \"(No-op) Setup as shared repository\", v => die(\"--shared is not supported\")},\n                { \"template=\", \"{Path} the template repository\",(string v) => cmd.TemplateDirectory = v },\n                { \"reference=\", \"Reference {repo}sitory\",(string v) => cmd.ReferenceRepository = v },\n                { \"o|origin=\", \"Use <{branch}> instead of 'origin' to track upstream\",(string v) => cmd.OriginName = v },\n                { \"u|upload-pack=\", \"{Path} to git-upload-pack on the remote\",(string v) => cmd.UploadPack = v },\n                { \"depth=\", \"Create a shallow clone of that {depth}\",(int v) => cmd.Depth = v },\n                { \"git-dir\", \"Set the new directory to clone into\", (string v) => cmd.GitDirectory = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\r\n                if (arguments.Count != 1 && arguments.Count != 2)\n                {\r\n                    OfflineHelp();\r\n                    return;\n                }\r\n\r\n                cmd.Source = arguments[0];\r\n\n                if (arguments.Count == 2) // <directory> parameter is optional\r                {\r\n                    cmd.Directory = arguments[1];\r\n                }\n                \n                cmd.Execute();\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"usage: git clone [options] [--] <repo> [<dir>]\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Git/Commands/Commit.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Record changes to the repository\")]\n    class Commit : TextBuiltin\n    {\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isCommitAll = false;\n        private static String reUseMessage = \"\";\n        private static String reEditMessage = \"\";\n        private static String cleanupOption = \"default\";\n        private static String untrackedFileMode = \"all\";\n        private static String message = \"\";\n        private static String author = \"\";\n        private static String logFile = \"\";\n        private static String templateFile = \"\";\n        private static Boolean isSignOff= false;\n        private static Boolean isNoVerify = false;\n        private static Boolean isAllowEmpty = false;\n        private static Boolean isAmend = false;\n        private static Boolean isForceEdit = false;\n        private static Boolean isInclude = false;\n        private static Boolean isCommitOnly = false;\n        private static Boolean isInteractive = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isQuiet = false;\n        private static Boolean isDryRun = false;\n#endif\n\n        override public void Run(String[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                { \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"F|file=\", \"Read log from {file}\", (string v) => logFile = v },\n                { \"author=\", \"Override {author} for commit\", (string v) => author = v },\n                { \"m|message=\", \"Specify commit {message}\", (string v) => message = v },\n                { \"c|reedit-message=\", \"Reuse and edit {message} from specified commit\", (string v) => reEditMessage = v },\n                { \"C|reuse-message=\", \"Reuse {message} from specified commit\", (string v) => reUseMessage = v },\n                { \"s|signoff\", \"Add Signed-off-by:\", v=>{isSignOff = true;}},\n                { \"t|template=\", \"Use specified {template} file\", (string v) => templateFile = v },\n                { \"e|edit\", \"Force edit of commit\", v=>{isForceEdit = true;}},\n                { \"a|all\", \"Commit all changed files.\", v=>{isCommitAll = true;}},\n                { \"i|include\", \"Add specified files to index for commit\", v=>{isInclude = true;}},\n                { \"interactive\", \"Interactively add files\", v=>{isInteractive = true;}},\n                { \"o|only\", \"Commit only specified files\", v=>{isCommitOnly = true;}},\n                { \"n|no-verify\", \"Bypass pre-commit hook\", v=>{isNoVerify = true;}},\n                { \"amend\", \"Amend previous commit\", v=>{isAmend = true;}},\n                { \"u|untracked-files=\", \"Show untracked files, optional {MODE}s: all, normal, no.\", (string v) => untrackedFileMode = v },\n                { \"allow-empty\", \"Ok to record an empty change\", v=> {isAllowEmpty = true;}},\n                { \"cleanup=\", \"How to strip spaces and #comments from message. Options are: \" +\n                    \"verbatim, whitespace, strip, and default.\", (string v) => cleanupOption = v },\n                { \"dry-run\", \"Don't actually commit the files, just show if they exist.\", v=>{isDryRun = true;}},\n\n\n               // [Mr Happy] There are the options that should be compatible w/ the stub, placed for convenience only.\n //              { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n //              { \"a|all\", \"Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected\", v => cmd.All = true },\n //              { \"C|reuse-message=\", \"Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit\", v => cmd.ReuseMessage = v },\n //              { \"c|reedit-message=\", \"Like '-C', but with '-c' the editor is invoked, so that the user can further edit the commit message\", v => cmd.ReeditMessage = v },\n //              { \"reset-author\", \"When used with -C/-c/--amend options, declare that the authorship of the resulting commit now belongs of the committer\", v => cmd.ResetAuthor = true },\n //              { \"F|file=\", \"Take the commit message from the given file\", v => cmd.File = v },\n //              { \"author=\", \"Override the author name used in the commit\", v => cmd.Author = v },\n //              { \"m|message=\", \"Use the given <msg> as the commit message\", v => cmd.Message = v },\n //              { \"t|template=\", \"Use the contents of the given file as the initial version of the commit message\", v => cmd.Template = v },\n //              { \"s|signoff\", \"Add Signed-off-by line by the committer at the end of the commit log message\", v => cmd.Signoff = true },\n //              { \"n|no-verify\", \"This option bypasses the pre-commit and commit-msg hooks\", v => cmd.NoVerify = true },\n //              { \"allow-empty\", \"Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit\", v => cmd.AllowEmpty = true },\n //              { \"cleanup=\", \"This option sets how the commit message is cleaned up\", v => cmd.Cleanup = v },\n //              { \"e|edit\", \"The message taken from file with `-F`, command line with `-m`, and from file with `-C` are usually used as the commit log message unmodified\", v => cmd.Edit = true },\n //              { \"amend\", \"Used to amend the tip of the current branch\", v => cmd.Amend = true },\n #endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    //Execute the commit using the specified file pattern\n                    DoCommit(arguments[0]);\n                }\n                else if (args.Length <= 0)\n                {\n                    //Display status if no changes are added to commit\n                    //If changes have been made, commit them?\n                    Console.WriteLine(\"These commands still need to be implemented.\");\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git commit [options] [--] <filepattern>...\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        public void DoCommit(String filepattern)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Config.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Rolenun\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Commands;\nusing NDesk.Options;\n\n\nnamespace GitSharp.CLI\n{\n\n    [Command(complete=false, common=true, requiresRepository=true, usage = \"Get and set repository or global options\")]\n    public class Config : TextBuiltin\n    {\n        private ConfigCommand cmd = new ConfigCommand();\n\n        private static Boolean isHelp = false;\n\n        public override void Run(string[] args)\n        {\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n/*                { \"replace-all\", \"Replaces all lines matching the key (and optionally the value_regex).\", v => cmd.ReplaceAll = true},\n                { \"add\", \"Adds a new line to the option without altering any existing values.\", v => cmd.Add = false},\n                { \"get\", \"Get the value for a given key\", v => cmd.Get = true},\n                { \"get-all\", \"Like get, but can handle multiple values for the key.\", v=> cmd.GetAll = true},\n                { \"get-regexp\", \"Like --get-all, but interprets the name as a regular expression\", v => cmd.GetRegExp = true},\n                { \"global\", \"Use the per-user config file instead of the default.\", v => cmd.Global = true},\n                { \"system\", \"Use the system-wide config file instead of the default.\", v => cmd.System = true},\n                { \"f|file\", \"Use the given config file instead of the one specified by GIT_CONFIG\", (string v) => cmd.File = v},\n                { \"remove-section\", \"Remove the given section from the configuration file\", v => cmd.RemoveSection = true},\n                { \"rename-section\", \"Rename the given section to a new name\", v => cmd.RenameSection = true},\n                { \"unset\", \"Remove the line matching the key from config file\", v => cmd.UnSet = true},\n                { \"unset-all\", \"Remove all lines matching the key from config file\", v => cmd.UnSetAll = true},*/\n                { \"l|list\", \"List all variables set in config file\", v => cmd.List = true},\n/*                { \"bool\", \"Ensure that the output is true or false\", v => cmd.Bool = true },\n                { \"int\", \"Ensure that the output is a simple decimal number\", v => cmd.Int = true },\n                { \"bool-or-int\", \"Ensure that the output matches the format of either --bool or --int, as described above\", v => cmd.BoolOrInt = true },\n                { \"z|null\", \"Always end values with null character instead of newlines\", v => cmd.Null = true },\n                { \"get-colorbool\", \"Find the color setting for {name} and output as true or false\", v => cmd.GetColorBool = true },\n                { \"get-color\", \"Find the color configured for {name}\", v => cmd.GetColor = true },\n                { \"e|edit\", \"Opens an editor to modify the specified config file as --global, --system, or repository (default)\", v => cmd.Edit = true },*/\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                \tcmd.Arg1 = arguments[0];\n                \t\n                \tif (arguments.Count > 1)\n\t\t\t\t\t\tcmd.Arg2 = arguments[1];\n                \telse\n                \t\tcmd.Arg2 = \"\";\n\t               \t\n                \tif (arguments.Count > 2)\n\t                \tcmd.Arg3 = arguments[2];\n                \telse\n                \t\tcmd.Arg3 = \"\";\n\n                    cmd.Execute();\n                }\n                else if (cmd.List)\n                {\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"usage: git config [file-option] [options]\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}"
  },
  {
    "path": "Git/Commands/Fetch.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Download objects and refs from another repository\")]\n    class Fetch : TextBuiltin\n    {\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isQuiet = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isAppend = false;\n        private static String uploadPack = \"\";\n        private static Boolean isForced = false;\n        private static Boolean isTags = false;\n        private static Boolean isNoTags = false;\n        private static Boolean isKeep = false;\n        private static Boolean isUpdateHeadOk = false;\n        private static Int32 depth = 0;\n#endif \n\n        override public void Run(String[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n\n#if ported\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n                { \"append\", \"Append to .git/FETCH_HEAD instead of overwriting\", v=>{isAppend = true;}},\n                { \"upload-pack=\", \"{Path} to upload pack on remote end\", (string v) => uploadPack = v },\n                { \"force\", \"Force overwrite of local branch\", v=> {isForced = true;}},\n                { \"tags\", \"Fetch all tags and associated objects\", v=>{isTags = true;} },\n                { \"no-tags\", \"Disable tags from being fetched and stored locally\", v=>{isNoTags = true;}},\n                { \"k|keep\", \"Keep download pack\", v=>{isKeep = true;}},\n                { \"u|update-head-ok\", \"Allow updating of HEAD ref\", v=>{isUpdateHeadOk = true;}},\n                { \"depth=\", \"Deepen the history of a shallow repository created by git clone\", (int v) => depth = v },\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    DoFetch(arguments);\n                }\n                else if (args.Length <= 0)\n                {\n                    // DoFetch with preset arguments\n                    Console.WriteLine(\"This command still needs to be implemented.\");\n\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git fetch [options] [<repository> <refspec>...]\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        private void DoFetch(List<String> args)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Help.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\n\nnamespace GitSharp.CLI.Nonstandard\n{\n    [Command(complete = false, common = true, usage = \"Displays the online help for the command. Use --help for offline options\")]\n    class Help : TextBuiltin\n    {\n\n        override public void Run(String[] args)\n        {\n            CommandCatalog catalog = new CommandCatalog();\n            if (args.Length > 0)\n            {\n                CommandRef subcommand = catalog.Get(args[0]);\n                if (subcommand != null)\n                {\n                    TextBuiltin cmd = subcommand.Create();\n                    cmd.OnlineHelp();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            else\n            {\n                OfflineHelp();\n            }\n        }\n\n        private static void OfflineHelp()\n        {\n            Console.WriteLine(\"usage: git help <command> \");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Init.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common = true, complete = false, usage = \"Create an empty git repository\")]\n    class Init : TextBuiltin\n    {\n        private InitCommand cmd = new InitCommand();\n\n        private static Boolean isHelp = false;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false; // [henon] the api defines the commands quiet by default. thus we need to override with git's default here.\n            \n            options = new CmdParserOptionSet\n            {\n                {\"bare\", \"Create a bare repository\", v => cmd.Bare = true},\n                {\"quiet|q\", \"Only print error and warning messages, all other output will be suppressed.\", v => cmd.Quiet = true},\n                {\"template\", \"Not supported.\", var => OutputStream.WriteLine(\"--template=<template dir> is not supported\")},\n                {\"shared\", \"Not supported.\", var => OutputStream.WriteLine(\"--shared is not supported\")},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                cmd.Execute();\n\t\t\t\tcmd.OutputStream.WriteLine(cmd.Repository.Directory);\n            }\n            catch (Exception e)\n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"usage: git init [options] [directory]\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n        //private void create()\n        //{\n        //    if (gitdir == null)\n        //        gitdir = bare ? Environment.CurrentDirectory : Path.Combine(Environment.CurrentDirectory, Constants.DOT_GIT);\n        //    db = new Repository(new DirectoryInfo(gitdir));\n        //    db.Create(bare);\n        //    Console.WriteLine(\"Initialized empty Git repository in \" + (new DirectoryInfo(gitdir)).FullName);\n        //}\n    }\n\n}"
  },
  {
    "path": "Git/Commands/Log.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n * Copyright (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Commands;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Log : TextBuiltin\n    {\n        private LogCommand cmd = new LogCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"n=\", \"Limits the number of commits to show\", v => cmd.n = v },\n               { \"decorate=\", \"Print out the ref names of any commits that are shown\", v => cmd.Decorate = v },\n               { \"source\", \"Print out the ref name given on the command line by which each commit was reached\", v => cmd.Source = true },\n               { \"full-diff=\", \"Without this flag, \\\"git log -p <path>\", v => cmd.FullDiff = v },\n               { \"follow\", \"Continue listing the history of a file beyond renames\", v => cmd.Follow = true },\n               { \"log-size\", \"Before the log message print out its size in bytes\", v => cmd.LogSize = true },\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"P\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n\n                // log always uses a pager\n                SetupPager();\n\n                cmd.Arguments = arguments\n                                    .Select(path => Path.GetFullPath(path))\n                                    .ToList();\n                cmd.Execute();\n            }\n            catch (System.IO.IOException)\n            {\n                // user closed pager\n            }\n            catch (Exception e)            \n            {\n                Console.Error.WriteLine(e.ToString());\n                cmd.OutputStream.WriteLine(e.ToString());\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Merge.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Join two or more development histories together\")]\n    class Merge : TextBuiltin\n    {\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isQuiet = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isStat = false;\n        private static Boolean isNoStat = false;\n        private static Boolean isLog = false;\n        private static Boolean isNoLog = false;\n        private static Boolean isCommit = false;\n        private static Boolean isNoCommit = false;\n        private static Boolean isSquash = false;\n        private static Boolean isNoSquash = false;\n        private static Boolean isFF = false;\n        private static Boolean isNoFF = false;\n        private static Boolean strategyMode = false;\n        private static String message = \"\";\n#endif \n\n        override public void Run(String[] args)\n        {\n\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n\n#if ported\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n                { \"stat\", \"Show a diffstat at the end of the merge\", v=>{isStat = true;}},\n                { \"n|no-stat\", \"Do not show a diffstat at the end of the merge\", v=>{isNoStat = true; }},\n                { \"log\", \"Add list of one-line log to merge commit message\", v=>{isLog = true; }},\n                { \"no-log\", \"Do not add list of one-line log to merge commit message\", v=>{isNoLog = true;} },\n                { \"commit\", \"Perform the merge and commit the result\", v=>{isCommit = true;} },\n                { \"no-commit\", \"Perform the merge, but do not autocommit\", v=>{isNoCommit = true;}},\n                { \"squash\", \"Create a single commit instead of doing a merge\", v=>{isSquash = true;}},\n                { \"no-squash\", \"Perfom the merge and commit the result\", v=>{isNoSquash = true;}},\n                { \"ff\", \"Do not generate a merge commit if the merge resolved as a fast forward\", v=>{isFF = true;}},\n                { \"no-ff\", \"Generate a merge commit, even if the merge resolved as a fast forward\", v=>{isNoFF = true;}},\n                { \"s|strategy=\", \"Use the given merge strategy. Options are resolve, recursive, octopus, \" +\n                    \"ours, and subtree\", (string v) => strategyMode = v},\n                { \"m=\", \"Message to be used for the merge commit (if any)\", (string v) => message = v },\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    DoMerge(arguments);\n                }\n                else if (args.Length <= 0)\n                {\n                    // DoMerge with preset arguments\n                    Console.WriteLine(\"This command still needs to be implemented.\");\n\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git merge [options] <remote>...\");\n                Console.WriteLine(\"   or: git merge [options] <msg> HEAD <remote>\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        private void DoMerge(List<String> args)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Pull.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Fetch from and merge with another repository or a local branch\")]\n    class Pull : TextBuiltin\n    {\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isQuiet = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isStat = false;\n        private static Boolean isNoStat = false;\n        private static Boolean isLog = false;\n        private static Boolean isNoLog = false;\n        private static Boolean isCommit = false;\n        private static Boolean isNoCommit = false;\n        private static Boolean isSquash = false;\n        private static Boolean isNoSquash = false;\n        private static Boolean isFF = false;\n        private static Boolean isNoFF = false;\n        private static Boolean strategyMode = false;\n        private static Boolean isRebase = false;\n        private static Boolean isNoRebase = false;\n        private static Boolean isAppend = false;\n        private static String uploadPack = \"\";\n        private static Boolean isForced = false;\n        private static Boolean isTags = false;\n        private static Boolean isNoTags = false;\n        private static Boolean isKeep = false;\n        private static Boolean isUpdateHeadOk = false;\n        private static Int32 depth = 0;\n#endif \n\n        override public void Run(String[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n\n#if ported\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n                { \"stat\", \"Show a diffstat at the end of the merge\", v=>{isStat = true;}},\n                { \"n|no-stat\", \"Do not show a diffstat at the end of the merge\", v=>{isNoStat = true; }},\n                { \"log\", \"Add list of one-line log to merge commit message\", v=>{isLog = true; }},\n                { \"no-log\", \"Do not add list of one-line log to merge commit message\", v=>{isNoLog = true;} },\n                { \"commit\", \"Perform the merge and commit the result\", v=>{isCommit = true;} },\n                { \"no-commit\", \"Perform the merge, but do not autocommit\", v=>{isNoCommit = true;}},\n                { \"squash\", \"Create a single commit instead of doing a merge\", v=>{isSquash = true;}},\n                { \"no-squash\", \"Perfom the merge and commit the result\", v=>{isNoSquash = true;}},\n                { \"ff\", \"Do not generate a merge commit if the merge resolved as a fast forward\", v=>{isFF = true;}},\n                { \"no-ff\", \"Generate a merge commit, even if the merge resolved as a fast forward\", v=>{isNoFF = true;}},\n                { \"s|strategy=\", \"Use the given merge strategy. Options are resolve, recursive, octopus, \" +\n                    \"ours, and subtree\", (string v) => strategyMode = v},\n                { \"rebase\", \"Instead of merge, perform a rebase after fetching. Dangerous option. Use wisely.\", v=>{isRebase = true;}},\n                { \"no-rebase\", \"Override the earlier rebase option\", v=>{isNoRebase = true;}},\n                { \"append\", \"Append to .git/FETCH_HEAD instead of overwriting\", v=>{isAppend = true;}},\n                { \"upload-pack=\", \"Path to upload pack on remote end\", (string v) => uploadPack = v },\n                { \"force\", \"Force overwrite of local branch\", v=> {isForced = true;}},\n                { \"tags\", \"Fetch all tags and associated objects\", v=>{isTags = true;} },\n                { \"no-tags\", \"Disable tags from being fetched and stored locally\", v=>{isNoTags = true;}},\n                { \"k|keep\", \"Keep download pack\", v=>{isKeep = true;}},\n                { \"u|update-head-ok\", \"Allow updating of HEAD ref\", v=>{isUpdateHeadOk = true;}},\n                { \"depth=\", \"Deepen the history of a shallow repository created by git clone\", (int v) => depth = v },\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    DoPull(arguments);\n                }\n                else if (args.Length <= 0)\n                {\n                    // DoPull with preset arguments\n                    Console.WriteLine(\"This command still needs to be implemented.\");\n                    \n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git pull [options] [fetch-options] <repo> <head>...\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        private void DoPull(List<String> args)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Push.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Update remote refs along with associated objects\")]\n    class Push : TextBuiltin\n    {\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isVerbose = false;\n        private static string repo = \"\";\n        private static Boolean pushAllRefs = false;\n        private static Boolean mirrorAllRefs = false;\n        private static Boolean pushTags = false;\n        private static Boolean isDryRun = false;\n        private static Boolean isForced = false;\n        private static Boolean useThinPack = false;\n        private static string receivePack = \"\";\n#endif\n\n        override public void Run(String[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                \n                { \"v|verbose\", \"Be verbose\", v=> {isVerbose = true;}},\n                { \"repo=\", \"{repository}\", (string v) => repo = v},\n                { \"all\", \"Push all refs\", v=> {pushAllRefs = true;}},\n                { \"mirror\", \"Mirror all refs\", v=> {mirrorAllRefs = true;}},\n                { \"tags\", \"Push tags\", v=> {pushTags = true;}},\n                { \"n|dry-run\", \"Dry run\", v=>{isDryRun = true;}},\n                { \"f|force\", \"Force updates\", v=> {isForced = true;}},\n                { \"thin\", \"Use thin pack\", v=> {useThinPack = true;}},\n                { \"receive-pack=\", \"{Receive pack} program\", (string v) => receivePack = v},\n                { \"exec=\", \"{Receive pack} program\", (string v) => receivePack = v},\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    //Add the file(s)\n                    DoPush(arguments);\n                }\n                else if (args.Length <= 0)\n                {\n                    //Display the modified files for the existing repository\n                    Console.WriteLine(\"Warning: You did not specify any refspecs to push, and the current remote\");\n                    Console.WriteLine(\"Warning: has not configured any push refspecs. The default action in this\");\n                    Console.WriteLine(\"Warning: case is to push all matching refspecs, that is, all branches\");\n                    Console.WriteLine(\"Warning: that exist both locally and remotely will be updated. This may\");\n                    Console.WriteLine(\"Warning: not necessarily be what you want to happen.\");\n                    Console.WriteLine(\"Warning:\");\n                    Console.WriteLine(\"Warning: You can specify what action you want to take in this case, and\");\n                    Console.WriteLine(\"Warning: avoid seeing this message again, by configuring 'push.default' to:\");\n                    Console.WriteLine(\"Warning:   'nothing'  : Do not push anything\");\n                    Console.WriteLine(\"Warning:   'matching' : Push all matching branches (default)\");\n                    Console.WriteLine(\"Warning:   'tracking' : Push the current branch to whatever it is tracking\");\n                    Console.WriteLine(\"Warning:   'current'  : Push the current branch\");\n                    \n                    // Enter passphrase\n                    Console.WriteLine(\"This command still needs to be implemented.\");\n\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git push [options] [<repository> <refspec>...]\");\n                Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        private void DoPush(List<String> filesAdded)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Rm.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Remove files from the working tree and from the index\")]\n    class Rm : TextBuiltin\n    {\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isDryRun = false;\n        private static Boolean isForced = false;\n        private static Boolean isQuiet = false;\n        private static Boolean isCached = false;\n        private static Boolean allowRecursiveRemoval = false;\n        private static Boolean ignoreUnmatch = false;\n#endif\n\n        override public void Run(String[] args)\n        {\n\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                { \"n|dry-run\", \"Dry run\", v=> {isDryRun = true;}},\n                { \"f|force\", \"Override the up-to-date check\", v=>{isForced = true;}},\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"cached\", \"Only remove from the index\", v=>{isCached = true;}},\n                { \"r\", \"Allow recursive removal\", v=>{allowRecursiveRemoval = true;}},\n                { \"ignore-match\", \"Exit with a zero status even if nothing is matched\", v=>{ignoreUnmatch = true;}},\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    DoRm(arguments);\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            } catch (OptionException e) {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git rm [options] [--] <file>...\");\n               Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                Console.WriteLine();\n            }\n        }\n\n        private void DoRm(List<String> args)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Status.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Commands;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, requiresRepository=true, usage = \"Show the working tree status\")]\n    class Status : TextBuiltin\n    {\n        private StatusCommand cmd = new StatusCommand();\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static Boolean isCommitAll = false;\n        private static String reUseMessage = \"\";\n        private static String reEditMessage = \"\";\n        private static String cleanupOption = \"default\";\n        private static String untrackedFileMode = \"all\";\n        private static String message = \"\";\n        private static String author = \"\";\n        private static String logFile = \"\";\n        private static String templateFile = \"\";\n        private static Boolean isSignOff= false;\n        private static Boolean isNoVerify = false;\n        private static Boolean isAllowEmpty = false;\n        private static Boolean isAmend = false;\n        private static Boolean isForceEdit = false;\n        private static Boolean isInclude = false;\n        private static Boolean isCommitOnly = false;\n        private static Boolean isInteractive = false;\n        private static Boolean isVerbose = false;\n        private static Boolean isQuiet = false;\n        private static Boolean isDryRun = false;\n#endif\n\n        override public void Run(String[] args)\n        {\n           \n            // The command takes the same options as git-commit. It shows what would be \n            // committed if the same options are given.\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                { \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n                { \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n                { \"F|file=\", \"Read log from {file}\", (string v) => logFile = v },\n                { \"author=\", \"Override {author} for commit\", (string v) => author = v },\n                { \"m|message=\", \"Specify commit {message}\", (string v) => message = v },\n                { \"c|reedit-message=\", \"Reuse and edit {message} from specified commit\", (string v) => reEditMessage = v },\n                { \"C|reuse-message=\", \"Reuse {message} from specified commit\", (string v) => reUseMessage = v },\n                { \"s|signoff\", \"Add Signed-off-by:\", v=>{isSignOff = true;}},\n                { \"t|template=\", \"Use specified {template} file\", (string v) => templateFile = v },\n                { \"e|edit\", \"Force edit of commit\", v=>{isForceEdit = true;}},\n                { \"a|all\", \"Commit all changed files.\", v=>{isCommitAll = true;}},\n                { \"i|include\", \"Add specified files to index for commit\", v=>{isInclude = true;}},\n                { \"interactive\", \"Interactively add files\", v=>{isInteractive = true;}},\n                { \"o|only\", \"Commit only specified files\", v=>{isCommitOnly = true;}},\n                { \"n|no-verify\", \"Bypass pre-commit hook\", v=>{isNoVerify = true;}},\n                { \"amend\", \"Amend previous commit\", v=>{isAmend = true;}},\n                { \"u|untracked-files=\", \"Show untracked files, optional {MODE}s: all, normal, no.\", (string v) => untrackedFileMode = v },\n                { \"allow-empty\", \"Ok to record an empty change\", v=> {isAllowEmpty = true;}},\n                { \"cleanup=\", \"How to strip spaces and #comments from message. Options are: \" +\n                    \"verbatim, whitespace, strip, and default.\", (string v) => cleanupOption = v },\n                { \"dry-run\", \"Don't actually commit the files, just show if they exist.\", v=>{isDryRun = true;}},\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    //Execute the status using the specified file pattern\n                    //cmd.Source = arguments[0];\n                    cmd.Execute();\n                    Display();\n                }\n                else if (args.Length <= 0)\n                {\n                    //Display status if no changes are added to commit\n                    //If changes have been made, commit them?\n                    //Console.WriteLine(\"These commands still need to be implemented.\");\n                    cmd.Execute();\n                    Display();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (OptionException e)\n            {\n                OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"usage: git status [options] [--] <filepattern>...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n            }\n        }\n\n        public void Display()\n        {\n            if (cmd.AnyDifferences || cmd.Results.UntrackedList.Count > 0)\n            {\n                //Display the stages of all files\n                doDisplayMergeConflict();\n                OutputStream.WriteLine(\"# On branch \" + cmd.Repository.CurrentBranch.Name);\n                //OutputStream.WriteLine(\"# Your branch is ahead of 'xxx' by x commits.\"); //Todo\n                OutputStream.WriteLine(\"#\");\n\n                doDisplayStaged();\n                doDisplayUnstaged();\n                doDisplayUntracked();\n\n                if (cmd.Results.StagedList.Count <= 0)\n                {\n                    OutputStream.WriteLine(\"no changes added to commit (use \\\"git add\\\" and/or \\\"git commit -a\\\")\");\n                }\n            }\n            else if (cmd.IsEmptyRepository)\n            {\n                OutputStream.WriteLine(\"# On branch \" + cmd.Repository.CurrentBranch.Name);\n                OutputStream.WriteLine(\"#\");\n                OutputStream.WriteLine(\"# Initial commit\");\n                OutputStream.WriteLine(\"#\");\n                OutputStream.WriteLine(\"# nothing to commit (create/copy files and use \\\"git add\\\" to track)\");\n            }\n            else\n            {\n                OutputStream.WriteLine(\"# nothing to commit (working directory clean)\");\n            }\n            // [henon] we do not throw here, instead we mention this in the docs.\n            //throw new NotImplementedException(\"The implementation is not yet complete. autocrlf support is not added.\"); \n        }\n\n        private void displayStatusList(Dictionary<string, int> statusList)\n        {\n            foreach (KeyValuePair<string, int> pair in statusList)\n            {\n                switch (pair.Value)\n                {\n                    case StatusType.Missing:\n                        OutputStream.WriteLine(\"#     missing: \" + pair.Key);\n                        break;\n                    case StatusType.Removed:\n                        OutputStream.WriteLine(\"#     deleted: \" + pair.Key);\n                        break;\n                    case StatusType.Modified:\n                    case StatusType.ModifiedStaged:\n                        OutputStream.WriteLine(\"#     modified: \" + pair.Key);\n                        break;\n                    case StatusType.Added:\n                        OutputStream.WriteLine(\"#     new file: \" + pair.Key);\n                        break;\n                    case StatusType.MergeConflict:\n                        OutputStream.WriteLine(\"#     unmerged: \" + pair.Key);\n                        break;\n                }\n            }\n        }\n\n        private void doDisplayUnstaged()\n        {\n            if (cmd.Results.ModifiedList.Count > 0)\n            {\n                OutputStream.WriteLine(\"# Changed but not updated:\");\n                OutputStream.WriteLine(\"# (use \\\"git add (file)...\\\" to update what will be committed)\");\n                OutputStream.WriteLine(\"# (use \\\"git checkout -- (file)...\\\" to discard changes in working directory)\");\n                OutputStream.WriteLine(\"#\");\n                displayStatusList(cmd.Results.ModifiedList);\n                OutputStream.WriteLine(\"#\");\n            }\n        }\n\n        private void doDisplayStaged()\n        {\n            if (cmd.Results.StagedList.Count > 0)\n            {\n                OutputStream.WriteLine(\"# Changes to be committed:\");\n                OutputStream.WriteLine(\"# (use \\\"git reset HEAD (file)...\\\" to unstage)\");\n                OutputStream.WriteLine(\"#\");\n                displayStatusList(cmd.Results.StagedList);\n                OutputStream.WriteLine(\"#\");\n            }\n        }\n\n        private void doDisplayUntracked()\n        {\n            if (cmd.Results.UntrackedList.Count > 0)\n            {\n                OutputStream.WriteLine(\"# Untracked files:\");\n                OutputStream.WriteLine(\"# (use \\\"git add (file)...\\\" to include in what will be committed)\");\n                OutputStream.WriteLine(\"#\");\n                cmd.Results.UntrackedList.Sort();\n                foreach (string hash in cmd.Results.UntrackedList)\n                    OutputStream.WriteLine(\"#     \" + hash);\n            }\n        }\n\n        private void doDisplayMergeConflict()\n        {\n            foreach (KeyValuePair<string, int> hash in cmd.Results.ModifiedList)\n            {\n                if (hash.Value == 5)\n                    OutputStream.WriteLine(hash + \": needs merge\");\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "Git/Commands/Version.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace GitSharp.CLI.Nonstandard\n{\n    [Command(complete = true, common = true, usage = \"Display the version of GitSharp\")]\n    class Version : TextBuiltin\n    {\n\n        override public void Run(String[] args) \n        {\n            //Assembly myAsm = Assembly.Load(\"git\");\n            //AssemblyName aName = myAsm.GetName();\n            //System.Version ver = aName.Version;\n            var ver = GitSharp.Git.Version;\n            if (ver == null)\n                throw die(\"Cannot read package information.\");\n\n\t\t    OutputStream.Write(\"GitSharp version \");\n            OutputStream.Write(ver);\n            OutputStream.WriteLine();\n            OutputStream.Flush();\n\t    }\n\n        private static void OfflineHelp()\n        {\n            Console.WriteLine(\"usage: git version\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Die.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.CLI\n{\n    /// <summary>\n    /// Indicates a <see cref=\"TextBuiltin\" /> implementation has failed during execution.\n    /// <para>\n    /// Typically the stack trace for a Die exception is not shown to the user as it\n    /// may indicate a simple error condition that the end-user can fix on their own,\n    /// without needing a screen of stack frames.\n    /// </para>\n    /// </summary>\n    public class Die : Exception\n    {\n        /// <summary>\n        /// Construct a new message explaining what has gone wrong.\n        /// </summary>\n        /// <param name=\"why\">The message to show to the end-user.</param>\n        public Die(string why)\n            : base(why)\n        {\n        }\n    }\n}"
  },
  {
    "path": "Git/Git.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{2A467118-E885-44FC-B7AF-DFAD937F6012}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>GitSharp.CLI</RootNamespace>\n    <AssemblyName>git</AssemblyName>\n    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <StartupObject>GitSharp.CLI.Program</StartupObject>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <SourceAnalysisOverrideSettingsFile>C:\\Users\\rolenun\\AppData\\Roaming\\ICSharpCode/SharpDevelop3.0\\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\n    <NoStdLib>False</NoStdLib>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>Full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Commandlineparameters>init</Commandlineparameters>\n    <DocumentationFile>bin\\Debug\\git.XML</DocumentationFile>\n    <NoWarn>1591</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\n    <RegisterForComInterop>False</RegisterForComInterop>\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\n    <BaseAddress>4194304</BaseAddress>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\SharedAssemblyInfo.cs\">\n      <Link>Properties\\SharedAssemblyInfo.cs</Link>\n    </Compile>\n    <Compile Include=\"Commands\\Add.cs\" />\n    <Compile Include=\"Stubs\\Am.cs\" />\n    <Compile Include=\"Stubs\\Annotate.cs\" />\n    <Compile Include=\"Stubs\\Apply.cs\" />\n    <Compile Include=\"Stubs\\Archive.cs\" />\n    <Compile Include=\"Stubs\\Blame.cs\" />\n    <Compile Include=\"Stubs\\Branch.cs\" />\n    <Compile Include=\"Stubs\\CatFile.cs\" />\n    <Compile Include=\"Commands\\Checkout.cs\" />\n    <Compile Include=\"Stubs\\CheckoutIndex.cs\" />\n    <Compile Include=\"Stubs\\Cherry.cs\" />\n    <Compile Include=\"Stubs\\CherryPick.cs\" />\n    <Compile Include=\"Stubs\\Clean.cs\" />\n    <Compile Include=\"Commands\\Clone.cs\" />\n    <Compile Include=\"CmdParserOptionSet.cs\" />\n    <Compile Include=\"Command.cs\" />\n    <Compile Include=\"CommandCatalog.cs\" />\n    <Compile Include=\"CommandRef.cs\" />\n    <Compile Include=\"Commands\\Commit.cs\" />\n    <Compile Include=\"Stubs\\CommitTree.cs\" />\n    <Compile Include=\"Commands\\Config.cs\" />\n    <Compile Include=\"Stubs\\CountObjects.cs\" />\n    <Compile Include=\"Stubs\\Describe.cs\" />\n    <Compile Include=\"Die.cs\" />\n    <Compile Include=\"Stubs\\Diff.cs\" />\n    <Compile Include=\"Stubs\\DiffFiles.cs\" />\n    <Compile Include=\"Stubs\\DiffIndex.cs\" />\n    <Compile Include=\"Stubs\\Difftool.cs\" />\n    <Compile Include=\"Stubs\\DiffTree.cs\" />\n    <Compile Include=\"Stubs\\FastExport.cs\" />\n    <Compile Include=\"Stubs\\FastImport.cs\" />\n    <Compile Include=\"Commands\\Fetch.cs\" />\n    <Compile Include=\"Stubs\\FetchPack.cs\" />\n    <Compile Include=\"Stubs\\FilterBranch.cs\" />\n    <Compile Include=\"Stubs\\FmtMergeMsg.cs\" />\n    <Compile Include=\"Stubs\\ForEachRef.cs\" />\n    <Compile Include=\"Stubs\\FormatPatch.cs\" />\n    <Compile Include=\"Stubs\\Fsck.cs\" />\n    <Compile Include=\"Stubs\\Gc.cs\" />\n    <Compile Include=\"Stubs\\Grep.cs\" />\n    <Compile Include=\"Stubs\\HashObject.cs\" />\n    <Compile Include=\"Commands\\Help.cs\" />\n    <Compile Include=\"Stubs\\IndexPack.cs\" />\n    <Compile Include=\"Commands\\Init.cs\" />\n    <Compile Include=\"Commands\\Log.cs\" />\n    <Compile Include=\"Stubs\\LsFiles.cs\" />\n    <Compile Include=\"Stubs\\LsRemote.cs\" />\n    <Compile Include=\"Stubs\\LsTree.cs\" />\n    <Compile Include=\"Stubs\\Mailinfo.cs\" />\n    <Compile Include=\"Stubs\\Mailsplit.cs\" />\n    <Compile Include=\"Commands\\Merge.cs\" />\n    <Compile Include=\"Stubs\\MergeBase.cs\" />\n    <Compile Include=\"Stubs\\MergeFile.cs\" />\n    <Compile Include=\"Stubs\\MergeIndex.cs\" />\n    <Compile Include=\"Stubs\\Mergetool.cs\" />\n    <Compile Include=\"Stubs\\Mktree.cs\" />\n    <Compile Include=\"Stubs\\Mv.cs\" />\n    <Compile Include=\"Stubs\\NameRev.cs\" />\n    <Compile Include=\"Stubs\\Notes.cs\" />\n    <Compile Include=\"Options.cs\" />\n    <Compile Include=\"Stubs\\PackObjects.cs\" />\n    <Compile Include=\"Stubs\\PackRedundant.cs\" />\n    <Compile Include=\"Stubs\\PackRefs.cs\" />\n    <Compile Include=\"Stubs\\PatchId.cs\" />\n    <Compile Include=\"Stubs\\PeekRemote.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Stubs\\Prune.cs\" />\n    <Compile Include=\"Stubs\\PrunePacked.cs\" />\n    <Compile Include=\"Commands\\Pull.cs\" />\n    <Compile Include=\"Commands\\Push.cs\" />\n    <Compile Include=\"Stubs\\Quiltimport.cs\" />\n    <Compile Include=\"Stubs\\ReadTree.cs\" />\n    <Compile Include=\"Stubs\\ReceivePack.cs\" />\n    <Compile Include=\"Stubs\\Reflog.cs\" />\n    <Compile Include=\"Stubs\\Relink.cs\" />\n    <Compile Include=\"Stubs\\Remote.cs\" />\n    <Compile Include=\"Stubs\\Repack.cs\" />\n    <Compile Include=\"Stubs\\Replace.cs\" />\n    <Compile Include=\"Stubs\\RequestPull.cs\" />\n    <Compile Include=\"Stubs\\Reset.cs\" />\n    <Compile Include=\"Stubs\\Revert.cs\" />\n    <Compile Include=\"Stubs\\RevParse.cs\" />\n    <Compile Include=\"Commands\\Rm.cs\" />\n    <Compile Include=\"Stubs\\SendPack.cs\" />\n    <Compile Include=\"Stubs\\Shortlog.cs\" />\n    <Compile Include=\"Stubs\\Show.cs\" />\n    <Compile Include=\"Stubs\\ShowBranch.cs\" />\n    <Compile Include=\"Stubs\\ShowRef.cs\" />\n    <Compile Include=\"Commands\\Status.cs\" />\n    <Compile Include=\"Stubs\\Stripspace.cs\" />\n    <Compile Include=\"Stubs\\Submodule.cs\" />\n    <Compile Include=\"Stubs\\Svn.cs\" />\n    <Compile Include=\"Stubs\\SymbolicRef.cs\" />\n    <Compile Include=\"Stubs\\Tag.cs\" />\n    <Compile Include=\"Stubs\\TarTree.cs\" />\n    <Compile Include=\"TextBuiltin.cs\" />\n    <Compile Include=\"Stubs\\Rebase.cs\" />\n    <Compile Include=\"Stubs\\UnpackFile.cs\" />\n    <Compile Include=\"Stubs\\UnpackObjects.cs\" />\n    <Compile Include=\"Stubs\\UpdateIndex.cs\" />\n    <Compile Include=\"Stubs\\UpdateServerInfo.cs\" />\n    <Compile Include=\"Stubs\\UploadArchive.cs\" />\n    <Compile Include=\"Stubs\\UploadPack.cs\" />\n    <Compile Include=\"Stubs\\Var.cs\" />\n    <Compile Include=\"Stubs\\VerifyPack.cs\" />\n    <Compile Include=\"Stubs\\VerifyTag.cs\" />\n    <Compile Include=\"Commands\\Version.cs\" />\n    <Compile Include=\"Stubs\\Whatchanged.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Resources\\Commands.xml\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </EmbeddedResource>\n    <Content Include=\"README.txt\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\GitSharp\\GitSharp.csproj\">\n      <Project>{7311850F-619A-4241-B09F-157792C75FBA}</Project>\n      <Name>GitSharp</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\GitSharp.Core\\GitSharp.Core.csproj\">\n      <Project>{C46EDD61-C202-465A-93F1-ADE20A83BB59}</Project>\n      <Name>GitSharp.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>\n      </ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>\n      </ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>\n      </ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "Git/Options.cs",
    "content": "//\n// Options.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n// Compile With:\n//   gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll\n//   gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll\n//\n// The LINQ version just changes the implementation of\n// OptionSet.Parse(IEnumerable<string>), and confers no semantic changes.\n\n//\n// A Getopt::Long-inspired option parsing library for C#.\n//\n// NDesk.Options.OptionSet is built upon a key/value table, where the\n// key is a option format string and the value is a delegate that is \n// invoked when the format string is matched.\n//\n// Option format strings:\n//  Regex-like BNF Grammar: \n//    name: .+\n//    type: [=:]\n//    sep: ( [^{}]+ | '{' .+ '}' )?\n//    aliases: ( name type sep ) ( '|' name type sep )*\n// \n// Each '|'-delimited name is an alias for the associated action.  If the\n// format string ends in a '=', it has a required value.  If the format\n// string ends in a ':', it has an optional value.  If neither '=' or ':'\n// is present, no value is supported.  `=' or `:' need only be defined on one\n// alias, but if they are provided on more than one they must be consistent.\n//\n// Each alias portion may also end with a \"key/value separator\", which is used\n// to split option values if the option accepts > 1 value.  If not specified,\n// it defaults to '=' and ':'.  If specified, it can be any character except\n// '{' and '}' OR the *string* between '{' and '}'.  If no separator should be\n// used (i.e. the separate values should be distinct arguments), then \"{}\"\n// should be used as the separator.\n//\n// Options are extracted either from the current option by looking for\n// the option name followed by an '=' or ':', or is taken from the\n// following option IFF:\n//  - The current option does not contain a '=' or a ':'\n//  - The current option requires a value (i.e. not a Option type of ':')\n//\n// The `name' used in the option format string does NOT include any leading\n// option indicator, such as '-', '--', or '/'.  All three of these are\n// permitted/required on any named option.\n//\n// Option bundling is permitted so long as:\n//   - '-' is used to start the option group\n//   - all of the bundled options are a single character\n//   - at most one of the bundled options accepts a value, and the value\n//     provided starts from the next character to the end of the string.\n//\n// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'\n// as '-Dname=value'.\n//\n// Option processing is disabled by specifying \"--\".  All options after \"--\"\n// are returned by OptionSet.Parse() unchanged and unprocessed.\n//\n// Unprocessed options are returned from OptionSet.Parse().\n//\n// Examples:\n//  int verbose = 0;\n//  OptionSet p = new OptionSet ()\n//    .Add (\"v\", v => ++verbose)\n//    .Add (\"name=|value=\", v => Console.WriteLine (v));\n//  p.Parse (new string[]{\"-v\", \"--v\", \"/v\", \"-name=A\", \"/name\", \"B\", \"extra\"});\n//\n// The above would parse the argument string array, and would invoke the\n// lambda expression three times, setting `verbose' to 3 when complete.  \n// It would also print out \"A\" and \"B\" to standard output.\n// The returned array would contain the string \"extra\".\n//\n// C# 3.0 collection initializers are supported and encouraged:\n//  var p = new OptionSet () {\n//    { \"h|?|help\", v => ShowHelp () },\n//  };\n//\n// System.ComponentModel.TypeConverter is also supported, allowing the use of\n// custom data types in the callback type; TypeConverter.ConvertFromString()\n// is used to convert the value option to an instance of the specified\n// type:\n//\n//  var p = new OptionSet () {\n//    { \"foo=\", (Foo f) => Console.WriteLine (f.ToString ()) },\n//  };\n//\n// Random other tidbits:\n//  - Boolean options (those w/o '=' or ':' in the option format string)\n//    are explicitly enabled if they are followed with '+', and explicitly\n//    disabled if they are followed with '-':\n//      string a = null;\n//      var p = new OptionSet () {\n//        { \"a\", s => a = s },\n//      };\n//      p.Parse (new string[]{\"-a\"});   // sets v != null\n//      p.Parse (new string[]{\"-a+\"});  // sets v != null\n//      p.Parse (new string[]{\"-a-\"});  // sets v == null\n//\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Linq;\n\n#if TEST\nusing NDesk.Options;\n#endif\n\nnamespace NDesk.Options\n{\n\tpublic class OptionValueCollection : IList, IList<string>\n\t{\n\n\t\tList<string> values = new List<string>();\n\t\tOptionContext c;\n\n\t\tinternal OptionValueCollection(OptionContext c)\n\t\t{\n\t\t\tthis.c = c;\n\t\t}\n\n\t\t#region ICollection\n\t\tvoid ICollection.CopyTo(Array array, int index) { (values as ICollection).CopyTo(array, index); }\n\t\tbool ICollection.IsSynchronized { get { return (values as ICollection).IsSynchronized; } }\n\t\tobject ICollection.SyncRoot { get { return (values as ICollection).SyncRoot; } }\n\t\t#endregion\n\n\t\t#region ICollection<T>\n\t\tpublic void Add(string item) { values.Add(item); }\n\t\tpublic void Clear() { values.Clear(); }\n\t\tpublic bool Contains(string item) { return values.Contains(item); }\n\t\tpublic void CopyTo(string[] array, int arrayIndex) { values.CopyTo(array, arrayIndex); }\n\t\tpublic bool Remove(string item) { return values.Remove(item); }\n\t\tpublic int Count { get { return values.Count; } }\n\t\tpublic bool IsReadOnly { get { return false; } }\n\t\t#endregion\n\n\t\t#region IEnumerable\n\t\tIEnumerator IEnumerable.GetEnumerator() { return values.GetEnumerator(); }\n\t\t#endregion\n\n\t\t#region IEnumerable<T>\n\t\tpublic IEnumerator<string> GetEnumerator() { return values.GetEnumerator(); }\n\t\t#endregion\n\n\t\t#region IList\n\t\tint IList.Add(object value) { return (values as IList).Add(value); }\n\t\tbool IList.Contains(object value) { return (values as IList).Contains(value); }\n\t\tint IList.IndexOf(object value) { return (values as IList).IndexOf(value); }\n\t\tvoid IList.Insert(int index, object value) { (values as IList).Insert(index, value); }\n\t\tvoid IList.Remove(object value) { (values as IList).Remove(value); }\n\t\tvoid IList.RemoveAt(int index) { (values as IList).RemoveAt(index); }\n\t\tbool IList.IsFixedSize { get { return false; } }\n\t\tobject IList.this[int index] { get { return this[index]; } set { (values as IList)[index] = value; } }\n\t\t#endregion\n\n\t\t#region IList<T>\n\t\tpublic int IndexOf(string item) { return values.IndexOf(item); }\n\t\tpublic void Insert(int index, string item) { values.Insert(index, item); }\n\t\tpublic void RemoveAt(int index) { values.RemoveAt(index); }\n\n\t\tprivate void AssertValid(int index)\n\t\t{\n\t\t\tif (c.Option == null)\n\t\t\t\tthrow new InvalidOperationException(\"OptionContext.Option is null.\");\n\t\t\tif (index >= c.Option.MaxValueCount)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\tif (c.Option.OptionValueType == OptionValueType.Required &&\n\t\t\t\t\tindex >= values.Count)\n\t\t\t\tthrow new OptionException(string.Format(\n\t\t\t\t\t\t\tc.OptionSet.MessageLocalizer(\"Missing required value for option '{0}'.\"), c.OptionName),\n\t\t\t\t\t\tc.OptionName);\n\t\t}\n\n\t\tpublic string this[int index]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tAssertValid(index);\n\t\t\t\treturn index >= values.Count ? null : values[index];\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tvalues[index] = value;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic List<string> ToList()\n\t\t{\n\t\t\treturn new List<string>(values);\n\t\t}\n\n\t\tpublic string[] ToArray()\n\t\t{\n\t\t\treturn values.ToArray();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Join(\", \", values.ToArray());\n\t\t}\n\t}\n\n\tpublic class OptionContext\n\t{\n\t\tprivate Option option;\n\t\tprivate string name;\n\t\tprivate int index;\n\t\tprivate OptionSet set;\n\t\tprivate OptionValueCollection c;\n\n\t\tpublic OptionContext(OptionSet set)\n\t\t{\n\t\t\tthis.set = set;\n\t\t\tthis.c = new OptionValueCollection(this);\n\t\t}\n\n\t\tpublic Option Option\n\t\t{\n\t\t\tget { return option; }\n\t\t\tset { option = value; }\n\t\t}\n\n\t\tpublic string OptionName\n\t\t{\n\t\t\tget { return name; }\n\t\t\tset { name = value; }\n\t\t}\n\n\t\tpublic int OptionIndex\n\t\t{\n\t\t\tget { return index; }\n\t\t\tset { index = value; }\n\t\t}\n\n\t\tpublic OptionSet OptionSet\n\t\t{\n\t\t\tget { return set; }\n\t\t}\n\n\t\tpublic OptionValueCollection OptionValues\n\t\t{\n\t\t\tget { return c; }\n\t\t}\n\t}\n\n\tpublic enum OptionValueType\n\t{\n\t\tNone,\n\t\tOptional,\n\t\tRequired,\n\t}\n\n\tpublic abstract class Option\n\t{\n\t\tstring prototype, description;\n\t\tstring[] names;\n\t\tOptionValueType type;\n\t\tint count;\n\t\tstring[] separators;\n\n\t\tprotected Option(string prototype, string description)\n\t\t\t: this(prototype, description, 1)\n\t\t{\n\t\t}\n\n\t\tprotected Option(string prototype, string description, int maxValueCount)\n\t\t{\n\t\t\tif (prototype == null)\n\t\t\t\tthrow new ArgumentNullException(\"prototype\");\n\t\t\tif (prototype.Length == 0)\n\t\t\t\tthrow new ArgumentException(\"Cannot be the empty string.\", \"prototype\");\n\t\t\tif (maxValueCount < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"maxValueCount\");\n\n\t\t\tthis.prototype = prototype;\n\t\t\tthis.names = prototype.Split('|');\n\t\t\tthis.description = description;\n\t\t\tthis.count = maxValueCount;\n\t\t\tthis.type = ParsePrototype();\n\n\t\t\tif (this.count == 0 && type != OptionValueType.None)\n\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\"Cannot provide maxValueCount of 0 for OptionValueType.Required or \" +\n\t\t\t\t\t\t\t\"OptionValueType.Optional.\",\n\t\t\t\t\t\t\"maxValueCount\");\n\t\t\tif (this.type == OptionValueType.None && maxValueCount > 1)\n\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\tstring.Format(\"Cannot provide maxValueCount of {0} for OptionValueType.None.\", maxValueCount),\n\t\t\t\t\t\t\"maxValueCount\");\n\t\t\tif (Array.IndexOf(names, \"<>\") >= 0 &&\n\t\t\t\t\t((names.Length == 1 && this.type != OptionValueType.None) ||\n\t\t\t\t\t (names.Length > 1 && this.MaxValueCount > 1)))\n\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\"The default option handler '<>' cannot require values.\",\n\t\t\t\t\t\t\"prototype\");\n\t\t}\n\n\t\tpublic string Prototype { get { return prototype; } }\n\t\tpublic string Description { get { return description; } }\n\t\tpublic OptionValueType OptionValueType { get { return type; } }\n\t\tpublic int MaxValueCount { get { return count; } }\n\n\t\tpublic string[] GetNames()\n\t\t{\n\t\t\treturn (string[])names.Clone();\n\t\t}\n\n\t\tpublic string[] GetValueSeparators()\n\t\t{\n\t\t\tif (separators == null)\n\t\t\t\treturn new string[0];\n\t\t\treturn (string[])separators.Clone();\n\t\t}\n\n\t\tprotected static T Parse<T>(string value, OptionContext c)\n\t\t{\n\t\t\tType tt = typeof(T);\n\t\t\tbool nullable = tt.IsValueType && tt.IsGenericType &&\n\t\t\t\t!tt.IsGenericTypeDefinition &&\n\t\t\t\ttt.GetGenericTypeDefinition() == typeof(Nullable<>);\n\t\t\tType targetType = nullable ? tt.GetGenericArguments()[0] : typeof(T);\n\t\t\tTypeConverter conv = TypeDescriptor.GetConverter(targetType);\n\t\t\tT t = default(T);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (value != null)\n\t\t\t\t\tt = (T)conv.ConvertFromString(value);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new OptionException(\n\t\t\t\t\t\tstring.Format(\n\t\t\t\t\t\t\tc.OptionSet.MessageLocalizer(\"Could not convert string `{0}' to type {1} for option `{2}'.\"),\n\t\t\t\t\t\t\tvalue, targetType.Name, c.OptionName),\n\t\t\t\t\t\tc.OptionName, e);\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\n\t\tinternal string[] Names { get { return names; } }\n\t\tinternal string[] ValueSeparators { get { return separators; } }\n\n\t\tstatic readonly char[] NameTerminator = new char[] { '=', ':' };\n\n\t\tprivate OptionValueType ParsePrototype()\n\t\t{\n\t\t\tchar type = '\\0';\n\t\t\tList<string> seps = new List<string>();\n\t\t\tfor (int i = 0; i < names.Length; ++i)\n\t\t\t{\n\t\t\t\tstring name = names[i];\n\t\t\t\tif (name.Length == 0)\n\t\t\t\t\tthrow new ArgumentException(\"Empty option names are not supported.\", \"prototype\");\n\n\t\t\t\tint end = name.IndexOfAny(NameTerminator);\n\t\t\t\tif (end == -1)\n\t\t\t\t\tcontinue;\n\t\t\t\tnames[i] = name.Substring(0, end);\n\t\t\t\tif (type == '\\0' || type == name[end])\n\t\t\t\t\ttype = name[end];\n\t\t\t\telse\n\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\tstring.Format(\"Conflicting option types: '{0}' vs. '{1}'.\", type, name[end]),\n\t\t\t\t\t\t\t\"prototype\");\n\t\t\t\tAddSeparators(name, end, seps);\n\t\t\t}\n\n\t\t\tif (type == '\\0')\n\t\t\t\treturn OptionValueType.None;\n\n\t\t\tif (count <= 1 && seps.Count != 0)\n\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\tstring.Format(\"Cannot provide key/value separators for Options taking {0} value(s).\", count),\n\t\t\t\t\t\t\"prototype\");\n\t\t\tif (count > 1)\n\t\t\t{\n\t\t\t\tif (seps.Count == 0)\n\t\t\t\t\tthis.separators = new string[] { \":\", \"=\" };\n\t\t\t\telse if (seps.Count == 1 && seps[0].Length == 0)\n\t\t\t\t\tthis.separators = null;\n\t\t\t\telse\n\t\t\t\t\tthis.separators = seps.ToArray();\n\t\t\t}\n\n\t\t\treturn type == '=' ? OptionValueType.Required : OptionValueType.Optional;\n\t\t}\n\n\t\tprivate static void AddSeparators(string name, int end, ICollection<string> seps)\n\t\t{\n\t\t\tint start = -1;\n\t\t\tfor (int i = end + 1; i < name.Length; ++i)\n\t\t\t{\n\t\t\t\tswitch (name[i])\n\t\t\t\t{\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tif (start != -1)\n\t\t\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\t\t\tstring.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n\t\t\t\t\t\t\t\t\t\"prototype\");\n\t\t\t\t\t\tstart = i + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '}':\n\t\t\t\t\t\tif (start == -1)\n\t\t\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\t\t\tstring.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n\t\t\t\t\t\t\t\t\t\"prototype\");\n\t\t\t\t\t\tseps.Add(name.Substring(start, i - start));\n\t\t\t\t\t\tstart = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (start == -1)\n\t\t\t\t\t\t\tseps.Add(name[i].ToString());\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (start != -1)\n\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\tstring.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n\t\t\t\t\t\t\"prototype\");\n\t\t}\n\n\t\tpublic void Invoke(OptionContext c)\n\t\t{\n\t\t\tOnParseComplete(c);\n\t\t\tc.OptionName = null;\n\t\t\tc.Option = null;\n\t\t\tc.OptionValues.Clear();\n\t\t}\n\n\t\tprotected abstract void OnParseComplete(OptionContext c);\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Prototype;\n\t\t}\n\t}\n\n\t[Serializable]\n\tpublic class OptionException : Exception\n\t{\n\t\tprivate string option;\n\n\t\tpublic OptionException()\n\t\t{\n\t\t}\n\n\t\tpublic OptionException(string message, string optionName)\n\t\t\t: base(message)\n\t\t{\n\t\t\tthis.option = optionName;\n\t\t}\n\n\t\tpublic OptionException(string message, string optionName, Exception innerException)\n\t\t\t: base(message, innerException)\n\t\t{\n\t\t\tthis.option = optionName;\n\t\t}\n\n\t\tprotected OptionException(SerializationInfo info, StreamingContext context)\n\t\t\t: base(info, context)\n\t\t{\n\t\t\tthis.option = info.GetString(\"OptionName\");\n\t\t}\n\n\t\tpublic string OptionName\n\t\t{\n\t\t\tget { return this.option; }\n\t\t}\n\n\t\t[SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)]\n\t\tpublic override void GetObjectData(SerializationInfo info, StreamingContext context)\n\t\t{\n\t\t\tbase.GetObjectData(info, context);\n\t\t\tinfo.AddValue(\"OptionName\", option);\n\t\t}\n\t}\n\n\tpublic delegate void OptionAction<TKey, TValue>(TKey key, TValue value);\n\n\tpublic class OptionSet : KeyedCollection<string, Option>\n\t{\n\t\tpublic OptionSet()\n\t\t\t: this(delegate(string f) { return f; })\n\t\t{\n\t\t}\n\n\t\tpublic OptionSet(Converter<string, string> localizer)\n\t\t{\n\t\t\tthis.localizer = localizer;\n\t\t}\n\n\t\tConverter<string, string> localizer;\n\n\t\tpublic Converter<string, string> MessageLocalizer\n\t\t{\n\t\t\tget { return localizer; }\n\t\t}\n\n\t\tprotected override string GetKeyForItem(Option item)\n\t\t{\n\t\t\tif (item == null)\n\t\t\t\tthrow new ArgumentNullException(\"option\");\n\t\t\tif (item.Names != null && item.Names.Length > 0)\n\t\t\t\treturn item.Names[0];\n\t\t\t// This should never happen, as it's invalid for Option to be\n\t\t\t// constructed w/o any names.\n\t\t\tthrow new InvalidOperationException(\"Option has no names!\");\n\t\t}\n\n\t\t[Obsolete(\"Use KeyedCollection.this[string]\")]\n\t\tprotected Option GetOptionForName(string option)\n\t\t{\n\t\t\tif (option == null)\n\t\t\t\tthrow new ArgumentNullException(\"option\");\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn base[option];\n\t\t\t}\n\t\t\tcatch (KeyNotFoundException)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void InsertItem(int index, Option item)\n\t\t{\n\t\t\tbase.InsertItem(index, item);\n\t\t\tAddImpl(item);\n\t\t}\n\n\t\tprotected override void RemoveItem(int index)\n\t\t{\n\t\t\tbase.RemoveItem(index);\n\t\t\tOption p = Items[index];\n\t\t\t// KeyedCollection.RemoveItem() handles the 0th item\n\t\t\tfor (int i = 1; i < p.Names.Length; ++i)\n\t\t\t{\n\t\t\t\tDictionary.Remove(p.Names[i]);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void SetItem(int index, Option item)\n\t\t{\n\t\t\tbase.SetItem(index, item);\n\t\t\tRemoveItem(index);\n\t\t\tAddImpl(item);\n\t\t}\n\n\t\tprivate void AddImpl(Option option)\n\t\t{\n\t\t\tif (option == null)\n\t\t\t\tthrow new ArgumentNullException(\"option\");\n\t\t\tList<string> added = new List<string>(option.Names.Length);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// KeyedCollection.InsertItem/SetItem handle the 0th name.\n\t\t\t\tfor (int i = 1; i < option.Names.Length; ++i)\n\t\t\t\t{\n\t\t\t\t\tDictionary.Add(option.Names[i], option);\n\t\t\t\t\tadded.Add(option.Names[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tforeach (string name in added)\n\t\t\t\t\tDictionary.Remove(name);\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tpublic new OptionSet Add(Option option)\n\t\t{\n\t\t\tbase.Add(option);\n\t\t\treturn this;\n\t\t}\n\n\t\tsealed class ActionOption : Option\n\t\t{\n\t\t\tAction<OptionValueCollection> action;\n\n\t\t\tpublic ActionOption(string prototype, string description, int count, Action<OptionValueCollection> action)\n\t\t\t\t: base(prototype, description, count)\n\t\t\t{\n\t\t\t\tif (action == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\t\tthis.action = action;\n\t\t\t}\n\n\t\t\tprotected override void OnParseComplete(OptionContext c)\n\t\t\t{\n\t\t\t\taction(c.OptionValues);\n\t\t\t}\n\t\t}\n\n\t\tpublic OptionSet Add(string prototype, Action<string> action)\n\t\t{\n\t\t\treturn Add(prototype, null, action);\n\t\t}\n\n\t\tpublic OptionSet Add(string prototype, string description, Action<string> action)\n\t\t{\n\t\t\tif (action == null)\n\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\tOption p = new ActionOption(prototype, description, 1,\n\t\t\t\t\tdelegate(OptionValueCollection v) { action(v[0]); });\n\t\t\tbase.Add(p);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic OptionSet Add(string prototype, OptionAction<string, string> action)\n\t\t{\n\t\t\treturn Add(prototype, null, action);\n\t\t}\n\n\t\tpublic OptionSet Add(string prototype, string description, OptionAction<string, string> action)\n\t\t{\n\t\t\tif (action == null)\n\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\tOption p = new ActionOption(prototype, description, 2,\n\t\t\t\t\tdelegate(OptionValueCollection v) { action(v[0], v[1]); });\n\t\t\tbase.Add(p);\n\t\t\treturn this;\n\t\t}\n\n\t\tsealed class ActionOption<T> : Option\n\t\t{\n\t\t\tAction<T> action;\n\n\t\t\tpublic ActionOption(string prototype, string description, Action<T> action)\n\t\t\t\t: base(prototype, description, 1)\n\t\t\t{\n\t\t\t\tif (action == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\t\tthis.action = action;\n\t\t\t}\n\n\t\t\tprotected override void OnParseComplete(OptionContext c)\n\t\t\t{\n\t\t\t\taction(Parse<T>(c.OptionValues[0], c));\n\t\t\t}\n\t\t}\n\n\t\tsealed class ActionOption<TKey, TValue> : Option\n\t\t{\n\t\t\tOptionAction<TKey, TValue> action;\n\n\t\t\tpublic ActionOption(string prototype, string description, OptionAction<TKey, TValue> action)\n\t\t\t\t: base(prototype, description, 2)\n\t\t\t{\n\t\t\t\tif (action == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\t\tthis.action = action;\n\t\t\t}\n\n\t\t\tprotected override void OnParseComplete(OptionContext c)\n\t\t\t{\n\t\t\t\taction(\n\t\t\t\t\t\tParse<TKey>(c.OptionValues[0], c),\n\t\t\t\t\t\tParse<TValue>(c.OptionValues[1], c));\n\t\t\t}\n\t\t}\n\n\t\tpublic OptionSet Add<T>(string prototype, Action<T> action)\n\t\t{\n\t\t\treturn Add(prototype, null, action);\n\t\t}\n\n\t\tpublic OptionSet Add<T>(string prototype, string description, Action<T> action)\n\t\t{\n\t\t\treturn Add(new ActionOption<T>(prototype, description, action));\n\t\t}\n\n\t\tpublic OptionSet Add<TKey, TValue>(string prototype, OptionAction<TKey, TValue> action)\n\t\t{\n\t\t\treturn Add(prototype, null, action);\n\t\t}\n\n\t\tpublic OptionSet Add<TKey, TValue>(string prototype, string description, OptionAction<TKey, TValue> action)\n\t\t{\n\t\t\treturn Add(new ActionOption<TKey, TValue>(prototype, description, action));\n\t\t}\n\n\t\tprotected virtual OptionContext CreateOptionContext()\n\t\t{\n\t\t\treturn new OptionContext(this);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Internal Use Only. Used by NDesk.OptionSetTest for unit testing purposes of OptionSet.Parse. \n\t\t/// </summary>\n\t\tpublic List<string> Parse(IEnumerable<string> arguments)\n\t\t{\n\t\t\tList<string> filePaths = null;\n\t\t\tList<string> remainingArguments = new List<string>();\n\n\t\t\tParse(arguments.ToArray<string>(), out filePaths, out remainingArguments);\n\t\t\treturn remainingArguments;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Used to parse the options (aka arguments) denoted by a \"-\" or \"--\" in the command line and return the remaining arguments in a list.\n\t\t/// </summary>\n\t\t/// <param name=\"arguments\">The command line arguments.</param>\n\t\t/// <param name=\"remainingArguments\">Return value for the arguments remaining after parsing is complete.</param>\n\t\tpublic void Parse(string[] arguments, out List<string> remainingArguments)\n\t\t{\n\t\t\tList<string> filePaths = null;\n\t\t\tParse(arguments, out filePaths, out remainingArguments);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Used to parse the options (aka arguments) denoted by a \"-\" or \"--\" in the command line.\n\t\t/// This method also returns the multiple file references denoted by -- &amp;filepattern> in git.\n\t\t/// </summary>\n\t\t/// <param name=\"arguments\">The command line arguments.</param>\n\t\t/// <param name=\"filePaths\">Return value for multiple file references, if specified. Setting the value to null will disable this option.</param>\n\t\t/// <param name=\"remainingArguments\">Return value for the arguments remaining after parsing is complete.</param>\n\t\tpublic void Parse(string[] arguments, out List<string> filePaths, out List<string> remainingArguments)\n\t\t{\n\t\t\tList<string> args = new List<string>();\n\t\t\tfilePaths = new List<string>();\n\n\t\t\tforeach (string a in arguments)\n\t\t\t\targs.Add(a);\n\n\t\t\tbool process = true;\n\t\t\tOptionContext c = CreateOptionContext();\n\t\t\tc.OptionIndex = -1;\n\t\t\t//var def = GetOptionForName (\"<>\");\n\t\t\t//Deviation from NDesk's Options.cs to remove the warning message.\n\t\t\tOption def = Contains(\"<>\") ? base[\"<>\"] : null;\n\n\t\t\tint index = args.IndexOf(\"--\");\n\t\t\tif (index != -1 && args.Count > index)\n\t\t\t{\n\t\t\t\t//Strip the additional filepaths and return as a separate value\n\t\t\t\tfor (int x = index + 1; x < args.Count; x++)\n\t\t\t\t\tfilePaths.Add(args[x]);\n\t\t\t\t//filePaths = (List<String>) arguments.Skip(index);\n\t\t\t\targs.RemoveRange(index, args.Count - index);\n\t\t\t}\n\n\t\t\tvar unprocessed =\n\t\t\t\t\t from argument in args\n\t\t\t\t\t where ++c.OptionIndex >= 0 && (process || def != null)\n\t\t\t\t\t\t ? process\n\t\t\t\t\t\t\t ? argument == \"--\"\n\t\t\t\t\t\t\t\t ? (process = false)\n\t\t\t\t\t\t\t\t : !Parse(argument, c)\n\t\t\t\t\t\t\t\t\t ? def != null\n\t\t\t\t\t\t\t\t\t\t ? Unprocessed(null, def, c, argument)\n\t\t\t\t\t\t\t\t\t\t : true\n\t\t\t\t\t\t\t\t\t : false\n\t\t\t\t\t\t\t : def != null\n\t\t\t\t\t\t\t\t ? Unprocessed(null, def, c, argument)\n\t\t\t\t\t\t\t\t : true\n\t\t\t\t\t\t : true\n\t\t\t\t\t select argument;\n\t\t\tList<string> r = unprocessed.ToList();\n\t\t\tif (c.Option != null)\n\t\t\t\tc.Option.Invoke(c);\n\t\t\tremainingArguments = r;\n\t\t}\n\n\t\tprivate static bool Unprocessed(ICollection<string> extra, Option def, OptionContext c, string argument)\n\t\t{\n\t\t\tif (def == null)\n\t\t\t{\n\t\t\t\textra.Add(argument);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tc.OptionValues.Add(argument);\n\t\t\tc.Option = def;\n\t\t\tc.Option.Invoke(c);\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate readonly Regex ValueOption = new Regex(\n\t\t\t@\"^(?<flag>--|-|/)(?<name>[^:=]+)((?<sep>[:=])(?<value>.*))?$\");\n\n\t\tprotected bool GetOptionParts(string argument, out string flag, out string name, out string sep, out string value)\n\t\t{\n\t\t\tif (argument == null)\n\t\t\t\tthrow new ArgumentNullException(\"argument\");\n\n\t\t\tflag = name = sep = value = null;\n\t\t\tMatch m = ValueOption.Match(argument);\n\t\t\tif (!m.Success)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tflag = m.Groups[\"flag\"].Value;\n\t\t\tname = m.Groups[\"name\"].Value;\n\t\t\tif (m.Groups[\"sep\"].Success && m.Groups[\"value\"].Success)\n\t\t\t{\n\t\t\t\tsep = m.Groups[\"sep\"].Value;\n\t\t\t\tvalue = m.Groups[\"value\"].Value;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected virtual bool Parse(string argument, OptionContext c)\n\t\t{\n\t\t\tif (c.Option != null)\n\t\t\t{\n\t\t\t\tParseValue(argument, c);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstring f, n, s, v;\n\t\t\tif (!GetOptionParts(argument, out f, out n, out s, out v))\n\t\t\t\treturn false;\n\n\t\t\tOption p;\n\t\t\tif (Contains(n))\n\t\t\t{\n\t\t\t\tp = this[n];\n\t\t\t\tc.OptionName = f + n;\n\t\t\t\tc.Option = p;\n\t\t\t\tswitch (p.OptionValueType)\n\t\t\t\t{\n\t\t\t\t\tcase OptionValueType.None:\n\t\t\t\t\t\tc.OptionValues.Add(n);\n\t\t\t\t\t\tc.Option.Invoke(c);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase OptionValueType.Optional:\n\t\t\t\t\tcase OptionValueType.Required:\n\t\t\t\t\t\tParseValue(v, c);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// no match; is it a bool option?\n\t\t\tif (ParseBool(argument, n, c))\n\t\t\t\treturn true;\n\t\t\t// is it a bundled option?\n\t\t\tif (ParseBundledValue(f, string.Concat(n + s + v), c))\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate void ParseValue(string option, OptionContext c)\n\t\t{\n\t\t\tif (option != null)\n\t\t\t\tforeach (string o in c.Option.ValueSeparators != null\n\t\t\t\t\t\t? option.Split(c.Option.ValueSeparators, StringSplitOptions.None)\n\t\t\t\t\t\t: new string[] { option })\n\t\t\t\t{\n\t\t\t\t\tc.OptionValues.Add(o);\n\t\t\t\t}\n\t\t\tif (c.OptionValues.Count == c.Option.MaxValueCount ||\n\t\t\t\t\tc.Option.OptionValueType == OptionValueType.Optional)\n\t\t\t\tc.Option.Invoke(c);\n\t\t\telse if (c.OptionValues.Count > c.Option.MaxValueCount)\n\t\t\t{\n\t\t\t\tthrow new OptionException(localizer(string.Format(\n\t\t\t\t\t\t\t\t\"Error: Found {0} option values when expecting {1}.\",\n\t\t\t\t\t\t\t\tc.OptionValues.Count, c.Option.MaxValueCount)),\n\t\t\t\t\t\tc.OptionName);\n\t\t\t}\n\t\t}\n\n\t\tprivate bool ParseBool(string option, string n, OptionContext c)\n\t\t{\n\t\t\tOption p;\n\t\t\tstring rn;\n\t\t\tif (n.Length >= 1 && (n[n.Length - 1] == '+' || n[n.Length - 1] == '-') &&\n\t\t\t\t\tContains((rn = n.Substring(0, n.Length - 1))))\n\t\t\t{\n\t\t\t\tp = this[rn];\n\t\t\t\tstring v = n[n.Length - 1] == '+' ? option : null;\n\t\t\t\tc.OptionName = option;\n\t\t\t\tc.Option = p;\n\t\t\t\tc.OptionValues.Add(v);\n\t\t\t\tp.Invoke(c);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate bool ParseBundledValue(string f, string n, OptionContext c)\n\t\t{\n\t\t\tif (f != \"-\")\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < n.Length; ++i)\n\t\t\t{\n\t\t\t\tOption p;\n\t\t\t\tstring opt = f + n[i].ToString();\n\t\t\t\tstring rn = n[i].ToString();\n\t\t\t\tif (!Contains(rn))\n\t\t\t\t{\n\t\t\t\t\tif (i == 0)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tthrow new OptionException(string.Format(localizer(\n\t\t\t\t\t\t\t\t\t\"Cannot bundle unregistered option '{0}'.\"), opt), opt);\n\t\t\t\t}\n\t\t\t\tp = this[rn];\n\t\t\t\tswitch (p.OptionValueType)\n\t\t\t\t{\n\t\t\t\t\tcase OptionValueType.None:\n\t\t\t\t\t\tInvoke(c, opt, n, p);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase OptionValueType.Optional:\n\t\t\t\t\tcase OptionValueType.Required:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstring v = n.Substring(i + 1);\n\t\t\t\t\t\t\tc.Option = p;\n\t\t\t\t\t\t\tc.OptionName = opt;\n\t\t\t\t\t\t\tParseValue(v.Length != 0 ? v : null, c);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Unknown OptionValueType: \" + p.OptionValueType);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate static void Invoke(OptionContext c, string name, string value, Option option)\n\t\t{\n\t\t\tc.OptionName = name;\n\t\t\tc.Option = option;\n\t\t\tc.OptionValues.Add(value);\n\t\t\toption.Invoke(c);\n\t\t}\n\n\t\tprivate const int OptionWidth = 29;\n\n\t\tpublic void WriteOptionDescriptions(TextWriter o)\n\t\t{\n\t\t\tforeach (Option p in this)\n\t\t\t{\n\t\t\t\tint written = 0;\n\t\t\t\tif (!WriteOptionPrototype(o, p, ref written))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (written < OptionWidth)\n\t\t\t\t\to.Write(new string(' ', OptionWidth - written));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\to.WriteLine();\n\t\t\t\t\to.Write(new string(' ', OptionWidth));\n\t\t\t\t}\n\n\t\t\t\tbool indent = false;\n\t\t\t\tstring prefix = new string(' ', OptionWidth + 2);\n\t\t\t\tforeach (string line in GetLines(localizer(GetDescription(p.Description))))\n\t\t\t\t{\n\t\t\t\t\tif (indent)\n\t\t\t\t\t\to.Write(prefix);\n\t\t\t\t\to.WriteLine(line);\n\t\t\t\t\tindent = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbool WriteOptionPrototype(TextWriter o, Option p, ref int written)\n\t\t{\n\t\t\tstring[] names = p.Names;\n\n\t\t\tint i = GetNextOptionIndex(names, 0);\n\t\t\tif (i == names.Length)\n\t\t\t\treturn false;\n\n\t\t\tif (names[i].Length == 1)\n\t\t\t{\n\t\t\t\tWrite(o, ref written, \"  -\");\n\t\t\t\tWrite(o, ref written, names[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tWrite(o, ref written, \"      --\");\n\t\t\t\tWrite(o, ref written, names[0]);\n\t\t\t}\n\n\t\t\tfor (i = GetNextOptionIndex(names, i + 1);\n\t\t\t\t\ti < names.Length; i = GetNextOptionIndex(names, i + 1))\n\t\t\t{\n\t\t\t\tWrite(o, ref written, \", \");\n\t\t\t\tWrite(o, ref written, names[i].Length == 1 ? \"-\" : \"--\");\n\t\t\t\tWrite(o, ref written, names[i]);\n\t\t\t}\n\n\t\t\tif (p.OptionValueType == OptionValueType.Optional ||\n\t\t\t\t\tp.OptionValueType == OptionValueType.Required)\n\t\t\t{\n\t\t\t\tif (p.OptionValueType == OptionValueType.Optional)\n\t\t\t\t{\n\t\t\t\t\tWrite(o, ref written, localizer(\"[\"));\n\t\t\t\t}\n\t\t\t\tWrite(o, ref written, localizer(\"=\" + GetArgumentName(0, p.MaxValueCount, p.Description)));\n\t\t\t\tstring sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0\n\t\t\t\t\t? p.ValueSeparators[0]\n\t\t\t\t\t: \" \";\n\t\t\t\tfor (int c = 1; c < p.MaxValueCount; ++c)\n\t\t\t\t{\n\t\t\t\t\tWrite(o, ref written, localizer(sep + GetArgumentName(c, p.MaxValueCount, p.Description)));\n\t\t\t\t}\n\t\t\t\tif (p.OptionValueType == OptionValueType.Optional)\n\t\t\t\t{\n\t\t\t\t\tWrite(o, ref written, localizer(\"]\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic int GetNextOptionIndex(string[] names, int i)\n\t\t{\n\t\t\twhile (i < names.Length && names[i] == \"<>\")\n\t\t\t{\n\t\t\t\t++i;\n\t\t\t}\n\t\t\treturn i;\n\t\t}\n\n\t\tstatic void Write(TextWriter o, ref int n, string s)\n\t\t{\n\t\t\tn += s.Length;\n\t\t\to.Write(s);\n\t\t}\n\n\t\tprivate static string GetArgumentName(int index, int maxIndex, string description)\n\t\t{\n\t\t\tif (description == null)\n\t\t\t\treturn maxIndex == 1 ? \"VALUE\" : \"VALUE\" + (index + 1);\n\t\t\tstring[] nameStart;\n\t\t\tif (maxIndex == 1)\n\t\t\t\tnameStart = new string[] { \"{0:\", \"{\" };\n\t\t\telse\n\t\t\t\tnameStart = new string[] { \"{\" + index + \":\" };\n\t\t\tfor (int i = 0; i < nameStart.Length; ++i)\n\t\t\t{\n\t\t\t\tint start, j = 0;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tstart = description.IndexOf(nameStart[i], j);\n\t\t\t\t} while (start >= 0 && j != 0 ? description[j++ - 1] == '{' : false);\n\t\t\t\tif (start == -1)\n\t\t\t\t\tcontinue;\n\t\t\t\tint end = description.IndexOf(\"}\", start);\n\t\t\t\tif (end == -1)\n\t\t\t\t\tcontinue;\n\t\t\t\treturn description.Substring(start + nameStart[i].Length, end - start - nameStart[i].Length);\n\t\t\t}\n\t\t\treturn maxIndex == 1 ? \"VALUE\" : \"VALUE\" + (index + 1);\n\t\t}\n\n\t\tprivate static string GetDescription(string description)\n\t\t{\n\t\t\tif (description == null)\n\t\t\t\treturn string.Empty;\n\t\t\tStringBuilder sb = new StringBuilder(description.Length);\n\t\t\tint start = -1;\n\t\t\tfor (int i = 0; i < description.Length; ++i)\n\t\t\t{\n\t\t\t\tswitch (description[i])\n\t\t\t\t{\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tif (i == start)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb.Append('{');\n\t\t\t\t\t\t\tstart = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (start < 0)\n\t\t\t\t\t\t\tstart = i + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '}':\n\t\t\t\t\t\tif (start < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((i + 1) == description.Length || description[i + 1] != '}')\n\t\t\t\t\t\t\t\tthrow new InvalidOperationException(\"Invalid option description: \" + description);\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tsb.Append(\"}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb.Append(description.Substring(start, i - start));\n\t\t\t\t\t\t\tstart = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ':':\n\t\t\t\t\t\tif (start < 0)\n\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\tstart = i + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (start < 0)\n\t\t\t\t\t\t\tsb.Append(description[i]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tprivate static IEnumerable<string> GetLines(string description)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(description))\n\t\t\t{\n\t\t\t\tyield return string.Empty;\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tint length = 80 - OptionWidth - 1;\n\t\t\tint start = 0, end;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tend = GetLineEnd(start, length, description);\n\t\t\t\tchar c = description[end - 1];\n\t\t\t\tif (char.IsWhiteSpace(c))\n\t\t\t\t\t--end;\n\t\t\t\tbool writeContinuation = end != description.Length && !IsEolChar(c);\n\t\t\t\tstring line = description.Substring(start, end - start) +\n\t\t\t\t\t\t(writeContinuation ? \"-\" : \"\");\n\t\t\t\tyield return line;\n\t\t\t\tstart = end;\n\t\t\t\tif (char.IsWhiteSpace(c))\n\t\t\t\t\t++start;\n\t\t\t\tlength = 80 - OptionWidth - 2 - 1;\n\t\t\t} while (end < description.Length);\n\t\t}\n\n\t\tprivate static bool IsEolChar(char c)\n\t\t{\n\t\t\treturn !char.IsLetterOrDigit(c);\n\t\t}\n\n\t\tprivate static int GetLineEnd(int start, int length, string description)\n\t\t{\n\t\t\tint end = System.Math.Min(start + length, description.Length);\n\t\t\tint sep = -1;\n\t\t\tfor (int i = start + 1; i < end; ++i)\n\t\t\t{\n\t\t\t\tif (description[i] == '\\n')\n\t\t\t\t\treturn i + 1;\n\t\t\t\tif (IsEolChar(description[i]))\n\t\t\t\t\tsep = i + 1;\n\t\t\t}\n\t\t\tif (sep == -1 || end == description.Length)\n\t\t\t\treturn end;\n\t\t\treturn sep;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "Git/Program.cs",
    "content": "/*\n * Copyright (C) 2006, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyrigth (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing NDesk.Options;\n\n// [henon] ported from org.spearce.jgit.pgm\\src\\org\\spearce\\jgit\\pgm\nnamespace GitSharp.CLI\n{\n    /// <summary>\n    /// Command line entry point.\n    /// </summary>\n    public class Program\n    {\n        private static CmdParserOptionSet options;\n\n        /// <summary>\n        /// Display the stack trace on exceptions\n        /// </summary>\n        private static bool showStackTrace;\n\n        /// <summary>\n        /// \n        /// </summary>\n        private static List<String> arguments = new List<String>();\n\n        /// <summary>\n        /// Load the parser options and \n        /// </summary>\n        /// <param name=\"args\"></param>\n        public static void Main(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n                { \"complete\", \"display the complete commands\", v => ShowComplete() },    \n\n                { \"help|h\", \"display this help text\", v => ShowHelp() },\n                { \"incomplete\", \"display the incomplete commands\", v => ShowIncomplete() },\n                { \"show-stack-trace\", \"display the C# stack trace on exceptions\", v => showStackTrace=true },\n                { \"version\", \"\", v => ShowVersion() },\n                { \"git-dir\", \"\", v => NoOp()},\n            };\n            try\n            {\n#if ported\n                //AwtAuthenticator.install();\n                //HttpSupport.configureHttpProxy();\n#endif\n                execute(args);\n            }\n            catch (Die err)\n            {\n                Console.Error.WriteLine(\"fatal: \" + err.Message);\n                if (showStackTrace)\n                    err.printStackTrace();\n                Exit(128);\n            }\n            catch (Exception err)\n            {\n                if (!showStackTrace && err.InnerException != null\n                        && err is TransportException)\n                    Console.Error.WriteLine(\"fatal: \" + err.InnerException.Message);\n\n                if (err.GetType().Name.StartsWith(\"GitSharp.Exceptions.\"))\n                {\n                    Console.Error.WriteLine(\"fatal: \" + err.Message);\n                    if (showStackTrace)\n                        err.printStackTrace();\n                    Exit(128);\n                }\n                err.printStackTrace();\n                Exit(1);\n            }\n\n        }\n\n        /// <summary>\n        /// Execute the command line\n        /// </summary>\n        /// <param name=\"argv\"></param>\n        private static void execute(string[] argv)\n        {\n            if (argv.Count() == 0)\n            {\n                ShowHelp();\n            }\n            else if (!argv[0].StartsWith(\"--\") && !argv[0].StartsWith(\"-\"))\n            {\n\n                CommandCatalog catalog = new CommandCatalog();\n                CommandRef subcommand = catalog.Get(argv[0]);\n                string gitdir = null;\n\n                if (subcommand != null)\n                {\n                    TextBuiltin cmd = subcommand.Create();\n                    List<String> args = argv.ToList();\n                    GitSharp.Repository repo = null;\n\n                    try\n                    {\n                        for (int x = 0; x < args.Count; x++)\n                        {\n                            if (args[x].IndexOf(\"--git-dir=\") > -1)\n                            {\n                                if (args[x].Length > 10)\n                                {\n                                    gitdir = args[x].Substring(10);\n                                    args.RemoveAt(x);\n                                    break;\n                                }\n                            }\n                        }\n                    }\n                    catch (ArgumentException)\n                    {\n                        if (Git.DefaultOutputStream != null)\n                        {\n                            Git.DefaultOutputStream.WriteLine(\"error: can't find git directory\");\n                            Git.DefaultOutputStream.Flush();\n                        }\n                        Exit(1);\n                    }\n\n                    if (cmd.RequiresRepository)\n                    {\n                        if (gitdir == null)\n                        {\n                            gitdir = Commands.AbstractCommand.FindGitDirectory(null, true, false);\n                            if (gitdir == null)\n                            {\n                                Console.Error.WriteLine(\"fatal: Not a git repository (or any of the parent directories): .git\");\n                                Exit(0);\n                            }\n                        }\n\n                        repo = new GitSharp.Repository(gitdir);\n                        cmd.Init(repo, gitdir);\n                    }\n                    else\n                        cmd.Init(null, gitdir);\n\n                    try\n                    {\n                        // Remove the subcommand from the command line\n                        args.RemoveAt(0);\n                        cmd.Execute(args.ToArray());\n                    }\n                    finally\n                    {\n                        if (Git.DefaultOutputStream != null)\n                            Git.DefaultOutputStream.Flush();\n\n                        if (repo != null)\n                            repo.Close();\n                    }\n                }\n                else\n                {\n                    // List all available commands starting with argv[0] if the command\n                    // specified does not exist.\n                    // If no commands exist starting with argv[0], show the help screen.\n                    if (!ShowCommandMatches(argv[0]))\n                        ShowHelp();\n                }\n            }\n            else\n            {\n                // If the first argument in the command line is an option (denoted by starting with - or --), \n                // no subcommand has been specified in the command line.\n                try\n                {\n                    options.Parse(argv, out arguments);\n                }\n                catch (OptionException err)\n                {\n                    if (arguments.Count > 0)\n                    {\n                        Console.Error.WriteLine(\"fatal: \" + err.Message);\n                        Exit(1);\n                    }\n                }\n            }\n            Exit(0);\n        }\n\n        /// <summary>\n        /// Display the main offline help screen.\n        /// </summary>\n        private static void ShowHelp()\n        {\n            Console.Write(\"usage: git \");\n            Console.Write(string.Join(\" \", options.Select(o => \"[--\" + string.Join(\"|-\", o.Names) + \"]\").ToArray()));\n            Console.WriteLine(\"\\nCOMMAND [ARGS]\\n\\nThe most commonly used git commands are:\");\n            options.WriteOptionDescriptions(Console.Error);\n            Console.WriteLine();\n\n            CommandCatalog catalog = new CommandCatalog();\n            foreach (CommandRef c in catalog.Common())\n            {\n                Console.Write(\"      \");\n                Console.Write(c.getName());\n                for (int i = c.getName().Length + 8; i < 31; i++)\n                    Console.Write(\" \");\n                Console.Write(c.getUsage());\n                Console.WriteLine();\n            }\n            Console.Error.WriteLine();\n            Console.Error.Write(@\"See 'git help COMMAND' for more information on a specific command.\");\n        }\n\n        /// <summary>\n        /// Implementation of --version\n        /// </summary>\n        private static void ShowVersion()\n        {\n            var version_command = new GitSharp.CLI.Nonstandard.Version();\n            version_command.Init(null, null);\n            version_command.Execute(new string[0]);\n        }\n\n        /// <summary>\n        /// Display the incomplete commands in GitSharp. Primarily for development use.\n        /// </summary>\n        private static void ShowIncomplete()\n        {\n            CommandCatalog catalog = new CommandCatalog();\n            foreach (CommandRef c in catalog.Incomplete())\n            {\n                Console.Write(\"      \");\n                Console.Write(c.getName());\n                for (int i = c.getName().Length + 8; i < 31; i++)\n                    Console.Write(\" \");\n                Console.Write(c.getUsage());\n                Console.WriteLine();\n            }\n        }\n\n        /// <summary>\n        /// Display the complete commands in GitSharp.\n        /// </summary>\n        private static void ShowComplete()\n        {\n            CommandCatalog catalog = new CommandCatalog();\n            foreach (CommandRef c in catalog.Complete())\n            {\n                Console.Write(\"      \");\n                Console.Write(c.getName());\n                for (int i = c.getName().Length + 8; i < 31; i++)\n                    Console.Write(\" \");\n                Console.Write(c.getUsage());\n                Console.WriteLine();\n            }\n        }\n\n        /// <summary>\n        /// Display the commands that start with the specified string.\n        /// </summary>\n        /// <param name=\"s\"></param>\n        /// <returns>Returns true if matches exist, otherwise false.</returns>\n        private static bool ShowCommandMatches(String s)\n        {\n            CommandCatalog catalog = new CommandCatalog();\n            List<CommandRef> matches = catalog.StartsWith(s);\n            if (matches.Count > 0)\n            {\n                foreach (CommandRef c in matches)\n                {\n                    Console.WriteLine(\"git: '\" + s + \"' is not a git command. See 'git --help'.\");\n                    Console.WriteLine();\n                    Console.WriteLine(\"Did you mean this?\");\n                    Console.Write(\"      \");\n                    Console.Write(c.getName());\n                    for (int i = c.getName().Length + 8; i < 31; i++)\n                        Console.Write(\" \");\n                    Console.Write(c.getUsage());\n                    Console.WriteLine();\n                }\n                return true;\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Wait for Enter key if in DEBUG mode\n        /// </summary>\n        /// <param name=\"exit_code\"></param>\n        static public void Exit(int exit_code)\n        {\n            //Close the static global repository before exiting\n            if (Git.DefaultRepository != null)\n                Git.DefaultRepository.Close();\n\n#if DEBUG\n            Console.WriteLine(\"\\n\\nrunning in DEBUG mode, press any key to exit.\");\n            Console.In.ReadLine();\n#endif\n            Environment.Exit(exit_code);\n        }\n\n        /// <summary>\n        /// Placeholder for the --git-dir command-line option. It is handled before it reaches this method.\n        /// </summary>\n        static private void NoOp()\n        {\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "Git/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyTitle(\"git\")]\n[assembly: AssemblyDescription(\"Command line interface for GitSharp\")]\n"
  },
  {
    "path": "Git/README.txt",
    "content": "CLI (Command Line Interface) is a not so close port of jgit's pgm-package and \nshall be equivalent to the original git command line.\n\nThe implemented git commands are located in Commands\nThe auto-generated command stubs are located in Stubs. They will be moved to Commands once implemented.\n\nThe CLI commands rely on the command API in GitSharp.Commands"
  },
  {
    "path": "Git/Resources/Commands.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root>\n  <CommandList>\n    <Command>\n      <Name>GitSharp.CLI.Add</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-add.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Bisect</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Branch</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-branch.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Checkout</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Clone</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-clone.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Commit</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-commit.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Config</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-config.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Daemon</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-daemon.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Diff</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-diff.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.DiffTree</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-diff-tree.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Fetch</Name>\n    <Help>http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Grep</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-grep.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.IndexPack</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-index-pack.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Init</Name>\n    <Help>http://www.kernel.org/pub/software/scm/git/docs/git-init.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Log</Name>\n    <Help>http://www.kernel.org/pub/software/scm/git/docs/git-log.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.LsRemote</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.LsTree</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-ls-tree.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Merge</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-merge.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.MergeBase</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-merge-base.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Mv</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-mv.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Pull</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-pull.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Push</Name>\n    <Help>http://www.kernel.org/pub/software/scm/git/docs/git-push.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Rebase</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.ReceivePack</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-receive-pack.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Reset</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-reset.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.RevList</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-rev-list.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.RevParse</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Rm</Name>\n    <Help>http://www.kernel.org/pub/software/scm/git/docs/git-rm.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Show</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-show.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.ShowRef</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-show-ref.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Status</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-status.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Tag</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-tag.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.UploadPack</Name>\n      <Help>http://www.kernel.org/pub/software/scm/git/docs/git-upload-pack.html</Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Nonstandard.Help</Name>\n      <Help></Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Nonstandard.Version</Name>\n      <Help></Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Nonstandard.Glog</Name>\n      <Help></Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Nonstandard.ShowRev</Name>\n      <Help></Help>\n    </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.MakeCacheTree</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.ReadDirCache</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.RebuildCommitGraph</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.ShowCacheTree</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.ShowCommands</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.ShowDirCache</Name>\n      <Help></Help>\n  </Command>\n    <Command>\n      <Name>GitSharp.CLI.Debug.WriteDirCache</Name>\n      <Help></Help>\n  </Command>\n  </CommandList>\n</root>"
  },
  {
    "path": "Git/Stubs/Am.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Am : TextBuiltin\n    {\n        private AmCommand cmd = new AmCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"s|signoff\", \"Add a `Signed-off-by:` line to the commit message, using the committer identity of yourself\", v => cmd.Signoff = true },\n               { \"k|keep\", \"Pass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1])\", v => cmd.Keep = true },\n               { \"c|scissors\", \"Remove everything in body before a scissors line (see linkgit:git-mailinfo[1])\", v => cmd.Scissors = true },\n               { \"no-scissors\", \"Ignore scissors lines (see linkgit:git-mailinfo[1])\", v => cmd.NoScissors = true },\n               { \"q|quiet\", \"Be quiet\", v => cmd.Quiet = true },\n               { \"u|utf8\", \"Pass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1])\", v => cmd.Utf8 = true },\n               { \"no-utf8\", \"Pass `-n` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1])\", v => cmd.NoUtf8 = true },\n               { \"3|3way\", \"When the patch does not apply cleanly, fall back on 3-way merge if the patch records the identity of blobs it is supposed to apply to and we have those blobs available locally\", v => cmd.ThreeWay = true },\n               { \"ignore-date\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.IgnoreDate = true },\n               { \"ignore-space-change\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.IgnoreSpaceChange = true },\n               { \"ignore-whitespace=\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.IgnoreWhitespace = v },\n               { \"w|whitespace=\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.Whitespace = v },\n               { \"p|directory=\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.Directory = v },\n               { \"reject\", \"These flags are passed to the 'git-apply' (see linkgit:git-apply[1]) program that applies the patch\", v => cmd.Reject = true },\n               { \"i|interactive\", \"Run interactively\", v => cmd.Interactive = true },\n               { \"committer-date-is-author-date\", \"By default the command records the date from the e-mail message as the commit author date, and uses the time of commit creation as the committer date\", v => cmd.CommitterDateIsAuthorDate = true },\n               { \"ignore-date\", \"By default the command records the date from the e-mail message as the commit author date, and uses the time of commit creation as the committer date\", v => cmd.IgnoreDate = true },\n               { \"skip\", \"Skip the current patch\", v => cmd.Skip = true },\n               { \"r|resolved\", \"After a patch failure (e\", v => cmd.Resolved = true },\n               { \"resolvemsg=\", \"When a patch failure occurs, <msg> will be printed to the screen before exiting\", v => cmd.Resolvemsg = v },\n               { \"abort\", \"Restore the original branch and abort the patching operation\", v => cmd.Abort = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Annotate.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n    // [Mr Happy] This will probably point to git-blame later on.\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Annotate : TextBuiltin\n    {\n        private AnnotateCommand cmd = new AnnotateCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"b\", \"Show blank SHA-1 for boundary commits\", v => cmd.B = true },\n               { \"root\", \"Do not treat root commits as boundaries\", v => cmd.Root = true },\n               { \"show-stats\", \"Include additional statistics at the end of blame output\", v => cmd.ShowStats = true },\n               { \"L=\", \"Annotate only the given line range\", v => cmd.L = v },\n               { \"l\", \"Show long rev (Default: off)\", v => cmd.l = true },\n               { \"t\", \"Show raw timestamp (Default: off)\", v => cmd.T = true },\n               { \"S=\", \"Use revisions from revs-file instead of calling linkgit:git-rev-list[1]\", v => cmd.S = v },\n               { \"reverse\", \"Walk history forward instead of backward\", v => cmd.Reverse = true },\n               { \"p|porcelain\", \"Show in a format designed for machine consumption\", v => cmd.Porcelain = true },\n               { \"incremental\", \"Show the result incrementally in a format designed for machine consumption\", v => cmd.Incremental = true },\n               { \"encoding=\", \"Specifies the encoding used to output author names and commit summaries\", v => cmd.Encoding = v },\n               { \"contents=\", \"When <rev> is not specified, the command annotates the changes starting backwards from the working tree copy\", v => cmd.Contents = v },\n               { \"date=\", \"The value is one of the following alternatives: {relative,local,default,iso,rfc,short}\", v => cmd.Date = v },\n               { \"M=\", \"Detect moving lines in the file as well\", v => cmd.M = v },\n               { \"C=\", \"In addition to `-M`, detect lines copied from other files that were modified in the same commit\", v => cmd.C = v },\n               { \"h|help\", \"Show help message\", v => cmd.Help = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Apply.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Apply : TextBuiltin\n    {\n        private ApplyCommand cmd = new ApplyCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"stat\", \"Instead of applying the patch, output diffstat for the input\", v => cmd.Stat = true },\n               { \"numstat\", \"Similar to `--stat`, but shows the number of added and deleted lines in decimal notation and the pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"summary\", \"Instead of applying the patch, output a condensed summary of information obtained from git diff extended headers, such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"check\", \"Instead of applying the patch, see if the patch is applicable to the current working tree and/or the index file and detects errors\", v => cmd.Check = true },\n               { \"index\", \"When `--check` is in effect, or when applying the patch (which is the default when none of the options that disables it is in effect), make sure the patch is applicable to what the current index file records\", v => cmd.Index = true },\n               { \"cached\", \"Apply a patch without touching the working tree\", v => cmd.Cached = true },\n               { \"build-fake-ancestor=\", \"Newer 'git-diff' output has embedded 'index information' for each blob to help identify the original version that the patch applies to\", v => cmd.BuildFakeAncestor = v },\n               { \"R|reverse\", \"Apply the patch in reverse\", v => cmd.Reverse = true },\n               { \"reject\", \"For atomicity, 'git-apply' by default fails the whole patch and does not touch the working tree when some of the hunks do not apply\", v => cmd.Reject = true },\n               { \"z\", \"When `--numstat` has been given, do not munge pathnames, but use a NUL-terminated machine-readable format\", v => cmd.Z = true },\n               { \"p=\", \"Remove <n> leading slashes from traditional diff paths\", v => cmd.P = v },\n               { \"C=\", \"Ensure at least <n> lines of surrounding context match before and after each change\", v => cmd.C = v },\n               { \"unidiff-zero\", \"By default, 'git-apply' expects that the patch being applied is a unified diff with at least one line of context\", v => cmd.UnidiffZero = true },\n               { \"apply\", \"If you use any of the options marked \\\"Turns off 'apply'\\\" above, 'git-apply' reads and outputs the requested information without actually applying the patch\", v => cmd.Apply = true },\n               { \"no-add\", \"When applying a patch, ignore additions made by the patch\", v => cmd.NoAdd = true },\n               { \"allow-binary-replacement\", \"Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so\", v => cmd.AllowBinaryReplacement = true },\n               { \"binary\", \"Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so\", v => cmd.Binary = true },\n               { \"exclude=\", \"Don't apply changes to files matching the given path pattern\", v => cmd.Exclude = v },\n               { \"include=\", \"Apply changes to files matching the given path pattern\", v => cmd.Include = v },\n               { \"ignore-space-change\", \"When applying a patch, ignore changes in whitespace in context lines if necessary\", v => cmd.IgnoreSpaceChange = true },\n               { \"ignore-whitespace\", \"When applying a patch, ignore changes in whitespace in context lines if necessary\", v => cmd.IgnoreWhitespace = true },\n               { \"whitespace=\", \"When applying a patch, detect a new or modified line that has whitespace errors\", v => cmd.Whitespace = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Archive.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Archive : TextBuiltin\n    {\n        private ArchiveCommand cmd = new ArchiveCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"format=\", \"Format of the resulting archive: 'tar' or 'zip'\", v => cmd.Format = v },\n               { \"l|list\", \"Show all available formats\", v => cmd.List = true },\n               { \"v|verbose\", \"Report progress to stderr\", v => cmd.Verbose = true },\n               { \"prefix=\", \"Prepend <prefix>/ to each filename in the archive\", v => cmd.Prefix = v },\n               { \"o|output=\", \"Write the archive to <file> instead of stdout\", v => cmd.Output = v },\n               { \"worktree-attributes\", \"Look for attributes in\", v => cmd.WorktreeAttributes = true },\n               { \"remote=\", \"Instead of making a tar archive from the local repository, retrieve a tar archive from a remote repository\", v => cmd.Remote = v },\n               { \"exec=\", \"Used with --remote to specify the path to the 'git-upload-archive' on the remote side\", v => cmd.Exec = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Blame.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Blame : TextBuiltin\n    {\n        private BlameCommand cmd = new BlameCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"c\", \"Use the same output mode as linkgit:git-annotate[1] (Default: off)\", v => cmd.c = true },\n               { \"score-debug\", \"Include debugging information related to the movement of lines between files (see `-C`) and lines moved within a file (see `-M`)\", v => cmd.ScoreDebug = true },\n               { \"f|show-name\", \"Show the filename in the original commit\", v => cmd.ShowName = true },\n               { \"n|show-number\", \"Show the line number in the original commit (Default: off)\", v => cmd.ShowNumber = true },\n               { \"s\", \"Suppress the author name and timestamp from the output\", v => cmd.s = true },\n               { \"w\", \"Ignore whitespace when comparing the parent's version and the child's to find where the lines came from\", v => cmd.W = true },\n               { \"b\", \"Show blank SHA-1 for boundary commits\", v => cmd.B = true },\n               { \"root\", \"Do not treat root commits as boundaries\", v => cmd.Root = true },\n               { \"show-stats\", \"Include additional statistics at the end of blame output\", v => cmd.ShowStats = true },\n               { \"L=\", \"Annotate only the given line range\", v => cmd.L = v },\n               { \"l\", \"Show long rev (Default: off)\", v => cmd.l = true },\n               { \"t\", \"Show raw timestamp (Default: off)\", v => cmd.T = true },\n               { \"S=\", \"Use revisions from revs-file instead of calling linkgit:git-rev-list[1]\", v => cmd.S = v },\n               { \"reverse\", \"Walk history forward instead of backward\", v => cmd.Reverse = true },\n               { \"p|porcelain\", \"Show in a format designed for machine consumption\", v => cmd.Porcelain = true },\n               { \"incremental\", \"Show the result incrementally in a format designed for machine consumption\", v => cmd.Incremental = true },\n               { \"encoding=\", \"Specifies the encoding used to output author names and commit summaries\", v => cmd.Encoding = v },\n               { \"contents=\", \"When <rev> is not specified, the command annotates the changes starting backwards from the working tree copy\", v => cmd.Contents = v },\n               { \"date=\", \"The value is one of the following alternatives: {relative,local,default,iso,rfc,short}\", v => cmd.Date = v },\n               { \"M=\", \"Detect moving lines in the file as well\", v => cmd.M = v },\n               { \"C=\", \"In addition to `-M`, detect lines copied from other files that were modified in the same commit\", v => cmd.C = v },\n               { \"h|help\", \"Show help message\", v => cmd.Help = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Branch.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Branch : TextBuiltin\n    {\n        private BranchCommand cmd = new BranchCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"d\", \"Delete a branch\", v => cmd.d = true },\n               { \"D\", \"Delete a branch irrespective of its merged status\", v => cmd.D = true },\n               { \"l\", \"Create the branch's reflog\", v => cmd.L = true },\n               { \"f|force\", \"Reset <branchname> to <startpoint> if <branchname> exists already\", v => cmd.Force = true },\n               { \"m\", \"Move/rename a branch and the corresponding reflog\", v => cmd.m = true },\n               { \"M\", \"Move/rename a branch even if the new branch name already exists\", v => cmd.M = true },\n               { \"color\", \"Color branches to highlight current, local, and remote branches\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off branch colors, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"r\", \"List or delete (if used with -d) the remote-tracking branches\", v => cmd.R = true },\n               { \"a\", \"List both remote-tracking branches and local branches\", v => cmd.A = true },\n               { \"v|verbose\", \"Show sha1 and commit subject line for each head, along with relationship to upstream branch (if any)\", v => cmd.Verbose = true },\n               { \"abbrev=\", \"Alter the sha1's minimum display length in the output listing\", v => cmd.Abbrev = v },\n               { \"no-abbrev\", \"Display the full sha1s in the output listing rather than abbreviating them\", v => cmd.NoAbbrev = true },\n               { \"t|track\", \"When creating a new branch, set up configuration to mark the start-point branch as \\\"upstream\\\" from the new branch\", v => cmd.Track = true },\n               { \"no-track\", \"Do not set up \\\"upstream\\\" configuration, even if the branch\", v => cmd.NoTrack = true },\n               { \"contains=\", \"Only list branches which contain the specified commit\", v => cmd.Contains = v },\n               { \"merged=\", \"Only list branches whose tips are reachable from the specified commit (HEAD if not specified)\", v => cmd.Merged = v },\n               { \"no-merged=\", \"Only list branches whose tips are not reachable from the specified commit (HEAD if not specified)\", v => cmd.NoMerged = v },\n             };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/CatFile.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Catfile : TextBuiltin\n    {\n        private CatFileCommand cmd = new CatFileCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"t\", \"Instead of the content, show the object type identified by <object>\", v => cmd.T = true },\n               { \"s\", \"Instead of the content, show the object size identified by <object>\", v => cmd.S = true },\n               { \"e=\", \"Suppress all output; instead exit with zero status if <object> exists and is a valid object\", v => cmd.E = v },\n               { \"p=\", \"Pretty-print the contents of <object> based on its type\", v => cmd.P = v },\n               { \"batch\", \"Print the SHA1, type, size, and contents of each object provided on stdin\", v => cmd.Batch = true },\n               { \"batch-check\", \"Print the SHA1, type, and size of each object provided on stdin\", v => cmd.BatchCheck = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/CheckoutIndex.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n    // [Mr Happy] Might be merged w/ regular checkout?\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Checkoutindex : TextBuiltin\n    {\n        private CheckoutIndexCommand cmd = new CheckoutIndexCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"u|index\", \"update stat information for the checked out entries in the index file\", v => cmd.Index = true },\n               { \"q|quiet\", \"be quiet if files exist or are not in the index\", v => cmd.Quiet = true },\n               { \"f|force\", \"forces overwrite of existing files\", v => cmd.Force = true },\n               { \"a|all\", \"checks out all files in the index\", v => cmd.All = true },\n               { \"n|no-create\", \"Don't checkout new files, only refresh files already checked out\", v => cmd.NoCreate = true },\n               { \"prefix=\", \"When creating files, prepend <string> (usually a directory including a trailing /)\", v => cmd.Prefix = v },\n               { \"stage=\", \"Instead of checking out unmerged entries, copy out the files from named stage\", v => cmd.Stage = v },\n               { \"temp\", \"Instead of copying the files to the working directory write the content to temporary files\", v => cmd.Temp = true },\n               { \"stdin\", \"Instead of taking list of paths from the command line, read list of paths from the standard input\", v => cmd.Stdin = true },\n               { \"z\", \"Only meaningful with `--stdin`; paths are separated with NUL character instead of LF\", v => cmd.Z = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Cherry.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Cherry : TextBuiltin\n    {\n        private CherryCommand cmd = new CherryCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"v\", \"Verbose\", v => cmd.V = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/CherryPick.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Cherrypick : TextBuiltin\n    {\n        private CherryPickCommand cmd = new CherryPickCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"e|edit\", \"With this option, 'git-cherry-pick' will let you edit the commit message prior to committing\", v => cmd.Edit = true },\n               { \"x\", \"When recording the commit, append to the original commit message a note that indicates which commit this change was cherry-picked from\", v => cmd.X = true },\n               { \"r\", \"It used to be that the command defaulted to do `-x` described above, and `-r` was to disable it\", v => cmd.R = true },\n               { \"m|mainline\", \"Usually you cannot cherry-pick a merge because you do not know which side of the merge should be considered the mainline\", v => cmd.Mainline = true },\n               { \"n|no-commit\", \"Usually the command automatically creates a commit\", v => cmd.NoCommit = true },\n               { \"s|signoff\", \"Add Signed-off-by line at the end of the commit message\", v => cmd.Signoff = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Clean.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Clean : TextBuiltin\n    {\n        private CleanCommand cmd = new CleanCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"d\", \"Remove untracked directories in addition to untracked files\", v => cmd.D = true },\n               { \"f|force\", \"If the git configuration specifies clean\", v => cmd.Force = true },\n               { \"n|dry-run\", \"Don't actually remove anything, just show what would be done\", v => cmd.DryRun = true },\n               { \"q|quiet\", \"Be quiet, only report errors, but not the files that are successfully removed\", v => cmd.Quiet = true },\n               { \"x\", \"Don't use the ignore rules\", v => cmd.x = true },\n               { \"X\", \"Remove only files ignored by git\", v => cmd.X = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/CommitTree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n    // [Mr Happy] May be obsolete, end users should use commit according to the documentation...\n    //            (API might need it tho)\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Committree : TextBuiltin\n    {\n        private CommitTreeCommand cmd = new CommitTreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"p=\", \"Each '-p' indicates the id of a parent commit object\", v => cmd.P = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/CountObjects.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Countobjects : TextBuiltin\n    {\n        private CountObjectsCommand cmd = new CountObjectsCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"v|verbose\", \"In addition to the number of loose objects and disk space consumed, it reports the number of in-pack objects, number of packs, disk space consumed by those packs, and number of objects that can be removed by running `git prune-packed`\", v => cmd.Verbose = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Describe.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Describe : TextBuiltin\n    {\n        private DescribeCommand cmd = new DescribeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"all\", \"Instead of using only the annotated tags, use any ref found in `\", v => cmd.All = true },\n               { \"tags\", \"Instead of using only the annotated tags, use any tag found in `\", v => cmd.Tags = true },\n               { \"contains\", \"Instead of finding the tag that predates the commit, find the tag that comes after the commit, and thus contains it\", v => cmd.Contains = true },\n               { \"abbrev=\", \"Instead of using the default 7 hexadecimal digits as the abbreviated object name, use <n> digits, or as many digits as needed to form a unique object name\", v => cmd.Abbrev = v },\n               { \"candidates=\", \"Instead of considering only the 10 most recent tags as candidates to describe the input committish consider up to <n> candidates\", v => cmd.Candidates = v },\n               { \"exact-match\", \"Only output exact matches (a tag directly references the supplied commit)\", v => cmd.ExactMatch = true },\n               { \"debug\", \"Verbosely display information about the searching strategy being employed to standard error\", v => cmd.Debug = true },\n               { \"long\", \"Always output the long format (the tag, the number of commits and the abbreviated commit name) even when it matches a tag\", v => cmd.Long = true },\n               { \"match=\", \"Only consider tags matching the given pattern (can be used to avoid leaking private tags made from the repository)\", v => cmd.Match = v },\n               { \"always\", \"Show uniquely abbreviated commit object as fallback\", v => cmd.Always = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Diff.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Diff : TextBuiltin\n    {\n        private DiffCommand cmd = new DiffCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"p\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/DiffFiles.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Difffiles : TextBuiltin\n    {\n        private DiffFilesCommand cmd = new DiffFilesCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"1\", \"Diff against the \\\"base\\\" version, \\\"our branch\\\" or \\\"their branch\\\" respectively\", v => cmd.One = true },\n               { \"2\", \"Diff against the \\\"base\\\" version, \\\"our branch\\\" or \\\"their branch\\\" respectively\", v => cmd.Two = true },\n               { \"3\", \"Diff against the \\\"base\\\" version, \\\"our branch\\\" or \\\"their branch\\\" respectively\", v => cmd.Three = true },\n               { \"0\", \"Diff against the \\\"base\\\" version, \\\"our branch\\\" or \\\"their branch\\\" respectively\", v => cmd.Zero = true },\n               { \"c|cc\", \"This compares stage 2 (our branch), stage 3 (their branch) and the working tree file and outputs a combined diff, similar to the way 'diff-tree' shows a merge commit with these flags\", v => cmd.Cc = true },\n               { \"q\", \"Remain silent even on nonexistent files\", v => cmd.Q = true },\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"p\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/DiffIndex.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Diffindex : TextBuiltin\n    {\n        private DiffIndexCommand cmd = new DiffIndexCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"cached\", \"do not consider the on-disk file at all\", v => cmd.Cached = true },\n               { \"m\", \"By default, files recorded in the index but not checked out are reported as deleted\", v => cmd.m = true },\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"p\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/DiffTree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Difftree : TextBuiltin\n    {\n        private DiffTreeCommand cmd = new DiffTreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"r\", \"recurse into sub-trees\", v => cmd.r = true },\n               { \"t\", \"show tree entry itself as well as subtrees\", v => cmd.T = true },\n               { \"root\", \"When '--root' is specified the initial commit will be shown as a big creation event\", v => cmd.Root = true },\n               { \"stdin\", \"When '--stdin' is specified, the command does not take <tree-ish> arguments from the command line\", v => cmd.Stdin = true },\n               { \"m\", \"By default, 'git-diff-tree --stdin' does not show differences for merge commits\", v => cmd.m = true },\n               { \"s\", \"By default, 'git-diff-tree --stdin' shows differences, either in machine-readable form (without '-p') or in patch form (with '-p')\", v => cmd.s = true },\n               { \"v\", \"This flag causes 'git-diff-tree --stdin' to also show the commit message before the differences\", v => cmd.V = true },\n               { \"no-commit-id\", \"'git-diff-tree' outputs a line with the commit ID when applicable\", v => cmd.NoCommitId = true },\n               { \"c\", \"This flag changes the way a merge commit is displayed (which means it is useful only when the command is given one <tree-ish>, or '--stdin')\", v => cmd.c = true },\n               { \"cc\", \"This flag changes the way a merge commit patch is displayed, in a similar way to the '-c' option\", v => cmd.Cc = true },\n               { \"always\", \"Show the commit itself and the commit log message even if the diff itself is empty\", v => cmd.Always = true },\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"p\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n               { \"pretty=\", \"For more detailed explanation on these common options, see also linkgit:gitdiffcore[7]\", v => cmd.Pretty = v },\n               { \"format=\", \"For more detailed explanation on these common options, see also linkgit:gitdiffcore[7]\", v => cmd.Format = v },\n               { \"abbrev-commit\", \"Instead of showing the full 40-byte hexadecimal commit object name, show only a partial prefix\", v => cmd.AbbrevCommit = true },\n               { \"oneline\", \"This is a shorthand for \\\"--pretty=oneline --abbrev-commit\\\" used together\", v => cmd.Oneline = true },\n               { \"encoding=\", \"The commit objects record the encoding used for the log message in their encoding header; this option can be used to tell the command to re-code the commit log message in the encoding preferred by the user\", v => cmd.Encoding = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Difftool.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Difftool : TextBuiltin\n    {\n        private DifftoolCommand cmd = new DifftoolCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"y|no-prompt\", \"Do not prompt before launching a diff tool\", v => cmd.NoPrompt = true },\n               { \"prompt\", \"Prompt before each invocation of the diff tool\", v => cmd.Prompt = true },\n               { \"t|tool=\", \"Use the diff tool specified by <tool>\", v => cmd.Tool = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FastExport.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Fastexport : TextBuiltin\n    {\n        private FastExportCommand cmd = new FastExportCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"progress=\", \"Insert 'progress' statements every <n> objects, to be shown by 'git-fast-import' during import\", v => cmd.Progress = v },\n               { \"signed-tags=\", \"Specify how to handle signed tags\", v => cmd.SignedTags = v },\n               { \"tag-of-filtered-object=\", \"Specify how to handle tags whose tagged objectis filtered out\", v => cmd.TagOfFilteredObject = v },\n               { \"M\", \"Perform move and/or copy detection, as described in the linkgit:git-diff[1] manual page, and use it to generate rename and copy commands in the output dump\", v => cmd.M = true },\n               { \"C\", \"Perform move and/or copy detection, as described in the linkgit:git-diff[1] manual page, and use it to generate rename and copy commands in the output dump\", v => cmd.C = true },\n               { \"export-marks=\", \"Dumps the internal marks table to <file> when complete\", v => cmd.ExportMarks = v },\n               { \"import-marks=\", \"Before processing any input, load the marks specified in <file>\", v => cmd.ImportMarks = v },\n               { \"fake-missing-tagger\", \"Some old repositories have tags without a tagger\", v => cmd.FakeMissingTagger = true },\n               { \"no-data\", \"Skip output of blob objects and instead refer to blobs via their original SHA-1 hash\", v => cmd.NoData = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FastImport.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Fastimport : TextBuiltin\n    {\n        private FastimportCommand cmd = new FastimportCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"date-format=\", \"Specify the type of dates the frontend will supply to fast-import within `author`, `committer` and `tagger` commands\", v => cmd.DateFormat = v },\n               { \"force\", \"Force updating modified existing branches, even if doing so would cause commits to be lost (as the new commit does not contain the old commit)\", v => cmd.Force = true },\n               { \"max-pack-size=\", \"Maximum size of each output packfile, expressed in MiB\", v => cmd.MaxPackSize = v },\n               { \"depth=\", \"Maximum delta depth, for blob and tree deltification\", v => cmd.Depth = v },\n               { \"active-branches=\", \"Maximum number of branches to maintain active at once\", v => cmd.ActiveBranches = v },\n               { \"export-marks=\", \"Dumps the internal marks table to <file> when complete\", v => cmd.ExportMarks = v },\n               { \"import-marks=\", \"Before processing any input, load the marks specified in <file>\", v => cmd.ImportMarks = v },\n               { \"export-pack-edges=\", \"After creating a packfile, print a line of data to <file> listing the filename of the packfile and the last commit on each branch that was written to that packfile\", v => cmd.ExportPackEdges = v },\n               { \"quiet\", \"Disable all non-fatal output, making fast-import silent when it is successful\", v => cmd.Quiet = true },\n               { \"stats\", \"Display some basic statistics about the objects fast-import has created, the packfiles they were stored into, and the memory used by fast-import during this run\", v => cmd.Stats = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FetchPack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Fetchpack : TextBuiltin\n    {\n        private FetchPackCommand cmd = new FetchPackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"all\", \"Fetch all remote refs\", v => cmd.All = true },\n               { \"q|quiet\", \"Pass '-q' flag to 'git-unpack-objects'; this makes the cloning process less verbose\", v => cmd.Quiet = true },\n               { \"k|keep\", \"Do not invoke 'git-unpack-objects' on received data, but create a single packfile out of it instead, and store it in the object database\", v => cmd.Keep = true },\n               { \"thin\", \"Spend extra cycles to minimize the number of objects to be sent\", v => cmd.Thin = true },\n               { \"include-tag\", \"If the remote side supports it, annotated tags objects will be downloaded on the same connection as the other objects if the object the tag references is downloaded\", v => cmd.IncludeTag = true },\n               { \"upload-pack=\", \"Use this to specify the path to 'git-upload-pack' on the remote side, if is not found on your $PATH\", v => cmd.UploadPack = v },\n               { \"exec=\", \"Same as --upload-pack=<git-upload-pack>\", v => cmd.Exec = v },\n               { \"depth=\", \"Limit fetching to ancestor-chains not longer than n\", v => cmd.Depth = v },\n               { \"no-progress\", \"Do not show the progress\", v => cmd.NoProgress = true },\n               { \"v\", \"Run verbosely\", v => cmd.V = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FilterBranch.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Filterbranch : TextBuiltin\n    {\n        private FilterBranchCommand cmd = new FilterBranchCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"env-filter=\", \"This filter may be used if you only need to modify the environment in which the commit will be performed\", v => cmd.EnvFilter = v },\n               { \"tree-filter=\", \"This is the filter for rewriting the tree and its contents\", v => cmd.TreeFilter = v },\n               { \"index-filter=\", \"This is the filter for rewriting the index\", v => cmd.IndexFilter = v },\n               { \"parent-filter=\", \"This is the filter for rewriting the commit's parent list\", v => cmd.ParentFilter = v },\n               { \"msg-filter=\", \"This is the filter for rewriting the commit messages\", v => cmd.MsgFilter = v },\n               { \"commit-filter=\", \"This is the filter for performing the commit\", v => cmd.CommitFilter = v },\n               { \"tag-name-filter=\", \"This is the filter for rewriting tag names\", v => cmd.TagNameFilter = v },\n               { \"subdirectory-filter=\", \"Only look at the history which touches the given subdirectory\", v => cmd.SubdirectoryFilter = v },\n               { \"remap-to-ancestor\", \"Rewrite refs to the nearest rewritten ancestor instead of ignoring them\", v => cmd.RemapToAncestor = true },\n               { \"prune-empty\", \"Some kind of filters will generate empty commits, that left the tree untouched\", v => cmd.PruneEmpty = true },\n               { \"original=\", \"Use this option to set the namespace where the original commits will be stored\", v => cmd.Original = v },\n               { \"d=\", \"Use this option to set the path to the temporary directory used for rewriting\", v => cmd.D = v },\n               { \"f|force\", \"'git-filter-branch' refuses to start with an existing temporary directory or when there are already refs starting with 'refs/original/', unless forced\", v => cmd.Force = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FmtMergeMsg.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Fmtmergemsg : TextBuiltin\n    {\n\t\t private MergeOptions cmd = new MergeOptions();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"log\", \"In addition to branch names, populate the log message with one-line descriptions from the actual commits that are being merged\", v => cmd.Log = true },\n               { \"no-log\", \"Do not list one-line descriptions from the actual commits being merged\", v => cmd.Log = false },\n\t\t\t\t\t// [obsolete]\n               //{ \"summary\", \"Synonyms to --log and --no-log; these are deprecated and will be removed in the future\", v => cmd.Summary = true },\n               //{ \"no-summary\", \"Synonyms to --log and --no-log; these are deprecated and will be removed in the future\", v => cmd.NoSummary = true },\n               { \"F|file=\", \"Take the list of merged objects from <file> instead of stdin\", v =>\n               \t{\n               \t\t//cmd.File = v \n               \t}\n               },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n\t\t\t\t\t\t  //cmd.Arguments = arguments;\n\t\t\t\t\t\t  //cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n\t\t\t\t\t //cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n\t\t\t\t\t OutputStream.WriteLine(\"Here should be the usage...\");\n\t\t\t\t\t OutputStream.WriteLine();\n\t\t\t\t\t options.WriteOptionDescriptions(OutputStream);\n\t\t\t\t\t OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/ForEachRef.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Foreachref : TextBuiltin\n    {\n        private ForEachRefCommand cmd = new ForEachRefCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"shell\", \"If given, strings that substitute `%(fieldname)` placeholders are quoted as string literals suitable for the specified host language\", v => cmd.Shell = true },\n               { \"perl\", \"If given, strings that substitute `%(fieldname)` placeholders are quoted as string literals suitable for the specified host language\", v => cmd.Perl = true },\n               { \"python\", \"If given, strings that substitute `%(fieldname)` placeholders are quoted as string literals suitable for the specified host language\", v => cmd.Python = true },\n               { \"tcl\", \"If given, strings that substitute `%(fieldname)` placeholders are quoted as string literals suitable for the specified host language\", v => cmd.Tcl = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/FormatPatch.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Formatpatch : TextBuiltin\n    {\n        private FormatPatchCommand cmd = new FormatPatchCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               // [Mr-Happy] This option is actually -<n>, so -4 or -6 for example.\n               //            need to look into how CmdParseOptionSet will/should handle this.\n               //{ \"n=\", \"Limits the number of patches to prepare\", v => cmd.< = v },\n               { \"o|output-directory=\", \"Use <dir> to store the resulting files, instead of the current working directory\", v => cmd.OutputDirectory = v },\n               { \"n|numbered\", \"Name output in '[PATCH n/m]' format, even with a single patch\", v => cmd.Numbered = true },\n               { \"N|no-numbered\", \"Name output in '[PATCH]' format\", v => cmd.NoNumbered = true },\n               { \"start-number=\", \"Start numbering the patches at <n> instead of 1\", v => cmd.StartNumber = v },\n               { \"numbered-files\", \"Output file names will be a simple number sequence without the default first line of the commit appended\", v => cmd.NumberedFiles = true },\n               { \"k|keep-subject\", \"Do not strip/add '[PATCH]' from the first line of the commit log message\", v => cmd.KeepSubject = true },\n               { \"s|signoff\", \"Add `Signed-off-by:` line to the commit message, using the committer identity of yourself\", v => cmd.Signoff = true },\n               { \"stdout\", \"Print all commits to the standard output in mbox format, instead of creating a file for each one\", v => cmd.Stdout = true },\n               { \"attach=\", \"Create multipart/mixed attachment, the first part of which is the commit message and the patch itself in the second part, with `Content-Disposition: attachment`\", v => cmd.Attach = v },\n               { \"no-attach\", \"Disable the creation of an attachment, overriding the configuration setting\", v => cmd.NoAttach = true },\n               { \"inline=\", \"Create multipart/mixed attachment, the first part of which is the commit message and the patch itself in the second part, with `Content-Disposition: inline`\", v => cmd.Inline = v },\n               { \"thread=\", \"Controls addition of `In-Reply-To` and `References` headers to make the second and subsequent mails appear as replies to the first\", v => cmd.Thread = v },\n               { \"no-thread\", \"Controls addition of `In-Reply-To` and `References` headers to make the second and subsequent mails appear as replies to the first\", v => cmd.NoThread = true },\n               { \"in-reply-to=\", \"Make the first mail (or all the mails with `--no-thread`) appear as a reply to the given Message-Id, which avoids breaking threads to provide a new patch series\", v => cmd.InReplyTo = v },\n               { \"ignore-if-in-upstream\", \"Do not include a patch that matches a commit in <until>\", v => cmd.IgnoreIfInUpstream = true },\n               { \"subject-prefix=\", \"Instead of the standard '[PATCH]' prefix in the subject line, instead use '[<Subject-Prefix>]'\", v => cmd.SubjectPrefix = v },\n               { \"cc=\", \"Add a `Cc:` header to the email headers\", v => cmd.Cc = v },\n               { \"add-header=\", \"Add an arbitrary header to the email headers\", v => cmd.AddHeader = v },\n               { \"cover-letter\", \"In addition to the patches, generate a cover letter file containing the shortlog and the overall diffstat\", v => cmd.CoverLetter = true },\n               { \"suffix=\", \"Instead of using `\", v => cmd.Suffix = v },\n               { \"no-binary\", \"Do not output contents of changes in binary files, instead display a notice that those files changed\", v => cmd.NoBinary = true },\n               { \"root=\", \"Treat the revision argument as a <revision range>, even if it is just a single commit (that would normally be treated as a <since>)\", v => cmd.Root = v },\n               { \"p|no-stat\", \"ifdef::git-format-patch[] Generate plain patches without any diffstats\", v => cmd.NoStat = true },\n               { \"p\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.P = true },\n               { \"u\", \"ifndef::git-format-patch[] Generate patch (see section on generating patches)\", v => cmd.U = true },\n               { \"U|unified=\", \"Generate diffs with <n> lines of context instead of the usual three\", v => cmd.Unified = v },\n               { \"raw\", \"ifndef::git-format-patch[] Generate the raw format\", v => cmd.Raw = true },\n               { \"patch-with-raw\", \"ifndef::git-format-patch[] Synonym for `-p --raw`\", v => cmd.PatchWithRaw = true },\n               { \"patience\", \"Generate a diff using the \\\"patience diff\\\" algorithm\", v => cmd.Patience = true },\n               { \"stat=\", \"Generate a diffstat\", v => cmd.Stat = v },\n               { \"numstat\", \"Similar to `--stat`, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\", v => cmd.Numstat = true },\n               { \"shortstat\", \"Output only the last line of the `--stat` format containing total number of modified files, as well as number of added and deleted lines\", v => cmd.Shortstat = true },\n               { \"dirstat=\", \"Output the distribution of relative amount of changes (number of lines added or removed) for each sub-directory\", v => cmd.Dirstat = v },\n               { \"dirstat-by-file=\", \"Same as `--dirstat`, but counts changed files instead of lines\", v => cmd.DirstatByFile = v },\n               { \"summary\", \"Output a condensed summary of extended header information such as creations, renames and mode changes\", v => cmd.Summary = true },\n               { \"patch-with-stat\", \"ifndef::git-format-patch[] Synonym for `-p --stat`\", v => cmd.PatchWithStat = true },\n               { \"z\", \"ifdef::git-log[] Separate the commits with NULs instead of with new newlines\", v => cmd.Z = true },\n               { \"name-only\", \"Show only names of changed files\", v => cmd.NameOnly = true },\n               { \"name-status\", \"Show only names and status of changed files\", v => cmd.NameStatus = true },\n               { \"submodule=\", \"Chose the output format for submodule differences\", v => cmd.Submodule = v },\n               { \"color\", \"Show colored diff\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored diff, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               { \"color-words=\", \"Show colored word diff, i\", v => cmd.ColorWords = v },\n               { \"no-renames\", \"Turn off rename detection, even when the configuration file gives the default to do so\", v => cmd.NoRenames = true },\n               { \"check\", \"ifndef::git-format-patch[] Warn if changes introduce trailing whitespace or an indent that uses a space before a tab\", v => cmd.Check = true },\n               { \"full-index\", \"Instead of the first handful of characters, show the full pre- and post-image blob object names on the \\\"index\\\" line when generating patch format output\", v => cmd.FullIndex = true },\n               { \"binary\", \"In addition to `--full-index`, output a binary diff that can be applied with `git-apply`\", v => cmd.Binary = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"B\", \"Break complete rewrite changes into pairs of delete and create\", v => cmd.B = true },\n               { \"M\", \"Detect renames\", v => cmd.M = true },\n               { \"C\", \"Detect copies as well as renames\", v => cmd.C = true },\n               { \"diff-filter=\", \"ifndef::git-format-patch[] Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their type (i\", v => cmd.DiffFilter = v },\n               { \"find-copies-harder\", \"For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset\", v => cmd.FindCopiesHarder = true },\n               { \"l=\", \"The `-M` and `-C` options require O(n^2) processing time where n is the number of potential rename/copy targets\", v => cmd.L = v },\n               { \"S=\", \"ifndef::git-format-patch[] Look for differences that introduce or remove an instance of <string>\", v => cmd.S = v },\n               { \"pickaxe-all\", \"When `-S` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\", v => cmd.PickaxeAll = true },\n               { \"pickaxe-regex=\", \"Make the <string> not a plain string but an extended POSIX regex to match\", v => cmd.PickaxeRegex = v },\n               { \"O=\", \"Output the patch in the order specified in the <orderfile>, which has one shell glob pattern per line\", v => cmd.O = v },\n               { \"R\", \"ifndef::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents\", v => cmd.R = true },\n               { \"relative=\", \"When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\", v => cmd.Relative = v },\n               { \"a|text\", \"Treat all files as text\", v => cmd.Text = true },\n               { \"ignore-space-at-eol\", \"Ignore changes in whitespace at EOL\", v => cmd.IgnoreSpaceAtEol = true },\n               { \"b|ignore-space-change\", \"Ignore changes in amount of whitespace\", v => cmd.IgnoreSpaceChange = true },\n               { \"w|ignore-all-space\", \"Ignore whitespace when comparing lines\", v => cmd.IgnoreAllSpace = true },\n               { \"inter-hunk-context=\", \"Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\", v => cmd.InterHunkContext = v },\n               { \"exit-code\", \"ifndef::git-format-patch[] Make the program exit with codes similar to diff(1)\", v => cmd.ExitCode = true },\n               { \"quiet\", \"Disable all output of the program\", v => cmd.Quiet = true },\n               { \"ext-diff\", \"Allow an external diff helper to be executed\", v => cmd.ExtDiff = true },\n               { \"no-ext-diff\", \"Disallow external diff drivers\", v => cmd.NoExtDiff = true },\n               { \"ignore-submodules\", \"Ignore changes to submodules in the diff generation\", v => cmd.IgnoreSubmodules = true },\n               { \"src-prefix=\", \"Show the given source prefix instead of \\\"a/\\\"\", v => cmd.SrcPrefix = v },\n               { \"dst-prefix=\", \"Show the given destination prefix instead of \\\"b/\\\"\", v => cmd.DstPrefix = v },\n               { \"no-prefix\", \"Do not show any source or destination prefix\", v => cmd.NoPrefix = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Fsck.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Fsck : TextBuiltin\n    {\n        private FsckCommand cmd = new FsckCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"unreachable\", \"Print out objects that exist but that aren't readable from any of the reference nodes\", v => cmd.Unreachable = true },\n               { \"root\", \"Report root nodes\", v => cmd.Root = true },\n               { \"tags\", \"Report tags\", v => cmd.Tags = true },\n               { \"cache\", \"Consider any object recorded in the index also as a head node for an unreachability trace\", v => cmd.Cache = true },\n               { \"no-reflogs\", \"Do not consider commits that are referenced only by an entry in a reflog to be reachable\", v => cmd.NoReflogs = true },\n               { \"full\", \"Check not just objects in GIT_OBJECT_DIRECTORY ($GIT_DIR/objects), but also the ones found in alternate object pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES or $GIT_DIR/objects/info/alternates, and in packed git archives found in $GIT_DIR/objects/pack and corresponding pack subdirectories in alternate object pools\", v => cmd.Full = true },\n               { \"strict\", \"Enable more strict checking, namely to catch a file mode recorded with g+w bit set, which was created by older versions of git\", v => cmd.Strict = true },\n               { \"verbose\", \"Be chatty\", v => cmd.Verbose = true },\n               { \"lost-found\", \"Write dangling objects into\", v => cmd.LostFound = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Gc.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Gc : TextBuiltin\n    {\n        private GcCommand cmd = new GcCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"aggressive\", \"Usually 'git-gc' runs very quickly while providing good disk space utilization and performance\", v => cmd.Aggressive = true },\n               { \"auto\", \"With this option, 'git-gc' checks whether any housekeeping is required; if not, it exits without performing any work\", v => cmd.Auto = true },\n               { \"prune=\", \"Prune loose objects older than date (default is 2 weeks ago, overridable by the config variable `gc\", v => cmd.Prune = v },\n               { \"no-prune\", \"Do not prune any loose objects\", v => cmd.NoPrune = true },\n               { \"quiet\", \"Suppress all progress reports\", v => cmd.Quiet = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Grep.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Grep : TextBuiltin\n    {\n        private GrepCommand cmd = new GrepCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"cached\", \"Instead of searching in the working tree files, check the blobs registered in the index file\", v => cmd.Cached = true },\n               { \"a|text\", \"Process binary files as if they were text\", v => cmd.Text = true },\n               { \"i|ignore-case\", \"Ignore case differences between the patterns and the files\", v => cmd.IgnoreCase = true },\n               { \"I\", \"Don't match the pattern in binary files\", v => cmd.I = true },\n               { \"max-depth=\", \"For each pathspec given on command line, descend at most <depth> levels of directories\", v => cmd.MaxDepth = v },\n               { \"w|word-regexp\", \"Match the pattern only at word boundary (either begin at the beginning of a line, or preceded by a non-word character; end at the end of a line or followed by a non-word character)\", v => cmd.WordRegexp = true },\n               { \"v|invert-match\", \"Select non-matching lines\", v => cmd.InvertMatch = true },\n               { \"h|H\", \"By default, the command shows the filename for each match\", v => cmd.H = true },\n               { \"full-name\", \"When run from a subdirectory, the command usually outputs paths relative to the current directory\", v => cmd.FullName = true },\n               { \"E|extended-regexp\", \"Use POSIX extended/basic regexp for patterns\", v => cmd.ExtendedRegexp = true },\n               { \"G|basic-regexp\", \"Use POSIX extended/basic regexp for patterns\", v => cmd.BasicRegexp = true },\n               { \"F|fixed-strings\", \"Use fixed strings for patterns (don't interpret pattern as a regex)\", v => cmd.FixedStrings = true },\n               { \"n\", \"Prefix the line number to matching lines\", v => cmd.N = true },\n               { \"l|files-with-matches\", \"Instead of showing every matched line, show only the names of files that contain (or do not contain) matches\", v => cmd.FilesWithMatches = true },\n               { \"name-only\", \"Instead of showing every matched line, show only the names of files that contain (or do not contain) matches\", v => cmd.NameOnly = true },\n               { \"files-without-match\", \"Instead of showing every matched line, show only the names of files that contain (or do not contain) matches\", v => cmd.FilesWithoutMatch = true },\n               { \"z|null\", \"Output \\0 instead of the character that normally follows a file name\", v => cmd.Null = true },\n               { \"c|count\", \"Instead of showing every matched line, show the number of lines that match\", v => cmd.Count = true },\n               { \"color\", \"Show colored matches\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off match highlighting, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n               // [Mr Happy] Original documentation says: -[ABC] <context>\n               { \"A=\", \"Show `context` trailing (`A` -- after), or leading (`B` -- before), or both (`C` -- context) lines, and place a line containing `--` between contiguous groups of matches\", v => cmd.A = v },\n               { \"B=\", \"Show `context` trailing (`A` -- after), or leading (`B` -- before), or both (`C` -- context) lines, and place a line containing `--` between contiguous groups of matches\", v => cmd.B = v },\n               { \"C=\", \"Show `context` trailing (`A` -- after), or leading (`B` -- before), or both (`C` -- context) lines, and place a line containing `--` between contiguous groups of matches\", v => cmd.C = v },\n               // [Mr Happy] Is more of an argument that an option.\n               //{ \"<num>=\", \"A shortcut for specifying -C<num>\", v => cmd.< = v },\n               { \"p|show-function\", \"Show the preceding line that contains the function name of the match, unless the matching line is a function name itself\", v => cmd.ShowFunction = true },\n               { \"f=\", \"Read patterns from <file>, one per line\", v => cmd.F = v },\n               { \"e\", \"The next parameter is the pattern\", v => cmd.E = true },\n               { \"and\", \"(\", v => cmd.And = true },\n               { \"or\", \"(\", v => cmd.Or = true },\n               { \"not\", \"(\", v => cmd.Not = true },\n               { \"all-match\", \"When giving multiple pattern expressions combined with `--or`, this flag is specified to limit the match to files that have lines to match all of them\", v => cmd.AllMatch = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/HashObject.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Hashobject : TextBuiltin\n    {\n        private HashObjectCommand cmd = new HashObjectCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"t=\", \"Specify the type (default: \\\"blob\\\")\", v => cmd.T = v },\n               { \"w\", \"Actually write the object into the object database\", v => cmd.W = true },\n               { \"stdin\", \"Read the object from standard input instead of from a file\", v => cmd.Stdin = true },\n               { \"stdin-paths\", \"Read file names from stdin instead of from the command-line\", v => cmd.StdinPaths = true },\n               { \"path\", \"Hash object as it were located at the given path\", v => cmd.Path = true },\n               { \"no-filters\", \"Hash the contents as is, ignoring any input filter that would have been chosen by the attributes mechanism, including crlf conversion\", v => cmd.NoFilters = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/IndexPack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Indexpack : TextBuiltin\n    {\n        private IndexpackCommand cmd = new IndexpackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"v\", \"Be verbose about what is going on, including progress status\", v => cmd.V = true },\n               { \"o=\", \"Write the generated pack index into the specified file\", v => cmd.O = v },\n               { \"stdin\", \"When this flag is provided, the pack is read from stdin instead and a copy is then written to <pack-file>\", v => cmd.Stdin = true },\n               { \"fix-thin\", \"It is possible for 'git-pack-objects' to build \\\"thin\\\" pack, which records objects in deltified form based on objects not included in the pack to reduce network traffic\", v => cmd.FixThin = true },\n               // [Mr Happy] I have no idea how OptionSet handles the two lines below this one.\n               //            might or might not work, haven't tested yet.\n               { \"keep\", \"Before moving the index into its final destination create an empty\", v => cmd.Keep = true },\n               { \"keep=\", \"Like --keep create a\", v => cmd.KeepMsg = v },\n               { \"index-version=\", \"This is intended to be used by the test suite only\", v => cmd.IndexVersion = v },\n               { \"strict\", \"Die, if the pack contains broken objects or links\", v => cmd.Strict = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/LsFiles.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class LsFiles : TextBuiltin\n    {\n        private LsFilesCommand cmd = new LsFilesCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"c|cached\", \"Show cached files in the output (default)\", v => cmd.Cached = true },\n               { \"d|deleted\", \"Show deleted files in the output\", v => cmd.Deleted = true },\n               { \"m|modified\", \"Show modified files in the output\", v => cmd.Modified = true },\n               { \"o|others\", \"Show other (i\", v => cmd.Others = true },\n               { \"i|ignored\", \"Show only ignored files in the output\", v => cmd.Ignored = true },\n               { \"s|stage\", \"Show staged contents' object name, mode bits and stage number in the output\", v => cmd.Stage = true },\n               { \"directory\", \"If a whole directory is classified as \\\"other\\\", show just its name (with a trailing slash) and not its whole contents\", v => cmd.Directory = true },\n               { \"no-empty-directory\", \"Do not list empty directories\", v => cmd.NoEmptyDirectory = true },\n               { \"u|unmerged\", \"Show unmerged files in the output (forces --stage)\", v => cmd.Unmerged = true },\n               { \"k|killed\", \"Show files on the filesystem that need to be removed due to file/directory conflicts for checkout-index to succeed\", v => cmd.Killed = true },\n               { \"z\", \"0 line termination on output\", v => cmd.Z = true },\n               { \"x|exclude=\", \"Skips files matching pattern\", v => cmd.Exclude = v },\n               { \"X|exclude-from=\", \"exclude patterns are read from <file>; 1 per line\", v => cmd.ExcludeFrom = v },\n               { \"exclude-per-directory=\", \"read additional exclude patterns that apply only to the directory and its subdirectories in <file>\", v => cmd.ExcludePerDirectory = v },\n               { \"exclude-standard\", \"Add the standard git exclusions:\", v => cmd.ExcludeStandard = true },\n               { \"error-unmatch=\", \"If any <file> does not appear in the index, treat this as an error (return 1)\", v => cmd.ErrorUnmatch = v },\n               { \"with-tree=\", \"When using --error-unmatch to expand the user supplied <file> (i\", v => cmd.WithTree = v },\n               { \"t\", \"Identify the file status with the following tags (followed by a space) at the start of each line: H::cached M::unmerged R::removed/deleted C::modified/changed K::to be killed ?::other\", v => cmd.T = true },\n               { \"v\", \"Similar to `-t`, but use lowercase letters for files that are marked as 'assume unchanged' (see linkgit:git-update-index[1])\", v => cmd.V = true },\n               { \"full-name\", \"When run from a subdirectory, the command usually outputs paths relative to the current directory\", v => cmd.FullName = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object lines, show only a partial prefix\", v => cmd.Abbrev = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/LsRemote.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class LsRemote : TextBuiltin\n    {\n        private LsRemoteCommand cmd = new LsRemoteCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"h|heads\", \"Limit to only refs/heads and refs/tags, respectively\", v => cmd.Heads = true },\n               { \"t|tags\", \"Limit to only refs/heads and refs/tags, respectively\", v => cmd.Tags = true },\n               { \"u|upload-pack=\", \"Specify the full path of 'git-upload-pack' on the remote host\", v => cmd.UploadPack = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/LsTree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class LsTree : TextBuiltin\n    {\n        private LsTreeCommand cmd = new LsTreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"d\", \"Show only the named tree entry itself, not its children\", v => cmd.D = true },\n               { \"r\", \"Recurse into sub-trees\", v => cmd.R = true },\n               { \"t\", \"Show tree entries even when going to recurse them\", v => cmd.T = true },\n               { \"l|long\", \"Show object size of blob (file) entries\", v => cmd.Long = true },\n               { \"z\", \"0 line termination on output\", v => cmd.Z = true },\n               { \"name-only\", \"List only filenames (instead of the \\\"long\\\" output), one per line\", v => cmd.NameOnly = true },\n               { \"name-status\", \"List only filenames (instead of the \\\"long\\\" output), one per line\", v => cmd.NameStatus = true },\n               { \"abbrev=\", \"Instead of showing the full 40-byte hexadecimal object lines, show only a partial prefix\", v => cmd.Abbrev = v },\n               { \"full-name\", \"Instead of showing the path names relative to the current working directory, show the full path names\", v => cmd.FullName = true },\n               { \"full-tree\", \"Do not limit the listing to the current working directory\", v => cmd.FullTree = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Mailinfo.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Mailinfo : TextBuiltin\n    {\n        private MailinfoCommand cmd = new MailinfoCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"k\", \"Usually the program 'cleans up' the Subject: header line to extract the title line for the commit log message, among which (1) remove 'Re:' or 're:', (2) leading whitespaces, (3) '[' up to ']', typically '[PATCH]', and then prepends \\\"[PATCH] \\\"\", v => cmd.K = true },\n               { \"b\", \"When -k is not in effect, all leading strings bracketed with '[' and ']' pairs are stripped\", v => cmd.B = true },\n               { \"u\", \"The commit log message, author name and author email are taken from the e-mail, and after minimally decoding MIME transfer encoding, re-coded in UTF-8 by transliterating them\", v => cmd.U = true },\n               { \"encoding=\", \"Similar to -u but if the local convention is different from what is specified by i18n\", v => cmd.Encoding = v },\n               { \"n\", \"Disable all charset re-coding of the metadata\", v => cmd.N = true },\n               { \"scissors\", \"Remove everything in body before a scissors line\", v => cmd.Scissors = true },\n               { \"no-scissors\", \"Ignore scissors lines\", v => cmd.NoScissors = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Mailsplit.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Mailsplit : TextBuiltin\n    {\n        private MailsplitCommand cmd = new MailsplitCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"o=\", \"Directory in which to place the individual messages\", v => cmd.O = v },\n               { \"b\", \"If any file doesn't begin with a From line, assume it is a single mail message instead of signaling error\", v => cmd.B = true },\n               { \"d=\", \"Instead of the default 4 digits with leading zeros, different precision can be specified for the generated filenames\", v => cmd.D = v },\n               { \"f=\", \"Skip the first <nn> numbers, for example if -f3 is specified, start the numbering with 0004\", v => cmd.F = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/MergeBase.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class MergeBase : TextBuiltin\n    {\n        private MergeBaseCommand cmd = new MergeBaseCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"a|all\", \"Output all merge bases for the commits, instead of just one\", v => cmd.All = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/MergeFile.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class MergeFile : TextBuiltin\n    {\n        private MergeFileCommand cmd = new MergeFileCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"L=\", \"This option may be given up to three times, and specifies labels to be used in place of the corresponding file names in conflict reports\", v => cmd.L = v },\n               { \"p\", \"Send results to standard output instead of overwriting `<current-file>`\", v => cmd.P = true },\n               { \"q\", \"Quiet; do not warn about conflicts\", v => cmd.Q = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/MergeIndex.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class MergeIndex : TextBuiltin\n    {\n        private MergeIndexCommand cmd = new MergeIndexCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"a\", \"Run merge against all files in the index that need merging\", v => cmd.A = true },\n               { \"o\", \"Instead of stopping at the first failed merge, do all of them in one shot - continue with merging even when previous merges returned errors, and only return the error code after all the merges\", v => cmd.O = true },\n               { \"q\", \"Do not complain about a failed merge program (a merge program failure usually indicates conflicts during the merge)\", v => cmd.Q = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Mergetool.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Mergetool : TextBuiltin\n    {\n        private MergetoolCommand cmd = new MergetoolCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"t|tool=\", \"Use the merge resolution program specified by <tool>\", v => cmd.Tool = v },\n               { \"y|no-prompt\", \"Don't prompt before each invocation of the merge resolution program\", v => cmd.NoPrompt = true },\n               { \"prompt\", \"Prompt before each invocation of the merge resolution program\", v => cmd.Prompt = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Mktree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Mktree : TextBuiltin\n    {\n        private MktreeCommand cmd = new MktreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"z\", \"Read the NUL-terminated `ls-tree -z` output instead\", v => cmd.Z = true },\n               { \"missing\", \"Allow missing objects\", v => cmd.Missing = true },\n               { \"batch\", \"Allow building of more than one tree object before exiting\", v => cmd.Batch = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Mv.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Mv : TextBuiltin\n    {\n        private MvCommand cmd = new MvCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"f|force\", \"Force renaming or moving of a file even if the target exists         Skip move or rename actions which would lead to an error condition\", v => cmd.Force = true },\n               { \"k\", \"Force renaming or moving of a file even if the target exists         Skip move or rename actions which would lead to an error condition\", v => cmd.K = true },\n               { \"n|dry-run\", \"Force renaming or moving of a file even if the target exists         Skip move or rename actions which would lead to an error condition\", v => cmd.DryRun = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/NameRev.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class NameRev : TextBuiltin\n    {\n        private NameRevCommand cmd = new NameRevCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"tags\", \"Do not use branch names, but only tags to name the commits\", v => cmd.Tags = true },\n               { \"refs=\", \"Only use refs whose names match a given shell pattern\", v => cmd.Refs = v },\n               { \"all\", \"List all commits reachable from all refs\", v => cmd.All = true },\n               { \"stdin=\", \"Read from stdin, append \\\"(<rev_name>)\\\" to all sha1's of nameable commits, and pass to stdout\", v => cmd.Stdin = v },\n               { \"name-only\", \"Instead of printing both the SHA-1 and the name, print only the name\", v => cmd.NameOnly = true },\n               { \"no-undefined\", \"Die with error code != 0 when a reference is undefined, instead of printing `undefined`\", v => cmd.NoUndefined = true },\n               { \"always\", \"Show uniquely abbreviated commit object as fallback\", v => cmd.Always = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Notes.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    // [Mr Happy] I haven't heard of this command before, and msysGit doesn't seem to support it.\n    //            It is in the documentation though, maybe for internal use?\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Notes : TextBuiltin\n    {\n        private NotesCommand cmd = new NotesCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"m=\", \"Use the given note message (instead of prompting)\", v => cmd.M = v },\n               { \"F=\", \"Take the note message from the given file\", v => cmd.F = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PackObjects.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PackObjects : TextBuiltin\n    {\n        private PackObjectsCommand cmd = new PackObjectsCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"stdout\", \"Write the pack contents (what would have been written to\", v => cmd.Stdout = true },\n               { \"revs\", \"Read the revision arguments from the standard input, instead of individual object names\", v => cmd.Revs = true },\n               { \"unpacked\", \"This implies `--revs`\", v => cmd.Unpacked = true },\n               { \"all\", \"This implies `--revs`\", v => cmd.All = true },\n               { \"include-tag\", \"Include unasked-for annotated tags if the object they reference was included in the resulting packfile\", v => cmd.IncludeTag = true },\n               { \"window=\", \"These two options affect how the objects contained in the pack are stored using delta compression\", v => cmd.Window = v },\n               { \"depth=\", \"These two options affect how the objects contained in the pack are stored using delta compression\", v => cmd.Depth = v },\n               { \"window-memory=\", \"This option provides an additional limit on top of `--window`; the window size will dynamically scale down so as to not take up more than N bytes in memory\", v => cmd.WindowMemory = v },\n               { \"max-pack-size=\", \"Maximum size of each output packfile, expressed in MiB\", v => cmd.MaxPackSize = v },\n               { \"honor-pack-keep\", \"This flag causes an object already in a local pack that has a\", v => cmd.HonorPackKeep = true },\n               { \"incremental\", \"This flag causes an object already in a pack ignored even if it appears in the standard input\", v => cmd.Incremental = true },\n               { \"local\", \"This flag is similar to `--incremental`; instead of ignoring all packed objects, it only ignores objects that are packed and/or not in the local object store (i\", v => cmd.Local = true },\n               { \"non-empty\", \"Only create a packed archive if it would contain at         least one object\", v => cmd.NonEmpty = true },\n               { \"progress\", \"Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified\", v => cmd.Progress = true },\n               { \"all-progress\", \"When --stdout is specified then progress report is displayed during the object count and compression phases but inhibited during the write-out phase\", v => cmd.AllProgress = true },\n               { \"all-progress-implied\", \"This is used to imply --all-progress whenever progress display is activated\", v => cmd.AllProgressImplied = true },\n               { \"q\", \"This flag makes the command not to report its progress on the standard error stream\", v => cmd.Q = true },\n               { \"no-reuse-delta\", \"When creating a packed archive in a repository that has existing packs, the command reuses existing deltas\", v => cmd.NoReuseDelta = true },\n               { \"no-reuse-object\", \"This flag tells the command not to reuse existing object data at all, including non deltified object, forcing recompression of everything\", v => cmd.NoReuseObject = true },\n               { \"compression=\", \"Specifies compression level for newly-compressed data in the generated pack\", v => cmd.Compression = v },\n               { \"delta-base-offset\", \"A packed archive can express base object of a delta as either 20-byte object name or as an offset in the stream, but older version of git does not understand the latter\", v => cmd.DeltaBaseOffset = true },\n               { \"threads=\", \"Specifies the number of threads to spawn when searching for best delta matches\", v => cmd.Threads = v },\n               { \"index-version=\", \"This is intended to be used by the test suite only\", v => cmd.IndexVersion = v },\n               { \"keep-true-parents\", \"With this option, parents that are hidden by grafts are packed nevertheless\", v => cmd.KeepTrueParents = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PackRedundant.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PackRedundant : TextBuiltin\n    {\n        private PackRedundantCommand cmd = new PackRedundantCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"all\", \"Processes all packs\", v => cmd.All = true },\n               { \"alt-odb\", \"Don't require objects present in packs from alternate object directories to be present in local packs\", v => cmd.AltOdb = true },\n               { \"verbose\", \"Outputs some statistics to stderr\", v => cmd.Verbose = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PackRefs.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PackRefs : TextBuiltin\n    {\n        private PackRefsCommand cmd = new PackRefsCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"all\", \"\", v => cmd.All = true },\n               { \"no-prune\", \"\", v => cmd.NoPrune = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PatchId.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PatchId : TextBuiltin\n    {\n        private PatchIdCommand cmd = new PatchIdCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PeekRemote.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PeekRemote : TextBuiltin\n    {\n        private PeekRemoteCommand cmd = new PeekRemoteCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"upload-pack=\", \"Use this to specify the path to 'git-upload-pack' on the remote side, if it is not found on your $PATH\", v => cmd.UploadPack = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Prune.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Prune : TextBuiltin\n    {\n        private PruneCommand cmd = new PruneCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"n\", \"Do not remove anything; just report what it would remove\", v => cmd.N = true },\n               { \"v\", \"Report all removed objects\", v => cmd.V = true },\n               { \"expire=\", \"Only expire loose objects older than <time>\", v => cmd.Expire = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/PrunePacked.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class PrunePacked : TextBuiltin\n    {\n        private PrunePackedCommand cmd = new PrunePackedCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"n|dry-run\", \"Don't actually remove any objects, only show those that would have been         removed\", v => cmd.DryRun = true },\n               { \"q|quiet\", \"Squelch the progress indicator\", v => cmd.Quiet = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Quiltimport.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Quiltimport : TextBuiltin\n    {\n        private QuiltimportCommand cmd = new QuiltimportCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"n|dry-run\", \"Walk through the patches in the series and warn if we cannot find all of the necessary information to commit a patch\", v => cmd.DryRun = true },\n               { \"author=\", \"The author name and email address to use when no author information can be found in the patch description\", v => cmd.Author = v },\n               { \"patches=\", \"The directory to find the quilt patches and the quilt series file\", v => cmd.Patches = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/ReadTree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class ReadTree : TextBuiltin\n    {\n        private ReadTreeCommand cmd = new ReadTreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"m\", \"Perform a merge, not just a read\", v => cmd.M = true },\n               { \"reset\", \"Same as -m, except that unmerged entries are discarded         instead of failing\", v => cmd.Reset = true },\n               { \"u\", \"After a successful merge, update the files in the work tree with the result of the merge\", v => cmd.U = true },\n               { \"i\", \"Usually a merge requires the index file as well as the files in the working tree are up to date with the current head commit, in order not to lose local changes\", v => cmd.I = true },\n               { \"v\", \"Show the progress of checking files out\", v => cmd.V = true },\n               { \"trivial\", \"Restrict three-way merge by 'git-read-tree' to happen only if there is no file-level merging required, instead of resolving merge for trivial cases and leaving conflicting files unresolved in the index\", v => cmd.Trivial = true },\n               { \"aggressive\", \"Usually a three-way merge by 'git-read-tree' resolves the merge for really trivial cases and leaves other cases unresolved in the index, so that Porcelains can implement different merge policies\", v => cmd.Aggressive = true },\n               { \"prefix=\", \"Keep the current index contents, and read the contents of named tree-ish under directory at `<prefix>`\", v => cmd.Prefix = v },\n               { \"exclude-per-directory=\", \"When running the command with `-u` and `-m` options, the merge result may need to overwrite paths that are not tracked in the current branch\", v => cmd.ExcludePerDirectory = v },\n               { \"index-output=\", \"Instead of writing the results out to `$GIT_INDEX_FILE`, write the resulting index in the named file\", v => cmd.IndexOutput = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Rebase.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Commands;\nusing NDesk.Options;\nusing GitSharp.CLI;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Rebase : TextBuiltin\n    {\n        private RebaseCommand cmd = new RebaseCommand();\n        private static Boolean isHelp;\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"continue\", \"Restart the rebasing process after having resolved a merge conflict\", v => cmd.Continue = true },\n               { \"abort\", \"Restore the original branch and abort the rebase operation\", v => cmd.Abort = true },\n               { \"skip\", \"Restart the rebasing process by skipping the current patch\", v => cmd.Skip = true },\n               { \"m|merge\", \"Use merging strategies to rebase\", v => cmd.Merge = true },\n               { \"s|strategy=\", \"Use the given merge strategy\", v => cmd.Strategy = v },\n               { \"q|quiet\", \"Be quiet\", v => cmd.Quiet = true },\n               { \"v|verbose\", \"Be verbose\", v => cmd.Verbose = true },\n               { \"stat\", \"Show a diffstat of what changed upstream since the last rebase\", v => cmd.Stat = true },\n               { \"n|no-stat\", \"Do not show a diffstat as part of the rebase process\", v => cmd.NoStat = true },\n               { \"no-verify\", \"This option bypasses the pre-rebase hook\", v => cmd.NoVerify = true },\n               { \"C=\", \"Ensure at least <n> lines of surrounding context match before and after each change\", v => cmd.Context = v },\n               { \"f|force-rebase\", \"Force the rebase even if the current branch is a descendant of the commit you are rebasing onto\", v => cmd.Forcerebase = true },\n               { \"ignore-whitespace=\", \"These flag are passed to the 'git-apply' program (see linkgit:git-apply[1]) that applies the patch\", v => cmd.IgnoreWhitespace = v },\n               { \"whitespace=\", \"These flag are passed to the 'git-apply' program (see linkgit:git-apply[1]) that applies the patch\", v => cmd.Whitespace = v },\n               { \"committer-date-is-author-date\", \"These flags are passed to 'git-am' to easily change the dates of the rebased commits (see linkgit:git-am[1])\", v => cmd.CommitterDateIsAuthorDate = true },\n               { \"ignore-date\", \"These flags are passed to 'git-am' to easily change the dates of the rebased commits (see linkgit:git-am[1])\", v => cmd.IgnoreDate = true },\n               { \"i|interactive\", \"Make a list of the commits which are about to be rebased\", v => cmd.Interactive = true },\n               { \"p|preserve-merges\", \"Instead of ignoring merges, try to recreate them\", v => cmd.PreserveMerges = true },\n               { \"root=\", \"Rebase all commits reachable from <branch>, instead of limiting them with an <upstream>\", v => cmd.Root = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"/*Usage*/\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/ReceivePack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class ReceivePack : TextBuiltin\n    {\n        private ReceivePackCommand cmd = new ReceivePackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Reflog.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Reflog : TextBuiltin\n    {\n        private ReflogCommand cmd = new ReflogCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"stale-fix\", \"This revamps the logic -- the definition of \\\"broken commit\\\" becomes: a commit that is not reachable from any of the refs and there is a missing object among the commit, tree, or blob objects reachable from it that is not reachable from any of the refs\", v => cmd.StaleFix = true },\n               { \"expire=\", \"Entries older than this time are pruned\", v => cmd.Expire = v },\n               { \"expire-unreachable=\", \"Entries older than this time and not reachable from the current tip of the branch are pruned\", v => cmd.ExpireUnreachable = v },\n               { \"all=\", \"Instead of listing <refs> explicitly, prune all refs\", v => cmd.All = v },\n               { \"updateref\", \"Update the ref with the sha1 of the top reflog entry (i\", v => cmd.Updateref = true },\n               { \"rewrite\", \"While expiring or deleting, adjust each reflog entry to ensure that the `old` sha1 field points to the `new` sha1 field of the previous entry\", v => cmd.Rewrite = true },\n               { \"verbose\", \"Print extra information on screen\", v => cmd.Verbose = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Relink.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Relink : TextBuiltin\n    {\n        private RelinkCommand cmd = new RelinkCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"safe\", \"Stops if two objects with the same hash exist but have different sizes\", v => cmd.Safe = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Remote.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Remote : TextBuiltin\n    {\n        private RemoteCommand cmd = new RemoteCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"v|verbose\", \"Be a little more verbose and show remote url after name\", v => cmd.Verbose = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Repack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Repack : TextBuiltin\n    {\n        private RepackCommand cmd = new RepackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"a\", \"Instead of incrementally packing the unpacked objects, pack everything referenced into a single pack\", v => cmd.a = true },\n               { \"A\", \"Same as `-a`, unless '-d' is used\", v => cmd.A = true },\n               { \"d\", \"After packing, if the newly created packs make some existing packs redundant, remove the redundant packs\", v => cmd.D = true },\n               { \"l\", \"Pass the `--local` option to 'git-pack-objects'\", v => cmd.L = true },\n               { \"f\", \"Pass the `--no-reuse-object` option to `git-pack-objects`, see linkgit:git-pack-objects[1]\", v => cmd.F = true },\n               { \"q\", \"Pass the `-q` option to 'git-pack-objects'\", v => cmd.Q = true },\n               { \"n\", \"Do not update the server information with 'git-update-server-info'\", v => cmd.N = true },\n               { \"window=\", \"These two options affect how the objects contained in the pack are stored using delta compression\", v => cmd.Window = v },\n               { \"depth=\", \"These two options affect how the objects contained in the pack are stored using delta compression\", v => cmd.Depth = v },\n               { \"window-memory=\", \"This option provides an additional limit on top of `--window`; the window size will dynamically scale down so as to not take up more than N bytes in memory\", v => cmd.WindowMemory = v },\n               { \"max-pack-size=\", \"Maximum size of each output packfile, expressed in MiB\", v => cmd.MaxPackSize = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Replace.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Replace : TextBuiltin\n    {\n        private ReplaceCommand cmd = new ReplaceCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"f\", \"If an existing replace ref for the same object exists, it will be overwritten (instead of failing)\", v => cmd.F = true },\n               { \"d\", \"Delete existing replace refs for the given objects\", v => cmd.D = true },\n               { \"l=\", \"List replace refs for objects that match the given pattern (or all if no pattern is given)\", v => cmd.L = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/RequestPull.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class RequestPull : TextBuiltin\n    {\n        private RequestPullCommand cmd = new RequestPullCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Reset.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Reset : TextBuiltin\n    {\n        private ResetCommand cmd = new ResetCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"mixed\", \"Resets the index but not the working tree (i\", v => cmd.Mixed = true },\n               { \"soft\", \"Does not touch the index file nor the working tree at all, but requires them to be in a good order\", v => cmd.Soft = true },\n               { \"hard\", \"Matches the working tree and index to that of the tree being switched to\", v => cmd.Hard = true },\n               { \"merge\", \"Resets the index to match the tree recorded by the named commit, and updates the files that are different between the named commit and the current commit in the working tree\", v => cmd.Merge = true },\n               { \"p|patch\", \"Interactively select hunks in the difference between the index and <commit> (defaults to HEAD)\", v => cmd.Patch = true },\n               { \"q\", \"Be quiet, only report errors\", v => cmd.Q = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/RevParse.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class RevParse : TextBuiltin\n    {\n        private RevParseCommand cmd = new RevParseCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"parseopt\", \"Use 'git-rev-parse' in option parsing mode (see PARSEOPT section below)\", v => cmd.Parseopt = true },\n               { \"keep-dashdash\", \"Only meaningful in `--parseopt` mode\", v => cmd.KeepDashdash = true },\n               { \"stop-at-non-option\", \"Only meaningful in `--parseopt` mode\", v => cmd.StopAtNonOption = true },\n               { \"sq-quote\", \"Use 'git-rev-parse' in shell quoting mode (see SQ-QUOTE section below)\", v => cmd.SqQuote = true },\n               { \"revs-only\", \"Do not output flags and parameters not meant for 'git-rev-list' command\", v => cmd.RevsOnly = true },\n               { \"no-revs\", \"Do not output flags and parameters meant for 'git-rev-list' command\", v => cmd.NoRevs = true },\n               { \"flags\", \"Do not output non-flag parameters\", v => cmd.Flags = true },\n               { \"no-flags\", \"Do not output flag parameters\", v => cmd.NoFlags = true },\n               { \"default=\", \"If there is no parameter given by the user, use `<arg>` instead\", v => cmd.Default = v },\n               { \"verify\", \"The parameter given must be usable as a single, valid object name\", v => cmd.Verify = true },\n               { \"q|quiet\", \"Only meaningful in `--verify` mode\", v => cmd.Quiet = true },\n               { \"sq\", \"Usually the output is made one line per flag and parameter\", v => cmd.Sq = true },\n               { \"not\", \"When showing object names, prefix them with '{caret}' and strip '{caret}' prefix from the object names that already have one\", v => cmd.Not = true },\n               { \"symbolic\", \"Usually the object names are output in SHA1 form (with possible '{caret}' prefix); this option makes them output in a form as close to the original input as possible\", v => cmd.Symbolic = true },\n               { \"symbolic-full-name\", \"This is similar to --symbolic, but it omits input that are not refs (i\", v => cmd.SymbolicFullName = true },\n               { \"abbrev-ref=\", \"A non-ambiguous short name of the objects name\", v => cmd.AbbrevRef = v },\n               { \"all\", \"Show all refs found in `$GIT_DIR/refs`\", v => cmd.All = true },\n               { \"branches\", \"Show branch refs found in `$GIT_DIR/refs/heads`\", v => cmd.Branches = true },\n               { \"tags\", \"Show tag refs found in `$GIT_DIR/refs/tags`\", v => cmd.Tags = true },\n               { \"remotes\", \"Show tag refs found in `$GIT_DIR/refs/remotes`\", v => cmd.Remotes = true },\n               { \"show-prefix\", \"When the command is invoked from a subdirectory, show the path of the current directory relative to the top-level directory\", v => cmd.ShowPrefix = true },\n               { \"show-cdup\", \"When the command is invoked from a subdirectory, show the path of the top-level directory relative to the current directory (typically a sequence of \\\"\", v => cmd.ShowCdup = true },\n               { \"git-dir\", \"Show `$GIT_DIR` if defined else show the path to the\", v => cmd.GitDir = true },\n               { \"is-inside-git-dir\", \"When the current working directory is below the repository directory print \\\"true\\\", otherwise \\\"false\\\"\", v => cmd.IsInsideGitDir = true },\n               { \"is-inside-work-tree\", \"When the current working directory is inside the work tree of the repository print \\\"true\\\", otherwise \\\"false\\\"\", v => cmd.IsInsideWorkTree = true },\n               { \"is-bare-repository\", \"When the repository is bare print \\\"true\\\", otherwise \\\"false\\\"\", v => cmd.IsBareRepository = true },\n               // [Mr Happy] Don't know how CmdParseOptionSet handles this. Might rename a property of the RevParseCommand-class.\n               //{ \"short\", \"Instead of outputting the full SHA1 values of object names try to abbreviate them to a shorter unique name\", v => cmd.Short = true },\n               { \"short=\", \"Instead of outputting the full SHA1 values of object names try to abbreviate them to a shorter unique name\", v => cmd.Short = v },\n               { \"since=\", \"Parse the date string, and output the corresponding --max-age= parameter for 'git-rev-list'\", v => cmd.Since = v },\n               { \"after=\", \"Parse the date string, and output the corresponding --max-age= parameter for 'git-rev-list'\", v => cmd.After = v },\n               { \"until=\", \"Parse the date string, and output the corresponding --min-age= parameter for 'git-rev-list'\", v => cmd.Until = v },\n               { \"before=\", \"Parse the date string, and output the corresponding --min-age= parameter for 'git-rev-list'\", v => cmd.Before = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Revert.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Revert : TextBuiltin\n    {\n        private RevertCommand cmd = new RevertCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"e|edit\", \"With this option, 'git-revert' will let you edit the commit message prior to committing the revert\", v => cmd.Edit = true },\n               { \"m|mainline\", \"Usually you cannot revert a merge because you do not know which side of the merge should be considered the mainline\", v => cmd.Mainline = true },\n               { \"no-edit\", \"With this option, 'git-revert' will not start the commit message editor\", v => cmd.NoEdit = true },\n               { \"n|no-commit\", \"Usually the command automatically creates a commit with a commit log message stating which commit was reverted\", v => cmd.NoCommit = true },\n               { \"s|signoff\", \"Add Signed-off-by line at the end of the commit message\", v => cmd.Signoff = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/SendPack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class SendPack : TextBuiltin\n    {\n        private SendPackCommand cmd = new SendPackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"receive-pack=\", \"Path to the 'git-receive-pack' program on the remote end\", v => cmd.ReceivePack = v },\n               { \"exec=\", \"Same as --receive-pack=<git-receive-pack>\", v => cmd.Exec = v },\n               { \"all\", \"Instead of explicitly specifying which refs to update, update all heads that locally exist\", v => cmd.All = true },\n               { \"dry-run\", \"Do everything except actually send the updates\", v => cmd.DryRun = true },\n               { \"force\", \"Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it\", v => cmd.Force = true },\n               { \"verbose\", \"Run verbosely\", v => cmd.Verbose = true },\n               { \"thin\", \"Spend extra cycles to minimize the number of objects to be sent\", v => cmd.Thin = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Shortlog.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Shortlog : TextBuiltin\n    {\n        private ShortlogCommand cmd = new ShortlogCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"h|help\", \"Print a short usage message and exit\", v => cmd.Help = true },\n               { \"n|numbered\", \"Sort output according to the number of commits per author instead of author alphabetic order\", v => cmd.Numbered = true },\n               { \"s|summary\", \"Suppress commit description and provide a commit count summary only\", v => cmd.Summary = true },\n               { \"e|email\", \"Show the email address of each author\", v => cmd.Email = true },\n               { \"w=\", \"Linewrap the output by wrapping each line at `width`\", v => cmd.W = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Show.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\n\nnamespace GitSharp.CLI\n{\n    [Command(complete = false, common = true, usage = \"Show various types of objects\")]\n    class Show : TextBuiltin\n    {\n\n        private static Boolean isHelp = false;\n\n#if ported\n        private static string prettyFormat = \"\";\n        private static string abbrevCommit = \"\";\n        private static Boolean isOneLine = false;\n        private static string encoding = \"\";\n#endif\n\n        override public void Run(String[] args)\n        {\n\n            options = new CmdParserOptionSet()\n            {\n                { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n#if ported\n                { \"pretty|format\", \"Pretty print the contents of the commit logs in a specified {format}\", (string v) => prettyFormat = v},\n                { \"abbrev-commit\", \"Show only a commit object's partial name\", (string v) => abbrevCommit = v},\n                { \"oneline\", \"Shorthand for --pretty=online and --abbrev-commit together\", v=>{isOneLine = true;}},\n                { \"encoding\", \"Display the commit log message(s) using the specified {encoding}\", (string v) => encoding = v},\n#endif\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    DoShow(arguments);\n                }\n                else if (args.Length <= 0)\n                {\n                    //Do show with preset arguments\n                    DoShow(arguments);\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            } catch (OptionException e) {\n                Console.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                Console.WriteLine(\"usage: git show [options] <object>...\");\n               Console.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                Console.WriteLine();\n            }\n        }\n\n        private void DoShow(List<String> args)\n        {\n            Console.WriteLine(\"This command still needs to be implemented.\");\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/ShowBranch.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class ShowBranch : TextBuiltin\n    {\n        private ShowBranchCommand cmd = new ShowBranchCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"r|remotes\", \"Show the remote-tracking branches\", v => cmd.Remotes = true },\n               { \"a|all\", \"Show both remote-tracking branches and local branches\", v => cmd.All = true },\n               { \"current\", \"With this option, the command includes the current branch to the list of revs to be shown when it is not given on the command line\", v => cmd.Current = true },\n               { \"topo-order\", \"By default, the branches and their commits are shown in         reverse chronological order\", v => cmd.TopoOrder = true },\n               { \"date-order\", \"This option is similar to '--topo-order' in the sense that no parent comes before all of its children, but otherwise commits are ordered according to their commit date\", v => cmd.DateOrder = true },\n               { \"sparse\", \"By default, the output omits merges that are reachable from only one tip being shown\", v => cmd.Sparse = true },\n               { \"more=\", \"Usually the command stops output upon showing the commit that is the common ancestor of all the branches\", v => cmd.More = v },\n               { \"list\", \"Synonym to `--more=-1`\", v => cmd.List = true },\n               { \"merge-base\", \"Instead of showing the commit list, determine possible merge bases for the specified commits\", v => cmd.MergeBase = true },\n               { \"independent=\", \"Among the <reference>s given, display only the ones that cannot be reached from any other <reference>\", v => cmd.Independent = v },\n               { \"no-name\", \"Do not show naming strings for each commit\", v => cmd.NoName = true },\n               { \"sha1-name\", \"Instead of naming the commits using the path to reach them from heads (e\", v => cmd.Sha1Name = true },\n               { \"topics\", \"Shows only commits that are NOT on the first branch given\", v => cmd.Topics = true },\n               { \"g|reflog=\", \"Shows <n> most recent ref-log entries for the given ref\", v => cmd.Reflog = v },\n               { \"color\", \"Color the status sign (one of these: `*` `!` `+` `-`) of each commit corresponding to the branch it's in\", v => cmd.Color = true },\n               { \"no-color\", \"Turn off colored output, even when the configuration file gives the default to color output\", v => cmd.NoColor = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/ShowRef.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class ShowRef : TextBuiltin\n    {\n        private ShowRefCommand cmd = new ShowRefCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"head\", \"\", v => cmd.Head = true },\n               { \"tags\", \"\", v => cmd.Tags = true },\n               { \"heads\", \"\", v => cmd.Heads = true },\n               { \"d|dereference\", \"\", v => cmd.Dereference = true },\n               { \"s|hash=\", \"\", v => cmd.Hash = v },\n               { \"verify\", \"\", v => cmd.Verify = true },\n               { \"abbrev=\", \"\", v => cmd.Abbrev = v },\n               { \"q|quiet\", \"\", v => cmd.Quiet = true },\n               { \"exclude-existing=\", \"\", v => cmd.ExcludeExisting = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Stripspace.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Stripspace : TextBuiltin\n    {\n        private StripspaceCommand cmd = new StripspaceCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"s|strip-comments\", \"In addition to empty lines, also strip lines starting with '#'\", v => cmd.StripComments = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Submodule.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Submodule : TextBuiltin\n    {\n        private SubmoduleCommand cmd = new SubmoduleCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"q|quiet\", \"Only print error messages\", v => cmd.Quiet = true },\n               { \"b|branch\", \"Branch of repository to add as submodule\", v => cmd.Branch = true },\n               { \"cached\", \"This option is only valid for status and summary commands\", v => cmd.Cached = true },\n               { \"files\", \"This option is only valid for the summary command\", v => cmd.Files = true },\n               { \"n|summary-limit\", \"This option is only valid for the summary command\", v => cmd.SummaryLimit = true },\n               { \"N|no-fetch\", \"This option is only valid for the update command\", v => cmd.NoFetch = true },\n               { \"merge\", \"This option is only valid for the update command\", v => cmd.Merge = true },\n               { \"rebase\", \"This option is only valid for the update command\", v => cmd.Rebase = true },\n               { \"reference=\", \"This option is only valid for add and update commands\", v => cmd.Reference = v },\n               { \"recursive\", \"This option is only valid for foreach, update and status commands\", v => cmd.Recursive = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Svn.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Svn : TextBuiltin\n    {\n        private SvnCommand cmd = new SvnCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"shared=\", \"Only used with the 'init' command\", v => cmd.Shared = v },\n               { \"template=\", \"Only used with the 'init' command\", v => cmd.Template = v },\n               { \"r|revision=\", \"Used with the 'fetch' command\", v => cmd.Revision = v },\n               { \":|stdin\", \"Only used with the 'set-tree' command\", v => cmd.Stdin = true },\n               { \"rmdir\", \"Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands\", v => cmd.Rmdir = true },\n               { \"e|edit\", \"Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands\", v => cmd.Edit = true },\n               { \"l|find-copies-harder=\", \"Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands\", v => cmd.FindCopiesHarder = v },\n               { \"A|authors-file=\", \"\", v => cmd.AuthorsFile = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/SymbolicRef.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class SymbolicRef : TextBuiltin\n    {\n        private SymbolicRefCommand cmd = new SymbolicRefCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            cmd.Quiet = false;\n\t\t\t\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"q|quiet\", \"Do not issue an error message if the <name> is not a symbolic ref but a detached HEAD; instead exit with non-zero status silently\", v => cmd.Quiet = true },\n               { \"m=\", \"Update the reflog for <name> with <reason>\", v => cmd.M = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Tag.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Tag : TextBuiltin\n    {\n        private TagCommand cmd = new TagCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"a\", \"Make an unsigned, annotated tag object\", v => cmd.A = true },\n               { \"s\", \"Make a GPG-signed tag, using the default e-mail address's key\", v => cmd.S = true },\n               { \"u=\", \"Make a GPG-signed tag, using the given key\", v => cmd.U = v },\n               { \"f|force\", \"Replace an existing tag with the given name (instead of failing)\", v => cmd.Force = true },\n               { \"d\", \"Delete existing tags with the given names\", v => cmd.D = true },\n               { \"v\", \"Verify the gpg signature of the given tag names\", v => cmd.V = true },\n               { \"n=\", \"<num> specifies how many lines from the annotation, if any, are printed when using -l\", v => cmd.N = v },\n               { \"l=\", \"List tags with names that match the given pattern (or all if no pattern is given)\", v => cmd.L = v },\n               { \"contains=\", \"Only list tags which contain the specified commit\", v => cmd.Contains = v },\n               { \"m=\", \"Use the given tag message (instead of prompting)\", v => cmd.M = v },\n               { \"F=\", \"Take the tag message from the given file\", v => cmd.F = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/TarTree.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class TarTree : TextBuiltin\n    {\n        private TarTreeCommand cmd = new TarTreeCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"remote=\", \"Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository\", v => cmd.Remote = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UnpackFile.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UnpackFile : TextBuiltin\n    {\n        private UnpackFileCommand cmd = new UnpackFileCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UnpackObjects.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UnpackObjects : TextBuiltin\n    {\n        private UnpackObjectsCommand cmd = new UnpackObjectsCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"n\", \"Dry run\", v => cmd.N = true },\n               { \"q\", \"The command usually shows percentage progress\", v => cmd.Q = true },\n               { \"r\", \"When unpacking a corrupt packfile, the command dies at the first corruption\", v => cmd.R = true },\n               { \"strict\", \"Don't write objects with broken content or links\", v => cmd.Strict = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UpdateIndex.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UpdateIndex : TextBuiltin\n    {\n        private UpdateIndexCommand cmd = new UpdateIndexCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"add\", \"If a specified file isn't in the index already then it's added\", v => cmd.Add = true },\n               { \"remove\", \"If a specified file is in the index but is missing then it's removed\", v => cmd.Remove = true },\n               { \"refresh\", \"Looks at the current index and checks to see if merges or updates are needed by checking stat() information\", v => cmd.Refresh = true },\n               { \"q\", \"Quiet\", v => cmd.Q = true },\n               { \"ignore-submodules\", \"Do not try to update submodules\", v => cmd.IgnoreSubmodules = true },\n               { \"unmerged\", \"If --refresh finds unmerged changes in the index, the default behavior is to error out\", v => cmd.Unmerged = true },\n               { \"ignore-missing\", \"Ignores missing files during a --refresh\", v => cmd.IgnoreMissing = true },\n               { \"cacheinfo=\", \"Directly insert the specified info into the index\", v => cmd.Cacheinfo = v },\n               { \"index-info\", \"Read index information from stdin\", v => cmd.IndexInfo = true },\n               { \"chmod=\", \"Set the execute permissions on the updated files\", v => cmd.Chmod = v },\n               { \"assume-unchanged\", \"When these flags are specified, the object names recorded for the paths are not updated\", v => cmd.AssumeUnchanged = true },\n               { \"no-assume-unchanged\", \"When these flags are specified, the object names recorded for the paths are not updated\", v => cmd.NoAssumeUnchanged = true },\n               { \"really-refresh\", \"Like '--refresh', but checks stat information unconditionally, without regard to the \\\"assume unchanged\\\" setting\", v => cmd.ReallyRefresh = true },\n               { \"g|again\", \"Runs 'git-update-index' itself on the paths whose index entries are different from those from the `HEAD` commit\", v => cmd.Again = true },\n               { \"unresolve\", \"Restores the 'unmerged' or 'needs updating' state of a file during a merge if it was cleared by accident\", v => cmd.Unresolve = true },\n               { \"info-only\", \"Do not create objects in the object database for all <file> arguments that follow this flag; just insert their object IDs into the index\", v => cmd.InfoOnly = true },\n               { \"force-remove\", \"Remove the file from the index even when the working directory still has such a file\", v => cmd.ForceRemove = true },\n               { \"replace\", \"By default, when a file `path` exists in the index, 'git-update-index' refuses an attempt to add `path/file`\", v => cmd.Replace = true },\n               { \"stdin\", \"Instead of taking list of paths from the command line, read list of paths from the standard input\", v => cmd.Stdin = true },\n               { \"verbose\", \"Report what is being added and removed from index\", v => cmd.Verbose = true },\n               { \"z\", \"Only meaningful with `--stdin`; paths are separated with NUL character instead of LF\", v => cmd.Z = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UpdateServerInfo.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UpdateServerInfo : TextBuiltin\n    {\n        private UpdateServerInfoCommand cmd = new UpdateServerInfoCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"f|force\", \"Update the info files from scratch\", v => cmd.Force = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UploadArchive.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UploadArchive : TextBuiltin\n    {\n        private UploadArchiveCommand cmd = new UploadArchiveCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/UploadPack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class UploadPack : TextBuiltin\n    {\n        private UploadPackCommand cmd = new UploadPackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"strict=\", \"Do not try <directory>/\", v => cmd.Strict = v },\n               { \"timeout=\", \"Interrupt transfer after <n> seconds of inactivity\", v => cmd.Timeout = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Var.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Var : TextBuiltin\n    {\n        private VarCommand cmd = new VarCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"l\", \"Cause the logical variables to be listed\", v => cmd.L = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/VerifyPack.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class VerifyPack : TextBuiltin\n    {\n        private VerifyPackCommand cmd = new VerifyPackCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"v|verbose\", \"After verifying the pack, show list of objects contained in the pack and a histogram of delta chain length\", v => cmd.Verbose = true },\n               { \"s|stat-only\", \"Do not verify the pack contents; only show the histogram of delta chain length\", v => cmd.StatOnly = true },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/VerifyTag.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class VerifyTag : TextBuiltin\n    {\n        private VerifyTagCommand cmd = new VerifyTagCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/Stubs/Whatchanged.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing NDesk.Options;\nusing GitSharp.Commands;\n\nnamespace GitSharp.CLI\n{\n\n    [Command(common=true, requiresRepository=true, usage = \"\")]\n    public class Whatchanged : TextBuiltin\n    {\n        private WhatchangedCommand cmd = new WhatchangedCommand();\n        private static Boolean isHelp;\n\n        public override void Run(string[] args)\n        {\n            options = new CmdParserOptionSet()\n            {\n               { \"h|help\", \"Display this help information. To see online help, use: git help <command>\", v=>OfflineHelp()},\n               { \"p\", \"Show textual diffs, instead of the git internal diff output format that is useful only to tell the changed paths and their nature of changes\", v => cmd.P = true },\n               { \"n=\", \"Limit output to <n> commits\", v => cmd.n = v },\n               { \"r\", \"Show git internal diff output, but for the whole tree, not just the top level\", v => cmd.R = true },\n               { \"m\", \"By default, differences for merge commits are not shown\", v => cmd.M = true },\n               { \"pretty=\", \"\", v => cmd.Pretty = v },\n               { \"format=\", \"\", v => cmd.Format = v },\n               { \"abbrev-commit\", \"Instead of showing the full 40-byte hexadecimal commit object name, show only a partial prefix\", v => cmd.AbbrevCommit = true },\n               { \"oneline\", \"This is a shorthand for \\\"--pretty=oneline --abbrev-commit\\\" used together\", v => cmd.Oneline = true },\n               { \"encoding=\", \"The commit objects record the encoding used for the log message in their encoding header; this option can be used to tell the command to re-code the commit log message in the encoding preferred by the user\", v => cmd.Encoding = v },\n            };\n\n            try\n            {\n                List<String> arguments = ParseOptions(args);\n                if (arguments.Count > 0)\n                {\n                    cmd.Arguments = arguments;\n                    cmd.Execute();\n                }\n                else\n                {\n                    OfflineHelp();\n                }\n            }\n            catch (Exception e)            \n            {\n                cmd.OutputStream.WriteLine(e.Message);\n            }\n        }\n\n        private void OfflineHelp()\n        {\n            if (!isHelp)\n            {\n                isHelp = true;\n                cmd.OutputStream.WriteLine(\"Here should be the usage...\");\n                cmd.OutputStream.WriteLine();\n                options.WriteOptionDescriptions(Console.Out);\n                cmd.OutputStream.WriteLine();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Git/TextBuiltin.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyright (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing NDesk.Options;\nusing System.Diagnostics;\n\nnamespace GitSharp.CLI\n{\n\n\t/// <summary>\n\t/// Abstract command which can be invoked from the command line.\n\t/// \n\t/// Commands are configured with a single \"current\" repository and then the\n\t/// execute(String[]) method is invoked with the arguments that appear\n\t/// after the subcommand.\n\t/// \n\t/// Command constructors should perform as little work as possible as they may be\n\t/// invoked very early during process loading, and the command may not execute\n\t/// even though it was constructed.\n\t/// </summary>\n\tpublic abstract class TextBuiltin\n\t{\n\t\t/// <summary>\n\t\t/// Name of the command in use\n\t\t/// </summary>\n\t\tprivate String commandName;\n\n\t\t/// <summary>\n\t\t/// Website address of the command help file\n\t\t/// </summary>\n\t\tprivate String commandHelp;\n\n\t\t/// <summary>\n\t\t/// Specifies if the command requires a repository to execute\n\t\t/// </summary>\n\t\tprivate bool requiresRepository = false;\n\n\t\t/// <summary>\n\t\t/// Specifies if the command requires an upward search for the git repository\n\t\t/// </summary>\n\t\tprivate bool requiresRecursive = false;\n\n\t\t/// <summary>\n\t\t/// RevWalk used during command line parsing, if it was required.\n\t\t/// </summary>\n\t\tprotected GitSharp.Core.RevWalk.RevWalk argWalk;\n\n\t\t/// <summary>\n\t\t/// Custom OptionSet to allow special option handling rules such as --option dir\n\t\t/// </summary>\n\t\tpublic CmdParserOptionSet options;\n\n\t\t/// <summary>\n\t\t/// If the command is using a pager, this represents that child process.\n\t\t/// </summary>\n\t\tprivate Process _pager;\n\n\t\t/// <summary>\n\t\t/// Used by CommandCatalog and CommandRef to set the command name during initial creation.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The command name.</param>\n\t\tpublic void setCommandName(String name)\n\t\t{\n\t\t\tcommandName = name;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Used by CommandRef to get the command name during initial creation.\n\t\t/// </summary>\n\t\tpublic string getCommandName()\n\t\t{\n\t\t\treturn commandName;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Used by CommandCatalog and CommandRef to set the website address of the command help during initial creation.\n\t\t/// </summary>\n\t\t/// <param name=\"cmdHelp\">The website address of the command help.</param>\n\t\tinternal void setCommandHelp(String cmdHelp)\n\t\t{\n\t\t\tcommandHelp = cmdHelp;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Used by CommandRef to get the command help website during initial creation.\n\t\t/// </summary>\n\t\tpublic string getCommandHelp()\n\t\t{\n\t\t\treturn commandHelp;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if the command requires a repository\n\t\t/// </summary>\n\t\tpublic bool RequiresRepository\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn requiresRepository;\n\t\t\t}\n\n\t\t\tinternal set\n\t\t\t{\n\t\t\t\trequiresRepository = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specifies if the command requires an upward search for the git repository\n\t\t/// </summary>\n\t\tpublic bool RequiresRecursive\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn requiresRecursive;\n\t\t\t}\n\n\t\t\tset\n\t\t\t{\n\t\t\t\trequiresRecursive = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a command for use including the repository and output support.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\">Specifies the repository to use.</param>\n\t\t/// <param name=\"path\"></param>\n\t\tpublic void Init(GitSharp.Repository repo, string path)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Initialize the output stream for all console-based messages.\n\t\t\t\tGit.DefaultOutputStream = new StreamWriter(Console.OpenStandardOutput());\n\t\t\t\tConsole.SetOut(Git.DefaultOutputStream);\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\tthrow die(\"cannot create output stream\");\n\t\t\t}\n\n\t\t\t// Initialize the repository in use.\n\t\t\tif (repo != null)\n\t\t\t{\n\t\t\t\tGitRepository = repo;\n\t\t\t\tGitDirectory = ((Core.Repository)repo).Directory.FullName;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tGitRepository = null;\n\t\t\t\tGitDirectory = path;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Starts a child process to paginate the command output.\n\t\t/// </summary>\n\t\tprotected void SetupPager()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_pager = Platform.Instance.GetTextPager(GitRepository.Config[\"core.pager\"]);\n\t\t\t\tif (_pager == null)\n\t\t\t\t\treturn;\n\t\t\t\t_pager.Start();\n\t\t\t\tGit.DefaultOutputStream = _pager.StandardInput;\n\t\t\t\t//TODO: should handle _pager.Exited event\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Failed to create pager\");\n\t\t\t\tConsole.Error.WriteLine(ex.ToString());\n\t\t\t\t_pager = null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses the command line and runs the corresponding subcommand \n\t\t/// </summary>\n\t\t/// <param name=\"args\">Specifies the command line arguments passed after the command name.</param>\n\t\tpublic void Execute(String[] args)\n\t\t{\n\t\t\tRun(args);\n\t\t\tif (_pager != null)\n\t\t\t{\n\t\t\t\tGit.DefaultOutputStream = null;\n\t\t\t\ttry { _pager.StandardInput.Close(); } catch { }\n\t\t\t\t_pager.WaitForExit();\n\t\t\t\t_pager.Close();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses the options for all subcommands and executes the corresponding code for each option.\n\t\t/// </summary>\n\t\t/// <param name=\"args\">Specifies the string from the options to the end of the command line.</param>\n\t\t/// <returns>Returns the arguments remaining after the options on the command line. Often, these are directories or paths.</returns>\n\t\tpublic List<String> ParseOptions(string[] args)\n\t\t{\n\t\t\tList<String> remainingArguments = new List<string>();\n\t\t\ttry\n\t\t\t{\n\t\t\t\toptions.Parse(args, out remainingArguments);\n\t\t\t}\n\t\t\tcatch (OptionException err)\n\t\t\t{\n\t\t\t\tthrow die(\"fatal: \" + err.Message);\n\t\t\t}\n\t\t\treturn remainingArguments;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses the options for all subcommands and executes the corresponding code for each option. This function should only be used if supporting -- &amp;filepatterns>\n\t\t/// </summary>\n\t\t/// <param name=\"args\">Specifies the string from the options to the end of the command line.</param>\n\t\t/// <param name=\"filePaths\">Returns a list of files following the -- argument</param>\n\t\t/// <param name=\"remainingArguments\">Returns the arguments remaining after the options on the command line. Often, these are directories or paths.</param>\n\t\t/// <returns>Returns the arguments remaining after the options on the command line. Often, these are directories or paths.</returns>\n\t\tpublic void ParseOptions(string[] args, out List<String> filePaths, out List<String> remainingArguments)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\toptions.Parse(args, out filePaths, out remainingArguments);\n\t\t\t}\n\t\t\tcatch (OptionException err)\n\t\t\t{\n\t\t\t\tthrow die(\"fatal: \" + err.Message);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the current command for lightweight referencing.\n\t\t/// </summary>\n\t\t/// <returns>Returns this command.</returns>\n\t\tpublic Command GetCommand()\n\t\t{\n\t\t\tType type = Type.GetType(this.ToString());\n\t\t\tobject[] attributes = type.GetCustomAttributes(true);\n\t\t\tforeach (object attribute in attributes)\n\t\t\t{\n\t\t\t\tCommand com = attribute as Command;\n\t\t\t\tif (com != null)\n\t\t\t\t\treturn com;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Provides an abstract layer to perform the action of this command.\n\t\t/// This method should only be invoked by the  Execute(String[] args) method.\n\t\t/// </summary>\n\t\tpublic abstract void Run(String[] args);\n\n\t\t/// <summary>\n\t\t/// Opens the default webbrowser to display the command specific help.\n\t\t/// </summary>\n\t\tpublic void OnlineHelp()\n\t\t{\n\t\t\tif (commandHelp.Length > 0)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Launching default browser to display HTML ...\");\n\t\t\t\tSystem.Diagnostics.Process.Start(commandHelp);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"There is no online help available for this command.\");\n\t\t\t}\n\t\t}\n\n\t\tObjectId Resolve(string s)\n\t\t{\n\t\t\tCore.Repository repo = Git.DefaultRepository;\n\t\t\tObjectId r = repo.Resolve(s);\n\t\t\tif (r == null)\n\t\t\t\tthrow die(\"Not a revision: \" + s);\n\t\t\treturn r;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generic method used to return an exception during fatal conditions. \n\t\t/// </summary>\n\t\t/// <param name=\"why\">Specifies the textual explanation of why the exception was thrown.</param>\n\t\t/// <returns>Returns a runtime exception the caller is expected to throw.</returns>\n\t\tprotected static Die die(String why)\n\t\t{\n\t\t\treturn new Die(why);\n\t\t}\n\n\t\tpublic StreamWriter OutputStream\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Git.DefaultOutputStream;\n\t\t\t}\n\n\t\t\tset\n\t\t\t{\n\t\t\t\tGit.DefaultOutputStream = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic GitSharp.Repository GitRepository\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Git.DefaultRepository;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tGit.DefaultRepository = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GitDirectory { get; set; }\n\t}\n}\n"
  },
  {
    "path": "GitSharp/AbstractObject.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing CoreTag = GitSharp.Core.Tag;\nusing System.Diagnostics;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// AbstractObject is the base class for the classes Blob, Commit, Tag and Tree. It proviedes test methods\n\t/// to identify its specialized type (i.e. IsBlob, IsCommit, etc). AbstractObject also defines comparison operators so you can\n\t/// safely compare git objects by using the operators == or != which internally efficiently compare the objects hashes. \n\t/// </summary>\n\tpublic abstract class AbstractObject\n\t{\n\t\tprotected Repository _repo;\n\t\tinternal ObjectId _id; // <--- the git object is lazy loaded. only a _id is required until properties are accessed.\n\n\t\tinternal AbstractObject(Repository repo, ObjectId id)\n\t\t{\n\t\t\t_repo = repo;\n\t\t\t_id = id;\n\t\t}\n\n\t\tinternal AbstractObject(Repository repo, string name)\n\t\t{\n\t\t\t_repo = repo;\n\t\t\t_id = _repo._internal_repo.Resolve(name);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The git object's SHA1 hash. This is the long hash, See ShortHash for the abbreviated version.\n\t\t/// </summary>\n\t\tpublic string Hash\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn _id.Name;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The git object's abbreviated SHA1 hash. \n\t\t/// </summary>\n\t\tpublic string ShortHash\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn _id.Abbreviate(_repo._internal_repo).name();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if this object is a Blob (or Leaf which is a subclass of Blob).\n\t\t/// </summary>\n\t\tpublic virtual bool IsBlob\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn _repo._internal_repo.MapObject(_id, null) is byte[];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if this object is a Commit.\n\t\t/// </summary>\n\t\tpublic virtual bool IsCommit\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn _repo._internal_repo.MapObject(_id, null) is CoreCommit;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if this object is a Tag.\n\t\t/// </summary>\n\t\tpublic virtual bool IsTag\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn _repo._internal_repo.MapObject(_id, null) is CoreTag;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if the internal object is a Tree.\n\t\t/// </summary>\n\t\tpublic virtual bool IsTree\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_id == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn _repo._internal_repo.MapObject(_id, null) is CoreTree;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The repository where this git object belongs to.\n\t\t/// </summary>\n\t\tpublic Repository Repository\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _repo;\n\t\t\t}\n\t\t}\n\n#if implemented\n        public Diff Diff(AbstractObject other) { }\n\n        public ?? Grep(?? pattern) { }\n\n        public Byte[] Content { get; }\n\n        public long Size { get; }\n#endif\n\n\t\t/// <summary>\n\t\t/// Internal helper function to create the right object instance for a given hash\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"objectId\"></param>\n\t\t/// <returns></returns>\n\t\tinternal static AbstractObject Wrap(Repository repo, ObjectId objectId)\n\t\t{\n\t\t\tDebug.Assert(objectId != null, \"ObjectId is null\");\n\t\t\tDebug.Assert(repo != null, \"Repository is null\");\n\t\t\tvar obj = repo._internal_repo.MapObject(objectId, null);\n\t\t\tif (obj is CoreCommit)\n\t\t\t\treturn new Commit(repo, obj as CoreCommit);\n\t\t\telse if (obj is CoreTag)\n\t\t\t\treturn new Tag(repo, obj as CoreTag);\n\t\t\telse if (obj is CoreTree)\n\t\t\t\treturn new Tree(repo, obj as CoreTree);\n\t\t\telse if (obj is byte[])\n\t\t\t\treturn new Blob(repo, objectId, obj as byte[]);\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Debug.Assert(false, \"What kind of object do we have here?\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t#region Equality overrides\n\n\t\t/// <summary>\n\t\t/// Overriding equals to reflect that different AbstractObject instances with the same hash are in fact equal.\n\t\t/// </summary>\n\t\t/// <param name=\"obj\"></param>\n\t\t/// <returns></returns>\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (obj is AbstractObject)\n\t\t\t\treturn _id == (obj as AbstractObject)._id;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool operator ==(AbstractObject self, object other)\n\t\t{\n\t\t\treturn Equals(self, other);\n\t\t}\n\n\t\tpublic static bool operator !=(AbstractObject self, object other)\n\t\t{\n\t\t\treturn !(self == other);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tif (_id != null)\n\t\t\t\treturn _id.GetHashCode();\n\t\t\treturn base.GetHashCode();\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/AbstractTreeNode.cs",
    "content": "/*\n * Copyright (C) 2009-2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Represents a <see cref=\"Tree\"/> (directory) or <see cref=\"Leaf\"/> (file) in the <see cref=\"Repository\"/>.\n\t/// </summary>\n\tpublic abstract class AbstractTreeNode : AbstractObject\n\t{\n\t\tinternal AbstractTreeNode(Repository repo, ObjectId id) : base(repo, id) { }\n\n\t\tpublic abstract string Name { get; }\n\t\tpublic abstract string Path { get; }\n\t\tpublic abstract Tree Parent { get; }\n\t\tpublic abstract int Permissions { get; }\n\n\t\t/// <summary>\n\t\t/// Returns all commits this file or directory was changed in\n\t\t/// </summary>\n\t\t/// <returns>commits in the order \"most recent first\"</returns>\n\t\tpublic IEnumerable<Commit> GetHistory()\n\t\t{\n\t\t\treturn GetHistoryBefore(_repo.CurrentBranch.CurrentCommit);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all commits this file or directory was changed in before the given commit\n\t\t/// </summary>\n\t\t/// <param name=\"commit\">The commit in whose ancestors should be searched</param>\n\t\t/// <returns>commits in the order \"most recent first\"</returns>\n\t\tpublic IEnumerable<Commit> GetHistoryBefore(Commit commit)\n\t\t{\n\t\t\tif (commit == null)\n\t\t\t\tyield break;\n\t\t\tforeach (var c in new[] { commit }.Concat(commit.Ancestors))\n\t\t\t{\n\t\t\t\tforeach (var change in c.Changes)\n\t\t\t\t{\n\t\t\t\t\tif ((this is Leaf && change.Path == this.Path) || (this is Tree && change.Path.StartsWith(this.Path))) // <--- [henon] normally this is bad style but here I prefer it over polymorphism for sake of readability\n\t\t\t\t\t{\n\t\t\t\t\t\tyield return c;\n\n\t\t\t\t\t\tif ((change.Path == this.Path) && (change.ChangeType == ChangeType.Added))\n\t\t\t\t\t\t\tyield break; // creation point, so there is no more history\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak; // <--- we found a change we can exit early\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Find the commit this file or tree was last changed in\n\t\t/// </summary>\n\t\tpublic Commit GetLastCommit()\n\t\t{\n\t\t\treturn GetLastCommitBefore(_repo.CurrentBranch.CurrentCommit);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Find the commit this file or tree was last changed in before the given commit\n\t\t/// </summary>\n\t\t/// <param name=\"commit\">commit to start at</param>\n\t\tpublic Commit GetLastCommitBefore(Commit commit)\n\t\t{\n\t\t\treturn GetHistoryBefore(commit).FirstOrDefault();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Author.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents the Author or Committer of a Commit.\n\t/// </summary>\n\tpublic class Author\n\t{\n\n\t\t/// <summary>\n\t\t/// Creates an uninitialized Author. You may use the object initializer syntax with this constructor, i.e. new Author { Name=\"henon\", EmailAddress=\"henon@gitsharp.com\" }\n\t\t/// </summary>\n\t\tpublic Author() { }\n\n\t\t/// <summary>\n\t\t/// Creates an Author.\n\t\t/// </summary>\n\t\tpublic Author(string name, string email)\n\t\t{\n\t\t\tName = name;\n\t\t\tEmailAddress = email;\n\t\t}\n\n\t\tpublic string Name { get; set; }\n\n\t\tpublic string EmailAddress { get; set; }\n\n\t\t/// <summary>\n\t\t/// Preconfigured anonymous Author, which may be used by GitSharp if no Author has been configured.\n\t\t/// </summary>\n\t\tpublic static Author Anonymous\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Author(\"anonymous\", \"anonymous@(none).com\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static Author GetDefaultAuthor(Repository repo)\n\t\t{\n\t\t\treturn new Author(repo.Config[\"user.name\"], repo.Config[\"user.email\"]);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Blob.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing CoreTag = GitSharp.Core.Tag;\nusing System.IO;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents a specific version of the content of a file tracked by git. Using a Blob you can access the contents of \n\t/// any git object as string or byte array. For tracked files (leaves of a git tree) it returns the content of the file. For git objects \n\t/// such as Commit, Tag or Tree the Blob API may be used to inspect the the uncompressed internal representation.\n\t/// <para/>\n\t/// To open a git object instantiate a Blob with the object's Hash or another valid reference (see Ref).\n\t/// <code>var b=new Blob(repo, \"e287f54\");</code>\n\t/// <para/>\n\t/// Note, that new Blob( ...) does not create a new blob in the repository but rather constructs the object to manipulate an existing blob.\n\t/// <para/>\n\t/// Advanced: To create a new Blob inside the repository you can use the static <see cref=\"Create(GitSharp.Repository,byte[])\"/> function, however, you are advised to use \n\t/// higher level functionality to create new revisions of files, i.e. by using the <see cref=\"Commit\"/> API, for instance <see cref=\"Commit.Create(string,GitSharp.Commit,GitSharp.Tree)\"/>.\n\t/// </summary>\n\tpublic class Blob : AbstractObject\n\t{\n\n\t\tinternal Blob(Repository repo, ObjectId id)\n\t\t\t: base(repo, id)\n\t\t{\n\t\t}\n\n\t\tinternal Blob(Repository repo, ObjectId id, byte[] blob)\n\t\t\t: base(repo, id)\n\t\t{\n\t\t\t_blob = blob;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a Blob object which represents an existing blob in the git repository\n\t\t/// </summary>\n\t\t/// <param name=\"repo\">The repository which owns the object to load</param>\n\t\t/// <param name=\"hash\">The SHA1 Hash of the object to load</param>\n\t\tpublic Blob(Repository repo, string hash) : base(repo, hash) { }\n\n\t\tprivate byte[] _blob;\n\n\t\t/// <summary>\n\t\t/// Get the uncompressed contents of this Blob as string. This assumes that the contents are encoded in UTF8. \n\t\t/// </summary>\n\t\tpublic string Data\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (RawData == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn RawParseUtils.decode(RawData);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the uncompressed original encoded raw data of the Blob as byte array. This is useful if the contents of the blob are encoded in some legacy encoding instead of UTF8.\n\t\t/// </summary>\n\t\tpublic byte[] RawData\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_blob == null)\n\t\t\t\t{\n\t\t\t\t\tvar loader = _repo._internal_repo.OpenBlob(_id);\n\t\t\t\t\tif (loader == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t_blob = loader.Bytes;\n\t\t\t\t}\n\t\t\t\treturn _blob;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Blob[\" + ShortHash + \"]\";\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new Blob containing the given string data as content. The string will be encoded as UTF8\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"content\">string to be stored in the blob</param>\n\t\t/// <returns></returns>\n\t\tpublic static Blob Create(Repository repo, string content)\n\t\t{\n\t\t\treturn Create(repo, content, Encoding.UTF8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new Blob containing the given string data as content. The string will be encoded by the submitted encoding\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"content\">string to be stored in the blob</param>\n\t\t/// <param name=\"encoding\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static Blob Create(Repository repo, string content, Encoding encoding)\n\t\t{\n\t\t\treturn Create(repo, encoding.GetBytes(content));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new Blob containing the contents of the given file.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"path\">Path to the file that should be stored in the blob</param>\n\t\t/// <returns></returns>\n\t\tpublic static Blob CreateFromFile(Repository repo, string path)\n\t\t{\n\t\t\tif (new FileInfo(path).Exists == false)\n\t\t\t\tthrow new ArgumentException(\"File does not exist\", \"path\");\n\t\t\treturn Create(repo, File.ReadAllBytes(path));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new Blob containing exactly the raw bytes given (before compression).\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"content\">Uncompressed, encoded raw data to be stored in the blob</param>\n\t\t/// <returns></returns>\n\t\tpublic static Blob Create(Repository repo, byte[] content)\n\t\t{\n\t\t\tvar db = repo._internal_repo;\n\t\t\tvar id = new GitSharp.Core.ObjectWriter(db).WriteBlob(content);\n\t\t\treturn new Blob(repo, id, content);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Branch.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Nulltoken <emeric.fermas@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing GitSharp.Commands;\nusing GitSharp.Core;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing CoreRepository = GitSharp.Core.Repository;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents a branch in git. You can create and manipulate git branches and you can manipulate your working directory using Branch.\n\t/// \n\t/// Note, that new Branch( ...) does not create a new branch in the repository but rather constructs the object to manipulate an existing branch.\n\t/// To create a new branch use the static Branch.Create API.\n\t/// </summary>\n\tpublic class Branch : Ref\n\t{\n\t\tstring _ref_name;\n\t\t\n\t\t/// <summary>\n\t\t/// Open a branch by resolving a reference (such as HEAD)\n\t\t/// </summary>\n\t\t/// <param name=\"ref\"></param>\n\t\tpublic Branch(Ref @ref)\n\t\t\t: base(@ref._repo, GetBranchName (@ref.Name))\n\t\t{\n\t\t\t_ref_name = GetRefName (_ref_name);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Open a branch by branch name (i.e. \"master\" or \"origin/master\")\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"name\"></param>\n\t\tpublic Branch(Repository repo, string name)\n\t\t\t: base(repo, GetBranchName (name))\n\t\t{\n\t\t\t_ref_name = GetRefName (name);\n\t\t}\n\n\t\tinternal Branch(Repository repo, CoreRef @ref)\n\t\t\t: this(repo, GetBranchName (@ref.Name))\n\t\t{\n\t\t\t_ref_name = GetRefName (@ref.Name);\n\t\t}\n\t\t\n\t\tstatic string GetBranchName (string name)\n\t\t{\n\t\t\tif (name.StartsWith (Constants.R_HEADS))\n\t\t\t\treturn name.Substring (Constants.R_HEADS.Length);\n\t\t\telse if (name.StartsWith (Constants.R_REMOTES))\n\t\t\t\treturn name.Substring (Constants.R_REMOTES.Length);\n\t\t\telse\n\t\t\t\treturn name;\n\t\t}\n\t\t\n\t\tstatic string GetRefName (string name)\n\t\t{\n\t\t\tif (name.StartsWith (Constants.R_HEADS))\n\t\t\t\treturn name;\n\t\t\telse if (name.StartsWith (Constants.R_REMOTES))\n\t\t\t\treturn name;\n\t\t\telse\n\t\t\t\treturn Constants.R_HEADS + name;\n\t\t}\n\t\t\n\t\tprotected override string RefName {\n\t\t\tget { return _ref_name; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the branch's full path name relative to the .git directory\n\t\t/// </summary>\n\t\tpublic string Fullname\n\t\t{\n\t\t\tget { return RefName; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the latest commit on this branch, or in other words, the commit this branch is pointing to.\n\t\t/// </summary>\n\t\tpublic Commit CurrentCommit\n\t\t{\n\t\t\tget { return Target as Commit; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if the branch is the current branch of the repository\n\t\t/// </summary>\n\t\tpublic bool IsCurrent\n\t\t{\n\t\t\tget { return _repo.CurrentBranch == this; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if this Ref points to a remote branch.\n\t\t/// </summary>\n\t\tpublic bool IsRemote\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\t\t\n\t\tpublic string UpstreamSource {\n\t\t\tget {\n\t\t\t\tstring remote = _repo._internal_repo.Config.getString (\"branch\", Name, \"remote\");\n\t\t\t\tstring branch = _repo._internal_repo.Config.getString (\"branch\", Name, \"merge\");\n\t\t\t\tif (string.IsNullOrEmpty (branch))\n\t\t\t\t\treturn null;\n\t\t\t\tif (branch.StartsWith (Constants.R_HEADS))\n\t\t\t\t\tbranch = branch.Substring (Constants.R_HEADS.Length);\n\t\t\t\telse if (branch.StartsWith (Constants.R_TAGS))\n\t\t\t\t\tbranch = branch.Substring (Constants.R_TAGS.Length);\n\t\t\t\tif (!string.IsNullOrEmpty (remote) && remote != \".\")\n\t\t\t\t\treturn remote + \"/\" + branch;\n\t\t\t\telse\n\t\t\t\t\treturn branch;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (string.IsNullOrEmpty (value)) {\n\t\t\t\t\t_repo._internal_repo.Config.unsetSection (\"branch\", Name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint i = value.IndexOf ('/');\n\t\t\t\tstring branch;\n\t\t\t\tif (i == -1) {\n\t\t\t\t\tif (_repo.Tags.ContainsKey (value))\n\t\t\t\t\t\tbranch = Constants.R_TAGS + value;\n\t\t\t\t\telse\n\t\t\t\t\t\tbranch = Constants.R_HEADS + value;\n\t\t\t\t\t_repo._internal_repo.Config.setString (\"branch\", Name, \"remote\", \".\");\n\t\t\t\t} else {\n\t\t\t\t\tbranch = Constants.R_HEADS + value.Substring (i + 1);\n\t\t\t\t\t_repo._internal_repo.Config.setString (\"branch\", Name, \"remote\", value.Substring (0, i));\n\t\t\t\t}\n\t\t\t\t_repo._internal_repo.Config.setString (\"branch\", Name, \"merge\", branch);\n\t\t\t}\n\t\t}\n\n\t\t#region --> Merging\n\n\n\t\t/// <summary>\n\t\t/// Merge the given branch into this Branch using the given merge strategy. \n\t\t/// </summary>\n\t\t/// <param name=\"other\"></param>\n\t\t/// <param name=\"strategy\"></param>\n\t\tpublic MergeResult Merge(Branch other, MergeStrategy strategy)\n\t\t{\n\t\t\treturn MergeCommand.Execute(new MergeOptions { Branches = new[] { this, other }, MergeStrategy = strategy });\n\t\t}\n\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Delete this branch\n\t\t/// </summary>\n\t\tpublic void Delete()\n\t\t{\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tvar updateRef = db.UpdateRef(RefName);\n\t\t\tupdateRef.IsForceUpdate = true;\n\t\t\tupdateRef.delete ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out this branch into the working directory and have HEAD point to it.\n\t\t/// </summary>\n\t\tpublic void Checkout()\n\t\t{\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tRefUpdate u = db.UpdateRef(Constants.HEAD);\n\t\t\tu.link(RefName);\n\t\t\tReset(ResetBehavior.Hard);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Rename the Branch. \n\t\t/// </summary>\n\t\tpublic void Rename (string name)\n\t\t{\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tvar renameRef = db.RenameRef(RefName, GetRefName (name));\n\t\t\trenameRef.rename ();\n\t\t\tName = name;\n\t\t}\n\n\t\t#region --> Reset\n\n\n\t\t/// <summary>\n\t\t/// Reset this Branch to the current Commit using the given ResetBehavior. <see cref=\"Reset(GitSharp.Commit,GitSharp.ResetBehavior)\"/> for explanation of the reset behavior.\n\t\t/// </summary>\n\t\tpublic void Reset(ResetBehavior resetBehavior)\n\t\t{\n\t\t\tif (this.CurrentCommit == null)\n\t\t\t\tthrow new InvalidOperationException(string.Format(\"Branch '{0}' has no commit.\", Name));\n\t\t\tvar commit = this.CurrentCommit;\n\t\t\tReset(commit, resetBehavior);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reset this Branch to the named Commit using the given ResetBehavior. <see cref=\"Reset(GitSharp.Commit,GitSharp.ResetBehavior)\"/> for explanation of the reset behavior.\n\t\t/// </summary>\n\t\tpublic void Reset(string commitHash, ResetBehavior resetBehavior)\n\t\t{\n\t\t\tvar commit = new Commit(_repo, commitHash);\n\t\t\tif (!commit.IsCommit)\n\t\t\t\tthrow new ArgumentException(string.Format(\"The provided hash ({0}) does not point to a commit.\", commitHash));\n\t\t\tReset(commit, resetBehavior);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reset this Branch to the given Commit using the given ResetBehavior.\n\t\t/// <para/>\n\t\t/// Reset behavior:\n\t\t/// <u>\n\t\t/// <il>Mixed - Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated. This is the default action.</il>\n\t\t/// <il>Soft - Does not touch the index file nor the working tree at all, but requires them to be in a good order. This leaves all your changed files \"Changes to be committed\", as git status would put it.</il>\n\t\t/// <il>Hard - Matches the working tree and index to that of the tree being switched to. Any changes to tracked files in the working tree since the commit are lost.</il>\n\t\t/// <il>Merge - (NOT IMPLEMENTED) Resets the index to match the tree recorded by the named commit, and updates the files that are different between the named commit and the current commit in the working tree.</il>\n\t\t/// </u>\n\t\t/// </summary>\n\t\tpublic void Reset(Commit commit, ResetBehavior resetBehavior)\n\t\t{\n\t\t\tif (commit == null)\n\t\t\t\tthrow new ArgumentNullException(\"commit\");\n\t\t\tswitch (resetBehavior)\n\t\t\t{\n\t\t\t\tcase ResetBehavior.Hard:\n\t\t\t\t\tResetHard(commit);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ResetBehavior.Soft:\n\t\t\t\t\tResetSoft(commit);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ResetBehavior.Mixed:\n\t\t\t\t\tResetMixed(commit);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ResetBehavior.Merge:\n\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(string.Format(\"{0} is not supported.\", resetBehavior));\n\t\t\t}\n\t\t}\n\n\t\tprivate void ResetMixed(Commit commit)\n\t\t{\n\t\t\tif (commit.Tree == null || commit.Tree.InternalTree == null)\n\t\t\t\tthrow new InvalidOperationException(\"The given commit '\" + commit.Hash + \"'contains no valid tree.\");\n\t\t\tvar index = _repo.Index.GitIndex;\n\t\t\tindex.ReadTree(commit.Tree.InternalTree);\n\t\t\tindex.write();\n\t\t\tRef.Update(\"HEAD\", commit);\n\t\t}\n\n\t\tprivate static void ResetSoft(Commit commit)\n\t\t{\n\t\t\tRef.Update(\"HEAD\", commit);\n\t\t}\n\n\t\tprivate void ResetHard(Commit commit)\n\t\t{\n\t\t\tcommit.Checkout();\n\t\t\t_repo._internal_repo.Index.write();\n\t\t\tRef.Update(\"HEAD\", commit);\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region --> Branch Creation API\n\n\t\t/// <summary>\n\t\t/// Create a new branch based on HEAD.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"name\">The name of the branch to create (i.e. \"master\", not \"refs/heads/master\")</param>\n\t\t/// <returns>returns the newly created Branch object</returns>\n\t\tpublic static Branch Create(Repository repo, string name)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name))\n\t\t\t\tthrow new ArgumentException(\"Branch name must not be null or empty\");\n\t\t\tRef.Update(GetRefName (name), repo.Head.CurrentCommit);\n\t\t\treturn new Branch(repo, name);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new branch basing on the given commit\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"name\">The name of the branch to create (i.e. \"master\", not \"refs/heads/master\")</param>\n\t\t/// <param name=\"commit\">The commit to base the branch on.</param>\n\t\t/// <returns>returns the newly created Branch object</returns>\n\t\tpublic static Branch Create(Repository repo, string name, Commit commit)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name))\n\t\t\t\tthrow new ArgumentException(\"Branch name must not be null or empty\", \"name\");\n\t\t\tif (commit == null || !commit.IsCommit)\n\t\t\t\tthrow new ArgumentException(\"Invalid commit\", \"commit\");\n\t\t\tRef.Update(GetRefName (name), commit);\n\t\t\treturn new Branch(repo, name);\n\t\t}\n\n\n\t\t#endregion\n\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Branch[\" + Name + \"]\";\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Change.cs",
    "content": "﻿/*\n * Copyright (C) 2009-2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp\n{\n\n\tpublic enum ChangeType\n\t{\n\t\tAdded, Deleted, Modified, TypeChanged, Renamed, Copied\n\t}\n\n\t/// <summary>\n\t/// Represents a change of a single file between two commits. Use Commit.Diff to get a list of Change objects.\n\t/// </summary>\n\tpublic class Change\n\t{\n\n\t\t/// <summary>\n\t\t/// The commit that serves as reference for this comparison. The change reflects the difference of the other commit against this ReferenceCommit.\n\t\t/// </summary>\n\t\tpublic Commit ReferenceCommit\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The commit which is compared against the ReferenceCommit.\n\t\t/// </summary>\n\t\tpublic Commit ComparedCommit\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The kind of change (Added, Modified, Deleted, etc. )\n\t\t/// </summary>\n\t\tpublic ChangeType ChangeType { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// The revision of the file from the ReferenceCommit. It may be null in some cases i.e. for ChangeType.Added\n\t\t/// </summary>\n\t\tpublic AbstractObject ReferenceObject { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// The revision of the file from the ComparedCommit. It may be null in some cases i.e. for ChangeType.Removed\n\t\t/// </summary>\n\t\tpublic AbstractObject ComparedObject { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// The file (i.e. Blob) this Change is according to.\n\t\t/// Always returns a non-null revision of the file, no matter what kind of change. It normally returns the ComparedCommit's version of the changed \n\t\t/// object except for ChangeType.Removed where it returns the ReferenceCommit's version of the object.\n\t\t/// \n\t\t/// This property is designed to release the calling code from null checking and revision selection and may be especially useful for GUI bindings.\n\t\t/// </summary>\n\t\tpublic AbstractObject ChangedObject\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (ComparedObject != null)\n\t\t\t\t\treturn ComparedObject;\n\t\t\t\telse\n\t\t\t\t\treturn ReferenceObject;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The filepath of the ChangedObject\n\t\t/// </summary>\n\t\tpublic string Path { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// The filename of the ChangedObject\n\t\t/// </summary>\n\t\tpublic string Name { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// Unix file permissions of the ReferenceCommit's version of the object\n\t\t/// </summary>\n\t\tpublic int ReferencePermissions\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Unix file permissions of the ComparedCommit's version of the object\n\t\t/// </summary>\n\t\tpublic int ComparedPermissions { get; internal set; }\n\n\t\t/// <summary>\n\t\t/// Returns ReferenceCommit and ComparedCommit as array\n\t\t/// </summary>\n\t\tpublic Commit[] Commits\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Commit[] { ReferenceCommit, ComparedCommit };\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns ReferenceObject and ComparedObject as array\n\t\t/// </summary>\n\t\tpublic AbstractObject[] Objects\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new AbstractObject[] { ReferenceObject, ComparedObject };\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns ReferenceObject's and ComparedObject's permissions as array\n\t\t/// </summary>\n\t\tpublic int[] Permissions\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new int[] { ReferencePermissions, ComparedPermissions };\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"{0} [{1}]\", ChangeType, Path);\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "GitSharp/Commands/AbstractCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core;\n\nnamespace GitSharp.Commands\n{\n    /// <summary>\n    /// Abstract base class of all git commands. It provides basic infrastructure\n    /// </summary>\n    public abstract class AbstractCommand : IGitCommand\n    {\n        /// <summary>\n        /// Abbreviates a ref-name, used in internal output\n        /// </summary>\n        /// <param name=\"dst\">long ref</param>\n        /// <param name=\"abbreviateRemote\">abbreviate as remote</param>\n        /// <returns></returns>\n        protected string AbbreviateRef(String dst, bool abbreviateRemote)\n        {\n            if (dst.StartsWith(Constants.R_HEADS))\n                dst = dst.Substring(Constants.R_HEADS.Length);\n            else if (dst.StartsWith(Constants.R_TAGS))\n                dst = dst.Substring(Constants.R_TAGS.Length);\n            else if (abbreviateRemote && dst.StartsWith(Constants.R_REMOTES))\n                dst = dst.Substring(Constants.R_REMOTES.Length);\n            return dst;\n        }\n\n        /// <summary>\n        /// Performs upward recursive lookup to return git directory. Honors the environment variable GIT_DIR.\n        /// </summary>\n        /// <returns></returns>\n        public static string FindGitDirectory(string rootDirectory, bool recursive, bool isBare)\n        {\n            string directory = null;\n            string gitDir = null;\n            string envGitDir = System.Environment.GetEnvironmentVariable(\"GIT_DIR\");\n\n            //Determine which git directory to use\n            if (rootDirectory != null)         \t//Directory specified by --git-dir \n                directory = rootDirectory;\n            else if (envGitDir != null) \t\t//Directory specified by $GIT_DIR\n                directory = envGitDir;\n            else                        \t\t//Current Directory\n            {\n                directory = Directory.GetCurrentDirectory();\n                if (recursive)\n                {\n                    //Check for non-bare repositories\n                    if (!isBare)\n                    {\n                        while (directory != null)\n                        {\n                            gitDir = Path.Combine(directory, Constants.DOT_GIT);\n                            if (Directory.Exists(gitDir))\n                                return directory;\n\n                            //Get parent directory\n                            string parentDirectory = Path.Combine(directory, \"..\");\n                            parentDirectory = Path.GetFullPath(parentDirectory);\n                            if (parentDirectory == directory)\n                                return null;\n                            directory = parentDirectory;\n                        }\n                    }\n                    else\n                    {\n                        //Check for bare repositories\n                        while (directory != null)\n                        {\n                            if (directory.EndsWith(Constants.DOT_GIT_EXT) && Directory.Exists(directory))\n                                return directory;\n\n                            //Get parent directory\n                            directory = Path.Combine(directory, \"..\");\n                            directory = Path.GetFullPath(directory);\n                        }\n                    }\n                }\n            }\n            if (!directory.EndsWith(Constants.DOT_GIT_EXT))\n            {\n                if (!isBare)\n                    directory = Path.Combine(directory, Constants.DOT_GIT);\n                else\n                    directory += Constants.DOT_GIT_EXT;\n            }\n            return directory;\n        }\n\n        /// <summary>\n        /// Returns the value of the process' environment variable GIT_DIR\n        /// </summary>\n        protected string GIT_DIR\n        {\n            get\n            {\n                return System.Environment.GetEnvironmentVariable(\"GIT_DIR\");\n            }\n        }\n\n        /// <summary>\n        /// This command's output stream. If not explicitly set, the command writes to Git.OutputStream out.\n        /// </summary>\n        public StreamWriter OutputStream\n        {\n            get\n            {\n                if (_output == null)\n                    return Git.DefaultOutputStream;\n                return _output;\n            }\n            set\n            {\n                _output = value;\n            }\n        }\n        StreamWriter _output = null;\n\n        /// <summary>\n        /// The git repository that is either result of the command (init, clone) or subject to alteration (all other commands). \n        /// If not explicitly set, the command uses Git.Commands.Repository.\n        /// \n        /// Note: InitCommand and CloneCommand ignore this property and overwrite it as a result of Execute.\n        /// </summary>\n        public Repository Repository\n        {\n            get\n            {\n                if (_repository == null)\n                    return Git.DefaultRepository;\n                return _repository;\n            }\n            set // <--- for the time being this is public settable. we need to refactor in order to remove the Repository property from Clone and Init\n            {\n                _repository = value;\n            }\n        }\n        Repository _repository = null;\n\n        /// <summary>\n        /// The git directory. If not explicitly set, the command uses Git.GitDirectory.\n        /// </summary>\n        public virtual string GitDirectory\n        {\n            get\n            {\n                if (_gitDirectory == null)\n                    return Git.DefaultGitDirectory;\n                return _gitDirectory;\n            }\n            set\n            {\n                _gitDirectory = value;\n            }\n        }\n        protected string _gitDirectory = null;\n\n        /// <summary>\n        /// Get the directory where the Init command will initialize the repository. if GitDirectory is null ActualDirectory is used to initialize the repository.\n        /// </summary>\n        public virtual string ActualDirectory\n        {\n            get\n            {\n                return FindGitDirectory(GitDirectory, false, false);\n            }\n        }\n\n        /// <summary>\n        /// Execute the git command.\n        /// </summary>\n        public abstract void Execute();\n\n    }\n}"
  },
  {
    "path": "GitSharp/Commands/AbstractFetchCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Commands\n{\n    public abstract class AbstractFetchCommand : AbstractCommand\n    {\n        protected bool verbose;\n\n        protected void showFetchResult(GitSharp.Core.Transport.Transport tn, FetchResult r)\n        {\n            bool shownURI = false;\n            foreach (TrackingRefUpdate u in r.TrackingRefUpdates)\n            {\n                if (!verbose && u.Result == RefUpdate.RefUpdateResult.NO_CHANGE)\n                    continue;\n\n                char type = shortTypeOf(u.Result);\n                string longType = longTypeOf(u);\n                string src = AbbreviateRef(u.RemoteName, false);\n                string dst = AbbreviateRef(u.LocalName, true);\n\n                if (!shownURI)\n                {\n                    OutputStream.Write(\"From \");\n                    OutputStream.WriteLine(tn.Uri);\n                    shownURI = true;\n                }\n\n                OutputStream.WriteLine(\" \" + type + \" \" + longType + \" \" + src + \" -> \" + dst);\n            }\n        }\n\n        private string longTypeOf(TrackingRefUpdate u)\n        {\n            RefUpdate.RefUpdateResult r = u.Result;\n            if (r == RefUpdate.RefUpdateResult.LOCK_FAILURE)\n                return \"[lock fail]\";\n            if (r == RefUpdate.RefUpdateResult.IO_FAILURE)\n                return \"[i/o error]\";\n            if (r == RefUpdate.RefUpdateResult.REJECTED)\n                return \"[rejected]\";\n            if (ObjectId.ZeroId.Equals(u.NewObjectId))\n                return \"[deleted]\";\n\n            if (r == RefUpdate.RefUpdateResult.NEW)\n            {\n                if (u.RemoteName.StartsWith(Constants.R_HEADS))\n                    return \"[new branch]\";\n                if (u.LocalName.StartsWith(Constants.R_TAGS))\n                    return \"[new tag]\";\n                return \"[new]\";\n            }\n\n            if (r == RefUpdate.RefUpdateResult.FORCED)\n            {\n                string aOld = u.OldObjectId.Abbreviate(Repository).name();\n                string aNew = u.NewObjectId.Abbreviate(Repository).name();\n                return aOld + \"...\" + aNew;\n            }\n\n            if (r == RefUpdate.RefUpdateResult.FAST_FORWARD)\n            {\n                string aOld = u.OldObjectId.Abbreviate(Repository).name();\n                string aNew = u.NewObjectId.Abbreviate(Repository).name();\n                return aOld + \"..\" + aNew;\n            }\n\n            if (r == RefUpdate.RefUpdateResult.NO_CHANGE)\n                return \"[up to date]\";\n\n            return \"[\" + r + \"]\";\n        }\n\n        private static char shortTypeOf(RefUpdate.RefUpdateResult r)\n        {\n            switch (r)\n            {\n                case RefUpdate.RefUpdateResult.LOCK_FAILURE:\n                case RefUpdate.RefUpdateResult.IO_FAILURE:\n                case RefUpdate.RefUpdateResult.REJECTED:\n                    return '!';\n\n                case RefUpdate.RefUpdateResult.NEW:\n                    return '*';\n\n                case RefUpdate.RefUpdateResult.FORCED:\n                    return '+';\n\n                case RefUpdate.RefUpdateResult.NO_CHANGE:\n                    return '=';\n\n                default:\n                    return ' ';\n            }\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp/Commands/CloneCommand.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2008, Google Inc\n * Copyright (C) 2008, Caytchen \n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core;\n\nnamespace GitSharp.Commands\n{\n\t/// <summary>\n\t/// Represents git's clone command line interface command.\n\t/// </summary>\n\tpublic class CloneCommand\n\t\t: AbstractFetchCommand\n\t{\n\n\t\tpublic CloneCommand()\n\t\t{\n\t\t\tQuiet = true;\n\t\t}\n\n\t\t// note: the naming of command parameters may not follow .NET conventions in favour of git command line parameter naming conventions.\n\n\t\t/// <summary>\n        /// The name of a new directory to clone into.\n\t\t/// </summary>\n\t\tpublic string Directory { get; set; }\n\n\t\t/// <summary>\n\t\t/// The (possibly remote) repository to clone from.\n\t\t/// </summary>\n\t\tpublic string Source { get; set; }\n\n\n\t\t/// <summary>\n\t\t/// Not implemented\n\t\t/// \n\t\t/// When the repository to clone from is on a local machine, this flag bypasses normal \"git aware\" transport mechanism and clones the repository \n\t\t/// by making a copy of HEAD and everything under objects and refs directories. The files under .git/objects/ directory are hardlinked to save \n\t\t/// space when possible. This is now the default when the source repository is specified with /path/to/repo  syntax, so it essentially is a no-op \n\t\t/// option. To force copying instead of hardlinking (which may be desirable if you are trying to make a back-up of your repository), but still avoid \n\t\t/// the usual \"git aware\" transport mechanism, --no-hardlinks can be used. \n\t\t/// </summary>\n\t\tpublic bool Local { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented\n\t\t/// \n\t\t/// Optimize the cloning process from a repository on a local filesystem by copying files under .git/objects  directory. \n\t\t/// </summary>\n\t\tpublic bool NoHardLinks { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented\n\t\t/// \n\t\t/// When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects \n\t\t/// with the source repository. The resulting repository starts out without any object of its own. \n\t\t///      \n\t\t/// NOTE: this is a possibly dangerous operation; do not use it unless you understand what it does. If you clone your repository using this option and then \n\t\t/// delete branches (or use any other git command that makes any existing commit unreferenced) in the source repository, some objects may become \n\t\t/// unreferenced (or dangling). These objects may be removed by normal git operations (such as git-commit) which automatically call git gc --auto. \n\t\t/// (See git-gc(1).) If these objects are removed and were referenced by the cloned repository, then the cloned repository will become corrupt.\n\t\t/// </summary>\n\t\tpublic bool Shared { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented\n\t\t/// \n\t\t/// If the reference repository is on the local machine automatically setup .git/objects/info/alternates to obtain objects from the reference repository. Using \n\t\t/// an already existing repository as an alternate will require fewer objects to be copied from the repository being cloned, reducing network and local storage costs.\n\t\t/// \n\t\t/// NOTE: see NOTE to --shared option.\n\t\t/// </summary>\n\t\tpublic string ReferenceRepository { get; set; }\n\n\t\t/// <summary>\n\t\t/// Operate quietly. This flag is also passed to the `rsync' command when given.\n\t\t/// </summary>\n\t\tpublic bool Quiet { get; set; }\n\n\t\t/// <summary>\n\t\t/// Display the progressbar, even in case the standard output is not a terminal. \n\t\t/// </summary>\n\t\tpublic bool Verbose { get; set; }\n\n\t\t/// <summary>\n\t\t/// No checkout of HEAD is performed after the clone is complete. \n\t\t/// </summary>\n\t\tpublic bool NoCheckout { get; set; }\n\n\t\t/// <summary>\n\t\t/// Make a bare GIT repository. That is, instead of creating \"directory\" and placing the administrative files in \"directory\"/.git, make the \"directory\"  itself the $GIT_DIR. \n\t\t/// This obviously implies the -n  because there is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to corresponding local \n\t\t/// branch heads, without mapping them to refs/remotes/origin/. When this option is used, neither remote-tracking branches nor the related configuration variables are created. \n\t\t/// </summary>\n\t\tpublic bool Bare { get; set; }\n\n\t\t/// <summary>\n\t\t/// Set up a mirror of the remote repository. This implies --bare. \n\t\t/// </summary>\n\t\tpublic bool Mirror { get; set; }\n\n\t\t/// <summary>\n\t\t/// Instead of using the remote name origin to keep track of the upstream repository, use \"name\". \n\t\t/// </summary>\n\t\tpublic string OriginName { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented.\n\t\t/// \n\t\t/// When given, and the repository to clone from is accessed via ssh, this specifies a non-default path for the command run on the other end. \n\t\t/// </summary>\n\t\tpublic string UploadPack { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented.\n\t\t/// \n\t\t/// Specify the directory from which templates will be used; if unset the templates are taken from the installation defined default, typically /usr/share/git-core/templates. \n\t\t/// </summary>\n\t\tpublic string TemplateDirectory { get; set; }\n\n\t\t/// <summary>\n\t\t/// Not implemented.\n\t\t/// \n\t\t/// Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, \n\t\t/// nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches. \n\t\t/// </summary>\n\t\tpublic int Depth { get; set; }\n\n\t\t/// <summary>\n\t\t/// Do it.\n\t\t/// </summary>\n\t\tpublic override void Execute()\n\t\t{\n\t\t\tif (Source.Length <= 0)\n\t\t\t{\n                throw new ArgumentException(\"fatal: You must specify a repository to clone.\");\n\t\t\t}\n\n            if (Directory != null && GitDirectory != null)\n            {\n                throw new ArgumentException(\"conflicting usage of --git-dir and arguments\");\n            }\n\n\t\t\tvar source = new URIish(Source);\n\n            if (Directory == null)\n            {\n                try\n                {\n                    Directory = source.getHumanishName();\n                }\n                catch (InvalidOperationException e)\n                {\n                    throw new ArgumentException(\"cannot guess local name from \" + source, e);\n                }\n            }\n\n            if (GitDirectory == null)\n            {\n                GitDirectory = Path.Combine(Directory, Constants.DOT_GIT);\n            }\n\n\t\t\tif (Mirror)\n\t\t\t\tBare = true;\n\t\t\tif (Bare)\n\t\t\t{\n\t\t\t\tif (OriginName != null)\n\t\t\t\t\tthrow new ArgumentException(\"Bare+Origin\", \"--bare and --origin \" + OriginName + \" options are incompatible.\");\n\t\t\t\tNoCheckout = true;\n\t\t\t}\n\t\t\tif (OriginName == null)\n\t\t\t\tOriginName = Constants.DEFAULT_REMOTE_NAME;\n\n\t\t\tif (System.IO.Directory.Exists(Directory) && System.IO.Directory.GetFileSystemEntries(Directory).Length != 0)\n\t\t\t{\n                throw new InvalidOperationException(string.Format(\"destination path '{0}' already exists and is not an empty directory.\", new DirectoryInfo(Directory).FullName));\n\t\t\t}\n            \n            var repo = new Core.Repository(new DirectoryInfo(GitDirectory));\n\t\t\trepo.Create(Bare);\n\t\t\trepo.Config.setBoolean(\"core\", null, \"bare\", Bare);\n\t\t\trepo.Config.save();\n\t\t\tRepository = new Repository(repo);\n\t\t\tif (!Quiet)\n\t\t\t{\n\t\t\t\tOutputStream.WriteLine(\"Initialized empty Git repository in \" + repo.Directory.FullName);\n\t\t\t\tOutputStream.Flush();\n\t\t\t}\n\n\t\t\tsaveRemote(source);\n\n            FetchResult r;\n\t\t    try\n\t\t    {\n\t\t        r = runFetch();\n\t\t    }\n\t\t    catch (NoRemoteRepositoryException)\n\t\t    {\n\t\t        Repository.Dispose();\n\t\t        throw;\n\t\t    }\n\t\t\tGitSharp.Core.Ref branch = guessHEAD(r);\n\t\t\tif (!NoCheckout)\n\t\t\t\tdoCheckout(branch);\n\t\t}\n\n\t\tprivate void saveRemote(URIish uri)\n\t\t{\n\t\t\tvar repo = Repository._internal_repo;\n\t\t\tRemoteConfig rc = new RemoteConfig(repo.Config, OriginName);\n\t\t\trc.AddURI(uri);\n\t\t\trc.AddFetchRefSpec(new RefSpec().SetForce(true).SetSourceDestination(Constants.R_HEADS + \"*\",\n\t\t\t\tConstants.R_REMOTES + OriginName + \"/*\"));\n\t\t\trc.Update(repo.Config);\n\t\t\trepo.Config.save();\n\t\t}\n\n\t\tprivate FetchResult runFetch()\n\t\t{\n\t\t\tTransport tn = Transport.open(Repository._internal_repo, OriginName);\n\t\t\tFetchResult r;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!Quiet)\n\t\t\t\t\tr = tn.fetch(new TextProgressMonitor(OutputStream), null);\n\t\t\t\telse\n\t\t\t\t\tr = tn.fetch(new NullProgressMonitor(), null);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\ttn.Dispose();\n\t\t\t}\n\n\t\t\tshowFetchResult(tn, r);\n\t\t\treturn r;\n\t\t}\n\n\t\tprivate static GitSharp.Core.Ref guessHEAD(FetchResult result)\n\t\t{\n\t\t\tGitSharp.Core.Ref idHEAD = result.GetAdvertisedRef(Constants.HEAD);\n\t\t\tList<GitSharp.Core.Ref> availableRefs = new List<GitSharp.Core.Ref>();\n\t\t\tGitSharp.Core.Ref head = null;\n\n\t\t\tforeach (GitSharp.Core.Ref r in result.AdvertisedRefs)\n\t\t\t{\n\t\t\t\tstring n = r.Name;\n\t\t\t\tif (!n.StartsWith(Constants.R_HEADS))\n\t\t\t\t\tcontinue;\n\t\t\t\tavailableRefs.Add(r);\n\t\t\t\tif (idHEAD == null || head != null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (r.ObjectId.Equals(idHEAD.ObjectId))\n\t\t\t\t\thead = r;\n\t\t\t}\n\t\t\tavailableRefs.Sort(RefComparator.INSTANCE);\n\t\t\tif (idHEAD != null && head == null)\n\t\t\t\thead = idHEAD;\n\t\t\treturn head;\n\t\t}\n\n\t\tprivate void doCheckout(GitSharp.Core.Ref branch)\n\t\t{\n\t\t\tif (branch == null)\n\t\t\t\tthrow new ArgumentNullException(\"branch\", \"Cannot checkout; no HEAD advertised by remote\");\n\t\t\tvar repo = Repository._internal_repo;\n\n\t\t\tif (!Constants.HEAD.Equals(branch.getName()))\n\t\t\t{\n\t\t\t\tRefUpdate u1 = repo.UpdateRef(Constants.HEAD);\n\t\t\t\tu1.disableRefLog();\n\t\t\t\tu1.link(branch.getName());\n\t\t\t}\n\n\t\t\tGitSharp.Core.Commit commit = repo.MapCommit(branch.ObjectId);\n\t\t\tRefUpdate u = repo.UpdateRef(Constants.HEAD);\n\t\t\tu.NewObjectId = commit.CommitId;\n\t\t\tu.forceUpdate();\n\t\t\tGitIndex index = new GitIndex(repo);\n\t\t\tGitSharp.Core.Tree tree = commit.TreeEntry;\n\t\t\tWorkDirCheckout co = new WorkDirCheckout(repo, repo.WorkingDirectory, index, tree);\n\t\t\tco.checkout();\n\t\t\tindex.write();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp/Commands/FetchCommand.cs",
    "content": "/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Commands\n{\n\tpublic class FetchCommand : AbstractFetchCommand\n\t{\n\t\tpublic string Remote { get; set; }\n\t\tpublic List<RefSpec> RefSpecs { get; set; }\n\t\tpublic ProgressMonitor ProgressMonitor { get; set; }\n\n\t\tpublic bool? Prune { get; set; }\n\t\tpublic bool DryRun { get; set; }\n\t\tpublic bool? Thin { get; set; }\n\n\t\tpublic FetchResult Result\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic FetchCommand()\n\t\t{\n\t\t\tRemote = Constants.DEFAULT_REMOTE_NAME;\n\t\t\tProgressMonitor = NullProgressMonitor.Instance;\n\t\t}\n\n\t\tpublic override void Execute()\n\t\t{\n\t\t\tTransport tn = Transport.open(Repository._internal_repo, Remote);\n\n\t\t\tif (Prune != null)\n\t\t\t\ttn.RemoveDeletedRefs = Prune.Value;\n\t\t\tif (Thin != null)\n\t\t\t\ttn.FetchThin = Thin.Value;\n\t\t\ttn.DryRun = DryRun;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tResult = tn.fetch(ProgressMonitor, RefSpecs);\n\t\t\t\tif (Result.TrackingRefUpdates.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\ttn.Dispose();\n\t\t\t}\n\t\t\tshowFetchResult(tn, Result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp/Commands/IGitCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n\tpublic interface IGitCommand\n\t{\n\t\tvoid Execute();\n\t}\n}"
  },
  {
    "path": "GitSharp/Commands/InitCommand.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Commands\n{\n    /// <summary>\n    /// git-init - Create an empty git repository or reinitialize an existing one \n    /// </summary>\n    public class InitCommand : AbstractCommand\n    {\n        public InitCommand()\n        {\n            Quiet = true; // <-- [henon] since this command will be used more often programmatically than by CLI quiet=true is the better default.\n            Shared = \"false\";\n        }\n\n        #region Properties / Options\n\n        /// <summary>\n        /// Get the directory where the Init command will initialize the repository. if GitDirectory is null ActualDirectory is used to initialize the repository.\n        /// </summary>\n        public override string ActualDirectory\n        {\n            get\n            {\n                return FindGitDirectory(GitDirectory, false, Bare);\n            }\n        }\n\n        /// <summary>\n        /// Only print error and warning messages, all other output will be suppressed. Is True by default.\n        /// </summary>\n        public bool Quiet\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory. Is False by default.\n        /// </summary>\n        public bool Bare\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// NOT IMPLEMENTED!\n        /// Provide the directory from which templates will be used. The default template directory is /usr/share/git-core/templates.\n        ///     \n        /// When specified, <see cref=\"Template\"/> is used as the source of the template files rather than the default. The template files include some directory structure, some suggested \"exclude patterns\", and copies of non-executing \"hook\" files. The suggested patterns and hook files are all modifiable and extensible.\n        /// </summary>\n        public string Template\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// NOT IMPLEMENTED!\n        ///     Specify that the git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable \"core.sharedRepository\" is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, git will use permissions reported by umask(2).\n        ///     The option can have the following values, defaulting to group if no value is given:\n        ///     * umask (or false): Use permissions reported by umask(2). The default, when --shared is not specified.\n        ///     * group (or true): Make the repository group-writable, (and g+sx, since the git group may be not the primary group of all users). This is used to loosen the permissions of an otherwise safe umask(2) value. Note that the umask still applies to the other permission bits (e.g. if umask is 0022, using group will not remove read privileges from other (non-group) users). See 0xxx for how to exactly specify the repository permissions.\n        ///     * all (or world or everybody): Same as group, but make the repository readable by all users.\n        ///     * 0xxx: 0xxx is an octal number and each file will have mode 0xxx. 0xxx will override users' umask(2) value (and not only loosen permissions as group and all does). 0640 will create a repository which is group-readable, but not group-writable or accessible to others. 0660 will create a repo that is readable and writable to the current user and group, but inaccessible to others.\n        ///     By default, the configuration flag receive.denyNonFastForwards is enabled in shared repositories, so that you cannot force a non fast-forwarding push into it.\n        /// </summary>\n        public string Shared\n        {\n            get;\n            set;\n        }\n\n\n        #endregion\n\n        /// <summary>\n        /// Execute the command.\n        /// </summary>\n        public override void Execute()\n        {\n            using (var repo = new GitSharp.Core.Repository(new DirectoryInfo(ActualDirectory)))\n            {\n                var reinit = repo.Create(Bare);\n                if (!Quiet)\n                {\n                    OutputStream.WriteLine(String.Format(\"{0} empty Git repository in {1}\", reinit ? \"Reinitialized\" : \"Initialized\", repo.Directory.FullName));\n                    OutputStream.Flush();\n                }\n                Repository = new Repository(repo);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp/Commands/LogCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n * Copyright (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class LogCommand\n        : AbstractCommand\n    {\n\n        public LogCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Limits the number of commits to show.\n        /// \n        /// </summary>\n        public string n { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print out the ref names of any commits that are shown. If 'short' is\n        /// specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and\n        /// 'refs/remotes/' will not be printed. If 'full' is specified, the\n        /// full ref name (including prefix) will be printed. The default option\n        /// is 'short'.\n        /// \n        /// </summary>\n        public string Decorate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print out the ref name given on the command line by which each\n        /// commit was reached.\n        /// \n        /// </summary>\n        public bool Source { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Without this flag, \"git log -p &lt;path&gt;...\" shows commits that\n        /// touch the specified paths, and diffs about the same specified\n        /// paths.  With this, the full diff is shown for commits that touch\n        /// the specified paths; this means that \"&lt;path&gt;...\" limits only\n        /// commits, and doesn't limit diff for those commits.\n        /// \n        /// </summary>\n        public string FullDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Continue listing the history of a file beyond renames.\n        /// \n        /// </summary>\n        public bool Follow { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Before the log message print out its size in bytes. Intended\n        /// mainly for porcelain tools consumption. If git is unable to\n        /// produce a valid value size is set to zero.\n        /// Note that only message is considered, if also a diff is shown\n        /// its size is not included.\n        /// \n        /// </summary>\n        public bool LogSize { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n        \n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            if (Arguments.Count == 0)\n                Arguments.Add(Directory.GetCurrentDirectory());\n            foreach (var commit in Repository.Get<AbstractTreeNode>(Arguments[0]).GetHistory())\n            {\n                ShowCommit(commit);\n            }\n        }\n\n        private void ShowCommit(Commit commit)\n        {\n            OutputStream.WriteLine(\"commit {0}\", commit.Hash);\n            OutputStream.WriteLine(\"Author: {0} <{1}>\", commit.Author.Name, commit.Author.EmailAddress);\n            OutputStream.WriteLine(\"Date: {0}\", commit.AuthorDate);\n            OutputStream.WriteLine();\n            foreach (var line in commit.Message.Split(new[] { \"\\r\\n\", \"\\r\", \"\\n\" }, StringSplitOptions.None))\n                OutputStream.WriteLine(\"    {0}\", line);\n            OutputStream.WriteLine();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Commands/MergeCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Merge;\n\nnamespace GitSharp.Commands\n{\n\tpublic static class MergeCommand\n\t{\n\t\tpublic static MergeResult Execute(MergeOptions options)\n\t\t{\n\t\t\toptions.Validate();\n\n\t\t\tvar merger = SelectMerger(options);\n\t\t\tbool success = merger.Merge(options.Commits.Select(c => ((Core.Commit)c).CommitId).ToArray());\n\t\t\tvar result = new MergeResult { Success = success };\n\t\t\tresult.Tree = new Tree(options.Repository, merger.GetResultTreeId());\n\t\t\tif (options.NoCommit)\n\t\t\t{\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(options.Message))\n\t\t\t\t{\n\t\t\t\t\toptions.Message = FormatMergeMessage(options);\n\t\t\t\t}\n\t\t\t\tvar author = Author.GetDefaultAuthor(options.Repository);\n\t\t\t\tresult.Commit = Commit.Create(options.Message, options.Commits, result.Tree, author, author, DateTimeOffset.Now);\n\t\t\t\tif (options.Branches.Length >= 1 && options.Branches[0] is Branch)\n\t\t\t\t\tRef.Update(\"refs/heads/\" + options.Branches[0].Name, result.Commit);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static string FormatMergeMessage(MergeOptions options)\n\t\t{\n\t\t\tif (options.Branches.Length > 0 && options.Branches[0] is Branch)\n\t\t\t\treturn string.Format(\"Merge branch '{0}' into {1}\", options.Branches[1].Name, options.Branches[0].Name);\n\t\t\telse\n\t\t\t\treturn \"Merge commits: \" + string.Join(\", \", options.Commits.Select(c => c.Hash).ToArray()); // todo: replace this fallback message with something sensible.\n\t\t}\n\n\t\tprivate static Merger SelectMerger(MergeOptions options)\n\t\t{\n\t\t\tswitch (options.MergeStrategy)\n\t\t\t{\n\t\t\t\tcase MergeStrategy.Ours:\n\t\t\t\t\treturn Core.Merge.MergeStrategy.Ours.NewMerger(options.Repository);\n\t\t\t\tcase MergeStrategy.Theirs:\n\t\t\t\t\treturn Core.Merge.MergeStrategy.Theirs.NewMerger(options.Repository);\n\t\t\t\tcase MergeStrategy.Recursive:\n\t\t\t\t\treturn Core.Merge.MergeStrategy.SimpleTwoWayInCore.NewMerger(options.Repository);\n\t\t\t}\n\t\t\tthrow new ArgumentException(\"Invalid merge option: \"+options.MergeStrategy);\n\t\t}\n\n\t}\n\n\n\tpublic enum MergeStrategy { Ours, Theirs, Recursive }\n\n\tpublic class MergeOptions\n\t{\n\t\tpublic MergeOptions()\n\t\t{\n\t\t\tNoCommit = false;\n\t\t\tNoFastForward = false;\n\t\t}\n\n\t\tinternal Repository Repository { get; set; }\n\n\t\t/// <summary>\n\t\t/// Commit message of the merge. If left empty or null a good default message will be provided by the merge command.\n\t\t/// </summary>\n\t\tpublic string Message { get; set; }\n\n\t\tpublic MergeStrategy MergeStrategy { get; set; }\n\n\t\tprivate Ref[] _branches;\n\n\t\t/// <summary>\n\t\t/// The branches to merge. This automatically sets the Commits property.\n\t\t/// </summary>\n\t\tpublic Ref[] Branches\n\t\t{\n\t\t\tget { return _branches; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_branches = value;\n\t\t\t\tif (value != null)\n\t\t\t\t\tCommits = value.Select(b => b.Target as Commit).ToArray();\n\t\t\t\tif (_branches != null && _branches.Length > 0 && _branches[0] != null)\n\t\t\t\t\tRepository = _branches[0]._repo;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The commits to merge, set this only if you can not specify the branches.\n\t\t/// </summary>\n\t\tpublic Commit[] Commits { get; set; }\n\n\t\t/// <summary>\n\t\t/// With NoCommit=true MergeCommand performs the merge but pretends the merge failed and does not autocommit, to give the user a chance to inspect and further tweak the merge result before committing.\n\t\t/// By default MergeCommand performs the merge and committs the result (the default value is false).\n\t\t/// </summary>\n\t\tpublic bool NoCommit { get; set; }\n\n\t\t/// <summary>\n\t\t/// When true Generate a merge commit even if the merge resolved as a fast-forward. \n\t\t/// MergeCommand by default does not generate a merge commit if the merge resolved as a fast-forward, only updates the branch pointer (the default value is false).\n\t\t/// </summary>\n\t\tpublic bool NoFastForward { get; set; }\n\n\n\t\tpublic bool Log { get; set; }\n\n\t\tpublic void Validate()\n\t\t{\n\t\t\tif (Repository == null)\n\t\t\t\tthrow new ArgumentException(\"Repository must not be null\");\n\t\t\tif (Commits.Count() < 2)\n\t\t\t\tthrow new ArgumentException(\"Need at least two commits to merge\");\n\t\t}\n\t}\n\n\tpublic class MergeResult\n\t{\n\t\t/// <summary>\n\t\t/// True if the merge was sucessful. In case of conflicts or the strategy not being able to conduct the merge this is false.\n\t\t/// </summary>\n\t\tpublic bool Success { get; set; }\n\n\t\t/// <summary>\n\t\t/// Result object of the merge command. If MergeOptions.NoCommit == true this is null.\n\t\t/// </summary>\n\t\tpublic Commit Commit { get; set; }\n\n\t\t/// <summary>\n\t\t/// Resulting tree. This property is especially useful when merging with option NoCommit == true.\n\t\t/// </summary>\n\t\tpublic Tree Tree { get; set; }\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Commands/PushCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Commands\n{\n\n    public class PushCommand : AbstractCommand\n    {\n        private bool shownUri;\n\n        public ProgressMonitor ProgressMonitor { get; set; }\n        public string Remote { get; set; }\n        public List<RefSpec> RefSpecs { get; set; }\n        public bool Force { get; set; }\n        public string ReceivePack { get; set; }\n        public bool DryRun { get; set; }\n        public bool Thin { get; set; }\n        public bool Verbose { get; set; }\n\n        public PushResult Result\n        {\n            get; private set;\n        }\n\n        public PushCommand()\n        {\n            Remote = Constants.DEFAULT_REMOTE_NAME;\n            ProgressMonitor = NullProgressMonitor.Instance;\n        }\n\n        public void AddAll()\n        {\n            RefSpecs.Add(Transport.REFSPEC_PUSH_ALL);\n        }\n\n        public void AddTags()\n        {\n            RefSpecs.Add(Transport.REFSPEC_TAGS);\n        }\n\n        public override void Execute()\n        {\n            if (Force)\n            {\n                List<RefSpec> orig = new List<RefSpec>(RefSpecs);\n                RefSpecs.Clear();\n                foreach (RefSpec spec in orig)\n                    RefSpecs.Add(spec.SetForce(true));\n            }\n\n            List<Transport> transports = Transport.openAll(Repository._internal_repo, Remote);\n            foreach (Transport transport in transports)\n            {\n                if (ReceivePack != null)\n                {\n                    transport.OptionReceivePack = ReceivePack;\n                }\n                transport.DryRun = DryRun;\n                transport.PushThin = Thin;\n\n                URIish uri = transport.Uri;\n                var toPush = transport.findRemoteRefUpdatesFor(RefSpecs);\n                try\n                {\n                    Result = transport.push(ProgressMonitor, toPush);\n                }\n                finally\n                {\n                    transport.Dispose();\n                }\n                printPushResult(uri, Result);\n            }\n        }\n\n        private void printPushResult(URIish uri, PushResult result)\n        {\n            shownUri = false;\n            bool everythingUpToDate = true;\n\n            foreach (RemoteRefUpdate rru in result.RemoteUpdates)\n            {\n                if (rru.Status == RemoteRefUpdate.UpdateStatus.UP_TO_DATE)\n                {\n                    if (Verbose)\n                        printRefUpdateResult(uri, result, rru);\n                }\n                else\n                {\n                    everythingUpToDate = false;\n                }\n            }\n\n            foreach (RemoteRefUpdate rru in result.RemoteUpdates)\n            {\n                if (rru.Status == RemoteRefUpdate.UpdateStatus.OK)\n                    printRefUpdateResult(uri, result, rru);\n            }\n\n            foreach (RemoteRefUpdate rru in result.RemoteUpdates)\n            {\n                if (rru.Status != RemoteRefUpdate.UpdateStatus.OK && rru.Status != RemoteRefUpdate.UpdateStatus.UP_TO_DATE)\n                    printRefUpdateResult(uri, result, rru);\n            }\n\n            if (everythingUpToDate)\n                OutputStream.WriteLine(\"Everything up-to-date\");\n        }\n\n        private void printRefUpdateResult(URIish uri, OperationResult result, RemoteRefUpdate rru)\n        {\n            if (!shownUri)\n            {\n                shownUri = true;\n                OutputStream.WriteLine(\"To \" + uri);\n            }\n\n            string remoteName = rru.RemoteName;\n            string srcRef = rru.IsDelete ? null : rru.SourceRef;\n\n            switch (rru.Status)\n            {\n                case RemoteRefUpdate.UpdateStatus.OK:\n                    {\n                        if (rru.IsDelete)\n                            printUpdateLine('-', \"[deleted]\", null, remoteName, null);\n                        else\n                        {\n                            GitSharp.Core.Ref oldRef = result.GetAdvertisedRef(remoteName);\n                            if (oldRef == null)\n                            {\n                                string summary = remoteName.StartsWith(Constants.R_TAGS) ? \"[new tag]\" : \"[new branch]\";\n                                printUpdateLine('*', summary, srcRef, remoteName, null);\n                            }\n                            else\n                            {\n                                bool fastForward = rru.FastForward;\n                                char flag = fastForward ? ' ' : '+';\n                                string summary = oldRef.ObjectId.Abbreviate(Repository._internal_repo).name() +\n                                                 (fastForward ? \"..\" : \"...\") +\n                                                 rru.NewObjectId.Abbreviate(Repository._internal_repo).name();\n                                string message = fastForward ? null : \"forced update\";\n                                printUpdateLine(flag, summary, srcRef, remoteName, message);\n                            }\n                        }\n                        break;\n                    }\n\n                case RemoteRefUpdate.UpdateStatus.NON_EXISTING:\n                    printUpdateLine('X', \"[no match]\", null, remoteName, null);\n                    break;\n\n                case RemoteRefUpdate.UpdateStatus.REJECTED_NODELETE:\n                    printUpdateLine('!', \"[rejected]\", null, remoteName, \"remote side does not support deleting refs\");\n                    break;\n\n                case RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD:\n                    printUpdateLine('!', \"[rejected]\", srcRef, remoteName, \"non-fast forward\");\n                    break;\n\n                case RemoteRefUpdate.UpdateStatus.REJECTED_REMOTE_CHANGED:\n                    {\n                        string message = \"remote ref object changed - is not expected one \" +\n                                         rru.ExpectedOldObjectId.Abbreviate(Repository._internal_repo).name();\n                        printUpdateLine('!', \"[rejected]\", srcRef, remoteName, message);\n                        break;\n                    }\n\n                case RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON:\n                    printUpdateLine('!', \"[rejected]\", srcRef, remoteName, rru.Message);\n                    break;\n\n                case RemoteRefUpdate.UpdateStatus.UP_TO_DATE:\n                    if (Verbose)\n                        printUpdateLine('=', \"[up to date]\", srcRef, remoteName, null);\n                    break;\n\n                case RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED:\n                case RemoteRefUpdate.UpdateStatus.AWAITING_REPORT:\n                    printUpdateLine('?', \"[unexpected push-process behavior]\", srcRef, remoteName, rru.Message);\n                    break;\n            }\n        }\n\n        private void printUpdateLine(char flag, string summary, string srcRef, string destRef, string message)\n        {\n            OutputStream.Write(\" \" + flag + \" \" + summary);\n            \n            if (srcRef != null)\n                OutputStream.Write(\" \" + AbbreviateRef(srcRef, true) + \" -> \");\n            OutputStream.Write(AbbreviateRef(destRef, true));\n\n            if (message != null)\n                OutputStream.Write(\" (\" + message + \")\");\n\n            OutputStream.WriteLine();\n\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp/Commands/StatusCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Rolenun <rolenun@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\n\nnamespace GitSharp.Commands\n{\n    #region Status Command\n    public class StatusCommand : AbstractCommand\n    {\n    \tprivate StatusResults results = new StatusResults();\n\n        public StatusCommand()\n        {\n        }\n\n        public Boolean AnyDifferences { get { return Repository.Status.AnyDifferences; } }\n        public int IndexSize { get; private set; }\n        public StatusResults Results \n        {\n        \tget { return results; } \n        \tprivate set { results = value; }\n        }\n        public Boolean IsEmptyRepository { get { return IndexSize <= 0; } }\n\n        public override void Execute()\n        {\n            RepositoryStatus status = new RepositoryStatus(Repository);\n            \n            IgnoreRules rules;\n\n            //Read ignore file list and remove from the untracked list\n            try\n            {\n                rules = new IgnoreRules(Path.Combine(Repository.WorkingDirectory, \".gitignore\"));\n            }\n            catch (FileNotFoundException) \n            {\n                //.gitignore file does not exist for a newly initialized repository.\n                string[] lines = {};\n                rules = new IgnoreRules(lines);\n            } \n\n            foreach (string hash in status.Untracked)\n            {\n                string path = Path.Combine(Repository.WorkingDirectory, hash);\n                if (!rules.IgnoreFile(Repository.WorkingDirectory, path) && !rules.IgnoreDir(Repository.WorkingDirectory, path))\n                {\n                    results.UntrackedList.Add(hash);\n                }\n            }\n            \n            if (status.AnyDifferences || results.UntrackedList.Count > 0)\n            {\n                // Files use the following StatusTypes: removed, missing, added, and modified, modified w/staged, and merge conflict.\n                // The following StatusStates are defined for each type:\n                //              Modified -> Unstaged\n                //         MergeConflict -> Unstaged\n                //                 Added -> Staged\n                //        ModifiedStaged -> Staged\n                //               Removed -> Staged\n                //               Missing -> Staged\n                // The StatusState known as \"Untracked\" is determined by what is *not* defined in any state.\n                // It is then intersected with the .gitignore list to determine what should be listed as untracked.\n\n                HashSet<string> hset = new HashSet<string>(status.MergeConflict);\n                foreach (string hash in hset)\n                {\n                    results.ModifiedList.Add(hash, StatusType.MergeConflict);\n                    status.Staged.Remove(hash);\n                    status.Modified.Remove(hash);\n                }\n\n                hset = new HashSet<string>(status.Missing);\n                foreach (string hash in hset)\n                    results.ModifiedList.Add(hash, StatusType.Missing);\n\n                hset = new HashSet<string>(status.Modified);\n                foreach (string hash in hset)\n                    results.ModifiedList.Add(hash, StatusType.Modified);\n\n                hset = new HashSet<string>(status.Staged);\n                foreach (string hash in hset)\n                    results.StagedList.Add(hash, StatusType.ModifiedStaged);\n\n                hset = new HashSet<string>(status.Added);\n                foreach (string hash in hset)\n                    results.StagedList.Add(hash, StatusType.Added);\n\n                hset = new HashSet<string>(status.Removed);\n                foreach (string hash in hset)\n                    results.StagedList.Add(hash, StatusType.Removed);\n\n                results.UntrackedList.Sort();\n                results.ModifiedList.OrderBy(v => v.Key);\n                results.StagedList.OrderBy(v => v.Key);\n            }\n\n            IndexSize = Repository.Index.Size;\n        }\n\n    }\n    #endregion\n\n    #region Status Results\n\n    public class StatusResults\n    {\n        public List<string> UntrackedList = new List<string>();\n        public Dictionary<string, int> StagedList = new Dictionary<string, int>();\n        public Dictionary<string, int> ModifiedList = new Dictionary<string, int>();\n\n        public void Clear()\n        {\n        \tUntrackedList.Clear();\n        \tStagedList.Clear();\n        \tModifiedList.Clear();\n        }\n        \n        // Returns all available matches of a file and its status based on filename.\n        public Dictionary<string,int> Search(string filepattern)\n        {\n            Dictionary<string, int> result = new Dictionary<string, int>();\n\n            foreach (string hash in UntrackedList)\n            {\n                if (hash.Contains(filepattern))\n                {\n                    result.Add(hash, StatusState.Untracked);\n                }\n            }\n            foreach (string key in ModifiedList.Keys)\n            {\n                if (key.Contains(filepattern))\n                {\n                    result.Add(key, StatusState.Modified);\n                }\n            }\n            foreach (string key in StagedList.Keys)\n            {\n                if (key.Contains(filepattern))\n                {\n                    result.Add(key, StatusState.Staged);\n                }\n            }\n\n            return result;\n        }\n        \n        public bool Contains(string filepattern, int state)\n        {\n            Dictionary<string, int> result = new Dictionary<string, int>();\n\n            if (state == StatusState.Untracked)\n            {\n                foreach (string hash in UntrackedList)\n                {\n                    if (hash.Contains(filepattern))\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            if (state == StatusState.Modified)\n            {\n                foreach (string key in ModifiedList.Keys)\n                {\n                    if (key.Contains(filepattern))\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            if (state == StatusState.Staged)\n            {\n                foreach (string key in StagedList.Keys)\n                {\n                    if (key.Contains(filepattern))\n                    {\n                        return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n\n    }\n\n    #endregion\n\n    #region Status Types\n    \n    public struct StatusState\n    {\n        public const int Staged = 1;\n        public const int Modified = 2;\n        public const int Untracked = 3;\n    }\n\n    public struct StatusType\n    {\n        public const int Added = 1;\n        public const int Modified = 2;\n        public const int Removed = 3;\n        public const int Missing = 4;\n        public const int MergeConflict = 5;\n        public const int ModifiedStaged = 6;\n    }\n\n    #endregion\n\n}"
  },
  {
    "path": "GitSharp/Commands/_NotSupportedCommands.txt",
    "content": "﻿The following git commands are not supported by the command api\n\nfmt-merge-msg: see MergeCommand.FormatMergeMessage"
  },
  {
    "path": "GitSharp/Commit.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Commands;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing GitSharp.Core.Diff;\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreTree = GitSharp.Core.Tree;\nusing System.IO;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing System.Diagnostics;\nusing System.Collections;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents a revision of the files and directories tracked in the repository.\n\t/// </summary>\n\tpublic class Commit : AbstractObject\n\t{\n\n\t\tpublic Commit(Repository repo, string hash_or_name)\n\t\t\t: base(repo, hash_or_name)\n\t\t{\n\t\t}\n\n\t\tinternal Commit(Repository repo, CoreRef @ref)\n\t\t\t: base(repo, @ref.ObjectId)\n\t\t{\n\t\t}\n\n\t\tinternal Commit(Repository repo, Core.Commit internal_commit)\n\t\t\t: base(repo, internal_commit.CommitId)\n\t\t{\n\t\t\t_internal_commit = internal_commit;\n\t\t}\n\n\t\tinternal Commit(Repository repo, ObjectId id)\n\t\t\t: base(repo, id)\n\t\t{\n\t\t}\n\n\t\tprivate Core.Commit _internal_commit;\n\n\t\tprivate Core.Commit InternalCommit\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_internal_commit == null)\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_internal_commit = _repo._internal_repo.MapCommit(_id);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\t// the commit object is invalid. however, we can not allow exceptions here because they would not be expected.\n\t\t\t\t\t}\n\t\t\t\treturn _internal_commit;\n\t\t\t}\n\t\t}\n\n\t\t#region --> Commit Properties\n\n\n\t\tpublic bool IsValid\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn InternalCommit is Core.Commit;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The commit message.\n\t\t/// </summary>\n\t\tpublic string Message\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\treturn InternalCommit.Message;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The encoding of the commit details.\n\t\t/// </summary>\n\t\tpublic Encoding Encoding\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\treturn InternalCommit.Encoding;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The author of the change set represented by this commit. \n\t\t/// </summary>\n\t\tpublic Author Author\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\treturn new Author() { Name = InternalCommit.Author.Name, EmailAddress = InternalCommit.Author.EmailAddress };\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The person who committed the change set by reusing authorship information from another commit. If the commit was created by the author himself, Committer is equal to the Author.\n\t\t/// </summary>\n\t\tpublic Author Committer\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\tvar committer = InternalCommit.Committer;\n\t\t\t\tif (committer == null) // this is null if the author committed himself\n\t\t\t\t\treturn Author;\n\t\t\t\treturn new Author() { Name = committer.Name, EmailAddress = committer.EmailAddress };\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Original timestamp of the commit created by Author. \n\t\t/// </summary>\n\t\tpublic DateTimeOffset AuthorDate\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn DateTimeOffset.MinValue;\n\t\t\t\treturn InternalCommit.Author.When.MillisToDateTimeOffset(InternalCommit.Author.TimeZoneOffset);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Final timestamp of the commit, after Committer has re-committed Author's commit.\n\t\t/// </summary>\n\t\tpublic DateTimeOffset CommitDate\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn DateTimeOffset.MinValue;\n\t\t\t\tvar committer = InternalCommit.Committer;\n\t\t\t\tif (committer == null) // this is null if the author committed himself\n\t\t\t\t\tcommitter = InternalCommit.Author;\n\t\t\t\treturn committer.When.MillisToDateTimeOffset(committer.TimeZoneOffset);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if the commit was created by the author of the change set himself.\n\t\t/// </summary>\n\t\tpublic bool IsCommittedByAuthor\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Author == Committer;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all parent commits.\n\t\t/// </summary>\n\t\tpublic IEnumerable<Commit> Parents\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn new Commit[0];\n\t\t\t\treturn InternalCommit.ParentIds.Select(parent_id => new Commit(_repo, parent_id)).ToArray();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if the commit has at least one parent.\n\t\t/// </summary>\n\t\tpublic bool HasParents\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn false;\n\t\t\t\treturn InternalCommit.ParentIds.Length > 0;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The first parent commit if the commit has at least one parent, null otherwise.\n\t\t/// </summary>\n\t\tpublic Commit Parent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\tif (HasParents)\n\t\t\t\t\treturn new Commit(_repo, InternalCommit.ParentIds[0]);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The commit's reference to the root of the directory structure of the revision.\n\t\t/// </summary>\n\t\tpublic Tree Tree\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalCommit == null) // this might happen if the object was created with an incorrect reference\n\t\t\t\t\treturn null;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn new Tree(_repo, InternalCommit.TreeEntry);\n\t\t\t\t}\n\t\t\t\tcatch (GitSharp.Core.Exceptions.MissingObjectException)\n\t\t\t\t{\n\t\t\t\t\treturn null; // relieve the client of having to catch the exception! If tree is null it is obvious that the tree could not be found.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Returns an iterator over all ancestor-commits of this commit. \n\t\t/// </summary>\n\t\tpublic IEnumerable<Commit> Ancestors\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar revwalk = new RevWalk(_repo);\n\t\t\t\trevwalk.RevSortStrategy.Add(RevSort.Strategy.COMMIT_TIME_DESC);\n\t\t\t\trevwalk.RevSortStrategy.Add(RevSort.Strategy.TOPO);\n\t\t\t\trevwalk.markStart(revwalk.parseCommit(_id));\n\t\t\t\treturn\n\t\t\t\t\tfrom revcommit in revwalk.Skip(1) // skip this commit\n\t\t\t\t\tselect new Commit(_repo, revcommit.AsCommit(revwalk));\n\t\t\t}\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region --> Checkout\n\n\n\t\t/// <summary>\n\t\t/// Checkout this commit into the working directory. Does not change HEAD.\n\t\t/// <para/>\n\t\t/// <seealso cref=\"Branch.Checkout\"/> and <seealso cref=\"Index.Checkout()\"/>.\n\t\t/// </summary>\n\t\tpublic void Checkout()\n\t\t{\n\t\t\tCheckout(_repo.WorkingDirectory);\n\t\t}\n\n\t\tprivate void Checkout(string working_directory) // [henon] made this private to not confuse with Checkout( paths ). It seems to be not a common use case anyway and could be better exposed via the CheckoutCommand\n\t\t{\n\t\t\tif (InternalCommit == null)\n\t\t\t\tthrow new InvalidOperationException(\"Unable to checkout this commit. It was not initialized properly (i.e. the hash is not pointing to a commit object).\");\n\t\t\tif (working_directory == null)\n\t\t\t\tthrow new ArgumentException(\"Path to checkout directory must not be null\");\n\t\t\tif (new DirectoryInfo(working_directory).Exists == false)\n\t\t\t\tthrow new IOException(\"Cannot checkout into non-existent directory: \" + working_directory);\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tvar index = _repo.Index.GitIndex;\n\t\t\tindex.RereadIfNecessary();\n\t\t\tCoreTree tree = InternalCommit.TreeEntry;\n\t\t\tvar co = new GitSharp.Core.WorkDirCheckout(db, new DirectoryInfo(working_directory), index, tree);\n\t\t\tco.checkout();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out the given paths into the working directory. Files in the working directory will be overwritten.\n\t\t/// <para/>\n\t\t/// See also <seealso cref=\"Index.Checkout(string[])\"/> to check out paths from the index.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\">Relative paths of the files to check out.</param>\n\t\t/// Throws a lot of IO and Security related exceptions.\n\t\tpublic void Checkout(params string[] paths)\n\t\t{\n\t\t\tvar tree = this.Tree;\n\t\t\tif (tree == null || !tree.IsTree)\n\t\t\t\tthrow new InvalidOperationException(\"This commit doesn't seem to have a valid tree.\");\n\t\t\tforeach (string path in paths)\n\t\t\t{\n\t\t\t\tvar leaf = tree[path] as Leaf;\n\t\t\t\tif (leaf == null)\n\t\t\t\t\tthrow new ArgumentException(\"The given path does not exist in this commit: \" + path);\n\t\t\t\tvar filename = Path.Combine(_repo.WorkingDirectory, path);\n\t\t\t\tnew FileInfo(filename).Directory.Mkdirs();\n\t\t\t\tFile.WriteAllBytes(filename, leaf.Blob.RawData); // todo: hmm, what is with file permissions and other file attributes?\n\t\t\t}\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region --> Blame\n\t\t\n\t\tpublic Commit[] Blame (string path)\n\t\t{\n\t\t\tLeaf leaf = Tree [path] as Leaf;\n\t\t\tif (leaf == null)\n\t\t\t\tthrow new ArgumentException(\"The given path does not exist in this commit: \" + path);\n\t\t\tbyte[] data = leaf.RawData;\n\t\t\tint lineCount = RawParseUtils.lineMap (data, 0, data.Length).size ();\n\t\t\tCommit[] lines = new Commit [lineCount];\n\t\t\tvar curText = new RawText (data);\n\t\t\tCommit prevAncestor = this;\n\t\t\t\n\t\t\tLeaf prevLeaf = null;\n\t\t\tCommit prevCommit = null;\n\t\t\tint emptyLines = lineCount;\n\t\t\t\n\t\t\tforeach (Commit ancestor in Ancestors) {\n\t\t\t\tLeaf cleaf = ancestor.Tree [path] as Leaf;\n\t\t\t\tif (prevCommit != null && (cleaf == null || cleaf.Hash != prevLeaf.Hash)) {\n\t\t\t\t\tbyte[] prevData = prevLeaf.RawData;\n\t\t\t\t\tif (prevData == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvar prevText = new RawText (prevData);\n\t\t\t\t\tvar differ = new MyersDiff (prevText, curText);\n\t\t\t\t\tforeach (Edit e in differ.getEdits ()) {\n\t\t\t\t\t\tfor (int n = e.BeginB; n < e.EndB; n++) {\n\t\t\t\t\t\t\tif (lines [n] == null) {\n\t\t\t\t\t\t\t\tlines [n] = prevCommit;\n\t\t\t\t\t\t\t\temptyLines--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (cleaf == null || emptyLines <= 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tprevCommit = ancestor;\n\t\t\t\tprevLeaf = cleaf;\n\t\t\t}\n\t\t\tfor (int n=0; n<lines.Length; n++)\n\t\t\t\tif (lines [n] == null)\n\t\t\t\t\tlines [n] = prevAncestor;\n\t\t\treturn lines;\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region --> Diffing commits\n\n\n\t\t/// <summary>\n\t\t/// Compare reference commit against compared commit. You may pass in a null commit (i.e. for getting the changes of the first commit)\n\t\t/// </summary>\n\t\t/// <param name=\"reference\">Usually the more recent commit</param>\n\t\t/// <param name=\"compared\">Usually an ancestor of the reference commit</param>\n\t\t/// <returns>a list of changes (<see cref=\"Change\"/>)</returns>\n\t\tpublic static IEnumerable<Change> CompareCommits(Commit reference, Commit compared)\n\t\t{\n\t\t\tvar changes = new List<Change>();\n\t\t\tif (reference == null && compared == null)\n\t\t\t\treturn changes;\n\t\t\tvar repo = (reference ?? compared).Repository;\n\t\t\tvar ref_tree = (reference != null ? reference.Tree._id : ObjectId.ZeroId);\n\t\t\tvar compared_tree = (compared != null ? compared.Tree._id : ObjectId.ZeroId);\n\t\t\tvar db = repo._internal_repo;\n\t\t\tvar walk = new TreeWalk(db);\n\t\t\tif (reference == null || compared == null)\n\t\t\t\twalk.reset((reference ?? compared).Tree._id);\n\t\t\telse\n\t\t\t\twalk.reset(new GitSharp.Core.AnyObjectId[] {ref_tree, compared_tree});\n\t\t\twalk.Recursive = true;\n\t\t\twalk.setFilter(AndTreeFilter.create(TreeFilter.ANY_DIFF, TreeFilter.ALL));\n\n\t\t\treturn CalculateCommitDiff(repo, walk, new[] { reference, compared });\n\t\t}\n\n\t\t/// <summary>\n\t\t/// compare the given commits and return the changes.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\"></param>\n\t\t/// <param name=\"walk\"></param>\n\t\t/// <param name=\"commits\">first commit in the array is the commit that is compared against the others which are his ancestors (i.e. from different branches)</param>\n\t\t/// <returns></returns>\n\t\tprivate static IEnumerable<Change> CalculateCommitDiff(Repository repo, TreeWalk walk, Commit[] commits)\n\t\t{\n\t\t\twhile (walk.next())\n\t\t\t{\n\t\t\t\tint m0 = walk.getRawMode(0);\n\t\t\t\tif (walk.getTreeCount() == 2)\n\t\t\t\t{\n\t\t\t\t\tint m1 = walk.getRawMode(1);\n\t\t\t\t\tvar change = new Change\n\t\t\t\t\t{\n\t\t\t\t\t\tReferenceCommit = commits[0],\n\t\t\t\t\t\tComparedCommit = commits[1],\n\t\t\t\t\t\tReferencePermissions = walk.getFileMode(0).Bits,\n\t\t\t\t\t\tComparedPermissions = walk.getFileMode(1).Bits,\n\t\t\t\t\t\tName = walk.getNameString(),\n\t\t\t\t\t\tPath = walk.getPathString(),\n\t\t\t\t\t};\n\t\t\t\t\tif (m0 != 0 && m1 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Added;\n\t\t\t\t\t\tchange.ComparedObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t}\n\t\t\t\t\telse if (m0 == 0 && m1 != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Deleted;\n\t\t\t\t\t\tchange.ReferenceObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t}\n\t\t\t\t\telse if (m0 != m1 && walk.idEqual(0, 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.TypeChanged;\n\t\t\t\t\t\tchange.ReferenceObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t\tchange.ComparedObject = Wrap(repo, walk.getObjectId(1));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Modified;\n\t\t\t\t\t\tchange.ReferenceObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t\tchange.ComparedObject = Wrap(repo, walk.getObjectId(1));\n\t\t\t\t\t}\n\t\t\t\t\tyield return change;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar raw_modes = new int[walk.getTreeCount()-1];\n\t\t\t\t\tfor(int i = 0;i<walk.getTreeCount()-1; i++)\n\t\t\t\t\t\traw_modes[i] = walk.getRawMode(i+1);\n\t\t\t\t\tvar change = new Change\n\t\t\t\t\t{\n\t\t\t\t\t\tReferenceCommit = commits[0],\n\t\t\t\t\t\t//ComparedCommit = compared,\n\t\t\t\t\t\tName = walk.getNameString(),\n\t\t\t\t\t\tPath = walk.getPathString(),\n\t\t\t\t\t};\n\t\t\t\t\tif (m0 != 0 && raw_modes.All(m1 => m1 == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Added;\n\t\t\t\t\t\tchange.ComparedObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t\tyield return change;\n\t\t\t\t\t}\n\t\t\t\t\telse if (m0 == 0 && raw_modes.Any(m1 => m1 != 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Deleted;\n\t\t\t\t\t\tyield return change;\n\t\t\t\t\t}\n\t\t\t\t\telse if (raw_modes.Select((m1, i) => new { Mode = m1, Index = i + 1 }).All(x => !walk.idEqual(0, x.Index))) // TODO: not sure if this condition suffices in some special cases.\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.Modified;\n\t\t\t\t\t\tchange.ReferenceObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t\tyield return change;\n\t\t\t\t\t}\n\t\t\t\t\telse if (raw_modes.Select((m1, i) => new { Mode = m1, Index = i + 1 }).Any(x => m0 != x.Mode && walk.idEqual(0, x.Index)))\n\t\t\t\t\t{\n\t\t\t\t\t\tchange.ChangeType = ChangeType.TypeChanged;\n\t\t\t\t\t\tchange.ReferenceObject = Wrap(repo, walk.getObjectId(0));\n\t\t\t\t\t\tyield return change;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compares this commit against another one and returns all changes between the two.\n\t\t/// </summary>\n\t\t/// <param name=\"other\"></param>\n\t\t/// <returns></returns>\n\t\tpublic IEnumerable<Change> CompareAgainst(Commit other)\n\t\t{\n\t\t\treturn CompareCommits(this, other);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the changes of this commit vs. it's parent commit(s). Works for the first commit too.\n\t\t/// </summary>\n\t\tpublic IEnumerable<Change> Changes\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (this.Parents.Count() == 0)\n\t\t\t\t\treturn CompareCommits(this, null);\n\t\t\t\telse\n\t\t\t\t\treturn CompareAgainstParents();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compare a commit against (one or multiple) parents (merge scenario)\n\t\t/// </summary>\n\t\t/// <returns>Changes of the commit</returns>\n\t\tprivate IEnumerable<Change> CompareAgainstParents()\n\t\t{\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tvar tree_ids = new[] { this }.Concat(Parents).Select(c => c.Tree._id).ToArray();\n\t\t\tvar walk = new TreeWalk(db);\n\t\t\twalk.reset(tree_ids);\n\t\t\twalk.Recursive = true;\n\t\t\twalk.setFilter(AndTreeFilter.create(TreeFilter.ANY_DIFF, TreeFilter.ALL));\n\n\t\t\treturn CalculateCommitDiff(_repo, walk, new[] { this }.Concat(Parents).ToArray());\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region --> Committing\n\n\n\t\tpublic static Commit Create(string message, Commit parent, Tree tree)\n\t\t{\n\t\t\tif (tree == null)\n\t\t\t\tthrow new ArgumentException(\"tree must not be null\");\n\t\t\tvar repo = tree.Repository;\n\t\t\tvar author = Author.GetDefaultAuthor(parent._repo);\n\t\t\treturn Create(message, parent, tree, author, author, DateTimeOffset.Now);\n\t\t}\n\n\t\tpublic static Commit Create(string message, Commit parent, Tree tree, Author author)\n\t\t{\n\t\t\treturn Create(message, parent, tree, author, author, DateTimeOffset.Now);\n\t\t}\n\n\t\tpublic static Commit Create(string message, Commit parent, Tree tree, Author author, Author committer, DateTimeOffset time)\n\t\t{\n\t\t\treturn Create(message, (parent == null ? new Commit[0] : new[] { parent }), tree, author, committer, time);\n\t\t}\n\n\t\tpublic static Commit Create(string message, IEnumerable<Commit> parents, Tree tree, Author author, Author committer, DateTimeOffset time)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(message))\n\t\t\t\tthrow new ArgumentException(\"message must not be null or empty\");\n\t\t\tif (tree == null)\n\t\t\t\tthrow new ArgumentException(\"tree must not be null\");\n\t\t\tvar repo = tree.Repository;\n\t\t\tvar corecommit = new Core.Commit(repo._internal_repo);\n\t\t\tif (parents != null)\n\t\t\t\tcorecommit.ParentIds = parents.Select(parent => parent._id).ToArray();\n\t\t\tcorecommit.Author = new Core.PersonIdent(author.Name, author.EmailAddress, time.ToMillisecondsSinceEpoch(), (int)time.Offset.TotalMinutes);\n\t\t\tcorecommit.Committer = new Core.PersonIdent(committer.Name, committer.EmailAddress, time.ToMillisecondsSinceEpoch(), (int)time.Offset.TotalMinutes);\n\t\t\tcorecommit.Message = message;\n\t\t\tcorecommit.TreeEntry = tree.InternalTree;\n\t\t\tcorecommit.Encoding = GetCommitEncoding(repo);\n\t\t\tcorecommit.Save();\n\t\t\treturn new Commit(repo, corecommit);\n\t\t}\n\n\t\tprivate static Encoding GetCommitEncoding(Repository repository)\n\t\t{\n\t\t\tstring encodingAlias = repository.Config[\"i18n.commitencoding\"];\n\t\t\tif (encodingAlias == null)\n\t\t\t{\n\t\t\t\t// No commitencoding has been specified in the config\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn Charset.forName(encodingAlias);\n\t\t}\n\n\n\t\t#endregion\n\n\t\tpublic static implicit operator Core.Commit(Commit c)\n\t\t{\n\t\t\treturn c.InternalCommit;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Commit[\" + ShortHash + \"]\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Config.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Diagnostics;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents repository-, user-, and global-configuration for git\n\t/// </summary>\n\tpublic class Config : IEnumerable<KeyValuePair<string, string>>\n\t{\n\t\tprivate Repository _repo;\n\n\t\tpublic Config(Repository repo)\n\t\t{\n\t\t\tDebug.Assert(repo != null);\n\t\t\t_repo = repo;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Direct config access via git style names (i.e. \"user.name\")\n\t\t/// </summary>\n\t\t/// <param name=\"key\"></param>\n\t\t/// <returns></returns>\n\t\tpublic string this[string key]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar config = _repo._internal_repo.Config;\n\t\t\t\tvar token = key.Split('.');\n\n\t\t\t\tif (token.Count() == 2)\n\t\t\t\t{\n\t\t\t\t\treturn config.getString(token[0], null, token[1]);\n\t\t\t\t}\n\n\t\t\t\tif (token.Count() == 3)\n\t\t\t\t{\n\t\t\t\t\treturn config.getString(token[0], token[1], token[2]);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tvar config = _repo._internal_repo.Config;\n\t\t\t\tvar token = key.Split('.');\n\t\t\t\tif (token.Count() == 2)\n\t\t\t\t\tconfig.setString(token[0], null, token[1], value);\n\t\t\t\telse if (token.Count() == 3)\n\t\t\t\t\tconfig.setString(token[0], token[1], token[2], value);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<string> Keys\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tforeach (var pair in this)\n\t\t\t\t\tyield return pair.Key;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<string> Values\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tforeach (var pair in this)\n\t\t\t\t\tyield return pair.Value;\n\t\t\t}\n\t\t}\n\n\t\t#region IEnumerable<KeyValuePair<string,string>> Members\n\n\t\tpublic IEnumerator<KeyValuePair<string, string>> GetEnumerator()\n\t\t{\n\t\t\tvar config = _repo._internal_repo.Config;\n\t\t\tconfig.getState();\n\t\t\tforeach (var entry in config._state.get().EntryList)\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(entry.name))\n\t\t\t\t\tcontinue;\n\t\t\t\tvar subsec = (entry.subsection != null ? \".\" + entry.subsection : \"\");\n\t\t\t\tyield return new KeyValuePair<string, string>(entry.section + subsec + \".\" + entry.name, entry.value);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEnumerable Members\n\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Saves the config to the file system.\n\t\t/// </summary>\n\t\tpublic void Persist()\n\t\t{\n\t\t\t_repo._internal_repo.Config.save();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Diff.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Diff;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// A Diff represents the line-based differences between two text sequences given as string or byte array as a list of Sections. The process of \n\t/// creating the diff might take a while for large files. \n\t/// <para/>\n\t/// Note: The underlying differencer operates on raw bytes.\n\t/// </summary>\n\tpublic class Diff : IEnumerable<Diff.Section>\n\t{\n\t\t/// <summary>\n\t\t/// Creates a line-based diff from the given texts. The strings are expected to be encoded in UTF8.\n\t\t/// </summary>\n\t\t/// <param name=\"a\"></param>\n\t\t/// <param name=\"b\"></param>\n\t\tpublic Diff(string a, string b)\n\t\t\t: this(Encoding.UTF8.GetBytes(a), Encoding.UTF8.GetBytes(b))\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates a line-based diff from the contents of the given blobs.\n\t\t/// </summary>\n\t\t/// <param name=\"a\"></param>\n\t\t/// <param name=\"b\"></param>\n\t\tpublic Diff(Blob a, Blob b)\n\t\t\t: this(a.RawData, b.RawData)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates a line-based diff from the the given byte arrays.\n\t\t/// </summary>\n\t\t/// <param name=\"a\"></param>\n\t\t/// <param name=\"b\"></param>\n\t\tpublic Diff(byte[] a, byte[] b)\n\t\t{\n\t\t\tm_sequence_a = new Text(a);\n\t\t\tm_sequence_b = new Text(b);\n\t\t\tvar diff = new MyersDiff((RawText)m_sequence_a, (RawText)m_sequence_b); // <--- using the undocumented cast operator of Text\n\t\t\tm_edits = diff.getEdits();\n\t\t}\n\n\t\tprivate readonly Text m_sequence_a;\n\t\tprivate readonly Text m_sequence_b;\n\n\t\tpublic bool HasDifferences\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (m_edits.Count == 0)\n\t\t\t\t\treturn false;\n\t\t\t\tif (m_edits.Count == 1 && m_edits[0].EditType == Edit.Type.EMPTY)\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the changed, unchanged and conflicting sections of this Diff.\n\t\t/// </summary>\n\t\tpublic IEnumerable<Section> Sections\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (m_edits.Count == 0)\n\t\t\t\t{\n\t\t\t\t\tif (m_sequence_a.RawLength == 0 && m_sequence_b.RawLength == 0) // <-- no content so return no sections\n\t\t\t\t\t\tyield break;\n\t\t\t\t\t// there is content but no edits so return a single unchanged section.\n\t\t\t\t\tyield return new Section(m_sequence_a, m_sequence_b) { Status = SectionStatus.Unchanged, BeginA = 1, BeginB = 1, EndA = m_sequence_a.NumberOfLines + 1, EndB = m_sequence_b.NumberOfLines + 1 };\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t\tif (m_edits.Count == 1 && m_edits[0].EditType == Edit.Type.EMPTY)\n\t\t\t\t\tyield break;\n\t\t\t\tif (m_edits[0].BeginA > 0 || m_edits[0].BeginB > 0) // <-- see if there is an unchanged section before the first edit\n\t\t\t\t\tyield return new Section(m_sequence_a, m_sequence_b) { Status = SectionStatus.Unchanged, BeginA = 1, BeginB = 1, EndA = m_edits[0].BeginA + 1, EndB = m_edits[0].BeginB + 1 };\n\t\t\t\tint index = 0;\n\t\t\t\tEdit edit = null;\n\t\t\t\tforeach (var e in m_edits)\n\t\t\t\t{\n\t\t\t\t\tedit = e;\n\t\t\t\t\tif (edit.EditType == Edit.Type.EMPTY)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tyield return new Section(m_sequence_a, m_sequence_b, edit);\n\t\t\t\t\tif (index + 1 >= m_edits.Count)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvar next_edit = m_edits[index + 1];\n\t\t\t\t\tif (next_edit.BeginA > edit.EndA || next_edit.BeginB > edit.EndB) // <-- see if there is an unchanged text block between the edits \n\t\t\t\t\t\tyield return new Section(m_sequence_a, m_sequence_b, edit) { Status = SectionStatus.Unchanged, BeginA = edit.EndA + 1, BeginB = edit.EndB + 1, EndA = next_edit.BeginA + 1, EndB = next_edit.BeginB + 1 };\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t\tif (edit == null)\n\t\t\t\t\tyield break;\n\t\t\t\tif (edit.EndA < m_sequence_a.NumberOfLines || edit.EndB < m_sequence_b.NumberOfLines) // <-- see if there is an unchanged section at the end\n\t\t\t\t\tyield return new Section(m_sequence_a, m_sequence_b) { Status = SectionStatus.Unchanged, BeginA = edit.EndA + 1, BeginB = edit.EndB + 1, EndA = m_sequence_a.NumberOfLines + 1, EndB = m_sequence_b.NumberOfLines + 1 };\n\t\t\t}\n\t\t}\n\n\t\tprivate readonly EditList m_edits;\n\n\t\tpublic enum SectionStatus { Unchanged, Different, Conflicting }\n\n\t\tpublic enum EditType { Unchanged, Inserted, Deleted, Replaced }\n\n\t\t#region --> Implementation of IEnumerable\n\n\t\t/// <summary>\n\t\t/// Returns an enumerator that iterates through the collection.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n\t\t/// </returns>\n\t\t/// <filterpriority>1</filterpriority>\n\t\tpublic IEnumerator<Section> GetEnumerator()\n\t\t{\n\t\t\treturn Sections.GetEnumerator();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns an enumerator that iterates through a collection.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n\t\t/// </returns>\n\t\t/// <filterpriority>2</filterpriority>\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region --> class Diff Section\n\n\n\t\t/// <summary>\n\t\t/// Section represents a block of text that is unchanged in two text sequences, a corresponding edit in two text sequences (two-way diff)  or a conflict (three-way diff).\n\t\t/// </summary>\n\t\tpublic class Section\n\t\t{\n\t\t\tpublic Section(Text a, Text b)\n\t\t\t{\n\t\t\t\tm_sequence_a = a;\n\t\t\t\tm_sequence_b = b;\n\t\t\t}\n\n\t\t\tprivate readonly Text m_sequence_a;\n\t\t\tprivate readonly Text m_sequence_b;\n\n\t\t\tinternal Section(Text a, Text b, Edit edit)\n\t\t\t\t: this(a, b)\n\t\t\t{\n\t\t\t\tStatus = SectionStatus.Different;\n\t\t\t\tBeginA = edit.BeginA + 1;\n\t\t\t\tEndA = edit.EndA + 1;\n\t\t\t\tBeginB = edit.BeginB + 1;\n\t\t\t\tEndB = edit.EndB + 1;\n\t\t\t}\n\n\t\t\tpublic byte[] RawTextA\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn m_sequence_a.GetRawBlock(BeginA, EndA);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic byte[] RawTextB\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn m_sequence_b.GetRawBlock(BeginB, EndB);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic string TextA\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn m_sequence_a.GetBlock(BeginA, EndA);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic string TextB\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn m_sequence_b.GetBlock(BeginB, EndB);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Line index (1-based) of the begin of the block A. The block starts exactly at the beginning of the spedified line.\n\t\t\t/// </summary>\n\t\t\tpublic int BeginA\n\t\t\t{\n\t\t\t\tget;\n\t\t\t\tinternal set;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Line index (1-based) of the begin of the block B. The block starts exactly at the beginning of the spedified line.\n\t\t\t/// </summary>\n\t\t\tpublic int BeginB\n\t\t\t{\n\t\t\t\tget;\n\t\t\t\tinternal set;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Line index (1-based) of the end of the block A. The block ends exactly at the beginning of the specified line.\n\t\t\t/// </summary>\n\t\t\tpublic int EndA\n\t\t\t{\n\t\t\t\tget;\n\t\t\t\tinternal set;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Line index (1-based) of the end of the block B. The block ends exactly at the beginning of the specified line.\n\t\t\t/// </summary>\n\t\t\tpublic int EndB\n\t\t\t{\n\t\t\t\tget;\n\t\t\t\tinternal set;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Status of the diff section. Values may be Unchanged, Different and Conflicting\n\t\t\t/// </summary>\n\t\t\tpublic SectionStatus Status\n\t\t\t{\n\t\t\t\tget;\n\t\t\t\tinternal set;\n\t\t\t}\n\n\t\t\tpublic EditType EditWithRespectToA\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tif (Status == SectionStatus.Unchanged)\n\t\t\t\t\t\treturn EditType.Unchanged;\n\t\t\t\t\tif (BeginB == EndB && BeginA != EndA)\n\t\t\t\t\t\treturn EditType.Deleted;\n\t\t\t\t\tif (BeginA == EndA && BeginB != EndB)\n\t\t\t\t\t\treturn EditType.Inserted;\n\t\t\t\t\treturn EditType.Replaced;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic EditType EditWithRespectToB\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tif (Status == SectionStatus.Unchanged)\n\t\t\t\t\t\treturn EditType.Unchanged;\n\t\t\t\t\tif (BeginB == EndB && BeginA != EndA)\n\t\t\t\t\t\treturn EditType.Inserted;\n\t\t\t\t\tif (BeginA == EndA && BeginB != EndB)\n\t\t\t\t\t\treturn EditType.Deleted;\n\t\t\t\t\treturn EditType.Replaced;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region --> Binary file detection\n\n\t\tconst int SCAN_RANGE = 4000;\n\n\t\t/// <summary>\n\t\t/// Returns true if the given file seems to be a binary file. The heuristic used is similar to that of diff on unix: it looks for 0 bytes. Of course this classifies Unicode files as binaries too.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">path to the file to check (absolute or relative to the current directory)</param>\n\t\t/// <returns>True if the file seems to be binary, false if it seems to be text and null if no decision can't be made</returns>\n\t\tpublic static bool? IsBinary(string path)\n\t\t{\n\t\t\tvar f = new FileInfo(path);\n\t\t\tif (!f.Exists)\n\t\t\t\tthrow new IOException(\"File does not exist: \" + path);\n\t\t\tusing (var stream = f.OpenRead())\n\t\t\t{\n\t\t\t\treturn IsBinary(stream);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool? IsBinary(byte[] data)\n\t\t{\n\t\t\tusing (var stream = new MemoryStream(data))\n\t\t\t{\n\t\t\t\treturn IsBinary(stream);\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool? IsBinary(Stream stream)\n\t\t{\n\t\t\tint null_count = 0;\n\t\t\tlong length = stream.Length;\n\t\t\tfor (int i = 0; i < Math.Min(length, SCAN_RANGE); i++)\n\t\t\t{\n\t\t\t\tvar b = stream.ReadByte();\n\t\t\t\tif (b == 0)\n\t\t\t\t\tnull_count++;\n\t\t\t}\n\t\t\treturn null_count > 0;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Examples.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/// This classes are used to check if the example code for the \n/// site http://www.eqqon.com/index.php/GitSharp/Examples compile\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Commands;\n\nnamespace GitSharp\n{\n\tinternal class Manipulating_git_objects\n\t{\n\t\tRepository repo;\n\n\t\tpublic void Repository()\n\t\t{\n\n\t\t\t//Opening an existing git repository\n\t\t\trepo = new Repository(\"path/to/repo\");\n\n\t\t\t// Now suppose you have created some new files and want to commit them\n\t\t\trepo.Index.Add(\"README\", \"License.txt\");\n\t\t\tCommit commit = repo.Commit(\"My first commit with gitsharp\", new Author(\"henon\", \"meinrad.recheis@gmail.com\"));\n\n\t\t\t// Easy, isn't it? Now let's have a look at the changes of this commit:\n\t\t\tforeach (Change change in commit.Changes)\n\t\t\t\tConsole.WriteLine(change.Name + \" \" + change.ChangeType);\n\n\t\t\t//Get the staged changes from the index\n\t\t\trepo.Status.Added.Contains(\"README\");\n\n\t\t\t//Access and manipulate the configuration\n\t\t\trepo.Config[\"core.autocrlf\"] = \"false\";\n\t\t}\n\n\t\tpublic void Commit()\n\t\t{\n\n\t\t\t// Get the message of the previous commit\n\t\t\tstring msg = new Commit(repo, \"HEAD^\").Message;\n\t\t\tDebug.Assert(msg == repo.CurrentBranch.CurrentCommit.Parent.Message);\n\n\t\t\t//Print a list of changes between two commits c1 and c2:\n\t\t\tCommit c1 = repo.Get<Commit>( \"979829389f136bfabb5956c68d909e7bf3092a4e\"); // <-- note: short hashes are not yet supported\n\t\t\tCommit c2 = new Commit(repo, \"4a7455c2f23e0f7356877d1813594041c56e2db9\");\n\t\t\tforeach (Change change in c1.CompareAgainst(c2))\n\t\t\t\tConsole.WriteLine(change.ChangeType + \": \" + change.Path);\n\n\t\t\t//Print all previous commits of HEAD of the repository repo\n\t\t\tforeach (Commit commit in repo.Head.CurrentCommit.Ancestors)\n\t\t\t\tConsole.WriteLine(commit.ShortHash + \": \" + commit.Message + \", \" + commit.Author.Name + \", \" + commit.AuthorDate);\n\t\t}\n\n\t\tpublic void Tree_and_Leaf()\n\t\t{\n\n\t\t\t//Get the root tree of the most recent commit\n\t\t\tvar tree = repo.Head.CurrentCommit.Tree;\n\n\t\t\t//It has no Parent so IsRoot should be true\n\t\t\tDebug.Assert(tree.Parent == null);\n\t\t\tDebug.Assert(tree.IsRoot);\n\n\t\t\t//Now you can browse throught that tree by iterating over its child trees\n\t\t\tforeach (Tree subtree in tree.Trees)\n\t\t\t\tConsole.WriteLine(subtree.Path);\n\n\t\t\t//Or printing the names of the files it contains\n\t\t\tforeach (Leaf leaf in tree.Leaves)\n\t\t\t\tConsole.WriteLine(leaf.Path);\n\t\t}\n\n\t\tpublic void Blob()\n\t\t{\n\n\t\t\t//A Leaf is a Blob and inherits from it a method to retrieve the data as a UTF8 encoded string:\n\t\t\tstring string_data = new Blob(repo, \"49322bb17d3acc9146f98c97d078513228bbf3c0\").Data;\n\n\t\t\t// Blob also let's you access the raw data as byte array\n\t\t\tbyte[] byte_data = new Blob(repo, \"49322bb17d3acc9146f98c97d078513228bbf3c0\").RawData;\n\t\t}\n\n\t\tpublic void Branch()\n\t\t{\n\n\t\t\t//Get the current branch\n\t\t\tvar branch = repo.CurrentBranch;\n\t\t\tConsole.WriteLine(\"Current branch is \" + branch.Name);\n\n\t\t\t//Another way to get the current branch\n\t\t\tBranch head = repo.Head;\n\n\t\t\t// check if head == master\n\t\t\tDebug.Assert(head.Name == \"master\");\n\n\t\t\t//Get master branch\n\t\t\tvar master = new Branch(repo, \"master\");\n\t\t\tDebug.Assert(master == repo.Get<Branch>(\"master\"));\n\n\t\t\t//Get the abbreviated hash of the last commit on master\n\t\t\tConsole.WriteLine(master.CurrentCommit.ShortHash);\n\n\t\t\t//Create a new branch\n\t\t\tvar b = GitSharp.Branch.Create(repo, \"foo\");\n\n\t\t\t// Switching to our new branch\n\t\t\tb.Checkout();\n\n\t\t\t//Check if foo is current branch\n\t\t\tDebug.Assert(b.IsCurrent);\n\n\t\t\t//Reset the branch to a previous commit (hard or soft or mixed)\n\t\t\tmaster.Reset(\"HEAD^\", ResetBehavior.Hard);\n\t\t\tmaster.Reset(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", ResetBehavior.Soft);\n\t\t\tmaster.Reset(\"master\", ResetBehavior.Mixed);\n\t\t}\n\t}\n\n\tinternal class Using_git_commands\n\t{\n\t\tpublic void Init()\n\t\t{\n\n\t\t\t//Initializing a new repository in the current directory (if GID_DIR environment variable is not set)\n\t\t\tGit.Init(\".\");\n\n\t\t\t//Initializing a new repository in the specified location\n\t\t\tGit.Init(\"path/to/repo\");\n\n\t\t\t//Initializing a new repository with options\n\t\t\tvar cmd = new InitCommand { GitDirectory =\"path/to/repo\", Quiet = false, Bare = true };\n\t\t\tcmd.Execute();\n\t\t}\n\n\t\tpublic void Clone()\n\t\t{\n\n\t\t\t//Clone a repository from a public repository via http\n\t\t\tGit.Clone(\"git://github.com/henon/GitSharp.git\", \"path/to/local/copy\");\n\n\t\t\t// Or using options\n\t\t\tGit.Clone(new CloneCommand { Source = \"git://github.com/henon/GitSharp.git\", GitDirectory = \"path/to/local/copy\", Quiet = false, Bare = true });\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Git.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Reflection;\nusing GitSharp.Commands;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// The static class Git provides everything to interact with git itself, such as the command line interface commands, the git configuration or properties that are affecting git globally.\n\t/// </summary>\n\tpublic static class Git\n\t{\n\n\t\t#region Version\n\n\n\t\t/// <summary>\n\t\t/// Returns the version of GitSharp.\n\t\t/// </summary>\n\t\tpublic static string Version\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tAssembly assembly = Assembly.Load(\"GitSharp\");\n\n\t\t\t\tVersion version = assembly.GetName().Version;\n\t\t\t\tif (version == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tobject[] attributes = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);\n\t\t\t\tif (attributes.Length == 0)\n\t\t\t\t{\n\t\t\t\t\t// No AssemblyProduct attribute to parse, no commit hash to extract\n\t\t\t\t\treturn version.ToString();\n\t\t\t\t}\n\n\t\t\t\tstring commitHash = ExtractCommitHashFrom(((AssemblyProductAttribute)attributes[0]).Product);\n\t\t\t\treturn string.Format(\"{0}.{1}.{2}.{3}\", version.Major, version.Minor, version.Build, commitHash);\n\t\t\t}\n\t\t}\n\n\t\tprivate static string ExtractCommitHashFrom(string product)\n\t\t{\n\t\t\t// TODO: Maybe should we switch to a regEx capture ?\n\t\t\tstring[] parts = product.Split(new[] { '[' });\n\t\t\treturn parts[1].TrimEnd(']');\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region Defaults for git commands\n\n\n\t\t/// <summary>\n\t\t/// Get or set the default output stream that all git commands are writing to. Per default this returns a StreamWriter wrapping the standard output stream.\n\t\t/// By setting your own Streamwriter one can capture the output of the commands.\n\t\t/// </summary>\n\t\tpublic static StreamWriter DefaultOutputStream\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_output == null)\n\t\t\t\t{\n\t\t\t\t\t_output = new StreamWriter(Console.OpenStandardOutput());\n\t\t\t\t\tConsole.SetOut(_output);\n\t\t\t\t}\n\t\t\t\treturn _output;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_output = value;\n\t\t\t}\n\t\t}\n\t\tprivate static StreamWriter _output;\n\n\t\t/// <summary>\n\t\t/// Get or set the default git repository for all commands. A command can override this by\n\t\t/// setting it's own Repository property.\n\t\t/// \n\t\t/// Note: Init and Clone do not respect Repository since they create a Repository as a result of Execute.\n\t\t/// </summary>\n\t\tpublic static Repository DefaultRepository { get; set; }\n\n\t\t/// <summary>\n\t\t/// Get or set the default git directory for all commands. A command can override this, however, \n\t\t/// by setting its own GitDirectory property.\n\t\t/// </summary>\n\t\tpublic static string DefaultGitDirectory { get; set; }\n\n\n\t\t#endregion\n\n\t\t#region Clone\n\n\t\t/// <summary>\n\t\t/// Clone a repository and checkout the working directory.\n\t\t/// </summary>\n\t\t/// <param name=\"fromUrl\"></param>\n\t\t/// <param name=\"toPath\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static Repository Clone(string fromUrl, string toPath)\n\t\t{\n\t\t\tbool bare = false;\n\t\t\treturn Clone(fromUrl, toPath, bare);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Clone a repository and checkout the working directory only if bare == false\n\t\t/// </summary>\n\t\t/// <param name=\"fromUrl\"></param>\n\t\t/// <param name=\"toPath\"></param>\n\t\t/// <param name=\"bare\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static Repository Clone(string fromUrl, string toPath, bool bare)\n\t\t{\n\t\t\tCloneCommand cmd = new CloneCommand()\n\t\t\t{\n\t\t\t\tSource = fromUrl,\n\t\t\t\tDirectory = toPath,\n\t\t\t\tBare = bare,\n\t\t\t};\n\t\t\treturn Clone(cmd);\n\t\t}\n\n\t\tpublic static Repository Clone(CloneCommand command)\n\t\t{\n\t\t\tcommand.Execute();\n\t\t\treturn command.Repository;\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region Init\n\n\n\t\tpublic static void Init(string path)\n\t\t{\n\t\t\tRepository.Init(path);\n\t\t}\n\n\t\tpublic static void Init(string path, bool bare)\n\t\t{\n\t\t\tRepository.Init(path, bare);\n\t\t}\n\n\t\tpublic static void Init(InitCommand command)\n\t\t{\n\t\t\tcommand.Execute();\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region Merge\n\n\n\t\tpublic static MergeResult Merge(MergeOptions options)\n\t\t{\n\t\t\treturn MergeCommand.Execute(options);\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region Status\n\n\t\tpublic static StatusResults Status(StatusCommand command)\n\t\t{\n\t\t\t//Populate the command with the status results\n\t\t\tcommand.Execute();\n\t\t\treturn command.Results;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/GitSharp.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{7311850F-619A-4241-B09F-157792C75FBA}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>GitSharp</RootNamespace>\n    <AssemblyName>GitSharp</AssemblyName>\n    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>http://localhost/GitSharp/</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Web</InstallFrom>\n    <UpdateEnabled>true</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>true</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\build\\mono-2.0-debug\\bin</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Debug\\GitSharp.XML</DocumentationFile>\n    <NoWarn>1591</NoWarn>\n    <CustomCommands>\n      <CustomCommands>\n        <Command type=\"BeforeBuild\" command=\"nant -D:project.sources.path=${ProjectDir} init create-assembly-info\" workingdir=\"${SolutionDir}\" externalConsole=\"true\" />\n        <Command type=\"AfterBuild\" command=\"nant -D:project.sources.path=${ProjectDir} init cleanup-assembly-info\" workingdir=\"${SolutionDir}\" externalConsole=\"true\" />\n      </CustomCommands>\n    </CustomCommands>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\build\\mono-2.0-release\\bin</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Tamir.SharpSSH, Version=1.1.1.13, Culture=neutral, PublicKeyToken=null\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\lib\\Tamir.SharpSSH.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Commands\\AbstractFetchCommand.cs\" />\n    <Compile Include=\"Author.cs\" />\n    <Compile Include=\"Commands\\AbstractCommand.cs\" />\n    <Compile Include=\"Blob.cs\" />\n    <Compile Include=\"Branch.cs\" />\n    <Compile Include=\"Change.cs\" />\n    <Compile Include=\"Stubs\\AddCommand.cs\" />\n    <Compile Include=\"Stubs\\AmCommand.cs\" />\n    <Compile Include=\"Stubs\\AnnotateCommand.cs\" />\n    <Compile Include=\"Stubs\\ApplyCommand.cs\" />\n    <Compile Include=\"Stubs\\ArchiveCommand.cs\" />\n    <Compile Include=\"Stubs\\BlameCommand.cs\" />\n    <Compile Include=\"Stubs\\BranchCommand.cs\" />\n    <Compile Include=\"Stubs\\CatFileCommand.cs\" />\n    <Compile Include=\"Stubs\\CheckoutCommand.cs\" />\n    <Compile Include=\"Stubs\\CheckoutIndexCommand.cs\" />\n    <Compile Include=\"Stubs\\CherryCommand.cs\" />\n    <Compile Include=\"Stubs\\CherryPickCommand.cs\" />\n    <Compile Include=\"Stubs\\CleanCommand.cs\" />\n    <Compile Include=\"Commands\\CloneCommand.cs\" />\n    <Compile Include=\"Stubs\\CommitCommand.cs\" />\n    <Compile Include=\"Stubs\\CommitTreeCommand.cs\" />\n    <Compile Include=\"Stubs\\CountObjectsCommand.cs\" />\n    <Compile Include=\"Stubs\\DescribeCommand.cs\" />\n    <Compile Include=\"Stubs\\DiffCommand.cs\" />\n    <Compile Include=\"Stubs\\DiffFilesCommand.cs\" />\n    <Compile Include=\"Stubs\\DiffIndexCommand.cs\" />\n    <Compile Include=\"Stubs\\DifftoolCommand.cs\" />\n    <Compile Include=\"Stubs\\DiffTreeCommand.cs\" />\n    <Compile Include=\"Stubs\\FastExportCommand.cs\" />\n    <Compile Include=\"Stubs\\FastImportCommand.cs\" />\n    <Compile Include=\"Stubs\\FilterBranchCommand.cs\" />\n    <Compile Include=\"Stubs\\ForEachRefCommand.cs\" />\n    <Compile Include=\"Stubs\\FormatPatchCommand.cs\" />\n    <Compile Include=\"Stubs\\FsckCommand.cs\" />\n    <Compile Include=\"Stubs\\GcCommand.cs\" />\n    <Compile Include=\"Stubs\\GrepCommand.cs\" />\n    <Compile Include=\"Stubs\\HashObjectCommand.cs\" />\n    <Compile Include=\"Stubs\\IndexPackCommand.cs\" />\n    <Compile Include=\"Stubs\\LsFilesCommand.cs\" />\n    <Compile Include=\"Stubs\\LsRemoteCommand.cs\" />\n    <Compile Include=\"Stubs\\LsTreeCommand.cs\" />\n    <Compile Include=\"Stubs\\MailinfoCommand.cs\" />\n    <Compile Include=\"Stubs\\MailsplitCommand.cs\" />\n    <Compile Include=\"Stubs\\MergeBaseCommand.cs\" />\n    <Compile Include=\"Commands\\MergeCommand.cs\" />\n    <Compile Include=\"Stubs\\MergeFileCommand.cs\" />\n    <Compile Include=\"Stubs\\MergeIndexCommand.cs\" />\n    <Compile Include=\"Stubs\\MergetoolCommand.cs\" />\n    <Compile Include=\"Stubs\\MktreeCommand.cs\" />\n    <Compile Include=\"Stubs\\MvCommand.cs\" />\n    <Compile Include=\"Stubs\\NameRevCommand.cs\" />\n    <Compile Include=\"Stubs\\NotesCommand.cs\" />\n    <Compile Include=\"Stubs\\PackObjectsCommand.cs\" />\n    <Compile Include=\"Stubs\\PackRedundantCommand.cs\" />\n    <Compile Include=\"Stubs\\PackRefsCommand.cs\" />\n    <Compile Include=\"Stubs\\PatchIdCommand.cs\" />\n    <Compile Include=\"Stubs\\PeekRemoteCommand.cs\" />\n    <Compile Include=\"Stubs\\PruneCommand.cs\" />\n    <Compile Include=\"Stubs\\PrunePackedCommand.cs\" />\n    <Compile Include=\"Stubs\\QuiltimportCommand.cs\" />\n    <Compile Include=\"Stubs\\ReadTreeCommand.cs\" />\n    <Compile Include=\"Stubs\\RebaseCommand.cs\" />\n    <Compile Include=\"Stubs\\ReceivePackCommand.cs\" />\n    <Compile Include=\"Stubs\\ReflogCommand.cs\" />\n    <Compile Include=\"Stubs\\RelinkCommand.cs\" />\n    <Compile Include=\"Stubs\\RemoteCommand.cs\" />\n    <Compile Include=\"Stubs\\RepackCommand.cs\" />\n    <Compile Include=\"Stubs\\ReplaceCommand.cs\" />\n    <Compile Include=\"Stubs\\RequestPullCommand.cs\" />\n    <Compile Include=\"Stubs\\ResetCommand.cs\" />\n    <Compile Include=\"Stubs\\RevertCommand.cs\" />\n    <Compile Include=\"Stubs\\RevParseCommand.cs\" />\n    <Compile Include=\"Stubs\\RmCommand.cs\" />\n    <Compile Include=\"Stubs\\SendPackCommand.cs\" />\n    <Compile Include=\"Stubs\\ShortlogCommand.cs\" />\n    <Compile Include=\"Stubs\\ShowBranchCommand.cs\" />\n    <Compile Include=\"Stubs\\ShowCommand.cs\" />\n    <Compile Include=\"Stubs\\ShowRefCommand.cs\" />\n    <Compile Include=\"Stubs\\StripspaceCommand.cs\" />\n    <Compile Include=\"Stubs\\SubmoduleCommand.cs\" />\n    <Compile Include=\"Stubs\\SvnCommand.cs\" />\n    <Compile Include=\"Stubs\\SymbolicRefCommand.cs\" />\n    <Compile Include=\"Stubs\\TagCommand.cs\" />\n    <Compile Include=\"Stubs\\TarTreeCommand.cs\" />\n    <Compile Include=\"Stubs\\UnpackFileCommand.cs\" />\n    <Compile Include=\"Stubs\\UnpackObjectsCommand.cs\" />\n    <Compile Include=\"Stubs\\UpdateIndexCommand.cs\" />\n    <Compile Include=\"Stubs\\UpdateServerInfoCommand.cs\" />\n    <Compile Include=\"Stubs\\UploadArchiveCommand.cs\" />\n    <Compile Include=\"Stubs\\UploadPackCommand.cs\" />\n    <Compile Include=\"Stubs\\VarCommand.cs\" />\n    <Compile Include=\"Stubs\\VerifyPackCommand.cs\" />\n    <Compile Include=\"Stubs\\VerifyTagCommand.cs\" />\n    <Compile Include=\"Stubs\\WhatchangedCommand.cs\" />\n    <Compile Include=\"Config.cs\" />\n    <Compile Include=\"Stubs\\ConfigCommand.cs\" />\n    <Compile Include=\"Commands\\FetchCommand.cs\" />\n    <Compile Include=\"Commands\\IGitCommand.cs\" />\n    <Compile Include=\"Commit.cs\" />\n    <Compile Include=\"AbstractObject.cs\" />\n    <Compile Include=\"Stubs\\FetchPackCommand.cs\" />\n    <Compile Include=\"Diff.cs\" />\n    <Compile Include=\"Examples.cs\" />\n    <Compile Include=\"IgnoreRules.cs\" />\n    <Compile Include=\"Index.cs\" />\n    <Compile Include=\"Commands\\InitCommand.cs\" />\n    <Compile Include=\"IReferenceObject.cs\" />\n    <Compile Include=\"AbstractTreeNode.cs\" />\n    <Compile Include=\"Leaf.cs\" />\n    <Compile Include=\"Git.cs\" />\n    <Compile Include=\"Commands\\PushCommand.cs\" />\n    <Compile Include=\"Commands\\LogCommand.cs\" />\n    <Compile Include=\"Ref.cs\" />\n    <Compile Include=\"Repository.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"ResetBehavior.cs\" />\n    <Compile Include=\"Commands\\StatusCommand.cs\" />\n    <Compile Include=\"Tag.cs\" />\n    <Compile Include=\"Text.cs\" />\n    <Compile Include=\"Tree.cs\" />\n    <Compile Include=\"RepositoryStatus.cs\" />\n    <Compile Include=\"UserInfoProvider.cs\" />\n    <Compile Include=\"Remote.cs\" />\n    <Compile Include=\"Stash.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\GitSharp.Core\\GitSharp.Core.csproj\">\n      <Project>{C46EDD61-C202-465A-93F1-ADE20A83BB59}</Project>\n      <Name>GitSharp.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Commands\\_NotSupportedCommands.txt\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "GitSharp/IReferenceObject.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Interface for objects like Ref and Tag, which point to a different object.\n\t/// </summary>\n\tpublic interface IReferenceObject\n\t{\n\t\tstring Name { get; }\n\t\tAbstractObject Target { get; }\n\t}\n}\n"
  },
  {
    "path": "GitSharp/IgnoreRules.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Matt DeKrey <mattdekrey@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace GitSharp\n{\n\tpublic class IgnoreRules\n\t{\n\t\tprivate struct Rule\n\t\t{\n\t\t\tpublic Regex pattern;\n\t\t\tpublic bool exclude;\n\t\t\tpublic bool isDirectoryOnly;\n\t\t}\n\n\t\tprivate IEnumerable<Rule> rules;\n\n\t\tpublic IgnoreRules(string ignorePath)\n\t\t\t: this(File.ReadAllLines(ignorePath))\n\t\t{\n\n\t\t}\n\n\t\tpublic IgnoreRules(string[] lines)\n\t\t{\n\t\t\tList<Rule> rules = new List<Rule>();\n\t\t\tBuildRules(rules, lines);\n\n\t\t\tthis.rules = rules;\n\t\t}\n\n\t\tprivate void BuildRules(List<Rule> rules, string[] lines)\n\t\t{\n\t\t\tforeach (string line in lines)\n\t\t\t{\n\t\t\t\tstring workingLine = line.Trim();\n\t\t\t\tif (workingLine.StartsWith(\"#\") || workingLine.Length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tRule r;\n\t\t\t\tr.exclude = !workingLine.StartsWith(\"!\");\n\t\t\t\tif (!r.exclude)\n\t\t\t\t\tworkingLine = workingLine.Substring(1);\n\t\t\t\tr.isDirectoryOnly = !workingLine.Contains(\".\");\n\n\t\t\t\tconst string regexCharMatch = @\"[^/\\\\]\";\n\t\t\t\tStringBuilder pattern = new StringBuilder();\n\t\t\t\tint i = 0;\n\t\t\t\tif (workingLine[0] == '/')\n\t\t\t\t{\n\t\t\t\t\tpattern.Append(\"^/\");\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpattern.Append(\"/\");\n\t\t\t\t}\n\t\t\t\tfor (; i < workingLine.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tswitch (workingLine[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase '?':\n\t\t\t\t\t\t\tpattern.Append(regexCharMatch).Append(\"?\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tpattern.Append(\"\\\\\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '*':\n\t\t\t\t\t\t\tpattern.Append(regexCharMatch).Append(\"*\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '[':\n\t\t\t\t\t\t\tfor (; i < workingLine.Length && workingLine[i] != ']'; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (i == 0 && workingLine[i] == '!')\n\t\t\t\t\t\t\t\t\tpattern.Append(\"^\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tpattern.Append(workingLine[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpattern.Append(workingLine[i]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '.':\n\t\t\t\t\t\t\tpattern.Append(\"\\\\.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tpattern.Append(workingLine[i]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!r.isDirectoryOnly)\n\t\t\t\t{\n\t\t\t\t\tpattern.Append(\"$\");\n\t\t\t\t}\n\t\t\t\tr.pattern = new System.Text.RegularExpressions.Regex(pattern.ToString());\n\t\t\t\trules.Add(r);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IgnoreDir(string workingDirectory, string fullDirectory)\n\t\t{\n\t\t\tstring path;\n\t\t\tworkingDirectory = workingDirectory.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\t\t\tpath = fullDirectory.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\n\t\t\tif (path.StartsWith(workingDirectory))\n\t\t\t{\n\t\t\t\tpath = path.Substring(workingDirectory.Length);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"fullDirectory must be a subdirectory of workingDirectory\", \"fullDirectory\", null);\n\t\t\t}\n\t\t\tstring dirPath = Path.GetDirectoryName(path).Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\n\t\t\tbool ignore = false;\n\t\t\tforeach (Rule rule in rules)\n\t\t\t{\n\t\t\t\tif (rule.exclude != ignore)\n\t\t\t\t{\n\t\t\t\t\tif (rule.isDirectoryOnly && rule.pattern.IsMatch(dirPath))\n\t\t\t\t\t\tignore = rule.exclude;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ignore;\n\t\t}\n\n\t\tpublic bool IgnoreFile(string workingDirectory, string filePath)\n\t\t{\n\t\t\tstring path;\n\t\t\tworkingDirectory = workingDirectory.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\t\t\tpath = filePath.Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\n\n\t\t\tif (path.StartsWith(workingDirectory))\n\t\t\t{\n\t\t\t\tpath = path.Substring(workingDirectory.Length);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"filePath must be a subpath of workingDirectory\", \"filePath\", null);\n\t\t\t}\n\t\t\tstring dirPath = Path.GetDirectoryName(path).Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/');\n\n\t\t\tbool ignore = false;\n\t\t\tforeach (Rule rule in rules)\n\t\t\t{\n\t\t\t\tif (rule.exclude != ignore)\n\t\t\t\t{\n\t\t\t\t\tif (!rule.isDirectoryOnly && rule.pattern.IsMatch(path))\n\t\t\t\t\t\tignore = rule.exclude;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ignore;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Index.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing CoreCommit = GitSharp.Core.Commit;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Represents the index of a git repository which keeps track of changes that are about to be committed.\n\t/// </summary>\n\tpublic class Index\n\t{\n\t\tprivate Repository _repo;\n\n\t\tpublic Index(Repository repo)\n\t\t{\n\t\t\t_repo = repo;\n\t\t\t//GitIndex.FilenameEncoding = repo.PreferredEncoding;\n\t\t\t//if (_repo.PreferredEncoding != Encoding.UTF8 && _repo.PreferredEncoding != Encoding.Default)\n\t\t\t//   GitIndex.FilenameEncoding = Encoding.Default;\n\t\t}\n\n\t\tstatic Index()\n\t\t{\n\t\t\tPathEncoding = Encoding.UTF8;\n\t\t\tContentEncoding = Encoding.UTF8;\n\t\t}\n\n\t\tinternal GitSharp.Core.GitIndex GitIndex\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _repo._internal_repo.Index;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Add all untracked files to the index and stage all changes (like git add .)\n\t\t/// </summary>\n\t\tpublic void AddAll()\n\t\t{\n\t\t\tAdd(_repo.WorkingDirectory);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds untracked files or directories to the index and writes the index to the disk (like \"git add\").\n\t\t/// For tracked files that were modified, it stages the modification. Is a no-op for tracked files that were\n\t\t/// not modified.\n\t\t/// \n\t\t/// Note: Add as many files as possible by one call of this method for best performance.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\">Paths to add to the index</param>\n\t\tpublic void Add(params string[] paths)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tforeach (var absolute_or_relative_path in paths)\n\t\t\t{\n\t\t\t\tstring path = absolute_or_relative_path;\n\t\t\t\tif (!Path.IsPathRooted(absolute_or_relative_path))\n\t\t\t\t\tpath = Path.Combine(_repo.WorkingDirectory, path);\n\t\t\t\tif (new FileInfo(path).Exists)\n\t\t\t\t\tAddFile(new FileInfo(path));\n\t\t\t\telse if (new DirectoryInfo(path).Exists)\n\t\t\t\t\tAddDirectory(new DirectoryInfo(path));\n\t\t\t\telse\n\t\t\t\t\tthrow new ArgumentException(\"File or directory at <\" + path + \"> doesn't seem to exist.\", \"path\");\n\t\t\t}\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Add a file to index (without relying on the working directory) by specifying the file's content as string. \n\t\t/// The added file doesn't need to exist in the working directory.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">Relative path in the working directory. Note: the path is encoded using PathEncoding</param>\n\t\t/// <param name=\"content\">The content as string. Note: the content is encoded using ContentEncoding</param>\n\t\tpublic void AddContent(string path, string content)\n\t\t{\n\t\t\tAddContent(PathEncoding.GetBytes(path), ContentEncoding.GetBytes(content));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Add content to the index directly without the need for a file in the working directory.\n\t\t/// </summary>\n\t\t/// <param name=\"encoded_relative_filepath\">encoded file path (relative to working directory)</param>\n\t\t/// <param name=\"encoded_content\">encoded content</param>\n\t\tpublic void AddContent(byte[] encoded_relative_filepath, byte[] encoded_content)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tGitIndex.add(encoded_relative_filepath, encoded_content);\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\tprivate void AddFile(FileInfo path)\n\t\t{\n\t\t\tGitIndex.add(_repo._internal_repo.WorkingDirectory, path);\n\t\t}\n\n\t\tprivate GitSharp.Core.IgnoreHandler _ignoreHandler;\n\t\tpublic GitSharp.Core.IgnoreHandler IgnoreHandler\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_ignoreHandler == null)\n\t\t\t\t\t_ignoreHandler = new Core.IgnoreHandler(_repo);\n\t\t\t\treturn _ignoreHandler;\n\t\t\t}\n\t\t}\n\n\t\tprivate void AddDirectory(DirectoryInfo dir)\n\t\t{\n\t\t\tforeach (var file in dir.GetFiles())\n\t\t\t\tif (!IgnoreHandler.IsIgnored(file.FullName))\n\t\t\t\t\tAddFile(file);\n\t\t\tforeach (var subdir in dir.GetDirectories())\n\t\t\t\tif (subdir.Name != GitSharp.Core.Constants.DOT_GIT && !IgnoreHandler.IsIgnored(subdir.FullName))\n\t\t\t\t\tAddDirectory(subdir);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Removes files or directories from the index which are no longer to be tracked. \n\t\t/// Does not delete files from the working directory. Use <seealso cref=\"Delete\"/> to remove and delete files.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\"></param>\n\t\tpublic void Remove(params string[] paths)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tforeach (var absolute_or_relative_path in paths)\n\t\t\t{\n\t\t\t\tstring path = absolute_or_relative_path;\n\t\t\t\tstring relative_path = absolute_or_relative_path;\n\t\t\t\tif (!Path.IsPathRooted(absolute_or_relative_path))\n\t\t\t\t\tpath = Path.Combine(_repo.WorkingDirectory, absolute_or_relative_path);\n\t\t\t\telse\n\t\t\t\t\trelative_path = Core.Util.PathUtil.RelativePath(_repo.WorkingDirectory, absolute_or_relative_path);\n\t\t\t\tif (new FileInfo(path).Exists)\n\t\t\t\t\tRemoveFile(new FileInfo(path), false);\n\t\t\t\telse if (new DirectoryInfo(path).Exists)\n\t\t\t\t\tRemoveDirectory(new DirectoryInfo(path), false);\n\t\t\t\telse\n\t\t\t\t\tGitIndex.Remove(relative_path);\n\t\t\t}\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Removes files or directories from the index and delete them from the working directory.\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"paths\"></param>\n\t\tpublic void Delete(params string[] paths)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tforeach (var absolute_or_relative_path in paths)\n\t\t\t{\n\t\t\t\tstring path = absolute_or_relative_path;\n\t\t\t\tif (!Path.IsPathRooted(absolute_or_relative_path))\n\t\t\t\t\tpath = Path.Combine(_repo.WorkingDirectory, path);\n\t\t\t\tif (new FileInfo(path).Exists)\n\t\t\t\t\tRemoveFile(new FileInfo(path), true);\n\t\t\t\telse if (new DirectoryInfo(path).Exists)\n\t\t\t\t\tRemoveDirectory(new DirectoryInfo(path), true);\n\t\t\t\telse\n\t\t\t\t\tthrow new ArgumentException(\"File or directory at <\" + path + \"> doesn't seem to exist.\", \"path\");\n\t\t\t}\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\tprivate void RemoveFile(FileInfo path, bool delete_file)\n\t\t{\n\t\t\tGitIndex.remove(_repo._internal_repo.WorkingDirectory, path); // Todo: change GitIndex.Remove to remove(DirectoryInfo , FileInfo) ??\n\t\t\tif (delete_file)\n\t\t\t\tpath.Delete();\n\t\t}\n\n\t\tprivate void RemoveDirectory(DirectoryInfo dir, bool delete_dir)\n\t\t{\n\t\t\tforeach (var file in dir.GetFiles())\n\t\t\t\tRemoveFile(file, delete_dir);\n\t\t\tforeach (var subdir in dir.GetDirectories())\n\t\t\t\tRemoveDirectory(subdir, delete_dir);\n\t\t\tif (delete_dir)\n\t\t\t\tdir.Delete(true);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Stages the given files. Untracked files are added. This is an alias for Add.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\"></param>\n\t\tpublic void Stage(params string[] paths)\n\t\t{\n\t\t\tAdd(paths);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is an alias for AddContent.\n\t\t/// </summary>\n\t\tpublic void StageContent(string path, string content)\n\t\t{\n\t\t\tAddContent(path, content);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Unstage overwrites staged files in the index with their current version in HEAD. In case of newly added files they are removed from the index.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\">Relative paths to files you want to unstage.</param>\n\t\tpublic void Unstage(params string[] paths)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tforeach (var absolute_or_relative_path in paths)\n\t\t\t{\n\t\t\t\tstring path = absolute_or_relative_path;\n\t\t\t\tif (Path.IsPathRooted(absolute_or_relative_path))\n\t\t\t\t\tpath = Core.Util.PathUtil.RelativePath(_repo.WorkingDirectory, absolute_or_relative_path);\n\t\t\t\tif (this[path] == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar blob = _repo.Get<Leaf>(path); // <--- we wouldn't want to stage something that is not representing a file\n\t\t\t\tif (blob == null)\n\t\t\t\t\tGitIndex.Remove(path);\n\t\t\t\telse\n\t\t\t\t\tGitIndex.add(Core.Repository.GitInternalSlash(PathEncoding.GetBytes(path)), blob.RawData);\n\t\t\t}\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out the index into the working directory. Any modified files will be overwritten.\n\t\t/// <para/>\n\t\t/// <seealso cref=\"Branch.Checkout\"/> to checkout from a commit.\n\t\t/// </summary>\n\t\tpublic void Checkout()\n\t\t{\n\t\t\tCheckout(_repo.WorkingDirectory);\n\t\t}\n\n\t\t// [henon] we do not publicly expose checking out into a custom directory, as this is an unrealistic use case and conflicts with checking out paths. \n\t\t// it is possible anyway by iterating over the Entries and writing the contents of each entry into a custom directory!\n\t\tprivate void Checkout(string directory)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tGitIndex.checkout(new FileInfo(directory));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out given paths from the index overwriting files in the working directory. Modified files might be overwritten.\n\t\t/// </summary>\n\t\t/// <param name=\"paths\"></param>\n\t\tpublic void Checkout(params string[] paths)\n\t\t{\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tforeach (var absolute_or_relative_path in paths)\n\t\t\t{\n\t\t\t\tstring path = absolute_or_relative_path;\n\t\t\t\tif (Path.IsPathRooted(absolute_or_relative_path))\n\t\t\t\t\tpath = Core.Util.PathUtil.RelativePath(_repo.WorkingDirectory, absolute_or_relative_path);\n\t\t\t\tvar e = GitIndex.GetEntry(path);\n\t\t\t\tif (e == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tGitIndex.checkoutEntry(new FileInfo(_repo.WorkingDirectory), e);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes the index to the disk.\n\t\t/// </summary>\n\t\tpublic void Write()\n\t\t{\n\t\t\tGitIndex.write();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the index from the disk\n\t\t/// </summary>\n\t\tpublic void Read()\n\t\t{\n\t\t\tGitIndex.Read();\n\t\t}\n\n\t\t//public RepositoryStatus CompareAgainstWorkingDirectory(bool honor_ignore_rules)\n\n\t\tpublic RepositoryStatus Status\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _repo.Status;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if the index has been changed, which means there are changes to be committed. This\n\t\t/// is not to be confused with the status of the working directory. If changes in the working directory have not been\n\t\t/// staged then IsChanged is false.\n\t\t/// </summary>\n\t\tpublic bool IsChanged\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn GitIndex.IsChanged;\n\t\t\t}\n\t\t}\n\n\t\tpublic Commit CommitChanges(string message, Author author)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(message))\n\t\t\t\tthrow new ArgumentException(\"Commit message must not be null or empty!\", \"message\");\n\t\t\tif (string.IsNullOrEmpty(author.Name))\n\t\t\t\tthrow new ArgumentException(\"Author name must not be null or empty!\", \"author\");\n\t\t\tGitIndex.RereadIfNecessary();\n\t\t\tvar tree_id = GitIndex.writeTree();\n\t\t\t// check if tree is different from current commit's tree\n\t\t\tvar parent = _repo.CurrentBranch.CurrentCommit;\n\t\t\tif ((parent == null && GitIndex.Members.Count == 0) || (parent != null && parent.Tree._id == tree_id))\n\t\t\t\tthrow new InvalidOperationException(\"There are no changes to commit\");\n\t\t\tvar commit = Commit.Create(message, parent, new Tree(_repo, tree_id), author);\n\t\t\tRef.Update(\"HEAD\", commit);\n\t\t\treturn commit;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Index[\" + Path.Combine(_repo.Directory, \"index\") + \"]\";\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The encoding to be used to convert file paths from string to byte arrays.\n\t\t/// </summary>\n\t\tpublic static Encoding PathEncoding\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The encoding to be used to convert file contents from string to byte arrays.\n\t\t/// </summary>\n\t\tpublic static Encoding ContentEncoding\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\n\t\tpublic string GetContent(string path)\n\t\t{\n\t\t\tvar blob = this[path];\n\t\t\tif (blob == null)\n\t\t\t\treturn null;\n\t\t\treturn ContentEncoding.GetString(blob.RawData);\n\t\t}\n\n\t\tpublic Blob this[string path]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar e = GitIndex.GetEntry(path);\n\t\t\t\tif (e == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new Blob(_repo, e.ObjectId);\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t//todo\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<string> Entries\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tGitIndex.RereadIfNecessary();\n\t\t\t\treturn GitIndex.Members.Select(e => e.Name).ToArray();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The number of files tracked by the repository \n\t\t/// </summary>\n\t\tpublic int Size\n\t\t{\n\t\t\tget { return GitIndex.Members.Count; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Leaf.cs",
    "content": "﻿/*\n * Copyright (C) 2009-2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing FileTreeEntry = GitSharp.Core.FileTreeEntry;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Leaf represents a tracked file in a directory tracked by git.\n\t/// </summary>\n\tpublic class Leaf : AbstractTreeNode\n\t{\n\t\tinternal Leaf(Repository repo, FileTreeEntry entry)\n\t\t\t: base(repo, entry.Id)\n\t\t{\n\t\t\t_internal_file_tree_entry = entry;\n\t\t}\n\n\t\tprivate FileTreeEntry _internal_file_tree_entry;\n\n\t\tinternal FileTreeEntry InternalEntry {\n\t\t\tget { return _internal_file_tree_entry; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// True if the file is executable (unix).\n\t\t/// </summary>\n\t\tpublic bool IsExecutable\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _internal_file_tree_entry.IsExecutable;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The file name\n\t\t/// </summary>\n\t\tpublic override string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _internal_file_tree_entry.Name;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The full path relative to repostiory root\n\t\t/// </summary>\n\t\tpublic override string Path\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _internal_file_tree_entry.FullName;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The unix file permissions.\n\t\t/// \n\t\t/// Todo: model this with a permission object\n\t\t/// </summary>\n\t\tpublic override int Permissions\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _internal_file_tree_entry.Mode.Bits;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The parent <see cref=\"Tree\"/>.\n\t\t/// </summary>\n\t\tpublic override Tree Parent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Tree(_repo, _internal_file_tree_entry.Parent);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a <see cref=\"Blob\"/> containing the data of this file\n\t\t/// </summary>\n\t\tpublic Blob Blob\n\t\t{\n\t\t\tget { return new Blob(_repo, _id); }\n\t\t}\n\n\t\tpublic static implicit operator Blob(Leaf self)\n\t\t{\n\t\t\treturn self.Blob;\n\t\t}\n\n\t\tpublic string Data\n\t\t{\n\t\t\tget { return Blob.Data; }\n\t\t}\n\n\t\tpublic byte[] RawData\n\t\t{\n\t\t\tget { return Blob.RawData; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyTitle(\"GitSharp\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "GitSharp/README.txt",
    "content": "GitSharp.API shall not only provide user friendly access to git's objects and commands but also decouple CLI and any other apps from the internals which are potentially changing all the time\nThis is especially when we continue to track jgit's commits"
  },
  {
    "path": "GitSharp/Ref.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing CoreRepository = GitSharp.Core.Repository;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Ref is a named symbolic reference that is a pointing to a specific git object. It is not resolved\n\t/// until you explicitly retrieve the link target. The Target is not cached.\n\t/// </summary>\n\tpublic class Ref : IReferenceObject\n\t{\n\t\tinternal Repository _repo;\n\t\t//private _internal_ref;\n\n\t\tpublic Ref(Repository repo, string name)\n\t\t{\n\t\t\t_repo = repo;\n\t\t\tName = name;\n\t\t}\n\n\t\tinternal Ref(Repository repo, CoreRef @ref)\n\t\t\t: this(repo, @ref.Name)\n\t\t{\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget;\n\t\t\tprotected set;\n\t\t}\n\t\t\n\t\tprotected virtual string RefName {\n\t\t\tget { return Name; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Resolve the symbolic reference and return the object that it is currently pointing at. Target is not cached\n\t\t/// in order to match the behavior of a real git ref.\n\t\t/// </summary>\n\t\tpublic AbstractObject Target\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar id = _repo._internal_repo.Resolve(Name);\n\t\t\t\tif (id == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn AbstractObject.Wrap(_repo, id);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsBranch\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tIDictionary<string, CoreRef> branches = _repo._internal_repo._refDb.getRefs(Constants.R_HEADS);\n\t\t\t\treturn branches.ContainsKey(Name);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Updates this ref by linking it to the given ref's target.\n\t\t/// </summary>\n\t\t/// <param name=\"reference\">The ref this ref shall reference.</param>\n\t\tpublic void Update(Ref reference)\n\t\t{\n\t\t\tUpdate(reference.Target);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Updates this ref by forwarding it to the given object.\n\t\t/// </summary>\n\t\t/// <param name=\"reference\">The ref this object shall reference.</param>\n\t\tpublic void Update(AbstractObject reference)\n\t\t{\n\t\t\tvar db = _repo._internal_repo;\n\t\t\tvar updateRef = db.UpdateRef(RefName);\n\t\t\tupdateRef.NewObjectId = reference._id;\n\t\t\tupdateRef.IsForceUpdate = true;\n\t\t\tupdateRef.update();\n\t\t\t//db.WriteSymref(Name, other.Name);\n\t\t}\n\n\t\tpublic static void Update(string name, AbstractObject reference)\n\t\t{\n\t\t\tnew Ref(reference.Repository, name).Update(reference);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check validity of a ref name. It must not contain a character that has\n\t\t/// a special meaning in a Git object reference expression. Some other\n\t\t/// dangerous characters are also excluded.\n\t\t/// </summary>\n\t\t/// <param name=\"refName\"></param>\n\t\t/// <returns>\n\t\t/// Returns true if <paramref name=\"refName\"/> is a valid ref name.\n\t\t/// </returns>\n\t\tpublic static bool IsValidName(string refName)\n\t\t{\n\t\t\treturn CoreRepository.IsValidRefName(refName);\n\t\t}\n\n\t\t#region Equality overrides\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (obj is Ref)\n\t\t\t{\n\t\t\t\tvar other = obj as Ref;\n\t\t\t\treturn _repo._internal_repo.Resolve(Name) == _repo._internal_repo.Resolve(other.Name);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool operator ==(Ref self, object other)\n\t\t{\n\t\t\treturn self.Equals(other);\n\t\t}\n\n\t\tpublic static bool operator !=(Ref self, object other)\n\t\t{\n\t\t\treturn !self.Equals(other);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tvar id = _repo._internal_repo.Resolve(Name);\n\t\t\tif (id != null)\n\t\t\t\treturn id.GetHashCode();\n\t\t\treturn base.GetHashCode();\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Ref[\" + Name + \"]\";\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Remote.cs",
    "content": "// \n// Remote.cs\n//  \n// Author:\n//       Lluis Sanchez Gual <lluis@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Transport;\nusing System.Collections;\n\nnamespace GitSharp\n{\n\tpublic class Remote\n\t{\n\t\tRemoteConfig _config;\n\t\tRepository _repo;\n\t\t\n\t\t\n\t\tinternal Remote (Repository repo, RemoteConfig config)\n\t\t{\n\t\t\t_config = config;\n\t\t\t_repo = repo;\n\t\t}\n\t\t\n\t\tpublic void Update ()\n\t\t{\n\t\t\t_config.Update (_repo._internal_repo.Config);\n\t\t\t_repo.Config.Persist ();\n\t\t}\n\t\t\n\t\tinternal void Delete ()\n\t\t{\n\t\t\t_config.Delete (_repo._internal_repo.Config);\n\t\t\t_repo.Config.Persist ();\n\t\t}\n\t\t\n        /// <summary>\n        /// local name this remote configuration is recognized as\n        /// </summary>\n\t\tpublic string Name {\n\t\t\tget { return _config.Name; }\n\t\t\tset { _config.Name = value; }\n\t\t}\n\n        /// <summary>\n        /// all configured URIs under this remote\n        /// </summary>\n\t\tpublic IEnumerable<URIish> URIs {\n\t\t\tget { return _config.URIs; }\n\t\t}\n\n        /// <summary>\n        /// all configured push-only URIs under this remote.\n        /// </summary>\n\t\tpublic IEnumerable<URIish> PushURIs {\n\t\t\tget { return _config.PushURIs; }\n\t\t}\n\n        /// <summary>\n        /// Remembered specifications for fetching from a repository.\n        /// </summary>\n\t\tpublic IEnumerable<RefSpec> Fetch {\n\t\t\tget { return _config.Fetch; }\n\t\t}\n\n        /// <summary>\n        /// Remembered specifications for pushing to a repository.\n        /// </summary>\n\t\tpublic IEnumerable<RefSpec> Push {\n\t\t\tget { return _config.Push; }\n\t\t}\n\n        /// <summary>\n        /// Override for the location of 'git-upload-pack' on the remote system.\n        /// <para/>\n        /// This value is only useful for an SSH style connection, where Git is\n        /// asking the remote system to execute a program that provides the necessary\n        /// network protocol.\n        /// <para/>\n        /// returns location of 'git-upload-pack' on the remote system. If no\n        /// location has been configured the default of 'git-upload-pack' is\n        /// returned instead.\n        /// </summary>\n\t\tpublic string UploadPack {\n\t\t\tget { return _config.UploadPack; }\n\t\t}\n\n        /// <summary>\n        /// Override for the location of 'git-receive-pack' on the remote system.\n        /// <para/>\n        /// This value is only useful for an SSH style connection, where Git is\n        /// asking the remote system to execute a program that provides the necessary\n        /// network protocol.\n        /// <para/>\n        /// returns location of 'git-receive-pack' on the remote system. If no\n        /// location has been configured the default of 'git-receive-pack' is\n        /// returned instead.\n        /// </summary>\n\t\tpublic string ReceivePack {\n\t\t\tget { return _config.ReceivePack; }\n\t\t}\n\n        /// <summary>\n        /// Get the description of how annotated tags should be treated during fetch.\n        /// <para/>\n        /// returns option indicating the behavior of annotated tags in fetch.\n        /// </summary>\n\t\tpublic TagOpt TagOpt {\n\t\t\tget { return _config.TagOpt; }\n\t\t\tset { _config.SetTagOpt (value); }\n\t\t}\n\n        /// <summary>\n        /// mirror flag to automatically delete remote refs.\n        /// <para/>\n        /// true if pushing to the remote automatically deletes remote refs\n        /// </summary>\n\t\tpublic bool Mirror {\n\t\t\tget { return _config.Mirror; }\n\t\t}\n        /// <summary>\n        /// timeout before willing to abort an IO call.\n        /// <para/>\n        /// number of seconds to wait (with no data transfer occurring)\n        /// before aborting an IO read or write operation with this\n        /// remote.  A timeout of 0 will block indefinitely.\n        /// </summary>\n\t\tpublic int Timeout {\n\t\t\tget { return _config.Timeout; }\n\t\t\tset { _config.Timeout = value; }\n\t\t}\n\t\t\n        /// <summary>\n        /// Add a new URI to the end of the list of URIs.\n        /// </summary>\n        /// <param name=\"toAdd\">the new URI to add to this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool AddURI(URIish toAdd)\n\t\t{\n\t\t\treturn _config.AddURI (toAdd);\n\t\t}\n\n        /// <summary>\n        /// Remove a URI from the list of URIs.\n        /// </summary>\n        /// <param name=\"toRemove\">the URI to remove from this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool RemoveURI(URIish toRemove)\n\t\t{\n\t\t\treturn _config.RemoveURI (toRemove);\n\t\t}\n\n        /// <summary>\n        /// Add a new push-only URI to the end of the list of URIs.\n        /// </summary>\n        /// <param name=\"toAdd\">the new URI to add to this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool AddPushURI(URIish toAdd)\n\t\t{\n\t\t\treturn _config.AddPushURI (toAdd);\n\t\t}\n\n        /// <summary>\n        /// Remove a push-only URI from the list of URIs.\n        /// </summary>\n        /// <param name=\"toRemove\">the URI to remove from this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n        public bool RemovePushURI(URIish toRemove)\n        {\n\t\t\treturn _config.RemovePushURI (toRemove);\n        }\n\n        /// <summary>\n        /// Add a new fetch RefSpec to this remote.\n        /// </summary>\n        /// <param name=\"s\">the new specification to add.</param>\n        /// <returns>true if the specification was added; false if it already exists.</returns>\n        public bool AddFetchRefSpec(RefSpec s)\n        {\n\t\t\treturn _config.AddFetchRefSpec (s);\n        }\n\n        /// <summary>\n        /// Override existing fetch specifications with new ones.\n        /// </summary>\n        /// <param name=\"specs\">\n        /// list of fetch specifications to set. List is copied, it can be\n        /// modified after this call.\n        /// </param>\n\t\tpublic void SetFetchRefSpecs(List<RefSpec> specs)\n\t\t{\n\t\t\t_config.SetFetchRefSpecs(specs);\n\t\t}\n\n        /// <summary>\n        /// Override existing push specifications with new ones.\n        /// </summary>\n        /// <param name=\"specs\">\n        /// list of push specifications to set. List is copied, it can be\n        /// modified after this call.\n        /// </param>\n\t\tpublic void SetPushRefSpecs(List<RefSpec> specs)\n\t\t{\n\t\t\t_config.SetPushRefSpecs(specs);\n\t\t}\n\n\t\t/// <summary>\n        /// Remove a fetch RefSpec from this remote.\n\t\t/// </summary>\n        /// <param name=\"s\">the specification to remove.</param>\n        /// <returns>true if the specification existed and was removed.</returns>\n        public bool RemoveFetchRefSpec(RefSpec s)\n\t\t{\n\t\t\treturn _config.RemoveFetchRefSpec(s);\n\t\t}\n\n        /// <summary>\n        /// Add a new push RefSpec to this remote.\n        /// </summary>\n        /// <param name=\"s\">the new specification to add.</param>\n        /// <returns>true if the specification was added; false if it already exists.</returns>\n\t\tpublic bool AddPushRefSpec(RefSpec s)\n\t\t{\n\t\t\treturn _config.AddPushRefSpec(s);\n\t\t}\n\n        /// <summary>\n        /// Remove a push RefSpec from this remote.\n        /// </summary>\n        /// <param name=\"s\">the specification to remove.</param>\n        /// <returns>true if the specification existed and was removed.</returns>\n\t\tpublic bool RemovePushRefSpec(RefSpec s)\n\t\t{\n\t\t\treturn _config.RemovePushRefSpec(s);\n\t\t}\n\t}\n\t\n\tpublic class RemoteCollection: IEnumerable<Remote>\n\t{\n\t\tRepository _repo;\n\t\t\n\t\tinternal RemoteCollection (Repository repo)\n\t\t{\n\t\t\t_repo = repo;\n\t\t}\n\t\t\n\t\tpublic IEnumerator<Remote> GetEnumerator ()\n\t\t{\n\t\t\tforeach (RemoteConfig rc in RemoteConfig.GetAllRemoteConfigs (_repo._internal_repo.Config))\n\t\t\t\tyield return new Remote (_repo, rc);\n\t\t}\n\t\t\n\t\tpublic Remote CreateRemote (string name)\n\t\t{\n\t\t\tRemoteConfig rc = new RemoteConfig (_repo._internal_repo.Config, name);\n\t\t\t_repo.Config.Persist ();\n\t\t\treturn new Remote (_repo, rc);\n\t\t}\n\t\n\t\tpublic void Remove (Remote remote)\n\t\t{\n\t\t\tremote.Delete ();\n\t\t\t_repo.Config.Persist ();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator ()\n\t\t{\n\t\t\treturn GetEnumerator ();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp/Repository.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the TicGit project nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing GitSharp.Commands;\nusing GitSharp.Core;\nusing CoreRepository = GitSharp.Core.Repository;\nusing System.Text.RegularExpressions;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents a git repository\n\t/// </summary>\n\tpublic class Repository : IDisposable\n\t{\n\t\t#region Constructors\n\n\t\tinternal CoreRepository _internal_repo;\n\t\t\n\t\tRemoteCollection _remoteCollection;\n\t\tStashCollection _stashCollection;\n\n\t\tinternal Repository(CoreRepository repo)\n\t\t{\n\t\t\t//PreferredEncoding = Encoding.UTF8;\n\t\t\t_internal_repo = repo;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes the Repository object.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">Path to the local git repository.</param>\n\t\tpublic Repository(string path)\n\t\t\t: this(GitSharp.Core.Repository.Open(path))\n\t\t{\n\t\t}\n\n\n\t\t#endregion\n\n\t\t#region Public properties\n\n\n\t\t/// <summary>\n\t\t/// Returns the path to the repository database (i.e. the .git directory).\n\t\t/// </summary>\n\t\tpublic string Directory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tDebug.Assert(_internal_repo != null, \"Repository not initialized correctly.\");\n\t\t\t\treturn _internal_repo.Directory.FullName;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the repository's head which is a symbolic reference to the active branch.\n\t\t/// </summary>\n\t\tpublic Branch Head\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tDebug.Assert(_internal_repo != null, \"Repository not initialized correctly.\");\n\t\t\t\treturn new Branch(this, \"HEAD\");\n\t\t\t}\n\t\t\tinternal set // <-- Note that setting head does not automatically check out that branch into the repository's working directory. \n\t\t\t{\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentException(\"Value can not be null.\");\n\t\t\t\tif (Head.Name != value.Name)\n\t\t\t\t{\n\t\t\t\t\tif (Branches.ContainsKey(value.Name))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar updateRef = _internal_repo.UpdateRef(\"HEAD\");\n\t\t\t\t\t\tupdateRef.NewObjectId = value.Target._id;\n\t\t\t\t\t\tupdateRef.IsForceUpdate = true;\n\t\t\t\t\t\tupdateRef.update();\n\t\t\t\t\t\tRefUpdate u = _internal_repo.UpdateRef(Constants.HEAD);\n\t\t\t\t\t\tu.link(value.Name);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new ArgumentException(\"Trying to set HEAD to non existent branch: \" + value.Name);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tpublic Index Index\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Index(this); // <--- this is just a wrapper around the internal repo's GitIndex instance so need not cache it here\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if this repository is a bare repository. Bare repositories don't have a working directory and thus do not support some operations.\n\t\t/// </summary>\n\t\tpublic bool IsBare\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tDebug.Assert(_internal_repo != null, \"Repository not initialized correctly.\");\n\t\t\t\treturn _internal_repo.Config.getBoolean(\"core\", \"bare\", false);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the path to the working directory (i.e. the parent of the .git directory of a non-bare repo). Returns null if it is a bare repository.\n\t\t/// </summary>\n\t\tpublic string WorkingDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tDebug.Assert(_internal_repo != null, \"Repository not initialized correctly.\");\n\t\t\t\tif (IsBare)\n\t\t\t\t\treturn null;\n\t\t\t\treturn _internal_repo.WorkingDirectory.FullName;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Check out the branch with the given name into the working directory and make it the current branch.\n\t\t/// </summary>\n\t\t/// <param name=\"name\"></param>\n\t\tpublic void SwitchToBranch(string name)\n\t\t{\n\t\t\tSwitchToBranch(new Branch(this, name));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out the given branch into the working directory and make it the current branch.\n\t\t/// </summary>\n\t\t/// <param name=\"branch\"></param>\n\t\tpublic void SwitchToBranch(Branch branch)\n\t\t{\n\t\t\tbranch.Checkout();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Commit staged changes and update HEAD. The default git author from the config is used.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The commit message</param>\n\t\t/// <returns>Returns the newly created commit</returns>\n\t\tpublic Commit Commit(string message)\n\t\t{\n\t\t\treturn Commit(message, new Author(Config[\"user.name\"] ?? \"unknown\", Config[\"user.email\"] ?? \"unknown@(none).\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Commit staged changes and update HEAD\n\t\t/// </summary>\n\t\t/// <param name=\"message\">The commit message</param>\n\t\t/// <param name=\"author\">The author of the content to be committed</param>\n\t\t/// <returns>Returns the newly created commit</returns>\n\t\tpublic Commit Commit(string message, Author author)\n\t\t{\n\t\t\treturn Index.CommitChanges(message, author);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Commit changes in the specified files and update HEAD\n\t\t/// </summary>\n\t\t/// <param name='message'>The commit message</param>\n\t\t/// <param name=\"paths\">List of files to commit</param>\n\t\t/// <returns>Returns the newly created commit</returns>\n\t\tpublic Commit Commit(string message, params string[] paths)\n\t\t{\n\t\t\treturn Commit(message, new Author(Config[\"user.name\"] ?? \"unknown\", Config[\"user.email\"] ?? \"unknown@(none).\"), paths);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Commit changes in the specified files and update HEAD\n\t\t/// </summary>\n\t\t/// <param name='message'>The commit message</param>\n\t\t/// <param name=\"author\">The author of the content to be committed</param>\n\t\t/// <param name=\"paths\">List of files to commit</param>\n\t\t/// <returns>Returns the newly created commit</returns>\n\t\tpublic Commit Commit(string message, Author author, params string[] paths)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(message))\n\t\t\t\tthrow new ArgumentException(\"Commit message must not be null or empty!\", \"message\");\n\t\t\tif (string.IsNullOrEmpty(author.Name))\n\t\t\t\tthrow new ArgumentException(\"Author name must not be null or empty!\", \"author\");\n\t\t\t\n\t\t\tint basePathLength = Path.GetFullPath (WorkingDirectory).TrimEnd ('/','\\\\').Length;\n\t\t\t\n\t\t\t// Expand directory paths into file paths. Convert paths to full paths.\n\t\t\tList<string> filePaths = new List<string> ();\n\t\t\tforeach (var path in paths) {\n\t\t\t\tstring fullPath = path;\n\t\t\t\tif (!Path.IsPathRooted (fullPath))\n\t\t\t\t\tfullPath = Path.Combine (WorkingDirectory, fullPath);\n\t\t\t\tfullPath = Path.GetFullPath (fullPath).TrimEnd ('/','\\\\');\n\t\t\t\tDirectoryInfo dir = new DirectoryInfo (fullPath);\n\t\t\t\tif (dir.Exists)\n\t\t\t\t\tfilePaths.AddRange (GetDirectoryFiles (dir));\n\t\t\t\telse\n\t\t\t\t\tfilePaths.Add (fullPath);\n\t\t\t}\n\t\t\t\n\t\t\t// Read the tree of the last commit. We are going to update it.\n\t\t\tGitSharp.Core.Tree tree = _internal_repo.MapTree (CurrentBranch.CurrentCommit._id);\n\n\t\t\t// Keep a list of trees that have been modified, since they have to be written.\n\t\t\tHashSet<GitSharp.Core.Tree> modifiedTrees = new HashSet<GitSharp.Core.Tree> ();\n\t\t\t\n\t\t\t// Update the tree\n\t\t\tforeach (string fullPath in filePaths) {\n\t\t\t\tstring relPath = fullPath.Substring (basePathLength + 1).Replace ('\\\\','/');\t\t\t\t\n\t\t\t\tTreeEntry treeEntry = tree.FindBlobMember (relPath);\n\t\t\t\t\n\t\t\t\tif (File.Exists (fullPath)) {\n\t\t\t\t\t// Looks like an old directory is now a file. Delete the subtree and create a new entry for the file.\n\t\t\t\t\tif (treeEntry != null && !(treeEntry is FileTreeEntry))\n\t\t\t\t\t\ttreeEntry.Delete ();\n\n\t\t\t\t\tFileTreeEntry fileEntry = treeEntry as FileTreeEntry;\n\t\t\t\t\tvar writer = new ObjectWriter (_internal_repo);\n\t\t\t\t\tbool executable = GitSharp.Core.Util.FS.canExecute (new FileInfo (fullPath));\n\t\t\t\t\tObjectId id = writer.WriteBlob (new FileInfo (fullPath));\n\t\t\t\t\tif (fileEntry == null) {\n\t\t\t\t\t\t// It's a new file. Add it.\n\t\t\t\t\t\tfileEntry = (FileTreeEntry) tree.AddFile (relPath);\n\t\t\t\t\t\ttreeEntry = fileEntry;\n\t\t\t\t\t} else if (fileEntry.Id == id && executable == fileEntry.IsExecutable) {\n\t\t\t\t\t\t// Same file, ignore it\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfileEntry.Id = id;\n\t\t\t\t\tfileEntry.SetExecutable (executable);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Deleted file or directory. Remove from the tree\n\t\t\t\t\tif (treeEntry != null) {\n\t\t\t\t\t\tGitSharp.Core.Tree ptree = treeEntry.Parent;\n\t\t\t\t\t\ttreeEntry.Delete ();\n\t\t\t\t\t\t// Remove the subtree if it's now empty\n\t\t\t\t\t\twhile (ptree != null && ptree.MemberCount == 0) {\n\t\t\t\t\t\t\tGitSharp.Core.Tree nextParent = ptree.Parent;\n\t\t\t\t\t\t\tptree.Delete ();\n\t\t\t\t\t\t\tptree = nextParent;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcontinue; // Already deleted.\n\t\t\t\t}\n\t\t\t\tmodifiedTrees.Add (treeEntry.Parent);\n\t\t\t}\n\n\t\t\t// check if tree is different from current commit's tree\n\t\t\tif (modifiedTrees.Count == 0)\n\t\t\t\tthrow new InvalidOperationException(\"There are no changes to commit\");\n\t\t\t\n\t\t\t// Create new trees if there is any change\n\t\t\tObjectId tree_id = SaveTree (tree, modifiedTrees);\n\n\t\t\t// Create the commit\n\t\t\tvar parent = CurrentBranch.CurrentCommit;\n\t\t\tvar commit = GitSharp.Commit.Create(message, parent, new Tree(this, tree_id), author);\n\t\t\tRef.Update(\"HEAD\", commit);\n\t\t\t\n\t\t\t// Unstage updated files\n\t\t\tIndex.Unstage (paths);\n\t\t\t\n\t\t\treturn commit;\n\t\t}\n\t\t\n\t\tIEnumerable<string> GetDirectoryFiles (DirectoryInfo dir)\n\t\t{\n\t\t\t// Recursively get the list of files in the directory (which are not ignored)\n\t\t\treturn dir.GetFiles ()\n\t\t\t\t\t\t.Where (f => !Index.IgnoreHandler.IsIgnored (f.FullName))\n\t\t\t\t\t\t.Select (f => f.FullName)\n\t\t\t\t   .Concat (dir.GetDirectories ()\n\t\t\t\t\t\t.Where (di => !Index.IgnoreHandler.IsIgnored (di.FullName) && di.Name != GitSharp.Core.Constants.DOT_GIT)\n\t\t\t\t\t\t.SelectMany (di => GetDirectoryFiles (di)));\n\t\t}\n\t\t\n\t\tObjectId SaveTree (GitSharp.Core.Tree tree, HashSet<GitSharp.Core.Tree> modifiedTrees)\n\t\t{\n\t\t\t// Saves tree that have been modified (that is, which are in the provided list or\n\t\t\t// which have child trees that have been modified)\n\t\t\t\n\t\t\tbool childModified = false;\n\t\t\tforeach (var te in tree.Members) {\n\t\t\t\tGitSharp.Core.Tree childTree = te as GitSharp.Core.Tree;\n\t\t\t\tif (childTree != null) {\n\t\t\t\t\tObjectId newId = SaveTree (childTree, modifiedTrees);\n\t\t\t\t\tif (newId != null) {\n\t\t\t\t\t\tchildTree.Id = newId;\n\t\t\t\t\t\tchildModified = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (childModified || modifiedTrees.Contains (tree)) {\n\t\t\t\tObjectWriter writer = new ObjectWriter (_internal_repo);\n\t\t\t\treturn writer.WriteTree (tree);\n\t\t\t} else\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IDictionary<string, Ref> Refs\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar internal_refs = _internal_repo.getAllRefs();\n\t\t\t\tvar dict = new Dictionary<string, Ref>(internal_refs.Count);\n\t\t\t\tforeach (var pair in internal_refs)\n\t\t\t\t\tdict[pair.Key] = new Ref(this, pair.Value);\n\t\t\t\treturn dict;\n\t\t\t}\n\t\t}\n\n\t\tpublic IDictionary<string, Tag> Tags\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar internal_tags = _internal_repo.getTags();\n\t\t\t\tvar dict = new Dictionary<string, Tag>(internal_tags.Count);\n\t\t\t\tforeach (var pair in internal_tags)\n\t\t\t\t\tdict[pair.Key] = new Tag(this, pair.Value);\n\t\t\t\treturn dict;\n\t\t\t}\n\t\t}\n\n\t\tpublic IDictionary<string, Branch> Branches\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tIDictionary<string, Core.Ref> internal_refs = _internal_repo._refDb.getRefs(Constants.R_HEADS);\n\t\t\t\tvar dict = new Dictionary<string, Branch>(internal_refs.Count);\n\t\t\t\tforeach (var pair in internal_refs)\n\t\t\t\t\tdict[pair.Key.TrimStart('/')] = new Branch(this, pair.Value);\n\t\t\t\treturn dict;\n\t\t\t}\n\t\t}\n\n\t\tpublic Branch CurrentBranch\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Branch(this, _internal_repo.getBranch());\n\t\t\t}\n\t\t}\n\n\t\tpublic IDictionary<string, Branch> RemoteBranches\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar internal_refs = _internal_repo._refDb.getRefs(Constants.R_REMOTES);\n\t\t\t\tvar dict = new Dictionary<string, Branch>(internal_refs.Count);\n\t\t\t\tforeach (var pair in internal_refs)\n\t\t\t\t{\n\t\t\t\t\tvar branch = new Branch(this, pair.Value);\n\t\t\t\t\tbranch.IsRemote = true;\n\t\t\t\t\tdict[pair.Key] = branch;\n\t\t\t\t}\n\t\t\t\treturn dict;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic RemoteCollection Remotes {\n\t\t\tget {\n\t\t\t\tif (_remoteCollection == null)\n\t\t\t\t\t_remoteCollection = new RemoteCollection (this);\n\t\t\t\treturn _remoteCollection;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic StashCollection Stashes {\n\t\t\tget {\n\t\t\t\tif (_stashCollection == null)\n\t\t\t\t\t_stashCollection = new StashCollection (this);\n\t\t\t\treturn _stashCollection;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the git configuration containing repository-specific, user-specific and global \n\t\t/// settings.\n\t\t/// </summary>\n\t\tpublic Config Config\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Config(this);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get a report about the differences between the working directory, the index and the current commit.\n\t\t/// </summary>\n\t\tpublic RepositoryStatus Status\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new RepositoryStatus(this, null, null, \"\", true);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic RepositoryStatus GetStatus (RepositoryStatusOptions options)\n\t\t{\n\t\t\treturn new RepositoryStatus(this, options, null, \"\", true);\n\t\t}\n\n\t\tpublic RepositoryStatus GetDirectoryStatus (string path, bool recursive)\n\t\t{\n\t\t\treturn new RepositoryStatus(this, null, null, path, recursive);\n\t\t}\n\n\t\tpublic RepositoryStatus GetDirectoryStatus (string path, bool recursive, RepositoryStatusOptions options)\n\t\t{\n\t\t\treturn new RepositoryStatus(this, options, null, path, recursive);\n\t\t}\n\n\t\tpublic RepositoryStatus GetFileStatus (string path)\n\t\t{\n\t\t\treturn new RepositoryStatus(this, null, path, null, false);\n\t\t}\n\t\t\n\t\tpublic RepositoryStatus GetFileStatus (string path, RepositoryStatusOptions options)\n\t\t{\n\t\t\treturn new RepositoryStatus(this, options, path, null, false);\n\t\t}\n\t\t\n\t\tpublic string ToGitPath (string path)\n\t\t{\n\t\t\tif (path == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t// If the path is absolute, make it relative to the working dir\n\t\t\tif (Path.IsPathRooted (path)) {\n\t\t\t\tstring repoPath = WorkingDirectory.TrimEnd (Path.DirectorySeparatorChar);\n\t\t\t\tpath = Path.GetFullPath (path).TrimEnd (Path.DirectorySeparatorChar);\n\t\t\t\tif (path != repoPath) {\n\t\t\t\t\tif (!path.StartsWith (repoPath + Path.DirectorySeparatorChar))\n\t\t\t\t\t\tthrow new InvalidOperationException (\"Path does not belong to the repository\");\n\t\t\t\t\tpath = path.Substring (repoPath.Length + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Path.DirectorySeparatorChar != '/')\n\t\t\t\tpath = path.Replace (Path.DirectorySeparatorChar, '/');\n\t\t\treturn path;\n\t\t}\n\t\t\n\t\tpublic string FromGitPath (string path)\n\t\t{\n\t\t\tif (path == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif (path.Length == 0)\n\t\t\t\treturn WorkingDirectory;\n\t\t\tif (Path.DirectorySeparatorChar != '/')\n\t\t\t\tpath = path.Replace ('/', Path.DirectorySeparatorChar);\n\t\t\treturn Path.Combine (WorkingDirectory, path);\n\t\t}\n\n\t\tpublic static implicit operator CoreRepository(Repository repo)\n\t\t{\n\t\t\treturn repo._internal_repo;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Repository[\" + Directory + \"]\";\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\t_internal_repo.Dispose();\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tClose();\n\t\t}\n\n\t\t#region Repository initialization (git init)\n\n\n\t\t/// <summary>\n\t\t/// Initializes a non-bare repository. Use GitDirectory to specify location.\n\t\t/// </summary>\n\t\t/// <returns>The initialized repository</returns>\n\t\tpublic static Repository Init(string path)\n\t\t{\n\t\t\treturn Init(path, false);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a repository. Use GitDirectory to specify the location. Default is the current directory.\n\t\t/// </summary>\n\t\t/// <param name=\"path\"></param>\n\t\t/// <param name=\"bare\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static Repository Init(string path, bool bare)\n\t\t{\n\t\t\tvar cmd = new InitCommand() { GitDirectory = path, Bare = bare };\n\t\t\treturn Init(cmd);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a repository in the current location using the provided git command's options.\n\t\t/// </summary>\n\t\t/// <param name=\"cmd\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static Repository Init(InitCommand cmd)\n\t\t{\n\t\t\tcmd.Execute();\n\t\t\treturn cmd.Repository;\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Checks if the directory given by the path is a valid non-bare git repository. The given path may either point to \n\t\t/// the working directory or the repository's .git directory.\n\t\t/// </summary>\n\t\t/// <param name=\"path\"></param>\n\t\t/// <returns>Returns true if the given path is a valid git repository, false otherwise.</returns>\n\t\tpublic static bool IsValid(string path)\n\t\t{\n\t\t\treturn IsValid(path, false);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks if the directory given by the path is a valid git repository.\n\t\t/// </summary>\n\t\t/// <param name=\"path\"></param>\n\t\t/// <param name=\"bare\"></param>\n\t\t/// <returns>Returns true if the given path is a valid git repository, false otherwise.</returns>\n\t\tpublic static bool IsValid(string path, bool bare)\n\t\t{\n\t\t\tif (path == null)\n\t\t\t\treturn false;\n\t\t\tif (!bare)\n\t\t\t{\n\t\t\t\tif (!Regex.IsMatch(path, \"\\\\.git[/\\\\\\\\]?$\"))\n\t\t\t\t\tpath = Path.Combine(path, Constants.DOT_GIT);\n\t\t\t}\n\n\t\t\tif (!DirExists(path))\n\t\t\t\treturn false;\n\t\t\tif (!FileExists(Path.Combine(path, \"HEAD\")))\n\t\t\t\treturn false;\n\t\t\tif (!FileExists(Path.Combine(path, \"config\")))\n\t\t\t\treturn false;\n\t\t\t//if (!DirExists(Path.Combine(path, \"description\")))\n\t\t\t//    return false;\n\t\t\t//if (!DirExists(Path.Combine(path, \"hooks\")))\n\t\t\t//   return false;\n\t\t\t//if (!DirExists(Path.Combine(path, \"info\")))\n\t\t\t//    return false;\n\t\t\t//if (!DirExists(Path.Combine(path, \"info/exclude\")))\n\t\t\t//    return false;\n\t\t\tif (!DirExists(Path.Combine(path, \"objects\")))\n\t\t\t\treturn false;\n\t\t\tif (!DirExists(Path.Combine(path, \"objects/info\")))\n\t\t\t\treturn false;\n\t\t\tif (!DirExists(Path.Combine(path, \"objects/pack\")))\n\t\t\t\treturn false;\n\t\t\tif (!DirExists(Path.Combine(path, \"refs\")))\n\t\t\t\treturn false;\n\t\t\tif (!DirExists(Path.Combine(path, \"refs/heads\")))\n\t\t\t\treturn false;\n\t\t\tif (!DirExists(Path.Combine(path, \"refs/tags\")))\n\t\t\t\treturn false;\n\n\t\t\tRepository repo = null;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// let's see if it loads without throwing an exception\n\t\t\t\trepo = new Repository(path);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tif (repo != null)\n\t\t\t\t{\n\t\t\t\t\trepo.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Searches for a git repository starting at the given path.\n\t\t/// \n\t\t/// Starting at the given path, searches up the file hierarchy for the next .git directory.\n\t\t/// </summary>\n\t\t/// <param name=\"starting_directory\">The path where the search should start or null to start at the current directory</param>\n\t\t/// <returns>A path if a repository has been found or null otherwise</returns>\n\t\tpublic static string FindRepository(string starting_directory)\n\t\t{\n\t\t\tvar directory = starting_directory;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (directory == null)\n\t\t\t\t\tdirectory = System.IO.Directory.GetCurrentDirectory();\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tvar git = Path.Combine(directory, Constants.DOT_GIT);\n\t\t\t\t\tif (DirExists(git))\n\t\t\t\t\t\treturn git;\n\n\t\t\t\t\t//Get parent directory\n\t\t\t\t\tvar parent_directory = Path.Combine(Path.GetFullPath(directory), \"..\");\n\t\t\t\t\tparent_directory = Path.GetFullPath(parent_directory);\n\t\t\t\t\tif (parent_directory == directory) // <-- we have reached a toplevel directory which doesn't contain a .git dir.\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tdirectory = parent_directory;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (ArgumentException) // --> invalid path form\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcatch (SecurityException) // --> access denied\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcatch (UnauthorizedAccessException) // --> access denied\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcatch (PathTooLongException)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcatch (NotSupportedException) // --> hmm?\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool DirExists(string path)\n\t\t{\n\t\t\treturn new DirectoryInfo(path).Exists;\n\t\t}\n\n\t\tprivate static bool FileExists(string path)\n\t\t{\n\t\t\treturn new FileInfo(path).Exists;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts a given absolute or relative path into a repository relative path. \n\t\t/// </summary>\n\t\tprotected string GetRelativePath(string path)\n\t\t{\n\t\t\treturn Core.Util.PathUtil.RelativePath(WorkingDirectory, path);\n\t\t}\n\n\t\t#region Accessing git Objects\n\n\t\t/// <summary>\n\t\t/// Access a git object by name, id or path. Use the type parameter to tell what kind of object you like to get. Supported types are\n\t\t/// <ul>\n\t\t///   <il><see cref=\"Blob\"/></il>\n\t\t///   <il><see cref=\"Branch\"/></il>\n\t\t///   <il><see cref=\"GitSharp.Commit\"/></il>\n\t\t///   <il><see cref=\"Leaf\"/></il>\n\t\t///   <il><see cref=\"Tag\"/></il>\n\t\t///   <il><see cref=\"Tree\"/></il>\n\t\t///   <il><see cref=\"AbstractTreeNode\"/> - use this if you are not sure about the type of a path (Tree or Leaf)</il>\n\t\t///   <il><see cref=\"AbstractObject\"/> - use this if you are not sure about the type yourself. You will get back an object of the correct type (Blob, Commit, Tag or Tree).</il>\n\t\t/// </ul>\n\t\t///\t<para />\n\t\t/// Branches, Commits or Tags may be accessed by name or reference expression. Currently supported are combinations of these:\n\t\t///\t<ul>\n\t\t///\t  <li>hash - a SHA-1 hash</li>\n\t\t///\t  <li>refs/... - a ref name</li>\n\t\t///\t  <li>ref^n - nth parent reference</li>\n\t\t///\t  <li>ref~n - distance via parent reference</li>\n\t\t///\t  <li>ref@{n} - nth version of ref</li>\n\t\t///\t  <li>ref^{tree} - tree references by ref</li>\n\t\t///\t  <li>ref^{commit} - commit references by ref</li>\n\t\t///\t</ul>\n\t\t///\t<para />\n\t\t///\tNot supported is\n\t\t///\t<ul>\n\t\t///    <li>abbreviated SHA-1</li>\n\t\t///\t  <li>timestamps in reflogs, ref@{full or relative timestamp}</li>\n\t\t///\t</ul>\t\t\n\t\t/// <para/>\n\t\t/// Tree or Leaf objects can be addressed by long hash or by their absolute or relative repository path\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic T Get<T>(string identifier) where T : class\n\t\t{\n\t\t\tif (typeof(T) == typeof(Blob))\n\t\t\t\treturn GetBlob(identifier) as T;\n\t\t\tif (typeof(T) == typeof(Branch))\n\t\t\t\treturn GetBranch(identifier) as T;\n\t\t\tif (typeof(T) == typeof(Commit))\n\t\t\t\treturn GetCommit(identifier) as T;\n\t\t\tif (typeof(T) == typeof(Leaf))\n\t\t\t\treturn GetLeaf(identifier) as T;\n\t\t\tif (typeof(T) == typeof(Tag))\n\t\t\t\treturn GetTag(identifier) as T;\n\t\t\tif (typeof(T) == typeof(Tree))\n\t\t\t\treturn GetTree(identifier) as T;\n\t\t\tif (typeof(T) == typeof(AbstractTreeNode))\n\t\t\t\treturn GetTreeNode(identifier) as T;\n\t\t\tif (typeof(T) == typeof(AbstractObject))\n\t\t\t\treturn Get(_internal_repo.Resolve(identifier)) as T;\n\t\t\tthrow new ArgumentException(\"Type parameter \" + typeof(T).Name + \" is not supported by Get<T>!\");\n\t\t}\n\n\t\tinternal AbstractObject Get(ObjectId id)\n\t\t{\n\t\t\treturn AbstractObject.Wrap(this, id);\n\t\t}\n\n\t\tinternal AbstractTreeNode GetTreeNode(string path)\n\t\t{\n\t\t\tvar obj = Head.CurrentCommit.Tree[GetRelativePath(path)];\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\t\t\tif (obj is AbstractTreeNode)\n\t\t\t\treturn obj as AbstractTreeNode;\n\t\t\treturn null;\n\t\t}\n\n\t\tinternal Leaf GetLeaf(string path)\n\t\t{\n\t\t\tvar obj = Head.CurrentCommit.Tree[GetRelativePath(path)];\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\t\t\tif (obj is Leaf)\n\t\t\t\treturn obj as Leaf;\n\t\t\treturn null;\n\t\t}\n\n\t\tinternal Blob GetBlob(string path)\n\t\t{\n\t\t\t//if (path.Length==Constants.OBJECT_ID_LENGTH)\n\t\t\tvar obj = Head.CurrentCommit.Tree[GetRelativePath(path)];\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\t\t\tif (obj is Leaf)\n\t\t\t\treturn (obj as Leaf).Blob;\n\t\t\tif (obj.IsBlob)\n\t\t\t\treturn (Blob)obj;\n\t\t\treturn new Blob(this, obj._id);\n\t\t}\n\n\t\tinternal Tag GetTag(string identifier)\n\t\t{\n\t\t\treturn new Tag(this, identifier);\n\t\t}\n\n\t\tinternal Branch GetBranch(string identifier)\n\t\t{\n\t\t\treturn new Branch(this, identifier);\n\t\t}\n\n\t\tinternal Commit GetCommit(string identifier)\n\t\t{\n\t\t\treturn Get(_internal_repo.Resolve(identifier)) as Commit;\n\t\t}\n\n\t\tinternal Tree GetTree(string path)\n\t\t{\n\t\t\treturn Head.CurrentCommit.Tree[GetRelativePath(path)] as Tree;\n\t\t}\n\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp/RepositoryStatus.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing GitSharp.Core;\n\nnamespace GitSharp\n{\n\tpublic class RepositoryStatus\n\t{\n\n\t\tprivate GitIndex _index;\n\t\tprivate Core.Tree _tree;\n\t\tprivate string _root_path;\n\t\tprivate bool _recursive;\n\t\tprivate string _file_path;\n\n\t\tpublic RepositoryStatus(Repository repository)\n\t\t\t: this(repository, new RepositoryStatusOptions { ForceContentCheck = true })\n\t\t{\n\t\t}\n\n\t\tpublic RepositoryStatus(Repository repository, RepositoryStatusOptions options)\n\t\t{\n\t\t\tRepository = repository;\n\t\t\tOptions = options;\n\t\t\t_root_path = string.Empty;\n\t\t\t_recursive = true;\n\t\t\tUpdate();\n\t\t}\n\n\t\tinternal RepositoryStatus(Repository repository, RepositoryStatusOptions options, string singleFile, string rootDir, bool recursive)\n\t\t{\n\t\t\tRepository = repository;\n\t\t\tOptions = options ?? new RepositoryStatusOptions { ForceContentCheck = true };\n\t\t\tIgnoreHandler = new IgnoreHandler(Repository);\n\t\t\t_root_path = Repository.ToGitPath (rootDir);\n\t\t\t_recursive = recursive;\n\t\t\t_file_path = Repository.ToGitPath (singleFile);\n\t\t\tUpdate();\n\t\t}\n\n\t\tpublic Repository Repository\n\t\t{\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\tpublic RepositoryStatusOptions Options { get; set; }\n\n\t\t/// <summary>\n\t\t/// List of files added to the index, which are not in the current commit\n\t\t/// </summary>\n\t\tpublic HashSet<string> Added { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files added to the index, which are already in the current commit with different content\n\t\t/// </summary>\n\t\tpublic HashSet<string> Staged { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files removed from the index but are existent in the current commit\n\t\t/// </summary>\n\t\tpublic HashSet<string> Removed { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files existent in the index but are missing in the working directory\n\t\t/// </summary>\n\t\tpublic HashSet<string> Missing { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files with unstaged modifications. A file may be modified and staged at the same time if it has been modified after adding.\n\t\t/// </summary>\n\t\tpublic HashSet<string> Modified { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files existing in the working directory but are neither tracked in the index nor in the current commit.\n\t\t/// </summary>\n\t\tpublic HashSet<string> Untracked { get; private set; }\n\n\t\t/// <summary>\n\t\t/// List of files with staged modifications that conflict.\n\t\t/// </summary>\n\t\tpublic HashSet<string> MergeConflict { get; private set; }\n\n\t\t///// <summary>\n\t\t///// Returns the number of files checked into the git repository\n\t\t///// </summary>\n\t\t//public int IndexSize { get { return _index.Members.Count; } }\n\n\t\tpublic bool AnyDifferences { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Recalculates the status\n\t\t/// </summary>\n\t\tpublic void Update()\n\t\t{\n\t\t\tAnyDifferences = false;\n\t\t\tAdded = new HashSet<string>();\n\t\t\tStaged = new HashSet<string>();\n\t\t\tRemoved = new HashSet<string>();\n\t\t\tMissing = new HashSet<string>();\n\t\t\tModified = new HashSet<string>();\n\t\t\tUntracked = new HashSet<string>();\n\t\t\tMergeConflict = new HashSet<string>();\n\t\t\tIgnoreHandler = new IgnoreHandler(Repository);\n\t\t\t\n\t\t\tif (_file_path != null)\n\t\t\t\tUpdateSingleFile (_file_path);\n\t\t\telse if (_recursive)\n\t\t\t\tUpdateDirectoryRecursive (_root_path);\n\t\t\telse\n\t\t\t\tUpdateDirectoryNotRecursive (_root_path);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Run the diff operation. Until this is called, all lists will be empty\n\t\t/// </summary>\n\t\t/// <returns>true if anything is different between index, tree, and workdir</returns>\n\t\tprivate void UpdateDirectoryRecursive (string path)\n\t\t{\n\t\t\tvar commit = Repository.Head.CurrentCommit;\n\t\t\t_tree = (commit != null ? commit.Tree : new Core.Tree(Repository));\n\t\t\t_index = Repository.Index.GitIndex;\n\t\t\t_index.RereadIfNecessary();\n\t\t\tDirectoryInfo root = _index.Repository.WorkingDirectory;\n\t\t\tvar visitor = new AbstractIndexTreeVisitor { VisitEntryAux = OnVisitEntry };\n\t\t\tnew IndexTreeWalker(_index, _tree, CreateWorkingDirectoryTree(path), root, visitor).Walk();\n\t\t}\n\n\t\tprivate void UpdateDirectoryNotRecursive (string path)\n\t\t{\n\t\t\t_index = Repository.Index.GitIndex;\n\t\t\t\n\t\t\t// Tree that will hold the working dir file entries\n\t\t\tvar wtree = new Core.Tree(Repository._internal_repo);\n\t\t\t\n\t\t\t// Get a list of a leaves in the path\n\t\t\t\n\t\t\tTree commitTree = null;\n\t\t\tvar commit = Repository.Head.CurrentCommit;\n\t\t\tcommitTree = commit != null ? commit.Tree : null;\n\t\t\tif (commitTree != null)\n\t\t\t\tcommitTree = commitTree[path] as Tree;\n\t\t\t\n\t\t\tDictionary<string,Leaf> commitEntries;\n\t\t\tif (commitTree != null)\n\t\t\t\tcommitEntries = commitTree.Leaves.ToDictionary (l => l.Path);\n\t\t\telse\n\t\t\t\tcommitEntries = new Dictionary<string, Leaf> ();\n\t\t\t\n\t\t\tHashSet<string> visited = new HashSet<string> ();\n\n\t\t\t// Compare commited files and working tree files\n\t\t\t\n\t\t\tDirectoryInfo dir = new DirectoryInfo (Repository.FromGitPath (path));\n\t\t\tif (dir.Exists) {\n\t\t\t\tforeach (FileInfo fileInfo in dir.GetFiles ()) {\n\t\t\t\t\tstring file = path + \"/\" + fileInfo.Name;\n\t\t\t\t\t\n\t\t\t\t\tLeaf lf;\n\t\t\t\t\tif (commitEntries.TryGetValue (file, out lf)) {\n\t\t\t\t\t\t// Remove from the collection. At the end of the loop, entries still remaining in the\n\t\t\t\t\t\t// collection will be processed as not having a corresponding working dir file\n\t\t\t\t\t\tcommitEntries.Remove (file);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tTreeEntry wdirEntry = null;\n\t\t\t\t\tif (!IgnoreHandler.IsIgnored (file) && fileInfo.Exists)\n\t\t\t\t\t\twdirEntry = wtree.AddFile (file);\n\t\t\t\t\t\n\t\t\t\t\tGitIndex.Entry indexEntry = _index.GetEntry (file);\n\t\t\t\t\t\n\t\t\t\t\tOnVisitEntry (lf != null ? lf.InternalEntry : null, wdirEntry, indexEntry, fileInfo);\n\t\t\t\t\tvisited.Add (file);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Now visit entries for which a working dir file was not found\n\t\t\t\n\t\t\tforeach (var lf in commitEntries) {\n\t\t\t\tstring file = lf.Key;\n\t\t\t\tFileInfo fileInfo = new FileInfo (Repository.FromGitPath (file));\n\t\t\t\tGitIndex.Entry indexEntry = _index.GetEntry (file);\n\t\t\t\tOnVisitEntry (lf.Value.InternalEntry, null, indexEntry, fileInfo);\n\t\t\t\tvisited.Add (file);\n\t\t\t}\n\t\t\t\n\t\t\t// Finally, visit remaining index entries which are not in the working dir nor in the commit\n\t\t\t\n\t\t\tforeach (var ie in _index.Members) {\n\t\t\t\tstring file = ie.Name;\n\t\t\t\t// Exclude entries in subdirectories of _root_path \n\t\t\t\tint i = file.LastIndexOf ('/');\n\t\t\t\tstring fdir = i != -1 ? file.Substring (0, i) : string.Empty;\n\t\t\t\tif (fdir == _root_path && !visited.Contains (file))\n\t\t\t\t\tOnVisitEntry (null, null, ie, new FileInfo (Repository.FromGitPath (file)));\n\t\t\t}\n\t\t}\n\t\t\n\t\tprivate void UpdateSingleFile (string file)\n\t\t{\n\t\t\tTreeEntry treeEntry = null;\n\t\t\tvar commit = Repository.Head.CurrentCommit;\n\t\t\t_tree = commit != null ? commit.Tree : null;\n\t\t\tif (_tree != null)\n\t\t\t\ttreeEntry = _tree.FindBlobMember (file);\n\t\t\t\n\t\t\t_index = Repository.Index.GitIndex;\n\t\t\t_index.RereadIfNecessary();\n\t\t\tGitIndex.Entry indexEntry = _index.GetEntry (file);\n\t\t\t\n\t\t\tTreeEntry wdirEntry = null;\n\t\t\tFileInfo fileInfo = new FileInfo (Path.Combine (Repository.WorkingDirectory, file.Replace ('/', Path.DirectorySeparatorChar)));\n\t\t\tif (fileInfo.Exists && !IgnoreHandler.IsIgnored(file)) {\n\t\t\t\tvar tree = new Core.Tree(Repository._internal_repo);\n\t\t\t\twdirEntry = tree.AddFile (file);\n\t\t\t}\n\t\t\t\n\t\t\tOnVisitEntry (treeEntry, wdirEntry, indexEntry, fileInfo);\n\t\t}\n\n\t\tprivate GitSharp.Core.Tree CreateWorkingDirectoryTree(string subdir)\n\t\t{\n\t\t\tvar mainTree = new Core.Tree(Repository._internal_repo);\n\t\t\tvar tree = mainTree;\n\t\t\t\n\t\t\t// Create the subdir branch\n\t\t\tforeach (string sdir in subdir.Split (new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries))\n\t\t\t\ttree = tree.AddTree (sdir);\n\t\t\t\n\t\t\tDirectoryInfo root = new DirectoryInfo (Repository.FromGitPath (subdir));\n\t\t\tif (root.Exists)\n\t\t\t\tFillTree(root, tree);\n\t\t\treturn mainTree;\n\t\t}\n\n\t\tprivate IgnoreHandler IgnoreHandler\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tprivate void FillTree(DirectoryInfo dir, Core.Tree tree)\n\t\t{\n\t\t\tforeach (var subdir in dir.GetDirectories())\n\t\t\t{\n\t\t\t\tif (subdir.Name == Constants.DOT_GIT || IgnoreHandler.IsIgnored(tree.FullName + \"/\" + subdir.Name))\n\t\t\t\t\tcontinue;\n\t\t\t\tvar t = tree.AddTree(subdir.Name);\n\t\t\t\tFillTree(subdir, t);\n\t\t\t}\n\t\t\tforeach (var file in dir.GetFiles())\n\t\t\t{\n\t\t\t\tif (IgnoreHandler.IsIgnored(tree.FullName + \"/\" + file.Name))\n\t\t\t\t\tcontinue;\n\t\t\t\ttree.AddFile((file.Name));\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"treeEntry\"></param>\n\t\t/// <param name=\"wdirEntry\">Note: wdirEntry is the non-ignored working directory entry.</param>\n\t\t/// <param name=\"indexEntry\"></param>\n\t\t/// <param name=\"file\">Note: gitignore patterns do not influence this parameter</param>\n\t\tprivate void OnVisitEntry(TreeEntry treeEntry, TreeEntry wdirEntry, GitIndex.Entry indexEntry, FileInfo file)\n\t\t{\n\t\t\t//Console.WriteLine(\" ----------- \");\n\t\t\t//if (treeEntry != null)\n\t\t\t//   Console.WriteLine(\"tree: \" + treeEntry.Name);\n\t\t\t//if (wdirEntry != null)\n\t\t\t//   Console.WriteLine(\"w-dir: \" + wdirEntry.Name);\n\t\t\t//if (indexEntry != null)\n\t\t\t//   Console.WriteLine(\"index: \" + indexEntry.Name);\n\t\t\t//Console.WriteLine(\"file: \" + file.Name);\n\t\t\t\n\t\t\tstring subdir_prefix = !string.IsNullOrEmpty (_root_path) ? _root_path + \"/\" : null;\n\t\t\t\n\t\t\tPathStatus path_status = null;\n\t\t\tif (indexEntry != null)\n\t\t\t{\n\t\t\t\tif (subdir_prefix != null && !indexEntry.Name.StartsWith (subdir_prefix))\n\t\t\t\t\treturn; // File outside the directory\n\t\t\t\t\n\t\t\t\tif (treeEntry == null)\n\t\t\t\t{\n\t\t\t\t\tpath_status = OnAdded(indexEntry.Name, path_status);\n\t\t\t\t}\n\t\t\t\tif (treeEntry != null && !treeEntry.Id.Equals(indexEntry.ObjectId))\n\t\t\t\t{\n\t\t\t\t\tDebug.Assert(treeEntry.FullName == indexEntry.Name);\n\t\t\t\t\tpath_status = OnStaged(indexEntry.Name, path_status);\n\t\t\t\t}\n\t\t\t\tif (!file.Exists)\n\t\t\t\t{\n\t\t\t\t\tpath_status = OnMissing(indexEntry.Name, path_status);\n\t\t\t\t}\n\t\t\t\tif (file.Exists && indexEntry.IsModified(new DirectoryInfo(Repository.WorkingDirectory), Options.ForceContentCheck))\n\t\t\t\t{\n\t\t\t\t\tpath_status = OnModified(indexEntry.Name, path_status);\n\t\t\t\t}\n\t\t\t\tif (indexEntry.Stage != 0)\n\t\t\t\t{\n\t\t\t\t\tpath_status = OnMergeConflict(indexEntry.Name, path_status);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse // <-- index entry == null\n\t\t\t{\n\t\t\t\tif (treeEntry != null && subdir_prefix != null && !treeEntry.FullName.StartsWith (subdir_prefix))\n\t\t\t\t\treturn; // File outside the directory\n\t\t\t\t\n\t\t\t\tif (treeEntry != null && !(treeEntry is Core.Tree))\n\t\t\t\t{\n\t\t\t\t\tpath_status = OnRemoved(treeEntry.FullName, path_status);\n\t\t\t\t}\n\t\t\t\tif (wdirEntry != null) // actually, we should enforce (treeEntry == null ) here too but original git does not, may be a bug. \n\t\t\t\t\tpath_status = OnUntracked(wdirEntry.FullName, path_status);\n\t\t\t}\n\t\t\tif (Options.PerPathNotificationCallback != null && path_status != null)\n\t\t\t\tOptions.PerPathNotificationCallback(path_status);\n\t\t}\n\n\t\tprivate PathStatus OnAdded(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.IndexPathStatus = IndexPathStatus.Added;\n\t\t\t}\n\t\t\tAdded.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnStaged(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.IndexPathStatus = IndexPathStatus.Staged;\n\t\t\t}\n\t\t\tStaged.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnMissing(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.WorkingPathStatus = WorkingPathStatus.Missing;\n\t\t\t}\n\t\t\tMissing.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnModified(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.WorkingPathStatus = WorkingPathStatus.Modified;\n\t\t\t}\n\t\t\tModified.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnMergeConflict(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.IndexPathStatus = IndexPathStatus.MergeConflict;\n\t\t\t}\n\t\t\tMergeConflict.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnRemoved(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.IndexPathStatus = IndexPathStatus.Removed;\n\t\t\t}\n\t\t\tRemoved.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\n\t\tprivate PathStatus OnUntracked(string path, PathStatus status)\n\t\t{\n\t\t\tif (Options.PerPathNotificationCallback != null)\n\t\t\t{\n\t\t\t\tif (status == null)\n\t\t\t\t\tstatus = new PathStatus(Repository, path);\n\t\t\t\tstatus.WorkingPathStatus = WorkingPathStatus.Untracked;\n\t\t\t}\n\t\t\tUntracked.Add(path);\n\t\t\tAnyDifferences = true;\n\t\t\treturn status;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// RepositoryStatus options allow customizing of the status checking routines. \n\t/// </summary>\n\tpublic class RepositoryStatusOptions\n\t{\n\t\t/// <summary>\n\t\t/// If filetime and index entry time are equal forces a full content check. This can be costly for large repositories.\n\t\t/// </summary>\n\t\tpublic bool ForceContentCheck { get; set; }\n\t\t/// <summary>\n\t\t/// If you want to get instant per path status info while the algorithm traverses working directry, index and commit tree set this callback. Note,\n\t\t/// that it is fired only if RepositoryStatus detects differences.\n\t\t/// </summary>\n\t\tpublic Action<PathStatus> PerPathNotificationCallback { get; set; }\n\t}\n\n\t/// <summary>\n\t/// Status information for a single path in the working directry or index. See RepositoryStatusOptions.PerPathNotification for more information.\n\t/// </summary>\n\tpublic class PathStatus\n\t{\n\t\tpublic PathStatus(Repository repo, string path)\n\t\t{\n\t\t\tRepository = repo;\n\t\t\tPath = path;\n\t\t\tWorkingPathStatus = WorkingPathStatus.Unchanged;\n\t\t\tIndexPathStatus = IndexPathStatus.Unchanged;\n\t\t}\n\n\t\tpublic Repository Repository { get; set; }\n\t\t/// <summary>\n\t\t/// Relative repository path.\n\t\t/// </summary>\n\t\tpublic string Path { get; set; }\n\t\t/// <summary>\n\t\t/// Name of the file\n\t\t/// </summary>\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Path == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn System.IO.Path.GetFileName(Path);\n\t\t\t}\n\t\t}\n\t\tpublic WorkingPathStatus WorkingPathStatus { get; set; }\n\t\tpublic IndexPathStatus IndexPathStatus { get; set; }\n\t}\n\n\tpublic enum WorkingPathStatus { Unchanged, Modified, Missing, Untracked }\n\tpublic enum IndexPathStatus { Unchanged, Added, Removed, Staged, MergeConflict }\n}\n"
  },
  {
    "path": "GitSharp/ResetBehavior.cs",
    "content": "/*\n * Copyright (C) 2009, Nulltoken <emeric.fermas@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Reset policies for Branch.Reset (see Branch)\n\t/// </summary>\n\tpublic enum ResetBehavior\n\t{\n\n\t\t/// <summary>\n\t\t/// Resets the index but not the working directory (i.e., the changed files are preserved but not marked for commit).\n\t\t/// </summary>\n\t\tMixed,\n\n\t\t/// <summary>\n\t\t/// Does not touch the index nor the working directory at all, but requires them to be in a good order. This leaves all your changed files \"Changes to be committed\", as git-status would put it.\n\t\t/// </summary>\n\t\tSoft,\n\n\t\t/// <summary>\n\t\t/// Matches the working directory and index to that of the commit being reset to. Any changes to tracked files in the working directory since are lost.\n\t\t/// </summary>\n\t\tHard,\n\n\t\t/// <summary>\n\t\t/// Resets the index to match the tree recorded by the named commit, and updates the files that are different between the named commit and the current commit in the working directory.\n\t\t/// </summary>\n\t\tMerge\n\t}\n}"
  },
  {
    "path": "GitSharp/Stash.cs",
    "content": "// \n// Stash.cs\n//  \n// Author:\n//       Lluis Sanchez Gual <lluis@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Collections;\nusing GitSharp.Core;\nusing System.Text;\n\nnamespace GitSharp\n{\n\tpublic class Stash\n\t{\n\t\tinternal string PrevStashCommitId { get; private set; }\n\t\tinternal string CommitId { get; private set; }\n\t\tinternal string FullLine { get; private set; }\n\t\tinternal StashCollection StashCollection { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Who created the stash\n\t\t/// </summary>\n\t\tpublic Author Author { get; private set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Timestamp of the stash creation\n\t\t/// </summary>\n\t\tpublic DateTimeOffset DateTime { get; private set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Stash comment\n\t\t/// </summary>\n\t\tpublic string Comment { get; private set; }\n\t\t\n\t\tprivate Stash ()\n\t\t{\n\t\t}\n\t\t\n\t\tinternal Stash (string prevStashCommitId, string commitId, Author author, string comment)\n\t\t{\n\t\t\tthis.PrevStashCommitId = prevStashCommitId;\n\t\t\tthis.CommitId = commitId;\n\t\t\tthis.Author = author;\n\t\t\tthis.Comment = comment;\n\t\t\tthis.DateTime = DateTimeOffset.Now;\n\t\t\t\n\t\t\t// Create the text line to be written in the stash log\n\t\t\t\n\t\t\tint secs = (int) (this.DateTime - new DateTimeOffset (1970, 1, 1, 0, 0, 0, TimeSpan.Zero)).TotalSeconds;\n\t\t\tConsole.WriteLine ();\n\t\t\t\n\t\t\tTimeSpan ofs = this.DateTime.Offset;\n\t\t\tstring tz = string.Format (\"{0}{1:00}{2:00}\", (ofs.Hours >= 0 ? '+':'-'), Math.Abs (ofs.Hours), Math.Abs (ofs.Minutes));\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tsb.Append (prevStashCommitId ?? new string ('0', 40)).Append (' ');\n\t\t\tsb.Append (commitId).Append (' ');\n\t\t\tsb.Append (author.Name).Append (\" <\").Append (author.EmailAddress).Append (\"> \");\n\t\t\tsb.Append (secs).Append (' ').Append (tz).Append ('\\t');\n\t\t\tsb.Append (comment);\n\t\t\tFullLine = sb.ToString ();\n\t\t}\n\n\t\t\n\t\tinternal static Stash Parse (string line)\n\t\t{\n\t\t\t// Parses a stash log line and creates a Stash object with the information\n\t\t\t\n\t\t\tStash s = new Stash ();\n\t\t\ts.PrevStashCommitId = line.Substring (0, 40);\n\t\t\tif (s.PrevStashCommitId.All (c => c == '0')) // And id will all 0 means no parent (first stash of the stack)\n\t\t\t\ts.PrevStashCommitId = null;\n\t\t\ts.CommitId = line.Substring (41, 40);\n\t\t\t\n\t\t\tint i = line.IndexOf ('<');\n\t\t\ts.Author = new Author ();\n\t\t\tif (i != -1) {\n\t\t\t\ts.Author.Name = line.Substring (82, i - 82 - 1);\n\t\t\t\ti++;\n\t\t\t\tint i2 = line.IndexOf ('>', i);\n\t\t\t\tif (i2 != -1)\n\t\t\t\t\ts.Author.EmailAddress = line.Substring (i, i2 - i);\n\t\t\t\t\n\t\t\t\ti2 += 2;\n\t\t\t\ti = line.IndexOf (' ', i2);\n\t\t\t\tint secs = int.Parse (line.Substring (i2, i - i2));\n\n\t\t\t\tstring stUtcOffset = line.Substring (i + 1, 3) + \":\" + line.Substring (i + 4, 2);\n\t\t\t\tif (stUtcOffset[0] == '+') stUtcOffset = stUtcOffset.Remove(0, 1);\n\t\t\t\tTimeSpan utcOffset = TimeSpan.Parse(stUtcOffset);\n\n\t\t\t\tDateTime t = new DateTime (1970, 1, 1) + TimeSpan.FromSeconds (secs) + utcOffset;\n\t\t\t\ts.DateTime = new DateTimeOffset(t, utcOffset);\n\n\t\t\t\ts.Comment = line.Substring (i + 7);\n\t\t\t}\n\t\t\ts.FullLine = line;\n\t\t\treturn s;\n\t\t}\n\t\t\n\t\tpublic void Apply ()\n\t\t{\n\t\t\tStashCollection.Apply (this);\n\t\t}\n\t}\n\t\n\tpublic class StashCollection: IEnumerable<Stash>\n\t{\n\t\tRepository _repo;\n\t\t\n\t\tinternal StashCollection (Repository repo)\n\t\t{\n\t\t\tthis._repo = repo;\n\t\t}\n\t\t\n\t\tFileInfo StashLogFile {\n\t\t\tget {\n\t\t\t\tstring stashLog = Path.Combine (_repo.Directory, \"logs\");\n\t\t\t\tstashLog = Path.Combine (stashLog, \"refs\");\n\t\t\t\treturn new FileInfo (Path.Combine (stashLog, \"stash\"));\n\t\t\t}\n\t\t}\n\t\t\n\t\tFileInfo StashRefFile {\n\t\t\tget {\n\t\t\t\tstring file = Path.Combine (_repo.Directory, \"refs\");\n\t\t\t\treturn new FileInfo (Path.Combine (file, \"stash\"));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Stash Create ()\n\t\t{\n\t\t\treturn Create (null);\n\t\t}\n\t\t\n\t\tpublic Stash Create (string message)\n\t\t{\n\t\t\tvar parent = _repo.CurrentBranch.CurrentCommit;\n\t\t\tAuthor author = new Author(_repo.Config[\"user.name\"] ?? \"unknown\", _repo.Config[\"user.email\"] ?? \"unknown@(none).\");\n\t\t\t\n\t\t\tif (message == null) {\n\t\t\t\t// Use the commit summary as message\n\t\t\t\tmessage = parent.ShortHash + \" \" + parent.Message;\n\t\t\t\tint i = message.IndexOfAny (new char[] { '\\r', '\\n' });\n\t\t\t\tif (i != -1)\n\t\t\t\t\tmessage = message.Substring (0, i);\n\t\t\t}\n\t\t\t\n\t\t\t// Create the index tree commit\n\t\t\tGitIndex index = _repo.Index.GitIndex;\n\t\t\tindex.RereadIfNecessary();\n\t\t\tvar tree_id = index.writeTree();\n\t\t\tTree indexTree = new Tree(_repo, tree_id);\n\t\t\tstring commitMsg = \"index on \" + _repo.CurrentBranch.Name + \": \" + message;\n\t\t\tvar indexCommit = Commit.Create(commitMsg + \"\\n\", parent, indexTree, author);\n\n\t\t\t// Create the working dir commit\n\t\t\ttree_id = WriteWorkingDirectoryTree (parent.Tree.InternalTree, index);\n\t\t\tcommitMsg = \"WIP on \" + _repo.CurrentBranch.Name + \": \" + message;\n\t\t\tvar wipCommit = Commit.Create(commitMsg + \"\\n\", new Commit[] { parent, indexCommit }, new Tree(_repo, tree_id), author, author, DateTimeOffset.Now);\n\t\t\t\n\t\t\tstring prevCommit = null;\n\t\t\tFileInfo sf = StashRefFile;\n\t\t\tif (sf.Exists)\n\t\t\t\tprevCommit = File.ReadAllText (sf.FullName);\n\t\t\t\n\t\t\tStash s = new Stash (prevCommit, wipCommit.Hash, author, commitMsg);\n\t\t\t\n\t\t\tFileInfo stashLog = StashLogFile;\n\t\t\tFile.AppendAllText (stashLog.FullName, s.FullLine + \"\\n\");\n\t\t\tFile.WriteAllText (sf.FullName, s.CommitId + \"\\n\");\n\t\t\t\n\t\t\t// Wipe all local changes\n\t\t\t_repo.CurrentBranch.Reset (ResetBehavior.Hard);\n\t\t\t\n\t\t\ts.StashCollection = this;\n\t\t\treturn s;\n\t\t}\n\t\t\n\t\tObjectId WriteWorkingDirectoryTree (Core.Tree headTree, GitIndex index)\n\t\t{\n\t\t\tvar writer = new ObjectWriter(_repo._internal_repo);\n\t\t\tvar tree = new Core.Tree(_repo._internal_repo);\n\t\t\tWriteTree (writer, headTree, index, tree, _repo._internal_repo.WorkingDirectory);\n\t\t\treturn writer.WriteTree (tree);\n\t\t}\n\t\t\n\t\tvoid WriteTree (ObjectWriter writer, Core.Tree headTree, GitIndex index, Core.Tree tree, DirectoryInfo dir)\n\t\t{\n\t\t\tforeach (var fsi in dir.GetFileSystemInfos ()) {\n\t\t\t\tif (fsi is FileInfo) {\n\t\t\t\t\t// Exclude untracked files\n\t\t\t\t\tstring gname = _repo.ToGitPath (fsi.FullName);\n\t\t\t\t\tbool inIndex = index.GetEntry (gname) != null;\n\t\t\t\t\tbool inHead = headTree.FindBlobMember (gname) != null;\n\t\t\t\t\tif (inIndex || inHead) {\n\t\t\t\t\t\tvar entry = tree.AddFile (fsi.Name);\n\t\t\t\t\t\tentry.Id = writer.WriteBlob ((FileInfo)fsi);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (fsi.Name != Constants.DOT_GIT) {\n\t\t\t\t\tvar child = tree.AddTree (fsi.Name);\n\t\t\t\t\tWriteTree (writer, headTree, index, child, (DirectoryInfo) fsi);\n\t\t\t\t\tchild.Id = writer.WriteTree (child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal void Apply (Stash stash)\n\t\t{\n\t\t\t// Restore the working tree\n\t\t\tCommit wip = _repo.Get<Commit> (stash.CommitId);\n\t\t\twip.Checkout();\n\t\t\t_repo._internal_repo.Index.write();\n\t\t\t\n\t\t\t// Restore the index\n\t\t\tCommit index = wip.Parents.Last ();\n\t\t\t_repo.Index.GitIndex.ReadTree (index.Tree.InternalTree);\n\t\t\t_repo.Index.GitIndex.write ();\n\t\t}\n\t\t\n\t\tpublic void Remove (Stash s)\n\t\t{\n\t\t\tList<Stash> stashes = ReadStashes ();\n\t\t\tRemove (stashes, s);\n\t\t}\n\t\t\n\t\tpublic void Pop ()\n\t\t{\n\t\t\tList<Stash> stashes = ReadStashes ();\n\t\t\tStash last = stashes.Last ();\n\t\t\tlast.Apply ();\n\t\t\tRemove (stashes, last);\n\t\t}\n\t\t\n\t\tpublic void Clear ()\n\t\t{\n\t\t\tif (StashRefFile.Exists)\n\t\t\t\tStashRefFile.Delete ();\n\t\t\tif (StashLogFile.Exists)\n\t\t\t\tStashLogFile.Delete ();\n\t\t}\n\t\t\n\t\tvoid Remove (List<Stash> stashes, Stash s)\n\t\t{\n\t\t\tint i = stashes.FindIndex (st => st.CommitId == s.CommitId);\n\t\t\tif (i != -1) {\n\t\t\t\tstashes.RemoveAt (i);\n\t\t\t\tif (stashes.Count == 0) {\n\t\t\t\t\t// No more stashes. The ref and log files can be deleted.\n\t\t\t\t\tStashRefFile.Delete ();\n\t\t\t\t\tStashLogFile.Delete ();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tWriteStashes (stashes);\n\t\t\t\tif (i == stashes.Count) {\n\t\t\t\t\t// We deleted the head. Write the new head.\n\t\t\t\t\tFile.WriteAllText (StashRefFile.FullName, stashes.Last ().CommitId + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerator<Stash> GetEnumerator ()\n\t\t{\n\t\t\treturn ReadStashes ().GetEnumerator ();\n\t\t}\n\t\t\n\t\tList<Stash> ReadStashes ()\n\t\t{\n\t\t\t// Reads the registered stashes\n\t\t\t// Results are returned from the bottom to the top of the stack\n\t\t\t\n\t\t\tList<Stash> result = new List<Stash> ();\n\t\t\tFileInfo logFile = StashLogFile;\n\t\t\tif (!logFile.Exists)\n\t\t\t\treturn result;\n\t\t\t\n\t\t\tDictionary<string,Stash> stashes = new Dictionary<string, Stash> ();\n\t\t\tStash first = null;\n\t\t\tforeach (string line in File.ReadAllLines (logFile.FullName)) {\n\t\t\t\tStash s = Stash.Parse (line);\n\t\t\t\ts.StashCollection = this;\n\t\t\t\tif (s.PrevStashCommitId == null)\n\t\t\t\t\tfirst = s;\n\t\t\t\telse\n\t\t\t\t\tstashes.Add (s.PrevStashCommitId, s);\n\t\t\t}\n\t\t\twhile (first != null) {\n\t\t\t\tresult.Add (first);\n\t\t\t\tstashes.TryGetValue (first.CommitId, out first);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tvoid WriteStashes (List<Stash> list)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tforeach (var s in list) {\n\t\t\t\tsb.Append (s.FullLine);\n\t\t\t\tsb.Append ('\\n');\n\t\t\t}\n\t\t\tFile.WriteAllText (StashLogFile.FullName, sb.ToString ());\n\t\t}\n\t\t\n\t\tIEnumerator IEnumerable.GetEnumerator ()\n\t\t{\n\t\t\treturn GetEnumerator ();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp/Stubs/AddCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.FnMatch;\nusing GitSharp.Core;\n\nnamespace GitSharp.Commands\n{\n    public class AddCommand\n        : AbstractCommand\n    {\n\n        public AddCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Don't actually add the file(s), just show if they exist.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Be verbose.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow adding otherwise ignored files.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add modified contents in the working tree interactively to\n        /// the index. Optional path arguments may be supplied to limit\n        /// operation to a subset of the working tree. See ``Interactive\n        /// mode'' for details.\n        /// \n        /// </summary>\n        public bool Interactive { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Interactively choose hunks of patch between the index and the\n        /// work tree and add them to the index. This gives the user a chance\n        /// to review the difference before adding modified contents to the\n        /// index.\n        /// +\n        /// This effectively runs `add --interactive`, but bypasses the\n        /// initial command menu and directly jumps to the `patch` subcommand.\n        /// See ``Interactive mode'' for details.\n        /// \n        /// </summary>\n        public bool Patch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Open the diff vs. the index in an editor and let the user\n        /// edit it.  After the editor was closed, adjust the hunk headers\n        /// and apply the patch to the index.\n        /// +\n        /// *NOTE*: Obviously, if you change anything else than the first character\n        /// on lines beginning with a space or a minus, the patch will no longer\n        /// apply.\n        /// \n        /// </summary>\n        public bool E { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Update only files that git already knows about, staging modified\n        /// content for commit and marking deleted files for removal. This\n        /// is similar\n        /// to what \"git commit -a\" does in preparation for making a commit,\n        /// except that the update is limited to paths specified on the\n        /// command line. If no paths are specified, all tracked files in the\n        /// current directory and its subdirectories are updated.\n        /// \n        /// </summary>\n        public bool Update { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Update files that git already knows about (same as '\\--update')\n        /// and add all untracked files that are not ignored by '.gitignore'\n        /// mechanism.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Record only the fact that the path will be added later. An entry\n        /// for the path is placed in the index with no content. This is\n        /// useful for, among other things, showing the unstaged content of\n        /// such files with 'git diff' and committing them with 'git commit\n        /// -a'.\n        /// \n        /// </summary>\n        public bool IntentToAdd { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't add the file(s), but only refresh their stat()\n        /// information in the index.\n        /// \n        /// </summary>\n        public bool Refresh { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If some files could not be added because of errors indexing\n        /// them, do not abort the operation, but continue adding the\n        /// others. The command shall still exit with non-zero status.\n        /// \n        /// </summary>\n        public bool IgnoreErrors { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            foreach (string arg in Arguments)\n            {   \n                //Todo: Add FileNameMatcher support. To be added when fnmatch is completed.\n                //For now, pattern matching is not allowed. Please specify the files only.               \n                \n                //Gain access to the Git index using the repository determined before command execution\n                Index index = new Index(Repository);\n                \n                //Use full paths only to eliminate platform-based directory differences\n                string path = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), arg));\n\n                //Perform the validity tests outside of the index to handle the error messages\n                if ((new FileInfo(path).Exists) || (new DirectoryInfo(path).Exists))\n                    index.Add(path);\n                else\n                    OutputStream.WriteLine(path + \" does not exist.\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/AmCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class AmCommand\n        : AbstractCommand\n    {\n\n        public AmCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n         #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add a `Signed-off-by:` line to the commit message, using\n        /// the committer identity of yourself.\n        /// \n        /// </summary>\n        public bool Signoff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\n        /// \n        /// </summary>\n        public bool Keep { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove everything in body before a scissors line (see\n        /// linkgit:git-mailinfo[1]).\n        /// \n        /// </summary>\n        public bool Scissors { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore scissors lines (see linkgit:git-mailinfo[1]).\n        /// \n        /// </summary>\n        public bool NoScissors { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be quiet. Only print error messages.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\n        /// The proposed commit log message taken from the e-mail\n        /// is re-coded into UTF-8 encoding (configuration variable\n        /// `i18n.commitencoding` can be used to specify project's\n        /// preferred encoding if it is not UTF-8).\n        /// +\n        /// This was optional in prior versions of git, but now it is the\n        /// default.   You can use `--no-utf8` to override this.\n        /// \n        /// </summary>\n        public bool Utf8 { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass `-n` flag to 'git-mailinfo' (see\n        /// linkgit:git-mailinfo[1]).\n        /// \n        /// </summary>\n        public bool NoUtf8 { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the patch does not apply cleanly, fall back on\n        /// 3-way merge if the patch records the identity of blobs\n        /// it is supposed to apply to and we have those blobs\n        /// available locally.\n        /// \n        /// </summary>\n        public bool ThreeWay { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n        /// program that applies\n        /// the patch.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n        /// program that applies\n        /// the patch.\n        /// \n        /// </summary>\n        public string IgnoreWhitespace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n        /// program that applies\n        /// the patch.\n        /// \n        /// </summary>\n        public string Whitespace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n        /// program that applies\n        /// the patch.\n        /// \n        /// </summary>\n        public string Directory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n        /// program that applies\n        /// the patch.\n        /// \n        /// </summary>\n        public bool Reject { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Run interactively.\n        /// \n        /// </summary>\n        public bool Interactive { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default the command records the date from the e-mail\n        /// message as the commit author date, and uses the time of\n        /// commit creation as the committer date. This allows the\n        /// user to lie about the committer date by using the same\n        /// value as the author date.\n        /// \n        /// </summary>\n        public bool CommitterDateIsAuthorDate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default the command records the date from the e-mail\n        /// message as the commit author date, and uses the time of\n        /// commit creation as the committer date. This allows the\n        /// user to lie about the author date by using the same\n        /// value as the committer date.\n        /// \n        /// </summary>\n        public bool IgnoreDate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Skip the current patch.  This is only meaningful when\n        /// restarting an aborted patch.\n        /// \n        /// </summary>\n        public bool Skip { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// After a patch failure (e.g. attempting to apply\n        /// conflicting patch), the user has applied it by hand and\n        /// the index file stores the result of the application.\n        /// Make a commit using the authorship and commit log\n        /// extracted from the e-mail message and the current index\n        /// file, and continue.\n        /// \n        /// </summary>\n        public bool Resolved { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When a patch failure occurs, &lt;msg&gt; will be printed\n        /// to the screen before exiting.  This overrides the\n        /// standard message informing you to use `--resolved`\n        /// or `--skip` to handle the failure.  This is solely\n        /// for internal use between 'git-rebase' and 'git-am'.\n        /// \n        /// </summary>\n        public string Resolvemsg { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restore the original branch and abort the patching operation.\n        /// </summary>\n        public bool Abort { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/AnnotateCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class AnnotateCommand\n        : AbstractCommand\n    {\n\n        public AnnotateCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n      #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show blank SHA-1 for boundary commits.  This can also\n        /// be controlled via the `blame.blankboundary` config option.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not treat root commits as boundaries.  This can also be\n        /// controlled via the `blame.showroot` config option.\n        /// \n        /// </summary>\n        public bool Root { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Include additional statistics at the end of blame output.\n        /// \n        /// </summary>\n        public bool ShowStats { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Annotate only the given line range.  &lt;start&gt; and &lt;end&gt; can take\n        /// one of these forms:\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show long rev (Default: off).\n        /// \n        /// </summary>\n        public bool l { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show raw timestamp (Default: off).\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use revisions from revs-file instead of calling linkgit:git-rev-list[1].\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Walk history forward instead of backward. Instead of showing\n        /// the revision in which a line appeared, this shows the last\n        /// revision in which a line has existed. This requires a range of\n        /// revision like START..END where the path to blame exists in\n        /// START.\n        /// \n        /// </summary>\n        public bool Reverse { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show in a format designed for machine consumption.\n        /// \n        /// </summary>\n        public bool Porcelain { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the result incrementally in a format designed for\n        /// machine consumption.\n        /// \n        /// </summary>\n        public bool Incremental { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specifies the encoding used to output author names\n        /// and commit summaries. Setting it to `none` makes blame\n        /// output unconverted data. For more information see the\n        /// discussion about encoding in the linkgit:git-log[1]\n        /// manual page.\n        /// \n        /// </summary>\n        public string Encoding { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When &lt;rev&gt; is not specified, the command annotates the\n        /// changes starting backwards from the working tree copy.\n        /// This flag makes the command pretend as if the working\n        /// tree copy has the contents of the named file (specify\n        /// `-` to make the command read from the standard input).\n        /// \n        /// </summary>\n        public string Contents { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The value is one of the following alternatives:\n        /// {relative,local,default,iso,rfc,short}. If --date is not\n        /// provided, the value of the blame.date config variable is\n        /// used. If the blame.date config variable is also not set, the\n        /// iso format is used. For more information, See the discussion\n        /// of the --date option at linkgit:git-log[1].\n        /// \n        /// </summary>\n        public string Date { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect moving lines in the file as well.  When a commit\n        /// moves a block of lines in a file (e.g. the original file\n        /// has A and then B, and the commit changes it to B and\n        /// then A), the traditional 'blame' algorithm typically blames\n        /// the lines that were moved up (i.e. B) to the parent and\n        /// assigns blame to the lines that were moved down (i.e. A)\n        /// to the child commit.  With this option, both groups of lines\n        /// are blamed on the parent.\n        /// +\n        /// alphanumeric characters that git must detect as moving\n        /// within a file for it to associate those lines with the parent\n        /// commit.\n        /// \n        /// </summary>\n        public string M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `-M`, detect lines copied from other\n        /// files that were modified in the same commit.  This is\n        /// useful when you reorganize your program and move code\n        /// around across files.  When this option is given twice,\n        /// the command additionally looks for copies from all other\n        /// files in the parent for the commit that creates the file.\n        /// +\n        /// alphanumeric characters that git must detect as moving\n        /// between files for it to associate those lines with the parent\n        /// commit.\n        /// \n        /// </summary>\n        public string C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show help message.\n        /// </summary>\n        public bool Help { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ApplyCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ApplyCommand\n        : AbstractCommand\n    {\n\n        public ApplyCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of applying the patch, output diffstat for the\n        /// input.  Turns off \"apply\".\n        /// \n        /// </summary>\n        public bool Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `--stat`, but shows the number of added and\n        /// deleted lines in decimal notation and the pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.  Turns off \"apply\".\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of applying the patch, output a condensed\n        /// summary of information obtained from git diff extended\n        /// headers, such as creations, renames and mode changes.\n        /// Turns off \"apply\".\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of applying the patch, see if the patch is\n        /// applicable to the current working tree and/or the index\n        /// file and detects errors.  Turns off \"apply\".\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `--check` is in effect, or when applying the patch\n        /// (which is the default when none of the options that\n        /// disables it is in effect), make sure the patch is\n        /// applicable to what the current index file records.  If\n        /// the file to be patched in the working tree is not\n        /// up-to-date, it is flagged as an error.  This flag also\n        /// causes the index file to be updated.\n        /// \n        /// </summary>\n        public bool Index { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Apply a patch without touching the working tree. Instead take the\n        /// cached data, apply the patch, and store the result in the index\n        /// without using the working tree. This implies `--index`.\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Newer 'git-diff' output has embedded 'index information'\n        /// for each blob to help identify the original version that\n        /// the patch applies to.  When this flag is given, and if\n        /// the original versions of the blobs are available locally,\n        /// builds a temporary index containing those blobs.\n        /// +\n        /// When a pure mode change is encountered (which has no index information),\n        /// the information is read from the current index instead.\n        /// \n        /// </summary>\n        public string BuildFakeAncestor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Apply the patch in reverse.\n        /// \n        /// </summary>\n        public bool Reverse { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For atomicity, 'git-apply' by default fails the whole patch and\n        /// does not touch the working tree when some of the hunks\n        /// do not apply.  This option makes it apply\n        /// the parts of the patch that are applicable, and leave the\n        /// rejected hunks in corresponding *.rej files.\n        /// \n        /// </summary>\n        public bool Reject { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `--numstat` has been given, do not munge pathnames,\n        /// but use a NUL-terminated machine-readable format.\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove &lt;n&gt; leading slashes from traditional diff paths. The\n        /// default is 1.\n        /// \n        /// </summary>\n        public string P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ensure at least &lt;n&gt; lines of surrounding context match before\n        /// and after each change. When fewer lines of surrounding\n        /// context exist they all must match.  By default no context is\n        /// ever ignored.\n        /// \n        /// </summary>\n        public string C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, 'git-apply' expects that the patch being\n        /// applied is a unified diff with at least one line of context.\n        /// This provides good safety measures, but breaks down when\n        /// applying a diff generated with `--unified=0`. To bypass these\n        /// checks use `--unidiff-zero`.\n        /// +\n        /// Note, for the reasons stated above usage of context-free patches is\n        /// discouraged.\n        /// \n        /// </summary>\n        public bool UnidiffZero { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If you use any of the options marked \"Turns off\n        /// 'apply'\" above, 'git-apply' reads and outputs the\n        /// requested information without actually applying the\n        /// patch.  Give this flag after those flags to also apply\n        /// the patch.\n        /// \n        /// </summary>\n        public bool Apply { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When applying a patch, ignore additions made by the\n        /// patch.  This can be used to extract the common part between\n        /// two files by first running 'diff' on them and applying\n        /// the result with this option, which would apply the\n        /// deletion part but not the addition part.\n        /// \n        /// </summary>\n        public bool NoAdd { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Historically we did not allow binary patch applied\n        /// without an explicit permission from the user, and this\n        /// flag was the way to do so.  Currently we always allow binary\n        /// patch application, so this is a no-op.\n        /// \n        /// </summary>\n        public bool AllowBinaryReplacement { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Historically we did not allow binary patch applied\n        /// without an explicit permission from the user, and this\n        /// flag was the way to do so.  Currently we always allow binary\n        /// patch application, so this is a no-op.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't apply changes to files matching the given path pattern. This can\n        /// be useful when importing patchsets, where you want to exclude certain\n        /// files or directories.\n        /// \n        /// </summary>\n        public string Exclude { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Apply changes to files matching the given path pattern. This can\n        /// be useful when importing patchsets, where you want to include certain\n        /// files or directories.\n        /// +\n        /// When `--exclude` and `--include` patterns are used, they are examined in the\n        /// order they appear on the command line, and the first match determines if a\n        /// patch to each path is used.  A patch to a path that does not match any\n        /// on the command line, and ignored if there is any include pattern.\n        /// \n        /// </summary>\n        public string Include { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When applying a patch, ignore changes in whitespace in context\n        /// lines if necessary.\n        /// Context lines will preserve their whitespace, and they will not\n        /// undergo whitespace fixing regardless of the value of the\n        /// `--whitespace` option. New lines will still be fixed, though.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When applying a patch, ignore changes in whitespace in context\n        /// lines if necessary.\n        /// Context lines will preserve their whitespace, and they will not\n        /// undergo whitespace fixing regardless of the value of the\n        /// `--whitespace` option. New lines will still be fixed, though.\n        /// \n        /// </summary>\n        public bool IgnoreWhitespace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When applying a patch, detect a new or modified line that has\n        /// whitespace errors.  What are considered whitespace errors is\n        /// controlled by `core.whitespace` configuration.  By default,\n        /// trailing whitespaces (including lines that solely consist of\n        /// whitespaces) and a space character that is immediately followed\n        /// by a tab character inside the initial indent of the line are\n        /// considered whitespace errors.\n        /// +\n        /// By default, the command outputs warning messages but applies the patch.\n        /// When `git-apply` is used for statistics and not applying a\n        /// patch, it defaults to `nowarn`.\n        /// +\n        /// You can use different `&lt;action&gt;` values to control this\n        /// behavior:\n        /// +\n        /// * `nowarn` turns off the trailing whitespace warning.\n        /// * `warn` outputs warnings for a few such errors, but applies the\n        /// </summary>\n        public string Whitespace { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ArchiveCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ArchiveCommand\n        : AbstractCommand\n    {\n\n        public ArchiveCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Format of the resulting archive: 'tar' or 'zip'. If this option\n        /// is not given, and the output file is specified, the format is\n        /// inferred from the filename if possible (e.g. writing to \"foo.zip\"\n        /// makes the output to be in the zip format). Otherwise the output\n        /// format is `tar`.\n        /// \n        /// </summary>\n        public string Format { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show all available formats.\n        /// \n        /// </summary>\n        public bool List { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Report progress to stderr.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Prepend &lt;prefix&gt;/ to each filename in the archive.\n        /// \n        /// </summary>\n        public string Prefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Write the archive to &lt;file&gt; instead of stdout.\n        /// \n        /// </summary>\n        public string Output { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Look for attributes in .gitattributes in working directory too.\n        /// \n        /// </summary>\n        public bool WorktreeAttributes { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of making a tar archive from the local repository,\n        /// retrieve a tar archive from a remote repository.\n        /// \n        /// </summary>\n        public string Remote { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Used with --remote to specify the path to the\n        /// 'git-upload-archive' on the remote side.\n        /// \n        /// </summary>\n        public string Exec { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/BlameCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class BlameCommand\n        : AbstractCommand\n    {\n\n        public BlameCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the same output mode as linkgit:git-annotate[1] (Default: off).\n        /// \n        /// </summary>\n        public bool c { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Include debugging information related to the movement of\n        /// lines between files (see `-C`) and lines moved within a\n        /// file (see `-M`).  The first number listed is the score.\n        /// This is the number of alphanumeric characters detected\n        /// as having been moved between or within files.  This must be above\n        /// a certain threshold for 'git-blame' to consider those lines\n        /// of code to have been moved.\n        /// \n        /// </summary>\n        public bool ScoreDebug { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the filename in the original commit.  By default\n        /// the filename is shown if there is any line that came from a\n        /// file with a different name, due to rename detection.\n        /// \n        /// </summary>\n        public bool ShowName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the line number in the original commit (Default: off).\n        /// \n        /// </summary>\n        public bool ShowNumber { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Suppress the author name and timestamp from the output.\n        /// \n        /// </summary>\n        public bool s { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing the parent's version and\n        /// the child's to find where the lines came from.\n        /// \n        /// </summary>\n        public bool W { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show blank SHA-1 for boundary commits.  This can also\n        /// be controlled via the `blame.blankboundary` config option.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not treat root commits as boundaries.  This can also be\n        /// controlled via the `blame.showroot` config option.\n        /// \n        /// </summary>\n        public bool Root { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Include additional statistics at the end of blame output.\n        /// \n        /// </summary>\n        public bool ShowStats { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Annotate only the given line range.  &lt;start&gt; and &lt;end&gt; can take\n        /// one of these forms:\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show long rev (Default: off).\n        /// \n        /// </summary>\n        public bool l { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show raw timestamp (Default: off).\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use revisions from revs-file instead of calling linkgit:git-rev-list[1].\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Walk history forward instead of backward. Instead of showing\n        /// the revision in which a line appeared, this shows the last\n        /// revision in which a line has existed. This requires a range of\n        /// revision like START..END where the path to blame exists in\n        /// START.\n        /// \n        /// </summary>\n        public bool Reverse { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show in a format designed for machine consumption.\n        /// \n        /// </summary>\n        public bool Porcelain { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the result incrementally in a format designed for\n        /// machine consumption.\n        /// \n        /// </summary>\n        public bool Incremental { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specifies the encoding used to output author names\n        /// and commit summaries. Setting it to `none` makes blame\n        /// output unconverted data. For more information see the\n        /// discussion about encoding in the linkgit:git-log[1]\n        /// manual page.\n        /// \n        /// </summary>\n        public string Encoding { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When &lt;rev&gt; is not specified, the command annotates the\n        /// changes starting backwards from the working tree copy.\n        /// This flag makes the command pretend as if the working\n        /// tree copy has the contents of the named file (specify\n        /// `-` to make the command read from the standard input).\n        /// \n        /// </summary>\n        public string Contents { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The value is one of the following alternatives:\n        /// {relative,local,default,iso,rfc,short}. If --date is not\n        /// provided, the value of the blame.date config variable is\n        /// used. If the blame.date config variable is also not set, the\n        /// iso format is used. For more information, See the discussion\n        /// of the --date option at linkgit:git-log[1].\n        /// \n        /// </summary>\n        public string Date { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect moving lines in the file as well.  When a commit\n        /// moves a block of lines in a file (e.g. the original file\n        /// has A and then B, and the commit changes it to B and\n        /// then A), the traditional 'blame' algorithm typically blames\n        /// the lines that were moved up (i.e. B) to the parent and\n        /// assigns blame to the lines that were moved down (i.e. A)\n        /// to the child commit.  With this option, both groups of lines\n        /// are blamed on the parent.\n        /// +\n        /// alphanumeric characters that git must detect as moving\n        /// within a file for it to associate those lines with the parent\n        /// commit.\n        /// \n        /// </summary>\n        public string M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `-M`, detect lines copied from other\n        /// files that were modified in the same commit.  This is\n        /// useful when you reorganize your program and move code\n        /// around across files.  When this option is given twice,\n        /// the command additionally looks for copies from all other\n        /// files in the parent for the commit that creates the file.\n        /// +\n        /// alphanumeric characters that git must detect as moving\n        /// between files for it to associate those lines with the parent\n        /// commit.\n        /// \n        /// </summary>\n        public string C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show help message.\n        /// </summary>\n        public bool Help { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/BranchCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class BranchCommand\n        : AbstractCommand\n    {\n\n        public BranchCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Delete a branch. The branch must be fully merged in HEAD.\n        /// \n        /// </summary>\n        public bool d { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Delete a branch irrespective of its merged status.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Create the branch's reflog.  This activates recording of\n        /// all changes made to the branch ref, enabling use of date\n        /// based sha1 expressions such as \"&lt;branchname&lt;@\\{yesterday}\".\n        /// \n        /// </summary>\n        public bool L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Reset &lt;branchname&gt; to &lt;startpoint&gt; if &lt;branchname&gt; exists\n        /// already. Without `-f` 'git-branch' refuses to change an existing branch.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Move/rename a branch and the corresponding reflog.\n        /// \n        /// </summary>\n        public bool m { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Move/rename a branch even if the new branch name already exists.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Color branches to highlight current, local, and remote branches.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off branch colors, even when the configuration file gives the\n        /// default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List or delete (if used with -d) the remote-tracking branches.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List both remote-tracking branches and local branches.\n        /// \n        /// </summary>\n        public bool A { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show sha1 and commit subject line for each head, along with\n        /// relationship to upstream branch (if any). If given twice, print\n        /// the name of the upstream branch, as well.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Alter the sha1's minimum display length in the output listing.\n        /// The default value is 7.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Display the full sha1s in the output listing rather than abbreviating them.\n        /// \n        /// </summary>\n        public bool NoAbbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When creating a new branch, set up configuration to mark the\n        /// start-point branch as \"upstream\" from the new branch. This\n        /// configuration will tell git to show the relationship between the\n        /// two branches in `git status` and `git branch -v`. Furthermore,\n        /// it directs `git pull` without arguments to pull from the\n        /// upstream when the new branch is checked out.\n        /// +\n        /// This behavior is the default when the start point is a remote branch.\n        /// Set the branch.autosetupmerge configuration variable to `false` if you\n        /// want `git checkout` and `git branch` to always behave as if '--no-track'\n        /// were given. Set it to `always` if you want this behavior when the\n        /// start-point is either a local or remote branch.\n        /// \n        /// </summary>\n        public bool Track { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not set up \"upstream\" configuration, even if the\n        /// branch.autosetupmerge configuration variable is true.\n        /// \n        /// </summary>\n        public bool NoTrack { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only list branches which contain the specified commit.\n        /// \n        /// </summary>\n        public string Contains { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only list branches whose tips are reachable from the\n        /// specified commit (HEAD if not specified).\n        /// \n        /// </summary>\n        public string Merged { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only list branches whose tips are not reachable from the\n        /// specified commit (HEAD if not specified).\n        /// \n        /// </summary>\n        public string NoMerged { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CatFileCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CatFileCommand\n        : AbstractCommand\n    {\n\n        public CatFileCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the content, show the object type identified by\n        /// &lt;object&gt;.\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the content, show the object size identified by\n        /// &lt;object&lt;.\n        /// \n        /// </summary>\n        public bool S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Suppress all output; instead exit with zero status if &lt;object&gt;\n        /// exists and is a valid object.\n        /// \n        /// </summary>\n        public string E { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pretty-print the contents of &lt;object&gt; based on its type.\n        /// \n        /// </summary>\n        public string P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print the SHA1, type, size, and contents of each object provided on\n        /// stdin. May not be combined with any other options or arguments.\n        /// \n        /// </summary>\n        public bool Batch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print the SHA1, type, and size of each object provided on stdin. May not\n        /// be combined with any other options or arguments.\n        /// </summary>\n        public bool BatchCheck { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CheckoutCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CheckoutCommand : AbstractCommand\n    {\n        private CheckoutResults results = new CheckoutResults();\n\n        public CheckoutCommand() {\n        }\n\n        public CheckoutResults Results\n        {\n            get { return results; }\n            private set { results = value; }\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Quiet, suppress feedback messages.\n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When switching branches, proceed even if the index or the\n        /// working tree differs from HEAD.  This is used to throw away\n        /// local changes.\n        /// +\n        /// When checking out paths from the index, do not fail upon unmerged\n        /// entries; instead, unmerged entries are ignored.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When checking out paths from the index, check out stage #2\n        /// ('ours') or #3 ('theirs') for unmerged paths.\n        /// \n        /// </summary>\n        public bool Ours { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When checking out paths from the index, check out stage #2\n        /// ('ours') or #3 ('theirs') for unmerged paths.\n        /// \n        /// </summary>\n        public bool Theirs { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Create a new branch named &lt;new_branch&gt; and start it at\n        /// &lt;start_point&gt;; see linkgit:git-branch[1] for details.\n        /// \n        /// </summary>\n        public string BranchCreate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When creating a new branch, set up \"upstream\" configuration. See\n        /// \"--track\" in linkgit:git-branch[1] for details.\n        /// +\n        /// If no '-b' option is given, the name of the new branch will be\n        /// derived from the remote branch.  If \"remotes/\" or \"refs/remotes/\"\n        /// is prefixed it is stripped away, and then the part up to the\n        /// next slash (which would be the nickname of the remote) is removed.\n        /// This would tell us to use \"hack\" as the local branch when branching\n        /// off of \"origin/hack\" (or \"remotes/origin/hack\", or even\n        /// \"refs/remotes/origin/hack\").  If the given name has no slash, or the above\n        /// guessing results in an empty name, the guessing is aborted.  You can\n        /// explicitly give a name with '-b' in such a case.\n        /// \n        /// </summary>\n        public bool Track { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not set up \"upstream\" configuration, even if the\n        /// branch.autosetupmerge configuration variable is true.\n        /// \n        /// </summary>\n        public bool NoTrack { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Create the new branch's reflog; see linkgit:git-branch[1] for\n        /// details.\n        /// \n        /// </summary>\n        public bool RefLog { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When switching branches,\n        /// if you have local modifications to one or more files that\n        /// are different between the current branch and the branch to\n        /// which you are switching, the command refuses to switch\n        /// branches in order to preserve your modifications in context.\n        /// However, with this option, a three-way merge between the current\n        /// branch, your working tree contents, and the new branch\n        /// is done, and you will be on the new branch.\n        /// +\n        /// When a merge conflict happens, the index entries for conflicting\n        /// paths are left unmerged, and you need to resolve the conflicts\n        /// and mark the resolved paths with `git add` (or `git rm` if the merge\n        /// should result in deletion of the path).\n        /// +\n        /// When checking out paths from the index, this option lets you recreate\n        /// the conflicted merge in the specified paths.\n        /// \n        /// </summary>\n        public bool Merge { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The same as --merge option above, but changes the way the\n        /// conflicting hunks are presented, overriding the\n        /// merge.conflictstyle configuration variable.  Possible values are\n        /// \"merge\" (default) and \"diff3\" (in addition to what is shown by\n        /// \"merge\" style, shows the original contents).\n        /// \n        /// </summary>\n        public string Conflict { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Interactively select hunks in the difference between the\n        /// &lt;tree-ish&gt; (or the index, if unspecified) and the working\n        /// tree.  The chosen hunks are then applied in reverse to the\n        /// working tree (and if a &lt;tree-ish&gt; was specified, the index).\n        /// +\n        /// This means that you can use `git checkout -p` to selectively discard\n        /// edits from your current working tree.\n        /// \n        /// </summary>\n        public bool Patch { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n\n            if (Patch && (Track || BranchCreate.Length > 0 || RefLog || Merge || Force))\n                throw new ArgumentException(\"--patch is incompatible with all other options\");\n\n            if (Force && Merge)\n                throw new ArgumentException(\"git checkout: -f and -m are incompatible\");\n            \n\t\t\tif (Track && !(BranchCreate.Length > 0))\n\t\t\t\tthrow new ArgumentException(\"Missing branch name; try -b\");\n\t\t\t\n            if (Arguments.Count == 0)\n                Arguments.Add(\"HEAD\");\n\n            //Create a new branch and reassign the Repository to the new location before checkout.\n            if (BranchCreate.Length > 0)\n            {\n                Branch.Create(Repository, BranchCreate);\n                Arguments[0] = BranchCreate;\n            }\n\n            if (Arguments.Count == 1)\n            {\n                //Checkout the branch using the SHA1 or the name such as HEAD or master/HEAD\n                Branch b = new Branch(Repository, Arguments[0]);\n                if (b != null)\n                {\n                    b.Checkout();\n                    return;\n                }\n            }\n\n            //Todo: Add FileNameMatcher support. To be added when fnmatch is completed.\n            //For now, pattern matching is not allowed. Please specify the files only.               \n\n            //Gain access to the Git index using the repository determined before command execution\n            Index index = new Index(Repository);\n\n            foreach (string arg in Arguments)\n            {\n                //Use full paths only to eliminate platform-based directory differences\n                string path = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), arg));\n\n                //Perform the validity tests outside of the index to handle the error messages\n                if ((new FileInfo(path).Exists) || (new DirectoryInfo(path).Exists))\n                    index.Checkout(path);\n                else \n                    results.FileNotFoundList.Add(path);\n            }\n        }\n    }\n\n    #region Checkout Results\n\n    public class CheckoutResults\n    {\n        public List<string> FileNotFoundList = new List<string>();\n    }\n\n    #endregion\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CheckoutIndexCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CheckoutIndexCommand\n        : AbstractCommand\n    {\n\n        public CheckoutIndexCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// update stat information for the checked out entries in\n        /// the index file.\n        /// \n        /// </summary>\n        public bool Index { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// be quiet if files exist or are not in the index\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// forces overwrite of existing files\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// checks out all files in the index.  Cannot be used\n        /// together with explicit filenames.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't checkout new files, only refresh files already checked\n        /// out.\n        /// \n        /// </summary>\n        public bool NoCreate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When creating files, prepend &lt;string&gt; (usually a directory\n        /// including a trailing /)\n        /// \n        /// </summary>\n        public string Prefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of checking out unmerged entries, copy out the\n        /// files from named stage. &lt;number&gt; must be between 1 and 3.\n        /// Note: --stage=all automatically implies --temp.\n        /// \n        /// </summary>\n        public string Stage { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of copying the files to the working directory\n        /// write the content to temporary files.  The temporary name\n        /// associations will be written to stdout.\n        /// \n        /// </summary>\n        public bool Temp { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of taking list of paths from the command line,\n        /// read list of paths from the standard input.  Paths are\n        /// separated by LF (i.e. one path per line) by default.\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only meaningful with `--stdin`; paths are separated with\n        /// NUL character instead of LF.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CherryCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CherryCommand\n        : AbstractCommand\n    {\n\n        public CherryCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Verbose.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CherryPickCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CherryPickCommand\n        : AbstractCommand\n    {\n\n        public CherryPickCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, 'git-cherry-pick' will let you edit the commit\n        /// message prior to committing.\n        /// \n        /// </summary>\n        public bool Edit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When recording the commit, append to the original commit\n        /// message a note that indicates which commit this change\n        /// was cherry-picked from.  Append the note only for cherry\n        /// picks without conflicts.  Do not use this option if\n        /// you are cherry-picking from your private branch because\n        /// the information is useless to the recipient.  If on the\n        /// other hand you are cherry-picking between two publicly\n        /// visible branches (e.g. backporting a fix to a\n        /// maintenance branch for an older release from a\n        /// development branch), adding this information can be\n        /// useful.\n        /// \n        /// </summary>\n        public bool X { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// It used to be that the command defaulted to do `-x`\n        /// described above, and `-r` was to disable it.  Now the\n        /// default is not to do `-x` so this option is a no-op.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually you cannot cherry-pick a merge because you do not know which\n        /// side of the merge should be considered the mainline.  This\n        /// option specifies the parent number (starting from 1) of\n        /// the mainline and allows cherry-pick to replay the change\n        /// relative to the specified parent.\n        /// \n        /// </summary>\n        public bool Mainline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the command automatically creates a commit.\n        /// This flag applies the change necessary to cherry-pick\n        /// the named commit to your working tree and the index,\n        /// but does not make the commit.  In addition, when this\n        /// option is used, your index does not have to match the\n        /// HEAD commit.  The cherry-pick is done against the\n        /// beginning state of your index.\n        /// +\n        /// This is useful when cherry-picking more than one commits'\n        /// effect to your index in a row.\n        /// \n        /// </summary>\n        public bool NoCommit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add Signed-off-by line at the end of the commit message.\n        /// \n        /// </summary>\n        public bool Signoff { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CleanCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CleanCommand\n        : AbstractCommand\n    {\n\n        public CleanCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove untracked directories in addition to untracked files.\n        /// If an untracked directory is managed by a different git\n        /// repository, it is not removed by default.  Use -f option twice\n        /// if you really want to remove such a directory.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If the git configuration specifies clean.requireForce as true,\n        /// 'git-clean' will refuse to run unless given -f or -n.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't actually remove anything, just show what would be done.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be quiet, only report errors, but not the files that are\n        /// successfully removed.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't use the ignore rules.  This allows removing all untracked\n        /// files, including build products.  This can be used (possibly in\n        /// conjunction with 'git-reset') to create a pristine\n        /// working directory to test a clean build.\n        /// \n        /// </summary>\n        public bool x { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove only files ignored by git.  This may be useful to rebuild\n        /// everything from scratch, but keep manually created files.\n        /// \n        /// </summary>\n        public bool X { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CommitCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CommitCommand\n        : AbstractCommand\n    {\n\n        public CommitCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Tell the command to automatically stage files that have\n        /// been modified and deleted, but new files you have not\n        /// told git about are not affected.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Take an existing commit object, and reuse the log message\n        /// and the authorship information (including the timestamp)\n        /// when creating the commit.\n        /// \n        /// </summary>\n        public string ReuseMessage { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Like '-C', but with '-c' the editor is invoked, so that\n        /// the user can further edit the commit message.\n        /// \n        /// </summary>\n        public string ReeditMessage { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When used with -C/-c/--amend options, declare that the\n        /// authorship of the resulting commit now belongs of the committer.\n        /// This also renews the author timestamp.\n        /// \n        /// </summary>\n        public bool ResetAuthor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Take the commit message from the given file.  Use '-' to\n        /// read the message from the standard input.\n        /// \n        /// </summary>\n        public string File { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Override the author name used in the commit.  You can use the\n        /// standard `A U Thor &lt;author@example.com&gt;` format.  Otherwise,\n        /// an existing commit that matches the given string and its author\n        /// name is used.\n        /// \n        /// </summary>\n        public string Author { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the given &lt;msg&gt; as the commit message.\n        /// \n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the contents of the given file as the initial version\n        /// of the commit message. The editor is invoked and you can\n        /// make subsequent changes. If a message is specified using\n        /// the `-m` or `-F` options, this option has no effect. This\n        /// overrides the `commit.template` configuration variable.\n        /// \n        /// </summary>\n        public string Template { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add Signed-off-by line by the committer at the end of the commit\n        /// log message.\n        /// \n        /// </summary>\n        public bool Signoff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option bypasses the pre-commit and commit-msg hooks.\n        /// See also linkgit:githooks[5].\n        /// \n        /// </summary>\n        public bool NoVerify { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually recording a commit that has the exact same tree as its\n        /// sole parent commit is a mistake, and the command prevents you\n        /// from making such a commit.  This option bypasses the safety, and\n        /// is primarily for use by foreign scm interface scripts.\n        /// \n        /// </summary>\n        public bool AllowEmpty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option sets how the commit message is cleaned up.\n        /// The  '&lt;mode&gt;' can be one of 'verbatim', 'whitespace', 'strip',\n        /// and 'default'. The 'default' mode will strip leading and\n        /// trailing empty lines and #commentary from the commit message\n        /// only if the message is to be edited. Otherwise only whitespace\n        /// removed. The 'verbatim' mode does not change message at all,\n        /// 'whitespace' removes just leading/trailing whitespace lines\n        /// and 'strip' removes both whitespace and commentary.\n        /// \n        /// </summary>\n        public string Cleanup { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The message taken from file with `-F`, command line with\n        /// `-m`, and from file with `-C` are usually used as the\n        /// commit log message unmodified.  This option lets you\n        /// further edit the message taken from these sources.\n        /// \n        /// </summary>\n        public bool Edit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Used to amend the tip of the current branch. Prepare the tree\n        /// object you would want to replace the latest commit as usual\n        /// (this includes the usual -i/-o and explicit paths), and the\n        /// commit log editor is seeded with the commit message from the\n        /// tip of the current branch. The commit you create replaces the\n        /// current tip -- if it was a merge, it will have the parents of\n        /// the current tip as parents -- so the current top commit is\n        /// discarded.\n        /// +\n        /// </summary>\n        public bool Amend { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/CommitTreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CommitTreeCommand\n        : AbstractCommand\n    {\n\n        public CommitTreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Each '-p' indicates the id of a parent commit object.\n        /// \n        /// </summary>\n        public string P { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ConfigCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core;\n\nnamespace GitSharp.Commands\n{\n    public class ConfigCommand : AbstractCommand\n    {\n\n        public ConfigCommand() {\n        }\n\n    \t#region Arguments\n    \tpublic string Arg1 { get; set; }\n    \t\n    \tpublic string Arg2 { get; set; }\n\n    \tpublic string Arg3 { get; set; }\n    \t#endregion\n    \t\n    \t#region Properties\n    \tpublic bool Bool { get; set; } \n \t\t\n \t\tpublic bool Int { get; set; }\n\n \t\tpublic bool BoolOrInt { get; set; }\n \t\t\n \t\tpublic bool Null { get; set; }\n \t\t\n  \t\tpublic bool Global { get; set; }\n \t\t\n \t\tpublic bool System { get; set; }\n \t\t\n \t\tpublic string File { get; set; }\n\t\t#endregion\n\t\t\n \t\t#region SubCommands\n        /// <summary>\n        /// Not implemented.\n        /// \n        /// For multi-line options only.\n        /// </summary>\n        public bool Add { get; set; }\n \t\t\n        public bool ReplaceAll { get; set; }\n        \n \t\tpublic bool Get { get; set; }\n \t\t\n \t\tpublic bool GetAll { get; set; }\n \t\t\n \t\tpublic bool GetRegExp { get; set; }\n \t\t\n \t\tpublic bool RemoveSection { get; set; }\n \t\t\n \t\tpublic bool RenameSection { get; set; }\n \t\t\n \t\tpublic bool UnSet { get; set; }\n \t\t\n \t\tpublic bool UnSetAll { get; set; }\n \t\t\n \t\tpublic bool List { get; set; }\n  \t\t\n \t\tpublic bool GetColorBool { get; set; }\n \t\t\n \t\tpublic bool GetColor { get; set; }\n \t\t\n \t\tpublic bool Edit { get; set; }\n \t\t\n \t\t#endregion\n \t\t\n        public override void Execute()\n        {\n        \tif (Add)\n        \t\tdoAdd(Arg1, Arg2);\n        \telse if (ReplaceAll)\n        \t\tdoReplaceAll(Arg1, Arg2, Arg3);\n        \telse if (Get)\n        \t\tdoGet(Arg1, Arg2);\n        \telse if (GetAll)\n        \t\tdoGetAll(Arg1, Arg2);\n        \telse if (GetRegExp)\n        \t\tdoGetRegExp(Arg1, Arg2);\n \t\t\telse if (RemoveSection)\n \t\t\t\tdoRemoveSection(Arg1);\n \t\t\telse if (RenameSection)\n        \t\tdoRenameSection(Arg1, Arg2);\n\t \t\telse if (UnSet)\n        \t\tdoUnSet(Arg1, Arg2);\n \t\t\telse if (UnSetAll)\n        \t\tdoUnSetAll(Arg1, Arg2);\n \t\t\telse if (List)\n        \t\tdoList();\n \t\t\telse if (GetColorBool)\n        \t\tdoGetColorBool(Arg1, Arg2);\n \t\t\telse if (GetColor)\n        \t\tdoGetColor(Arg1, Arg2);\n\t \t\telse if (Edit)\n        \t\tdoEdit();\n\t\t\telse\n\t\t\t{\n\t\t\t\tdoDefault(Arg1, Arg2, Arg3);\n\t\t\t}\n        }\n\n        #region Methods\n        \n        private void doAdd(string name, string value)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doReplaceAll(string name, string value, string regexValue)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doGet(string name, string regexValue)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doGetAll(string name, string regexValue)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doGetRegExp(string nameRegex, string valueRegex)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n\t\tprivate void doRemoveSection(string name)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doRenameSection(string oldName, string newName)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doUnSet(string name, string valueRegex)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doUnSetAll(string name, string valueRegex)\n        {\n        \tthrow new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Displays list of all the variables set in the config file\n        /// </summary>\n       \tprivate void doList()\n        {\n            GitSharp.Config cfg = new GitSharp.Config(Repository);\n            foreach (KeyValuePair<string, string> pair in cfg)\n            {\n                OutputStream.WriteLine(pair.Key + \"=\" + pair.Value);\n            }\n            OutputStream.Flush();\n        }\n        \n\t\tprivate void doGetColorBool(string color, string ouputToTerminal)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doGetColor(string color, string defaultColor)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n       \tprivate void doEdit()\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n\t\tprivate void doDefault(string name, string value, string valueRegex)\n        {\n        \tthrow new NotImplementedException();\n        }\n        \n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp/Stubs/CountObjectsCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class CountObjectsCommand\n        : AbstractCommand\n    {\n\n        public CountObjectsCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to the number of loose objects and disk\n        /// space consumed, it reports the number of in-pack\n        /// objects, number of packs, disk space consumed by those packs,\n        /// and number of objects that can be removed by running\n        /// `git prune-packed`.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DescribeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DescribeCommand\n        : AbstractCommand\n    {\n\n        public DescribeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of using only the annotated tags, use any ref\n        /// found in `.git/refs/`.  This option enables matching\n        /// any known branch, remote branch, or lightweight tag.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of using only the annotated tags, use any tag\n        /// found in `.git/refs/tags`.  This option enables matching\n        /// a lightweight (non-annotated) tag.\n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of finding the tag that predates the commit, find\n        /// the tag that comes after the commit, and thus contains it.\n        /// Automatically implies --tags.\n        /// \n        /// </summary>\n        public bool Contains { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of using the default 7 hexadecimal digits as the\n        /// abbreviated object name, use &lt;n&gt; digits, or as many digits\n        /// as needed to form a unique object name.  An &lt;n&gt; of 0\n        /// will suppress long format, only showing the closest tag.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of considering only the 10 most recent tags as\n        /// candidates to describe the input committish consider\n        /// up to &lt;n&gt; candidates.  Increasing &lt;n&gt; above 10 will take\n        /// slightly longer but may produce a more accurate result.\n        /// An &lt;n&gt; of 0 will cause only exact matches to be output.\n        /// \n        /// </summary>\n        public string Candidates { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only output exact matches (a tag directly references the\n        /// supplied commit).  This is a synonym for --candidates=0.\n        /// \n        /// </summary>\n        public bool ExactMatch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Verbosely display information about the searching strategy\n        /// being employed to standard error.  The tag name will still\n        /// be printed to standard out.\n        /// \n        /// </summary>\n        public bool Debug { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Always output the long format (the tag, the number of commits\n        /// and the abbreviated commit name) even when it matches a tag.\n        /// This is useful when you want to see parts of the commit object name\n        /// in \"describe\" output, even when the commit in question happens to be\n        /// a tagged version.  Instead of just emitting the tag name, it will\n        /// describe such a commit as v1.2-0-gdeadbee (0th commit since tag v1.2\n        /// that points at object deadbee....).\n        /// \n        /// </summary>\n        public bool Long { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only consider tags matching the given pattern (can be used to avoid\n        /// leaking private tags made from the repository).\n        /// \n        /// </summary>\n        public string Match { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show uniquely abbreviated commit object as fallback.\n        /// </summary>\n        public bool Always { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DiffCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DiffCommand\n        : AbstractCommand\n    {\n\n        public DiffCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DiffFilesCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DiffFilesCommand\n        : AbstractCommand\n    {\n\n        public DiffFilesCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Diff against the \"base\" version, \"our branch\" or \"their\n        /// branch\" respectively.  With these options, diffs for\n        /// merged entries are not shown.\n        /// +\n        /// The default is to diff against our branch (-2) and the\n        /// cleanly resolved paths.  The option -0 can be given to\n        /// omit diff output for unmerged entries and just show \"Unmerged\".\n        /// \n        /// </summary>\n        public bool One { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Diff against the \"base\" version, \"our branch\" or \"their\n        /// branch\" respectively.  With these options, diffs for\n        /// merged entries are not shown.\n        /// +\n        /// The default is to diff against our branch (-2) and the\n        /// cleanly resolved paths.  The option -0 can be given to\n        /// omit diff output for unmerged entries and just show \"Unmerged\".\n        /// \n        /// </summary>\n        public bool Two { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Diff against the \"base\" version, \"our branch\" or \"their\n        /// branch\" respectively.  With these options, diffs for\n        /// merged entries are not shown.\n        /// +\n        /// The default is to diff against our branch (-2) and the\n        /// cleanly resolved paths.  The option -0 can be given to\n        /// omit diff output for unmerged entries and just show \"Unmerged\".\n        /// \n        /// </summary>\n        public bool Three { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Diff against the \"base\" version, \"our branch\" or \"their\n        /// branch\" respectively.  With these options, diffs for\n        /// merged entries are not shown.\n        /// +\n        /// The default is to diff against our branch (-2) and the\n        /// cleanly resolved paths.  The option -0 can be given to\n        /// omit diff output for unmerged entries and just show \"Unmerged\".\n        /// \n        /// </summary>\n        public bool Zero { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This compares stage 2 (our branch), stage 3 (their\n        /// branch) and the working tree file and outputs a combined\n        /// diff, similar to the way 'diff-tree' shows a merge\n        /// commit with these flags.\n        /// \n        /// </summary>\n        public bool Cc { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remain silent even on nonexistent files\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DiffIndexCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DiffIndexCommand\n        : AbstractCommand\n    {\n\n        public DiffIndexCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// do not consider the on-disk file at all\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, files recorded in the index but not checked\n        /// out are reported as deleted.  This flag makes\n        /// 'git-diff-index' say that all non-checked-out files are up\n        /// to date.\n        /// \n        /// </summary>\n        public bool m { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DiffTreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DiffTreeCommand\n        : AbstractCommand\n    {\n\n        public DiffTreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         recurse into sub-trees\n        /// \n        /// </summary>\n        public bool r { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// show tree entry itself as well as subtrees.  Implies -r.\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When '--root' is specified the initial commit will be shown as a big\n        /// creation event. This is equivalent to a diff against the NULL tree.\n        /// \n        /// </summary>\n        public bool Root { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When '--stdin' is specified, the command does not take\n        /// &lt;tree-ish&gt; arguments from the command line.  Instead, it\n        /// reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a\n        /// list of &lt;commit&gt; from its standard input.  (Use a single space\n        /// as separator.)\n        /// +\n        /// When two trees are given, it compares the first tree with the second.\n        /// When a single commit is given, it compares the commit with its\n        /// parents.  The remaining commits, when given, are used as if they are\n        /// parents of the first commit.\n        /// +\n        /// When comparing two trees, the ID of both trees (separated by a space\n        /// and terminated by a newline) is printed before the difference.  When\n        /// comparing commits, the ID of the first (or only) commit, followed by a\n        /// newline, is printed.\n        /// +\n        /// The following flags further affect the behavior when comparing\n        /// commits (but not trees).\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, 'git-diff-tree --stdin' does not show\n        /// differences for merge commits.  With this flag, it shows\n        /// differences to that commit from all of its parents. See\n        /// also '-c'.\n        /// \n        /// </summary>\n        public bool m { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, 'git-diff-tree --stdin' shows differences,\n        /// either in machine-readable form (without '-p') or in patch\n        /// form (with '-p').  This output can be suppressed.  It is\n        /// only useful with '-v' flag.\n        /// \n        /// </summary>\n        public bool s { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag causes 'git-diff-tree --stdin' to also show\n        /// the commit message before the differences.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// 'git-diff-tree' outputs a line with the commit ID when\n        /// applicable.  This flag suppressed the commit ID output.\n        /// \n        /// </summary>\n        public bool NoCommitId { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag changes the way a merge commit is displayed\n        /// (which means it is useful only when the command is given\n        /// one &lt;tree-ish&gt;, or '--stdin').  It shows the differences\n        /// from each of the parents to the merge result simultaneously\n        /// instead of showing pairwise diff between a parent and the\n        /// result one at a time (which is what the '-m' option does).\n        /// Furthermore, it lists only files which were modified\n        /// from all parents.\n        /// \n        /// </summary>\n        public bool c { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag changes the way a merge commit patch is displayed,\n        /// in a similar way to the '-c' option. It implies the '-c'\n        /// and '-p' options and further compresses the patch output\n        /// by omitting uninteresting hunks whose the contents in the parents\n        /// have only two variants and the merge result picks one of them\n        /// without modification.  When all hunks are uninteresting, the commit\n        /// itself and the commit log message is not shown, just like in any other\n        /// \"empty diff\" case.\n        /// \n        /// </summary>\n        public bool Cc { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the commit itself and the commit log message even\n        /// if the diff itself is empty.\n        /// \n        /// </summary>\n        public bool Always { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat{ get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For more detailed explanation on these common options, see also\n        /// linkgit:gitdiffcore[7].\n        /// \n        /// </summary>\n        public string Pretty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For more detailed explanation on these common options, see also\n        /// linkgit:gitdiffcore[7].\n        /// \n        /// </summary>\n        public string Format { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal commit object\n        /// name, show only a partial prefix.  Non default number of\n        /// digits can be specified with \"--abbrev=&lt;n&gt;\" (which also modifies\n        /// diff output, if it is displayed).\n        /// +\n        /// This should make \"--pretty=oneline\" a whole lot more readable for\n        /// people using 80-column terminals.\n        /// \n        /// </summary>\n        public bool AbbrevCommit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is a shorthand for \"--pretty=oneline --abbrev-commit\"\n        /// used together.\n        /// \n        /// </summary>\n        public bool Oneline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The commit objects record the encoding used for the log message\n        /// in their encoding header; this option can be used to tell the\n        /// command to re-code the commit log message in the encoding\n        /// preferred by the user.  For non plumbing commands this\n        /// defaults to UTF-8.\n        /// </summary>\n        public string Encoding { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/DifftoolCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class DifftoolCommand\n        : AbstractCommand\n    {\n\n        public DifftoolCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not prompt before launching a diff tool.\n        /// \n        /// </summary>\n        public bool NoPrompt { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Prompt before each invocation of the diff tool.\n        /// This is the default behaviour; the option is provided to\n        /// override any configuration settings.\n        /// \n        /// </summary>\n        public bool Prompt { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the diff tool specified by &lt;tool&gt;.\n        /// Valid merge tools are:\n        /// kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,\n        /// ecmerge, diffuse, opendiff, p4merge and araxis.\n        /// +\n        /// If a diff tool is not specified, 'git-difftool'\n        /// will use the configuration variable `diff.tool`.  If the\n        /// configuration variable `diff.tool` is not set, 'git-difftool'\n        /// will pick a suitable default.\n        /// +\n        /// You can explicitly provide a full path to the tool by setting the\n        /// configuration variable `difftool.&lt;tool&gt;.path`. For example, you\n        /// can configure the absolute path to kdiff3 by setting\n        /// `difftool.kdiff3.path`. Otherwise, 'git-difftool' assumes the\n        /// tool is available in PATH.\n        /// +\n        /// Instead of running one of the known diff tools,\n        /// 'git-difftool' can be customized to run an alternative program\n        /// by specifying the command line to invoke in a configuration\n        /// variable `difftool.&lt;tool&gt;.cmd`.\n        /// +\n        /// When 'git-difftool' is invoked with this tool (either through the\n        /// `-t` or `--tool` option or the `diff.tool` configuration variable)\n        /// the configured command line will be invoked with the following\n        /// variables available: `$LOCAL` is set to the name of the temporary\n        /// file containing the contents of the diff pre-image and `$REMOTE`\n        /// is set to the name of the temporary file containing the contents\n        /// of the diff post-image.  `$BASE` is provided for compatibility\n        /// with custom merge tool commands and has the same value as `$LOCAL`.\n        /// \n        /// </summary>\n        public string Tool { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FastExportCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FastExportCommand\n        : AbstractCommand\n    {\n\n        public FastExportCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Insert 'progress' statements every &lt;n&gt; objects, to be shown by\n        /// 'git-fast-import' during import.\n        /// \n        /// </summary>\n        public string Progress { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specify how to handle signed tags.  Since any transformation\n        /// after the export can change the tag names (which can also happen\n        /// when excluding revisions) the signatures will not match.\n        /// +\n        /// When asking to 'abort' (which is the default), this program will die\n        /// when encountering a signed tag.  With 'strip', the tags will be made\n        /// unsigned, with 'verbatim', they will be silently exported\n        /// and with 'warn', they will be exported, but you will see a warning.\n        /// \n        /// </summary>\n        public string SignedTags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specify how to handle tags whose tagged objectis filtered out.\n        /// Since revisions and files to export can be limited by path,\n        /// tagged objects may be filtered completely.\n        /// +\n        /// When asking to 'abort' (which is the default), this program will die\n        /// when encountering such a tag.  With 'drop' it will omit such tags from\n        /// the output.  With 'rewrite', if the tagged object is a commit, it will\n        /// rewrite the tag to tag an ancestor commit (via parent rewriting; see\n        /// linkgit:git-rev-list[1])\n        /// \n        /// </summary>\n        public string TagOfFilteredObject { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Perform move and/or copy detection, as described in the\n        /// linkgit:git-diff[1] manual page, and use it to generate\n        /// rename and copy commands in the output dump.\n        /// +\n        /// Note that earlier versions of this command did not complain and\n        /// produced incorrect results if you gave these options.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Perform move and/or copy detection, as described in the\n        /// linkgit:git-diff[1] manual page, and use it to generate\n        /// rename and copy commands in the output dump.\n        /// +\n        /// Note that earlier versions of this command did not complain and\n        /// produced incorrect results if you gave these options.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Dumps the internal marks table to &lt;file&gt; when complete.\n        /// Marks are written one per line as `:markid SHA-1`. Only marks\n        /// for revisions are dumped; marks for blobs are ignored.\n        /// Backends can use this file to validate imports after they\n        /// have been completed, or to save the marks table across\n        /// incremental runs.  As &lt;file&gt; is only opened and truncated\n        /// at completion, the same path can also be safely given to\n        /// \\--import-marks.\n        /// \n        /// </summary>\n        public string ExportMarks { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Before processing any input, load the marks specified in\n        /// &lt;file&gt;.  The input file must exist, must be readable, and\n        /// must use the same format as produced by \\--export-marks.\n        /// +\n        /// Any commits that have already been marked will not be exported again.\n        /// If the backend uses a similar \\--import-marks file, this allows for\n        /// incremental bidirectional exporting of the repository by keeping the\n        /// marks the same across runs.\n        /// \n        /// </summary>\n        public string ImportMarks { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Some old repositories have tags without a tagger.  The\n        /// fast-import protocol was pretty strict about that, and did not\n        /// allow that.  So fake a tagger to be able to fast-import the\n        /// output.\n        /// \n        /// </summary>\n        public bool FakeMissingTagger { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Skip output of blob objects and instead refer to blobs via\n        /// their original SHA-1 hash.  This is useful when rewriting the\n        /// directory structure or history of a repository without\n        /// touching the contents of individual files.  Note that the\n        /// resulting stream can only be used by a repository which\n        /// already contains the necessary objects.\n        /// \n        /// </summary>\n        public bool NoData { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FastImportCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FastimportCommand\n        : AbstractCommand\n    {\n\n        public FastimportCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specify the type of dates the frontend will supply to\n        /// fast-import within `author`, `committer` and `tagger` commands.\n        /// See ``Date Formats'' below for details about which formats\n        /// are supported, and their syntax.\n        /// \n        /// </summary>\n        public string DateFormat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Force updating modified existing branches, even if doing\n        /// so would cause commits to be lost (as the new commit does\n        /// not contain the old commit).\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Maximum size of each output packfile, expressed in MiB.\n        /// The default is 4096 (4 GiB) as that is the maximum allowed\n        /// packfile size (due to file format limitations). Some\n        /// importers may wish to lower this, such as to ensure the\n        /// resulting packfiles fit on CDs.\n        /// \n        /// </summary>\n        public string MaxPackSize { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Maximum delta depth, for blob and tree deltification.\n        /// Default is 10.\n        /// \n        /// </summary>\n        public string Depth { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Maximum number of branches to maintain active at once.\n        /// See ``Memory Utilization'' below for details.  Default is 5.\n        /// \n        /// </summary>\n        public string ActiveBranches { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Dumps the internal marks table to &lt;file&gt; when complete.\n        /// Marks are written one per line as `:markid SHA-1`.\n        /// Frontends can use this file to validate imports after they\n        /// have been completed, or to save the marks table across\n        /// incremental runs.  As &lt;file&gt; is only opened and truncated\n        /// at checkpoint (or completion) the same path can also be\n        /// safely given to \\--import-marks.\n        /// \n        /// </summary>\n        public string ExportMarks { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Before processing any input, load the marks specified in\n        /// &lt;file&gt;.  The input file must exist, must be readable, and\n        /// must use the same format as produced by \\--export-marks.\n        /// Multiple options may be supplied to import more than one\n        /// set of marks.  If a mark is defined to different values,\n        /// the last file wins.\n        /// \n        /// </summary>\n        public string ImportMarks { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// After creating a packfile, print a line of data to\n        /// &lt;file&gt; listing the filename of the packfile and the last\n        /// commit on each branch that was written to that packfile.\n        /// This information may be useful after importing projects\n        /// whose total object set exceeds the 4 GiB packfile limit,\n        /// as these commits can be used as edge points during calls\n        /// to 'git-pack-objects'.\n        /// \n        /// </summary>\n        public string ExportPackEdges { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all non-fatal output, making fast-import silent when it\n        /// is successful.  This option disables the output shown by\n        /// \\--stats.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Display some basic statistics about the objects fast-import has\n        /// created, the packfiles they were stored into, and the\n        /// memory used by fast-import during this run.  Showing this output\n        /// is currently the default, but can be disabled with \\--quiet.\n        /// \n        /// </summary>\n        public bool Stats { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FetchPackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FetchPackCommand\n        : AbstractCommand\n    {\n\n        public FetchPackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Fetch all remote refs.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass '-q' flag to 'git-unpack-objects'; this makes the\n        /// cloning process less verbose.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not invoke 'git-unpack-objects' on received data, but\n        /// create a single packfile out of it instead, and store it\n        /// in the object database. If provided twice then the pack is\n        /// locked against repacking.\n        /// \n        /// </summary>\n        public bool Keep { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Spend extra cycles to minimize the number of objects to be sent.\n        /// Use it on slower connection.\n        /// \n        /// </summary>\n        public bool Thin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If the remote side supports it, annotated tags objects will\n        /// be downloaded on the same connection as the other objects if\n        /// the object the tag references is downloaded.  The caller must\n        /// otherwise determine the tags this option made available.\n        /// \n        /// </summary>\n        public bool IncludeTag { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use this to specify the path to 'git-upload-pack' on the\n        /// remote side, if is not found on your $PATH.\n        /// Installations of sshd ignores the user's environment\n        /// setup scripts for login shells (e.g. .bash_profile) and\n        /// your privately installed git may not be found on the system\n        /// default $PATH.  Another workaround suggested is to set\n        /// up your $PATH in \".bashrc\", but this flag is for people\n        /// who do not want to pay the overhead for non-interactive\n        /// shells by having a lean .bashrc file (they set most of\n        /// the things up in .bash_profile).\n        /// \n        /// </summary>\n        public string UploadPack { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as \\--upload-pack=&lt;git-upload-pack&gt;.\n        /// \n        /// </summary>\n        public string Exec { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Limit fetching to ancestor-chains not longer than n.\n        /// \n        /// </summary>\n        public string Depth { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show the progress.\n        /// \n        /// </summary>\n        public bool NoProgress { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Run verbosely.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FilterBranchCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FilterBranchCommand\n        : AbstractCommand\n    {\n\n        public FilterBranchCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This filter may be used if you only need to modify the environment\n        /// in which the commit will be performed.  Specifically, you might\n        /// want to rewrite the author/committer name/email/time environment\n        /// variables (see linkgit:git-commit[1] for details).  Do not forget\n        /// to re-export the variables.\n        /// \n        /// </summary>\n        public string EnvFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for rewriting the tree and its contents.\n        /// The argument is evaluated in shell with the working\n        /// directory set to the root of the checked out tree.  The new tree\n        /// is then used as-is (new files are auto-added, disappeared files\n        /// are auto-removed - neither .gitignore files nor any other ignore\n        /// rules *HAVE ANY EFFECT*!).\n        /// \n        /// </summary>\n        public string TreeFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for rewriting the index.  It is similar to the\n        /// tree filter but does not check out the tree, which makes it much\n        /// faster.  Frequently used with `git rm \\--cached\n        /// \\--ignore-unmatch ...`, see EXAMPLES below.  For hairy\n        /// cases, see linkgit:git-update-index[1].\n        /// \n        /// </summary>\n        public string IndexFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for rewriting the commit's parent list.\n        /// It will receive the parent string on stdin and shall output\n        /// the new parent string on stdout.  The parent string is in\n        /// the format described in linkgit:git-commit-tree[1]: empty for\n        /// the initial commit, \"-p parent\" for a normal commit and\n        /// \"-p parent1 -p parent2 -p parent3 ...\" for a merge commit.\n        /// \n        /// </summary>\n        public string ParentFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for rewriting the commit messages.\n        /// The argument is evaluated in the shell with the original\n        /// commit message on standard input; its standard output is\n        /// used as the new commit message.\n        /// \n        /// </summary>\n        public string MsgFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for performing the commit.\n        /// If this filter is specified, it will be called instead of the\n        /// 'git-commit-tree' command, with arguments of the form\n        /// \"&lt;TREE_ID&gt; [-p &lt;PARENT_COMMIT_ID&gt;]...\" and the log message on\n        /// stdin.  The commit id is expected on stdout.\n        /// +\n        /// As a special extension, the commit filter may emit multiple\n        /// commit ids; in that case, the rewritten children of the original commit will\n        /// have all of them as parents.\n        /// +\n        /// You can use the 'map' convenience function in this filter, and other\n        /// convenience functions, too.  For example, calling 'skip_commit \"$@\"'\n        /// will leave out the current commit (but not its changes! If you want\n        /// that, use 'git-rebase' instead).\n        /// +\n        /// You can also use the 'git_commit_non_empty_tree \"$@\"' instead of\n        /// 'git commit-tree \"$@\"' if you don't wish to keep commits with a single parent\n        /// and that makes no change to the tree.\n        /// \n        /// </summary>\n        public string CommitFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is the filter for rewriting tag names. When passed,\n        /// it will be called for every tag ref that points to a rewritten\n        /// object (or to a tag object which points to a rewritten object).\n        /// The original tag name is passed via standard input, and the new\n        /// tag name is expected on standard output.\n        /// +\n        /// The original tags are not deleted, but can be overwritten;\n        /// use \"--tag-name-filter cat\" to simply update the tags.  In this\n        /// case, be very careful and make sure you have the old tags\n        /// backed up in case the conversion has run afoul.\n        /// +\n        /// Nearly proper rewriting of tag objects is supported. If the tag has\n        /// a message attached, a new tag object will be created with the same message,\n        /// author, and timestamp. If the tag has a signature attached, the\n        /// signature will be stripped. It is by definition impossible to preserve\n        /// signatures. The reason this is \"nearly\" proper, is because ideally if\n        /// the tag did not change (points to the same object, has the same name, etc.)\n        /// it should retain any signature. That is not the case, signatures will always\n        /// be removed, buyer beware. There is also no support for changing the\n        /// author or timestamp (or the tag message for that matter). Tags which point\n        /// to other tags will be rewritten to point to the underlying commit.\n        /// \n        /// </summary>\n        public string TagNameFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only look at the history which touches the given subdirectory.\n        /// The result will contain that directory (and only that) as its\n        /// project root.  Implies --remap-to-ancestor.\n        /// \n        /// </summary>\n        public string SubdirectoryFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Rewrite refs to the nearest rewritten ancestor instead of\n        /// ignoring them.\n        /// +\n        /// Normally, positive refs on the command line are only changed if the\n        /// commit they point to was rewritten.  However, you can limit the extent\n        /// of this rewriting by using linkgit:rev-list[1] arguments, e.g., path\n        /// limiters.  Refs pointing to such excluded commits would then normally\n        /// be ignored.  With this option, they are instead rewritten to point at\n        /// the nearest ancestor that was not excluded.\n        /// \n        /// </summary>\n        public bool RemapToAncestor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Some kind of filters will generate empty commits, that left the tree\n        /// untouched.  This switch allow git-filter-branch to ignore such\n        /// commits.  Though, this switch only applies for commits that have one\n        /// and only one parent, it will hence keep merges points. Also, this\n        /// option is not compatible with the use of '--commit-filter'. Though you\n        /// just need to use the function 'git_commit_non_empty_tree \"$@\"' instead\n        /// of the 'git commit-tree \"$@\"' idiom in your commit filter to make that\n        /// happen.\n        /// \n        /// </summary>\n        public bool PruneEmpty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use this option to set the namespace where the original commits\n        /// will be stored. The default value is 'refs/original'.\n        /// \n        /// </summary>\n        public string Original { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use this option to set the path to the temporary directory used for\n        /// rewriting.  When applying a tree filter, the command needs to\n        /// temporarily check out the tree to some directory, which may consume\n        /// considerable space in case of large projects.  By default it\n        /// does this in the '.git-rewrite/' directory but you can override\n        /// that choice by this parameter.\n        /// \n        /// </summary>\n        public string D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// 'git-filter-branch' refuses to start with an existing temporary\n        /// directory or when there are already refs starting with\n        /// 'refs/original/', unless forced.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ForEachRefCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ForEachRefCommand\n        : AbstractCommand\n    {\n\n        public ForEachRefCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If given, strings that substitute `%(fieldname)`\n        /// placeholders are quoted as string literals suitable for\n        /// the specified host language.  This is meant to produce\n        /// a scriptlet that can directly be `eval`ed.\n        /// \n        /// </summary>\n        public bool Shell { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If given, strings that substitute `%(fieldname)`\n        /// placeholders are quoted as string literals suitable for\n        /// the specified host language.  This is meant to produce\n        /// a scriptlet that can directly be `eval`ed.\n        /// \n        /// </summary>\n        public bool Perl { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If given, strings that substitute `%(fieldname)`\n        /// placeholders are quoted as string literals suitable for\n        /// the specified host language.  This is meant to produce\n        /// a scriptlet that can directly be `eval`ed.\n        /// \n        /// </summary>\n        public bool Python { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If given, strings that substitute `%(fieldname)`\n        /// placeholders are quoted as string literals suitable for\n        /// the specified host language.  This is meant to produce\n        /// a scriptlet that can directly be `eval`ed.\n        /// \n        /// </summary>\n        public bool Tcl { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FormatPatchCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FormatPatchCommand\n        : AbstractCommand\n    {\n\n        public FormatPatchCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n\n        \n        // <summary>\n        // Not implemented\n        // \n        // Limits the number of patches to prepare.\n        // \n        // </summary>\n        //  [Mr-Happy] This option should prolly be an integer(short?)\n        //             need to think about how to implement while\n        //             also keeping the CLI in mind...\n        //public string <n> { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use &lt;dir&gt; to store the resulting files, instead of the\n        /// current working directory.\n        /// \n        /// </summary>\n        public string OutputDirectory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Name output in '[PATCH n/m]' format, even with a single patch.\n        /// \n        /// </summary>\n        public bool Numbered { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Name output in '[PATCH]' format.\n        /// \n        /// </summary>\n        public bool NoNumbered { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Start numbering the patches at &lt;n&gt; instead of 1.\n        /// \n        /// </summary>\n        public string StartNumber { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output file names will be a simple number sequence\n        /// without the default first line of the commit appended.\n        /// \n        /// </summary>\n        public bool NumberedFiles { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not strip/add '[PATCH]' from the first line of the\n        /// commit log message.\n        /// \n        /// </summary>\n        public bool KeepSubject { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add `Signed-off-by:` line to the commit message, using\n        /// the committer identity of yourself.\n        /// \n        /// </summary>\n        public bool Signoff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print all commits to the standard output in mbox format,\n        /// instead of creating a file for each one.\n        /// \n        /// </summary>\n        public bool Stdout { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Create multipart/mixed attachment, the first part of\n        /// which is the commit message and the patch itself in the\n        /// second part, with `Content-Disposition: attachment`.\n        /// \n        /// </summary>\n        public string Attach { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable the creation of an attachment, overriding the\n        /// configuration setting.\n        /// \n        /// </summary>\n        public bool NoAttach { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Create multipart/mixed attachment, the first part of\n        /// which is the commit message and the patch itself in the\n        /// second part, with `Content-Disposition: inline`.\n        /// \n        /// </summary>\n        public string Inline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Controls addition of `In-Reply-To` and `References` headers to\n        /// make the second and subsequent mails appear as replies to the\n        /// first.  Also controls generation of the `Message-Id` header to\n        /// reference.\n        /// +\n        /// The optional &lt;style&gt; argument can be either `shallow` or `deep`.\n        /// 'shallow' threading makes every mail a reply to the head of the\n        /// series, where the head is chosen from the cover letter, the\n        /// `\\--in-reply-to`, and the first patch mail, in this order.  'deep'\n        /// threading makes every mail a reply to the previous one.\n        /// +\n        /// The default is `--no-thread`, unless the 'format.thread' configuration\n        /// is set.  If `--thread` is specified without a style, it defaults to the\n        /// style specified by 'format.thread' if any, or else `shallow`.\n        /// +\n        /// Beware that the default for 'git send-email' is to thread emails\n        /// itself.  If you want `git format-patch` to take care of threading, you\n        /// will want to ensure that threading is disabled for `git send-email`.\n        /// \n        /// </summary>chrome\n        public string Thread { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Controls addition of `In-Reply-To` and `References` headers to\n        /// make the second and subsequent mails appear as replies to the\n        /// first.  Also controls generation of the `Message-Id` header to\n        /// reference.\n        /// +\n        /// The optional &lt;style&gt; argument can be either `shallow` or `deep`.\n        /// 'shallow' threading makes every mail a reply to the head of the\n        /// series, where the head is chosen from the cover letter, the\n        /// `\\--in-reply-to`, and the first patch mail, in this order.  'deep'\n        /// threading makes every mail a reply to the previous one.\n        /// +\n        /// The default is `--no-thread`, unless the 'format.thread' configuration\n        /// is set.  If `--thread` is specified without a style, it defaults to the\n        /// style specified by 'format.thread' if any, or else `shallow`.\n        /// +\n        /// Beware that the default for 'git send-email' is to thread emails\n        /// itself.  If you want `git format-patch` to take care of threading, you\n        /// will want to ensure that threading is disabled for `git send-email`.\n        /// \n        /// </summary>\n        public bool NoThread { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the first mail (or all the mails with `--no-thread`) appear as a\n        /// reply to the given Message-Id, which avoids breaking threads to\n        /// provide a new patch series.\n        /// \n        /// </summary>\n        public string InReplyTo { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not include a patch that matches a commit in\n        /// &lt;until&gt;..&lt;since&gt;.  This will examine all patches reachable\n        /// from &lt;since&gt; but not from &lt;until&gt; and compare them with the\n        /// patches being generated, and any patch that matches is\n        /// ignored.\n        /// \n        /// </summary>\n        public bool IgnoreIfInUpstream { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the standard '[PATCH]' prefix in the subject\n        /// line, instead use '[&lt;Subject-Prefix&gt;]'. This\n        /// allows for useful naming of a patch series, and can be\n        /// combined with the `--numbered` option.\n        /// \n        /// </summary>\n        public string SubjectPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add a `Cc:` header to the email headers. This is in addition\n        /// to any configured headers, and may be used multiple times.\n        /// \n        /// </summary>\n        public string Cc { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add an arbitrary header to the email headers.  This is in addition\n        /// to any configured headers, and may be used multiple times.\n        /// For example, `--add-header=\"Organization: git-foo\"`\n        /// \n        /// </summary>\n        public string AddHeader { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to the patches, generate a cover letter file\n        /// containing the shortlog and the overall diffstat.  You can\n        /// fill in a description in the file before sending it out.\n        /// \n        /// </summary>\n        public bool CoverLetter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of using `.patch` as the suffix for generated\n        /// filenames, use specified suffix.  A common alternative is\n        /// `--suffix=.txt`.  Leaving this empty will remove the `.patch`\n        /// suffix.\n        /// +\n        /// Note that the leading character does not have to be a dot; for example,\n        /// you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`.\n        /// \n        /// </summary>\n        public string Suffix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not output contents of changes in binary files, instead\n        /// display a notice that those files changed.  Patches generated\n        /// using this option cannot be applied properly, but they are\n        /// still useful for code review.\n        /// \n        /// </summary>\n        public bool NoBinary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat the revision argument as a &lt;revision range&gt;, even if it\n        /// is just a single commit (that would normally be treated as a\n        /// &lt;since&gt;).  Note that root commits included in the specified\n        /// range are always formatted as creation patches, independently\n        /// of this flag.\n        /// // Please don't remove this comment as asciidoc behaves badly when\n        /// // the first non-empty line is ifdef/ifndef. The symptom is that\n        /// // without this comment the &lt;git-diff-core&gt; attribute conditionally\n        /// // defined below ends up being defined unconditionally.\n        /// // Last checked with asciidoc 7.0.2.\n        /// \n        /// </summary>\n        public string Root { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-format-patch[]\n        /// Generate plain patches without any diffstats.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate patch (see section on generating patches).\n        /// {git-diff? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate diffs with &lt;n&gt; lines of context instead of\n        /// the usual three.\n        /// ifndef::git-format-patch[]\n        /// Implies `-p`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string Unified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Generate the raw format.\n        /// {git-diff-core? This is the default.}\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Raw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --raw`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithRaw { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diff using the \"patience diff\" algorithm.\n        /// \n        /// </summary>\n        public bool Patience { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Generate a diffstat.  You can override the default\n        /// output width for 80-column terminal by `--stat=width`.\n        /// The width of the filename part can be controlled by\n        /// giving another width to it separated by a comma.\n        /// \n        /// </summary>\n        public string Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `\\--stat`, but shows number of added and\n        /// deleted lines in decimal notation and pathname without\n        /// abbreviation, to make it more machine friendly.  For\n        /// binary files, outputs two `-` instead of saying\n        /// `0 0`.\n        /// \n        /// </summary>\n        public bool Numstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output only the last line of the `--stat` format containing total\n        /// number of modified files, as well as number of added and deleted\n        /// lines.\n        /// \n        /// </summary>\n        public bool Shortstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the distribution of relative amount of changes (number of lines added or\n        /// removed) for each sub-directory. Directories with changes below\n        /// a cut-off percent (3% by default) are not shown. The cut-off percent\n        /// can be set with `--dirstat=limit`. Changes in a child directory is not\n        /// counted for the parent directory, unless `--cumulative` is used.\n        /// \n        /// </summary>\n        public string Dirstat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `--dirstat`, but counts changed files instead of lines.\n        /// \n        /// </summary>\n        public string DirstatByFile { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output a condensed summary of extended header information\n        /// such as creations, renames and mode changes.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Synonym for `-p --stat`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool PatchWithStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifdef::git-log[]\n        /// Separate the commits with NULs instead of with new newlines.\n        /// +\n        /// Also, when `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// ifndef::git-log[]\n        /// When `--raw` or `--numstat` has been given, do not munge\n        /// pathnames and use NULs as output field terminators.\n        /// endif::git-log[]\n        /// +\n        /// Without this option, each pathname output will have TAB, LF, double quotes,\n        /// and backslash characters replaced with `\\t`, `\\n`, `\\\"`, and `\\\\`,\n        /// respectively, and the pathname will be enclosed in double quotes if\n        /// any of those replacements occurred.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names of changed files.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only names and status of changed files. See the description\n        /// of the `--diff-filter` option on what the status letters mean.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Chose the output format for submodule differences. &lt;format&gt; can be one of\n        /// 'short' and 'log'. 'short' just shows pairs of commit names, this format\n        /// is used when this option is not given. 'log' is the default value for this\n        /// option and lists the commits in that commit range like the 'summary'\n        /// option of linkgit:git-submodule[1] does.\n        /// \n        /// </summary>\n        public string Submodule { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored diff.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored diff, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored word diff, i.e., color words which have changed.\n        /// By default, words are separated by whitespace.\n        /// +\n        /// When a &lt;regex&gt; is specified, every non-overlapping match of the\n        /// considered whitespace and ignored(!) for the purposes of finding\n        /// differences.  You may want to append `|[^[:space:]]` to your regular\n        /// expression to make sure that it matches all non-whitespace characters.\n        /// A match that contains a newline is silently truncated(!) at the\n        /// newline.\n        /// +\n        /// The regex can also be set via a diff driver or configuration option, see\n        /// linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly\n        /// overrides any diff driver or configuration setting.  Diff drivers\n        /// override configuration settings.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string ColorWords { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off rename detection, even when the configuration\n        /// file gives the default to do so.\n        /// \n        /// </summary>\n        public bool NoRenames { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Warn if changes introduce trailing whitespace\n        /// or an indent that uses a space before a tab. Exits with\n        /// non-zero status if problems are found. Not compatible with\n        /// --exit-code.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Check { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the first handful of characters, show the full\n        /// pre- and post-image blob object names on the \"index\"\n        /// line when generating patch format output.\n        /// \n        /// </summary>\n        public bool FullIndex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to `--full-index`, output a binary diff that\n        /// can be applied with `git-apply`.\n        /// \n        /// </summary>\n        public bool Binary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// name in diff-raw format output and diff-tree header\n        /// lines, show only a partial prefix.  This is\n        /// independent of the `--full-index` option above, which controls\n        /// the diff-patch output format.  Non default number of\n        /// digits can be specified with `--abbrev=&lt;n&gt;`.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Break complete rewrite changes into pairs of delete and create.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect renames.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Detect copies as well as renames.  See also `--find-copies-harder`.\n        /// \n        /// </summary>\n        public bool C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Select only files that are Added (`A`), Copied (`C`),\n        /// Deleted (`D`), Modified (`M`), Renamed (`R`), have their\n        /// type (i.e. regular file, symlink, submodule, ...) changed (`T`),\n        /// are Unmerged (`U`), are\n        /// Unknown (`X`), or have had their pairing Broken (`B`).\n        /// Any combination of the filter characters may be used.\n        /// When `*` (All-or-none) is added to the combination, all\n        /// paths are selected if there is any file that matches\n        /// other criteria in the comparison; if there is no file\n        /// that matches other criteria, nothing is selected.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string DiffFilter { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For performance reasons, by default, `-C` option finds copies only\n        /// if the original file of the copy was modified in the same\n        /// changeset.  This flag makes the command\n        /// inspect unmodified files as candidates for the source of\n        /// copy.  This is a very expensive operation for large\n        /// projects, so use it with caution.  Giving more than one\n        /// `-C` option has the same effect.\n        /// \n        /// </summary>\n        public bool FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The `-M` and `-C` options require O(n^2) processing time where n\n        /// is the number of potential rename/copy targets.  This\n        /// option prevents rename/copy detection from running if\n        /// the number of rename/copy targets exceeds the specified\n        /// number.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Look for differences that introduce or remove an instance of\n        /// &lt;string&gt;. Note that this is different than the string simply\n        /// appearing in diff output; see the 'pickaxe' entry in\n        /// linkgit:gitdiffcore[7] for more details.\n        /// \n        /// </summary>\n        public string S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When `-S` finds a change, show all the changes in that\n        /// changeset, not just the files that contain the change\n        /// in &lt;string&gt;.\n        /// \n        /// </summary>\n        public bool PickaxeAll { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make the &lt;string&gt; not a plain string but an extended POSIX\n        /// regex to match.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public string PickaxeRegex { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output the patch in the order specified in the\n        /// &lt;orderfile&gt;, which has one shell glob pattern per line.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Swap two inputs; that is, show differences from index or\n        /// on-disk file to tree contents.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory of the project, it can be\n        /// told to exclude changes outside the directory and show\n        /// pathnames relative to it with this option.  When you are\n        /// not in a subdirectory (e.g. in a bare repository), you\n        /// can name which subdirectory to make the output relative\n        /// to by giving a &lt;path&gt; as an argument.\n        /// \n        /// </summary>\n        public string Relative { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Treat all files as text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in whitespace at EOL.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceAtEol { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes in amount of whitespace.  This ignores whitespace\n        /// at line end, and considers all other sequences of one or\n        /// more whitespace characters to be equivalent.\n        /// \n        /// </summary>\n        public bool IgnoreSpaceChange { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore whitespace when comparing lines.  This ignores\n        /// differences even if one line has whitespace where the other\n        /// line has none.\n        /// \n        /// </summary>\n        public bool IgnoreAllSpace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the context between diff hunks, up to the specified number\n        /// of lines, thereby fusing hunks that are close to each other.\n        /// \n        /// </summary>\n        public string InterHunkContext { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ifndef::git-format-patch[]\n        /// Make the program exit with codes similar to diff(1).\n        /// That is, it exits with 1 if there were differences and\n        /// 0 means no differences.\n        /// \n        /// </summary>\n        public bool ExitCode { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all output of the program. Implies `--exit-code`.\n        /// endif::git-format-patch[]\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow an external diff helper to be executed. If you set an\n        /// external diff driver with linkgit:gitattributes[5], you need\n        /// to use this option with linkgit:git-log[1] and friends.\n        /// \n        /// </summary>\n        public bool ExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disallow external diff drivers.\n        /// \n        /// </summary>\n        public bool NoExtDiff { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore changes to submodules in the diff generation.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given source prefix instead of \"a/\".\n        /// \n        /// </summary>\n        public string SrcPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the given destination prefix instead of \"b/\".\n        /// \n        /// </summary>\n        public string DstPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show any source or destination prefix.\n        /// \n        /// </summary>\n        public bool NoPrefix { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/FsckCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class FsckCommand\n        : AbstractCommand\n    {\n\n        public FsckCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        \n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print out objects that exist but that aren't readable from any\n        /// of the reference nodes.\n        /// \n        /// </summary>\n        public bool Unreachable { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Report root nodes.\n        /// \n        /// </summary>\n        public bool Root { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Report tags.\n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Consider any object recorded in the index also as a head node for\n        /// an unreachability trace.\n        /// \n        /// </summary>\n        public bool Cache { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not consider commits that are referenced only by an\n        /// entry in a reflog to be reachable.  This option is meant\n        /// only to search for commits that used to be in a ref, but\n        /// now aren't, but are still in that corresponding reflog.\n        /// \n        /// </summary>\n        public bool NoReflogs { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Check not just objects in GIT_OBJECT_DIRECTORY\n        /// ($GIT_DIR/objects), but also the ones found in alternate\n        /// object pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES\n        /// or $GIT_DIR/objects/info/alternates,\n        /// and in packed git archives found in $GIT_DIR/objects/pack\n        /// and corresponding pack subdirectories in alternate\n        /// object pools.  This is now default; you can turn it off\n        /// with --no-full.\n        /// \n        /// </summary>\n        public bool Full { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Enable more strict checking, namely to catch a file mode\n        /// recorded with g+w bit set, which was created by older\n        /// versions of git.  Existing repositories, including the\n        /// Linux kernel, git itself, and sparse repository have old\n        /// objects that triggers this check, but it is recommended\n        /// to check new projects with this flag.\n        /// \n        /// </summary>\n        public bool Strict { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be chatty.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Write dangling objects into .git/lost-found/commit/ or\n        /// .git/lost-found/other/, depending on type.  If the object is\n        /// a blob, the contents are written into the file, rather than\n        /// its object name.\n        /// \n        /// </summary>\n        public bool LostFound { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/GcCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class GcCommand\n        : AbstractCommand\n    {\n\n        public GcCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually 'git-gc' runs very quickly while providing good disk\n        /// space utilization and performance.  This option will cause\n        /// 'git-gc' to more aggressively optimize the repository at the expense\n        /// of taking much more time.  The effects of this optimization are\n        /// persistent, so this option only needs to be used occasionally; every\n        /// few hundred changesets or so.\n        /// \n        /// </summary>\n        public bool Aggressive { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, 'git-gc' checks whether any housekeeping is\n        /// required; if not, it exits without performing any work.\n        /// Some git commands run `git gc --auto` after performing\n        /// operations that could create many loose objects.\n        /// +\n        /// Housekeeping is required if there are too many loose objects or\n        /// too many packs in the repository. If the number of loose objects\n        /// exceeds the value of the `gc.auto` configuration variable, then\n        /// all loose objects are combined into a single pack using\n        /// 'git-repack -d -l'.  Setting the value of `gc.auto` to 0\n        /// disables automatic packing of loose objects.\n        /// +\n        /// If the number of packs exceeds the value of `gc.autopacklimit`,\n        /// then existing packs (except those marked with a `.keep` file)\n        /// are consolidated into a single pack by using the `-A` option of\n        /// 'git-repack'. Setting `gc.autopacklimit` to 0 disables\n        /// automatic consolidation of packs.\n        /// \n        /// </summary>\n        public bool Auto { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Prune loose objects older than date (default is 2 weeks ago,\n        /// overridable by the config variable `gc.pruneExpire`).  This\n        /// option is on by default.\n        /// \n        /// </summary>\n        public string Prune { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not prune any loose objects.\n        /// \n        /// </summary>\n        public bool NoPrune { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Suppress all progress reports.\n        /// </summary>\n        public bool Quiet { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/GrepCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class GrepCommand\n        : AbstractCommand\n    {\n\n        public GrepCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of searching in the working tree files, check\n        /// the blobs registered in the index file.\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Process binary files as if they were text.\n        /// \n        /// </summary>\n        public bool Text { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore case differences between the patterns and the\n        /// files.\n        /// \n        /// </summary>\n        public bool IgnoreCase { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't match the pattern in binary files.\n        /// \n        /// </summary>\n        public bool I { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// For each pathspec given on command line, descend at most &lt;depth&gt;\n        /// levels of directories. A negative value means no limit.\n        /// \n        /// </summary>\n        public string MaxDepth { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Match the pattern only at word boundary (either begin at the\n        /// beginning of a line, or preceded by a non-word character; end at\n        /// the end of a line or followed by a non-word character).\n        /// \n        /// </summary>\n        public bool WordRegexp { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Select non-matching lines.\n        /// \n        /// </summary>\n        public bool InvertMatch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, the command shows the filename for each\n        /// match.  `-h` option is used to suppress this output.\n        /// `-H` is there for completeness and does not do anything\n        /// except it overrides `-h` given earlier on the command\n        /// line.\n        /// \n        /// </summary>\n        public bool H { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory, the command usually\n        /// outputs paths relative to the current directory.  This\n        /// option forces paths to be output relative to the project\n        /// top directory.\n        /// \n        /// </summary>\n        public bool FullName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use POSIX extended/basic regexp for patterns.  Default\n        /// is to use basic regexp.\n        /// \n        /// </summary>\n        public bool ExtendedRegexp { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use POSIX extended/basic regexp for patterns.  Default\n        /// is to use basic regexp.\n        /// \n        /// </summary>\n        public bool BasicRegexp { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use fixed strings for patterns (don't interpret pattern\n        /// as a regex).\n        /// \n        /// </summary>\n        public bool FixedStrings { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Prefix the line number to matching lines.\n        /// \n        /// </summary>\n        public bool N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing every matched line, show only the\n        /// names of files that contain (or do not contain) matches.\n        /// For better compatibility with 'git-diff', --name-only is a\n        /// synonym for --files-with-matches.\n        /// \n        /// </summary>\n        public bool FilesWithMatches { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing every matched line, show only the\n        /// names of files that contain (or do not contain) matches.\n        /// For better compatibility with 'git-diff', --name-only is a\n        /// synonym for --files-with-matches.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing every matched line, show only the\n        /// names of files that contain (or do not contain) matches.\n        /// For better compatibility with 'git-diff', --name-only is a\n        /// synonym for --files-with-matches.\n        /// \n        /// </summary>\n        public bool FilesWithoutMatch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output \\0 instead of the character that normally follows a\n        /// file name.\n        /// \n        /// </summary>\n        public bool Null { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing every matched line, show the number of\n        /// lines that match.\n        /// \n        /// </summary>\n        public bool Count { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show colored matches.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off match highlighting, even when the configuration file\n        /// gives the default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show `context` trailing (`A` -- after), or leading (`B`\n        /// -- before), or both (`C` -- context) lines, and place a\n        /// line containing `--` between contiguous groups of\n        /// matches.\n        /// \n        /// </summary>\n        public string A { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show `context` trailing (`A` -- after), or leading (`B`\n        /// -- before), or both (`C` -- context) lines, and place a\n        /// line containing `--` between contiguous groups of\n        /// matches.\n        /// \n        /// </summary>\n        public string B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show `context` trailing (`A` -- after), or leading (`B`\n        /// -- before), or both (`C` -- context) lines, and place a\n        /// line containing `--` between contiguous groups of\n        /// matches.\n        /// \n        /// </summary>\n        public string C { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the preceding line that contains the function name of\n        /// the match, unless the matching line is a function name itself.\n        /// The name is determined in the same way as 'git diff' works out\n        /// patch hunk headers (see 'Defining a custom hunk-header' in\n        /// linkgit:gitattributes[5]).\n        /// \n        /// </summary>\n        public bool ShowFunction { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read patterns from &lt;file&gt;, one per line.\n        /// \n        /// </summary>\n        public string F { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The next parameter is the pattern. This option has to be\n        /// used for patterns starting with - and should be used in\n        /// scripts passing user input to grep.  Multiple patterns are\n        /// combined by 'or'.\n        /// \n        /// </summary>\n        public bool E { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ( ... )::\n        /// Specify how multiple patterns are combined using Boolean\n        /// expressions.  `--or` is the default operator.  `--and` has\n        /// higher precedence than `--or`.  `-e` has to be used for all\n        /// patterns.\n        /// \n        /// </summary>\n        public bool And { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ( ... )::\n        /// Specify how multiple patterns are combined using Boolean\n        /// expressions.  `--or` is the default operator.  `--and` has\n        /// higher precedence than `--or`.  `-e` has to be used for all\n        /// patterns.\n        /// \n        /// </summary>\n        public bool Or { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// ( ... )::\n        /// Specify how multiple patterns are combined using Boolean\n        /// expressions.  `--or` is the default operator.  `--and` has\n        /// higher precedence than `--or`.  `-e` has to be used for all\n        /// patterns.\n        /// \n        /// </summary>\n        public bool Not { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When giving multiple pattern expressions combined with `--or`,\n        /// this flag is specified to limit the match to files that\n        /// have lines to match all of them.\n        /// \n        /// </summary>\n        public bool AllMatch { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/HashObjectCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class HashObjectCommand\n        : AbstractCommand\n    {\n\n        public HashObjectCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specify the type (default: \"blob\").\n        /// \n        /// </summary>\n        public string T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Actually write the object into the object database.\n        /// \n        /// </summary>\n        public bool W { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read the object from standard input instead of from a file.\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read file names from stdin instead of from the command-line.\n        /// \n        /// </summary>\n        public bool StdinPaths { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Hash object as it were located at the given path. The location of\n        /// file does not directly influence on the hash value, but path is\n        /// used to determine what git filters should be applied to the object\n        /// before it can be placed to the object database, and, as result of\n        /// applying filters, the actual blob put into the object database may\n        /// differ from the given file. This option is mainly useful for hashing\n        /// temporary files located outside of the working directory or files\n        /// read from stdin.\n        /// \n        /// </summary>\n        public bool Path { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Hash the contents as is, ignoring any input filter that would\n        /// have been chosen by the attributes mechanism, including crlf\n        /// conversion. If the file is read from standard input then this\n        /// is always implied, unless the --path option is given.\n        /// </summary>\n        public bool NoFilters { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/IndexPackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class IndexpackCommand\n        : AbstractCommand\n    {\n\n        public IndexpackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be verbose about what is going on, including progress status.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Write the generated pack index into the specified\n        /// file.  Without this option the name of pack index\n        /// file is constructed from the name of packed archive\n        /// file by replacing .pack with .idx (and the program\n        /// fails if the name of packed archive does not end\n        /// with .pack).\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When this flag is provided, the pack is read from stdin\n        /// instead and a copy is then written to &lt;pack-file&gt;. If\n        /// &lt;pack-file&gt; is not specified, the pack is written to\n        /// objects/pack/ directory of the current git repository with\n        /// a default name determined from the pack content.  If\n        /// &lt;pack-file&gt; is not specified consider using --keep to\n        /// prevent a race condition between this process and\n        /// 'git-repack'.\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// It is possible for 'git-pack-objects' to build\n        /// \"thin\" pack, which records objects in deltified form based on\n        /// objects not included in the pack to reduce network traffic.\n        /// Those objects are expected to be present on the receiving end\n        /// and they must be included in the pack for that pack to be self\n        /// contained and indexable. Without this option any attempt to\n        /// index a thin pack will fail. This option only makes sense in\n        /// conjunction with --stdin.\n        /// \n        /// </summary>\n        public bool FixThin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Before moving the index into its final destination\n        /// create an empty .keep file for the associated pack file.\n        /// This option is usually necessary with --stdin to prevent a\n        /// simultaneous 'git-repack' process from deleting\n        /// the newly constructed pack and index before refs can be\n        /// updated to use objects contained in the pack.\n        /// \n        /// </summary>\n        public bool Keep { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Like --keep create a .keep file before moving the index into\n        /// its final destination, but rather than creating an empty file\n        /// place 'why' followed by an LF into the .keep file.  The 'why'\n        /// message can later be searched for within all .keep files to\n        /// locate any which have outlived their usefulness.\n        /// \n        /// </summary>\n        public string KeepMsg { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is intended to be used by the test suite only. It allows\n        /// to force the version for the generated pack index, and to force\n        /// 64-bit index entries on objects located above the given offset.\n        /// \n        /// </summary>\n        public string IndexVersion { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Die, if the pack contains broken objects or links.\n        /// \n        /// </summary>\n        public bool Strict { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/LsFilesCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class LsFilesCommand\n        : AbstractCommand\n    {\n\n        public LsFilesCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show cached files in the output (default)\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show deleted files in the output\n        /// \n        /// </summary>\n        public bool Deleted { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show modified files in the output\n        /// \n        /// </summary>\n        public bool Modified { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show other (i.e. untracked) files in the output\n        /// \n        /// </summary>\n        public bool Others { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only ignored files in the output. When showing files in the\n        /// index, print only those matched by an exclude pattern. When\n        /// showing \"other\" files, show only those matched by an exclude\n        /// pattern.\n        /// \n        /// </summary>\n        public bool Ignored { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show staged contents' object name, mode bits and stage number in the output.\n        /// \n        /// </summary>\n        public bool Stage { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If a whole directory is classified as \"other\", show just its\n        /// name (with a trailing slash) and not its whole contents.\n        /// \n        /// </summary>\n        public bool Directory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not list empty directories. Has no effect without --directory.\n        /// \n        /// </summary>\n        public bool NoEmptyDirectory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show unmerged files in the output (forces --stage)\n        /// \n        /// </summary>\n        public bool Unmerged { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show files on the filesystem that need to be removed due\n        /// to file/directory conflicts for checkout-index to\n        /// succeed.\n        /// \n        /// </summary>\n        public bool Killed { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \\0 line termination on output.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Skips files matching pattern.\n        /// Note that pattern is a shell wildcard pattern.\n        /// \n        /// </summary>\n        public string Exclude { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// exclude patterns are read from &lt;file&gt;; 1 per line.\n        /// \n        /// </summary>\n        public string ExcludeFrom { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// read additional exclude patterns that apply only to the\n        /// directory and its subdirectories in &lt;file&gt;.\n        /// \n        /// </summary>\n        public string ExcludePerDirectory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add the standard git exclusions: .git/info/exclude, .gitignore\n        /// in each directory, and the user's global exclusion file.\n        /// \n        /// </summary>\n        public bool ExcludeStandard { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If any &lt;file&gt; does not appear in the index, treat this as an\n        /// error (return 1).\n        /// \n        /// </summary>\n        public string ErrorUnmatch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When using --error-unmatch to expand the user supplied\n        /// &lt;file&gt; (i.e. path pattern) arguments to paths, pretend\n        /// that paths which were removed in the index since the\n        /// named &lt;tree-ish&gt; are still present.  Using this option\n        /// with `-s` or `-u` options does not make any sense.\n        /// \n        /// </summary>\n        public string WithTree { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Identify the file status with the following tags (followed by\n        /// a space) at the start of each line:\n        /// H::cached\n        /// M::unmerged\n        /// R::removed/deleted\n        /// C::modified/changed\n        /// K::to be killed\n        /// ?::other\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to `-t`, but use lowercase letters for files\n        /// that are marked as 'assume unchanged' (see\n        /// linkgit:git-update-index[1]).\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When run from a subdirectory, the command usually\n        /// outputs paths relative to the current directory.  This\n        /// option forces paths to be output relative to the project\n        /// top directory.\n        /// \n        /// </summary>\n        public bool FullName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// lines, show only a partial prefix.\n        /// Non default number of digits can be specified with --abbrev=&lt;n&gt;.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/LsRemoteCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class LsRemoteCommand\n        : AbstractCommand\n    {\n\n        public LsRemoteCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Limit to only refs/heads and refs/tags, respectively.\n        /// These options are _not_ mutually exclusive; when given\n        /// both, references stored in refs/heads and refs/tags are\n        /// displayed.\n        /// \n        /// </summary>\n        public bool Heads { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Limit to only refs/heads and refs/tags, respectively.\n        /// These options are _not_ mutually exclusive; when given\n        /// both, references stored in refs/heads and refs/tags are\n        /// displayed.\n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specify the full path of 'git-upload-pack' on the remote\n        /// host. This allows listing references from repositories accessed via\n        /// SSH and where the SSH daemon does not use the PATH configured by the\n        /// user.\n        /// \n        /// </summary>\n        public string UploadPack { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/LsTreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class LsTreeCommand\n        : AbstractCommand\n    {\n\n        public LsTreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show only the named tree entry itself, not its children.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Recurse into sub-trees.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show tree entries even when going to recurse them. Has no effect\n        /// if '-r' was not passed. '-d' implies '-t'.\n        /// \n        /// </summary>\n        public bool T { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show object size of blob (file) entries.\n        /// \n        /// </summary>\n        public bool Long { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \\0 line termination on output.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List only filenames (instead of the \"long\" output), one per line.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List only filenames (instead of the \"long\" output), one per line.\n        /// \n        /// </summary>\n        public bool NameStatus { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal object\n        /// lines, show only a partial prefix.\n        /// Non default number of digits can be specified with --abbrev=&lt;n&gt;.\n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the path names relative to the current working\n        /// directory, show the full path names.\n        /// \n        /// </summary>\n        public bool FullName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not limit the listing to the current working directory.\n        /// Implies --full-name.\n        /// \n        /// </summary>\n        public bool FullTree { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MailinfoCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MailinfoCommand\n        : AbstractCommand\n    {\n\n        public MailinfoCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the program 'cleans up' the Subject: header line\n        /// to extract the title line for the commit log message,\n        /// among which (1) remove 'Re:' or 're:', (2) leading\n        /// whitespaces, (3) '[' up to ']', typically '[PATCH]', and\n        /// then prepends \"[PATCH] \".  This flag forbids this\n        /// munging, and is most useful when used to read back\n        /// 'git-format-patch -k' output.\n        /// \n        /// </summary>\n        public bool K { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When -k is not in effect, all leading strings bracketed with '['\n        /// and ']' pairs are stripped.  This option limits the stripping to\n        /// only the pairs whose bracketed string contains the word \"PATCH\".\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The commit log message, author name and author email are\n        /// taken from the e-mail, and after minimally decoding MIME\n        /// transfer encoding, re-coded in UTF-8 by transliterating\n        /// them.  This used to be optional but now it is the default.\n        /// +\n        /// Note that the patch is always used as-is without charset\n        /// conversion, even with this flag.\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Similar to -u but if the local convention is different\n        /// from what is specified by i18n.commitencoding, this flag\n        /// can be used to override it.\n        /// \n        /// </summary>\n        public string Encoding { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Disable all charset re-coding of the metadata.\n        /// \n        /// </summary>\n        public bool N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove everything in body before a scissors line.  A line that\n        /// mainly consists of scissors (either \"&gt;8\" or \"8&lt;\") and perforation\n        /// (dash \"-\") marks is called a scissors line, and is used to request\n        /// the reader to cut the message at that line.  If such a line\n        /// appears in the body of the message before the patch, everything\n        /// before it (including the scissors line itself) is ignored when\n        /// this option is used.\n        /// +\n        /// This is useful if you want to begin your message in a discussion thread\n        /// with comments and suggestions on the message you are responding to, and to\n        /// conclude it with a patch submission, separating the discussion and the\n        /// beginning of the proposed commit log message with a scissors line.\n        /// +\n        /// This can enabled by default with the configuration option mailinfo.scissors.\n        /// \n        /// </summary>\n        public bool Scissors { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignore scissors lines. Useful for overriding mailinfo.scissors settings.\n        /// \n        /// </summary>\n        public bool NoScissors { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MailsplitCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MailsplitCommand\n        : AbstractCommand\n    {\n\n        public MailsplitCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Directory in which to place the individual messages.\n        /// \n        /// </summary>\n        public string O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If any file doesn't begin with a From line, assume it is a\n        /// single mail message instead of signaling error.\n        /// \n        /// </summary>\n        public bool B { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of the default 4 digits with leading zeros,\n        /// different precision can be specified for the generated\n        /// filenames.\n        /// \n        /// </summary>\n        public string D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Skip the first &lt;nn&gt; numbers, for example if -f3 is specified,\n        /// start the numbering with 0004.\n        /// </summary>\n        public string F { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MergeBaseCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MergeBaseCommand\n        : AbstractCommand\n    {\n\n        public MergeBaseCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Output all merge bases for the commits, instead of just one.\n        /// </summary>\n        public bool All { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MergeFileCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MergeFileCommand\n        : AbstractCommand\n    {\n\n        public MergeFileCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option may be given up to three times, and\n        /// specifies labels to be used in place of the\n        /// corresponding file names in conflict reports. That is,\n        /// `git merge-file -L x -L y -L z a b c` generates output that\n        /// looks like it came from files x, y and z instead of\n        /// from files a, b and c.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Send results to standard output instead of overwriting\n        /// `&lt;current-file&gt;`.\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Quiet; do not warn about conflicts.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MergeIndexCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MergeIndexCommand\n        : AbstractCommand\n    {\n\n        public MergeIndexCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Run merge against all files in the index that need merging.\n        /// \n        /// </summary>\n        public bool A { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of stopping at the first failed merge, do all of them\n        /// in one shot - continue with merging even when previous merges\n        /// returned errors, and only return the error code after all the\n        /// merges.\n        /// \n        /// </summary>\n        public bool O { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not complain about a failed merge program (a merge program\n        /// failure usually indicates conflicts during the merge). This is for\n        /// porcelains which might want to emit custom messages.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MergetoolCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MergetoolCommand\n        : AbstractCommand\n    {\n\n        public MergetoolCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the merge resolution program specified by &lt;tool&gt;.\n        /// Valid merge tools are:\n        /// kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,\n        /// diffuse, tortoisemerge, opendiff, p4merge and araxis.\n        /// +\n        /// If a merge resolution program is not specified, 'git-mergetool'\n        /// will use the configuration variable `merge.tool`.  If the\n        /// configuration variable `merge.tool` is not set, 'git-mergetool'\n        /// will pick a suitable default.\n        /// +\n        /// You can explicitly provide a full path to the tool by setting the\n        /// configuration variable `mergetool.&lt;tool&gt;.path`. For example, you\n        /// can configure the absolute path to kdiff3 by setting\n        /// `mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the\n        /// tool is available in PATH.\n        /// +\n        /// Instead of running one of the known merge tool programs,\n        /// 'git-mergetool' can be customized to run an alternative program\n        /// by specifying the command line to invoke in a configuration\n        /// variable `mergetool.&lt;tool&gt;.cmd`.\n        /// +\n        /// When 'git-mergetool' is invoked with this tool (either through the\n        /// `-t` or `--tool` option or the `merge.tool` configuration\n        /// variable) the configured command line will be invoked with `$BASE`\n        /// set to the name of a temporary file containing the common base for\n        /// the merge, if available; `$LOCAL` set to the name of a temporary\n        /// file containing the contents of the file on the current branch;\n        /// `$REMOTE` set to the name of a temporary file containing the\n        /// contents of the file to be merged, and `$MERGED` set to the name\n        /// of the file to which the merge tool should write the result of the\n        /// merge resolution.\n        /// +\n        /// If the custom merge tool correctly indicates the success of a\n        /// merge resolution with its exit code, then the configuration\n        /// variable `mergetool.&lt;tool&gt;.trustExitCode` can be set to `true`.\n        /// Otherwise, 'git-mergetool' will prompt the user to indicate the\n        /// success of the resolution after the custom tool has exited.\n        /// \n        /// </summary>\n        public string Tool { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't prompt before each invocation of the merge resolution\n        /// program.\n        /// \n        /// </summary>\n        public bool NoPrompt { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Prompt before each invocation of the merge resolution program.\n        /// This is the default behaviour; the option is provided to\n        /// override any configuration settings.\n        /// </summary>\n        public bool Prompt { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MktreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MktreeCommand\n        : AbstractCommand\n    {\n\n        public MktreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read the NUL-terminated `ls-tree -z` output instead.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow missing objects.  The default behaviour (without this option)\n        /// is to verify that each tree entry's sha1 identifies an existing\n        /// object.  This option has no effect on the treatment of gitlink entries\n        /// (aka \"submodules\") which are always allowed to be missing.\n        /// \n        /// </summary>\n        public bool Missing { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Allow building of more than one tree object before exiting.  Each\n        /// tree is separated by as single blank line. The final new-line is\n        /// optional.  Note - if the '-z' option is used, lines are terminated\n        /// with NUL.\n        /// </summary>\n        public bool Batch { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/MvCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class MvCommand\n        : AbstractCommand\n    {\n\n        public MvCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Force renaming or moving of a file even if the target exists\n        ///         Skip move or rename actions which would lead to an error\n        /// condition. An error happens when a source is neither existing nor\n        ///         controlled by GIT, or when it would overwrite an existing\n        ///         file unless '-f' is given.\n        /// Do nothing; only show what would happen\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Force renaming or moving of a file even if the target exists\n        ///         Skip move or rename actions which would lead to an error\n        /// condition. An error happens when a source is neither existing nor\n        ///         controlled by GIT, or when it would overwrite an existing\n        ///         file unless '-f' is given.\n        /// Do nothing; only show what would happen\n        /// \n        /// </summary>\n        public bool K { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Force renaming or moving of a file even if the target exists\n        ///         Skip move or rename actions which would lead to an error\n        /// condition. An error happens when a source is neither existing nor\n        ///         controlled by GIT, or when it would overwrite an existing\n        ///         file unless '-f' is given.\n        /// Do nothing; only show what would happen\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/NameRevCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class NameRevCommand\n        : AbstractCommand\n    {\n\n        public NameRevCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not use branch names, but only tags to name the commits\n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only use refs whose names match a given shell pattern.\n        /// \n        /// </summary>\n        public string Refs { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List all commits reachable from all refs\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read from stdin, append \"(&lt;rev_name&gt;)\" to all sha1's of nameable\n        /// commits, and pass to stdout\n        /// \n        /// </summary>\n        public string Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of printing both the SHA-1 and the name, print only\n        /// the name.  If given with --tags the usual tag prefix of\n        /// \"tags/\" is also omitted from the name, matching the output\n        /// of `git-describe` more closely.\n        /// \n        /// </summary>\n        public bool NameOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Die with error code != 0 when a reference is undefined,\n        /// instead of printing `undefined`.\n        /// \n        /// </summary>\n        public bool NoUndefined { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show uniquely abbreviated commit object as fallback.\n        /// </summary>\n        public bool Always { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/NotesCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class NotesCommand\n        : AbstractCommand\n    {\n\n        public NotesCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the given note message (instead of prompting).\n        /// If multiple `-m` (or `-F`) options are given, their\n        /// values are concatenated as separate paragraphs.\n        /// \n        /// </summary>\n        public string M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Take the note message from the given file.  Use '-' to\n        /// read the note message from the standard input.\n        /// If multiple `-F` (or `-m`) options are given, their\n        /// values are concatenated as separate paragraphs.\n        /// \n        /// </summary>\n        public string F { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PackObjectsCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PackObjectsCommand\n        : AbstractCommand\n    {\n\n        public PackObjectsCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Write the pack contents (what would have been written to\n        /// .pack file) out to the standard output.\n        /// \n        /// </summary>\n        public bool Stdout { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Read the revision arguments from the standard input, instead of\n        /// individual object names.  The revision arguments are processed\n        /// the same way as 'git-rev-list' with the `--objects` flag\n        /// uses its `commit` arguments to build the list of objects it\n        /// outputs.  The objects on the resulting list are packed.\n        /// \n        /// </summary>\n        public bool Revs { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This implies `--revs`.  When processing the list of\n        /// revision arguments read from the standard input, limit\n        /// the objects packed to those that are not already packed.\n        /// \n        /// </summary>\n        public bool Unpacked { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This implies `--revs`.  In addition to the list of\n        /// revision arguments read from the standard input, pretend\n        /// as if all refs under `$GIT_DIR/refs` are specified to be\n        /// included.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Include unasked-for annotated tags if the object they\n        /// reference was included in the resulting packfile.  This\n        /// can be useful to send new tags to native git clients.\n        /// \n        /// </summary>\n        public bool IncludeTag { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These two options affect how the objects contained in\n        /// the pack are stored using delta compression.  The\n        /// objects are first internally sorted by type, size and\n        /// optionally names and compared against the other objects\n        /// within --window to see if using delta compression saves\n        /// space.  --depth limits the maximum delta depth; making\n        /// it too deep affects the performance on the unpacker\n        /// side, because delta data needs to be applied that many\n        /// times to get to the necessary object.\n        /// The default value for --window is 10 and --depth is 50.\n        /// \n        /// </summary>\n        public string Window { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These two options affect how the objects contained in\n        /// the pack are stored using delta compression.  The\n        /// objects are first internally sorted by type, size and\n        /// optionally names and compared against the other objects\n        /// within --window to see if using delta compression saves\n        /// space.  --depth limits the maximum delta depth; making\n        /// it too deep affects the performance on the unpacker\n        /// side, because delta data needs to be applied that many\n        /// times to get to the necessary object.\n        /// The default value for --window is 10 and --depth is 50.\n        /// \n        /// </summary>\n        public string Depth { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option provides an additional limit on top of `--window`;\n        /// the window size will dynamically scale down so as to not take\n        /// up more than N bytes in memory.  This is useful in\n        /// repositories with a mix of large and small objects to not run\n        /// out of memory with a large window, but still be able to take\n        /// advantage of the large window for the smaller objects.  The\n        /// size can be suffixed with \"k\", \"m\", or \"g\".\n        /// `--window-memory=0` makes memory usage unlimited, which is the\n        /// default.\n        /// \n        /// </summary>\n        public string WindowMemory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Maximum size of each output packfile, expressed in MiB.\n        /// If specified,  multiple packfiles may be created.\n        /// The default is unlimited, unless the config variable\n        /// `pack.packSizeLimit` is set.\n        /// \n        /// </summary>\n        public string MaxPackSize { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag causes an object already in a local pack that\n        /// has a .keep file to be ignored, even if it appears in the\n        /// standard input.\n        /// \n        /// </summary>\n        public bool HonorPackKeep { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag causes an object already in a pack ignored\n        /// even if it appears in the standard input.\n        /// \n        /// </summary>\n        public bool Incremental { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag is similar to `--incremental`; instead of\n        /// ignoring all packed objects, it only ignores objects\n        /// that are packed and/or not in the local object store\n        /// (i.e. borrowed from an alternate).\n        /// \n        /// </summary>\n        public bool Local { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Only create a packed archive if it would contain at\n        ///         least one object.\n        /// \n        /// </summary>\n        public bool NonEmpty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Progress status is reported on the standard error stream\n        /// by default when it is attached to a terminal, unless -q\n        /// is specified. This flag forces progress status even if\n        /// the standard error stream is not directed to a terminal.\n        /// \n        /// </summary>\n        public bool Progress { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When --stdout is specified then progress report is\n        /// displayed during the object count and compression phases\n        /// but inhibited during the write-out phase. The reason is\n        /// that in some cases the output stream is directly linked\n        /// to another command which may wish to display progress\n        /// status of its own as it processes incoming pack data.\n        /// This flag is like --progress except that it forces progress\n        /// report for the write-out phase as well even if --stdout is\n        /// used.\n        /// \n        /// </summary>\n        public bool AllProgress { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is used to imply --all-progress whenever progress display\n        /// is activated.  Unlike --all-progress this flag doesn't actually\n        /// force any progress display by itself.\n        /// \n        /// </summary>\n        public bool AllProgressImplied { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag makes the command not to report its progress\n        /// on the standard error stream.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When creating a packed archive in a repository that\n        /// has existing packs, the command reuses existing deltas.\n        /// This sometimes results in a slightly suboptimal pack.\n        /// This flag tells the command not to reuse existing deltas\n        /// but compute them from scratch.\n        /// \n        /// </summary>\n        public bool NoReuseDelta { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This flag tells the command not to reuse existing object data at all,\n        /// including non deltified object, forcing recompression of everything.\n        /// This implies --no-reuse-delta. Useful only in the obscure case where\n        /// wholesale enforcement of a different compression level on the\n        /// packed data is desired.\n        /// \n        /// </summary>\n        public bool NoReuseObject { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specifies compression level for newly-compressed data in the\n        /// generated pack.  If not specified,  pack compression level is\n        /// determined first by pack.compression,  then by core.compression,\n        /// and defaults to -1,  the zlib default,  if neither is set.\n        /// Add --no-reuse-object if you want to force a uniform compression\n        /// level on all data no matter the source.\n        /// \n        /// </summary>\n        public string Compression { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// A packed archive can express base object of a delta as\n        /// either 20-byte object name or as an offset in the\n        /// stream, but older version of git does not understand the\n        /// latter.  By default, 'git-pack-objects' only uses the\n        /// former format for better compatibility.  This option\n        /// allows the command to use the latter format for\n        /// compactness.  Depending on the average delta chain\n        /// length, this option typically shrinks the resulting\n        /// packfile by 3-5 per-cent.\n        /// \n        /// </summary>\n        public bool DeltaBaseOffset { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Specifies the number of threads to spawn when searching for best\n        /// delta matches.  This requires that pack-objects be compiled with\n        /// pthreads otherwise this option is ignored with a warning.\n        /// This is meant to reduce packing time on multiprocessor machines.\n        /// The required amount of memory for the delta search window is\n        /// however multiplied by the number of threads.\n        /// Specifying 0 will cause git to auto-detect the number of CPU's\n        /// and set the number of threads accordingly.\n        /// \n        /// </summary>\n        public string Threads { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is intended to be used by the test suite only. It allows\n        /// to force the version for the generated pack index, and to force\n        /// 64-bit index entries on objects located above the given offset.\n        /// \n        /// </summary>\n        public string IndexVersion { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, parents that are hidden by grafts are packed\n        /// nevertheless.\n        /// \n        /// </summary>\n        public bool KeepTrueParents { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PackRedundantCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PackRedundantCommand\n        : AbstractCommand\n    {\n\n        public PackRedundantCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Processes all packs. Any filenames on the command line are ignored.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't require objects present in packs from alternate object\n        /// directories to be present in local packs.\n        /// \n        /// </summary>\n        public bool AltOdb { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Outputs some statistics to stderr. Has a small performance penalty.\n        /// </summary>\n        public bool Verbose { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PackRefsCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PackRefsCommand\n        : AbstractCommand\n    {\n\n        public PackRefsCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool NoPrune { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PatchIdCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PatchIdCommand\n        : AbstractCommand\n    {\n\n        public PatchIdCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PeekRemoteCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PeekRemoteCommand\n        : AbstractCommand\n    {\n\n        public PeekRemoteCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use this to specify the path to 'git-upload-pack' on the\n        /// remote side, if it is not found on your $PATH. Some\n        /// installations of sshd ignores the user's environment\n        /// setup scripts for login shells (e.g. .bash_profile) and\n        /// your privately installed git may not be found on the system\n        /// default $PATH.  Another workaround suggested is to set\n        /// up your $PATH in \".bashrc\", but this flag is for people\n        /// who do not want to pay the overhead for non-interactive\n        /// shells, but prefer having a lean .bashrc file (they set most of\n        /// the things up in .bash_profile).\n        /// \n        /// </summary>\n        public string UploadPack { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PruneCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PruneCommand\n        : AbstractCommand\n    {\n\n        public PruneCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not remove anything; just report what it would\n        /// remove.\n        /// \n        /// </summary>\n        public bool N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Report all removed objects.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only expire loose objects older than &lt;time&gt;.\n        /// \n        /// </summary>\n        public string Expire { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/PrunePackedCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class PrunePackedCommand\n        : AbstractCommand\n    {\n\n        public PrunePackedCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Don't actually remove any objects, only show those that would have been\n        ///         removed.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Squelch the progress indicator.\n        /// </summary>\n        public bool Quiet { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/QuiltimportCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class QuiltimportCommand\n        : AbstractCommand\n    {\n\n        public QuiltimportCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Walk through the patches in the series and warn\n        /// if we cannot find all of the necessary information to commit\n        /// a patch.  At the time of this writing only missing author\n        /// information is warned about.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The author name and email address to use when no author\n        /// information can be found in the patch description.\n        /// \n        /// </summary>\n        public string Author { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The directory to find the quilt patches and the\n        /// quilt series file.\n        /// +\n        /// The default for the patch directory is patches\n        /// or the value of the $QUILT_PATCHES environment\n        /// variable.\n        /// </summary>\n        public string Patches { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ReadTreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ReadTreeCommand\n        : AbstractCommand\n    {\n\n        public ReadTreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Perform a merge, not just a read.  The command will\n        /// refuse to run if your index file has unmerged entries,\n        /// indicating that you have not finished previous merge you\n        /// started.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Same as -m, except that unmerged entries are discarded\n        ///         instead of failing.\n        /// \n        /// </summary>\n        public bool Reset { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// After a successful merge, update the files in the work\n        /// tree with the result of the merge.\n        /// \n        /// </summary>\n        public bool U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually a merge requires the index file as well as the\n        /// files in the working tree are up to date with the\n        /// current head commit, in order not to lose local\n        /// changes.  This flag disables the check with the working\n        /// tree and is meant to be used when creating a merge of\n        /// trees that are not directly related to the current\n        /// working tree status into a temporary index file.\n        /// \n        /// </summary>\n        public bool I { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the progress of checking files out.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restrict three-way merge by 'git-read-tree' to happen\n        /// only if there is no file-level merging required, instead\n        /// of resolving merge for trivial cases and leaving\n        /// conflicting files unresolved in the index.\n        /// \n        /// </summary>\n        public bool Trivial { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually a three-way merge by 'git-read-tree' resolves\n        /// the merge for really trivial cases and leaves other\n        /// cases unresolved in the index, so that Porcelains can\n        /// implement different merge policies.  This flag makes the\n        /// command to resolve a few more cases internally:\n        /// +\n        /// * when one side removes a path and the other side leaves the path\n        ///   unmodified.  The resolution is to remove that path.\n        /// * when both sides remove a path.  The resolution is to remove that path.\n        /// * when both sides adds a path identically.  The resolution\n        ///   is to add that path.\n        /// \n        /// </summary>\n        public bool Aggressive { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Keep the current index contents, and read the contents\n        /// of named tree-ish under directory at `&lt;prefix&gt;`.  The\n        /// original index file cannot have anything at the path\n        /// `&lt;prefix&gt;` itself, and have nothing in `&lt;prefix&gt;/`\n        /// directory.  Note that the `&lt;prefix&gt;/` value must end\n        /// with a slash.\n        /// \n        /// </summary>\n        public string Prefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When running the command with `-u` and `-m` options, the\n        /// merge result may need to overwrite paths that are not\n        /// tracked in the current branch.  The command usually\n        /// refuses to proceed with the merge to avoid losing such a\n        /// path.  However this safety valve sometimes gets in the\n        /// way.  For example, it often happens that the other\n        /// branch added a file that used to be a generated file in\n        /// your branch, and the safety valve triggers when you try\n        /// to switch to that branch after you ran `make` but before\n        /// running `make clean` to remove the generated file.  This\n        /// option tells the command to read per-directory exclude\n        /// file (usually '.gitignore') and allows such an untracked\n        /// but explicitly ignored file to be overwritten.\n        /// \n        /// </summary>\n        public string ExcludePerDirectory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of writing the results out to `$GIT_INDEX_FILE`,\n        /// write the resulting index in the named file.  While the\n        /// command is operating, the original index file is locked\n        /// with the same mechanism as usual.  The file must allow\n        /// to be rename(2)ed into from a temporary file that is\n        /// created next to the usual index file; typically this\n        /// means it needs to be on the same filesystem as the index\n        /// file itself, and you need write permission to the\n        /// directories the index file and index output file are\n        /// located in.\n        /// \n        /// </summary>\n        public string IndexOutput { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RebaseCommand.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n\n    public class RebaseCommand\n        : AbstractCommand\n    {\n\n        public RebaseCommand()\n        {\n        }\n\n        // note: the naming of command parameters may not follow .NET conventions in favour of git command line parameter naming conventions.\n\n        public List<string> Arguments { get; set; } // <--- [henon] what is that? the name must be clearer\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restart the rebasing process after having resolved a merge conflict.\n        /// \n        /// </summary>\n        public bool Continue { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restore the original branch and abort the rebase operation.\n        /// \n        /// </summary>\n        public bool Abort { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restart the rebasing process by skipping the current patch.\n        /// \n        /// </summary>\n        public bool Skip { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use merging strategies to rebase.  When the recursive (default) merge\n        /// strategy is used, this allows rebase to be aware of renames on the\n        /// upstream side.\n        /// +\n        /// Note that a rebase merge works by replaying each commit from the working\n        /// branch on top of the &lt;upstream&gt; branch.  Because of this, when a merge\n        /// conflict happens, the side reported as 'ours' is the so-far rebased\n        /// series, starting with &lt;upstream&gt;, and 'theirs' is the working branch.  In\n        /// other words, the sides are swapped.\n        /// \n        /// </summary>\n        public bool Merge { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the given merge strategy.\n        /// If there is no `-s` option 'git-merge-recursive' is used\n        /// instead.  This implies --merge.\n        /// +\n        /// Because 'git-rebase' replays each commit from the working branch\n        /// on top of the &lt;upstream&gt; branch using the given strategy, using\n        /// the 'ours' strategy simply discards all patches from the &lt;branch&gt;,\n        /// which makes little sense.\n        /// \n        /// </summary>\n        public string Strategy { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be quiet. Implies --no-stat.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be verbose. Implies --stat.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show a diffstat of what changed upstream since the last rebase. The\n        /// diffstat is also controlled by the configuration option rebase.stat.\n        /// \n        /// </summary>\n        public bool Stat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show a diffstat as part of the rebase process.\n        /// \n        /// </summary>\n        public bool NoStat { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option bypasses the pre-rebase hook.  See also linkgit:githooks[5].\n        /// \n        /// </summary>\n        public bool NoVerify { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ensure at least n lines of surrounding context match before\n        /// and after each change.  When fewer lines of surrounding\n        /// context exist they all must match.  By default no context is\n        /// ever ignored.\n        /// \n        /// </summary>\n        public string Context { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Force the rebase even if the current branch is a descendant\n        /// of the commit you are rebasing onto.  Normally the command will\n        /// exit with the message \"Current branch is up to date\" in such a\n        /// situation.\n        /// \n        /// </summary>\n        public bool Forcerebase { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flag are passed to the 'git-apply' program\n        /// (see linkgit:git-apply[1]) that applies the patch.\n        /// Incompatible with the --interactive option.\n        /// \n        /// </summary>\n        public string IgnoreWhitespace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flag are passed to the 'git-apply' program\n        /// (see linkgit:git-apply[1]) that applies the patch.\n        /// Incompatible with the --interactive option.\n        /// \n        /// </summary>\n        public string Whitespace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to 'git-am' to easily change the dates\n        /// of the rebased commits (see linkgit:git-am[1]).\n        /// \n        /// </summary>\n        public bool CommitterDateIsAuthorDate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These flags are passed to 'git-am' to easily change the dates\n        /// of the rebased commits (see linkgit:git-am[1]).\n        /// \n        /// </summary>\n        public bool IgnoreDate { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make a list of the commits which are about to be rebased.  Let the\n        /// user edit that list before rebasing.  This mode can also be used to\n        /// split commits (see SPLITTING COMMITS below).\n        /// \n        /// </summary>\n        public bool Interactive { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of ignoring merges, try to recreate them.\n        /// \n        /// </summary>\n        public bool PreserveMerges { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Rebase all commits reachable from &lt;branch&gt;, instead of\n        /// limiting them with an &lt;upstream&gt;.  This allows you to rebase\n        /// the root commit(s) on a branch.  Must be used with --onto, and\n        /// will skip changes already contained in &lt;newbase&gt; (instead of\n        /// &lt;upstream&gt;).  When used together with --preserve-merges, 'all'\n        /// root commits will be rewritten to have &lt;newbase&gt; as parent\n        /// instead.\n        /// \n        /// </summary>\n        public string Root { get; set; }\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp/Stubs/ReceivePackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ReceivePackCommand\n        : AbstractCommand\n    {\n\n        public ReceivePackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ReflogCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ReflogCommand\n        : AbstractCommand\n    {\n\n        public ReflogCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This revamps the logic -- the definition of \"broken commit\"\n        /// becomes: a commit that is not reachable from any of the refs and\n        /// there is a missing object among the commit, tree, or blob\n        /// objects reachable from it that is not reachable from any of the\n        /// refs.\n        /// +\n        /// This computation involves traversing all the reachable objects, i.e. it\n        /// has the same cost as 'git-prune'.  Fortunately, once this is run, we\n        /// should not have to ever worry about missing objects, because the current\n        /// prune and pack-objects know about reflogs and protect objects referred by\n        /// them.\n        /// \n        /// </summary>\n        public bool StaleFix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Entries older than this time are pruned.  Without the\n        /// option it is taken from configuration `gc.reflogExpire`,\n        /// which in turn defaults to 90 days.\n        /// \n        /// </summary>\n        public string Expire { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Entries older than this time and not reachable from\n        /// the current tip of the branch are pruned.  Without the\n        /// option it is taken from configuration\n        /// `gc.reflogExpireUnreachable`, which in turn defaults to\n        /// 30 days.\n        /// \n        /// </summary>\n        public string ExpireUnreachable { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of listing &lt;refs&gt; explicitly, prune all refs.\n        /// \n        /// </summary>\n        public string All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Update the ref with the sha1 of the top reflog entry (i.e.\n        /// &lt;ref&gt;@\\{0\\}) after expiring or deleting.\n        /// \n        /// </summary>\n        public bool Updateref { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// While expiring or deleting, adjust each reflog entry to ensure\n        /// that the `old` sha1 field points to the `new` sha1 field of the\n        /// previous entry.\n        /// \n        /// </summary>\n        public bool Rewrite { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print extra information on screen.\n        /// </summary>\n        public bool Verbose { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RelinkCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RelinkCommand\n        : AbstractCommand\n    {\n\n        public RelinkCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Stops if two objects with the same hash exist but have different sizes.\n        /// Default is to warn and continue.\n        /// \n        /// </summary>\n        public bool Safe { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RemoteCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RemoteCommand\n        : AbstractCommand\n    {\n\n        public RemoteCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be a little more verbose and show remote url after name.\n        /// NOTE: This must be placed between `remote` and `subcommand`.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RepackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RepackCommand\n        : AbstractCommand\n    {\n\n        public RepackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of incrementally packing the unpacked objects,\n        /// pack everything referenced into a single pack.\n        /// Especially useful when packing a repository that is used\n        /// for private development. Use\n        /// with '-d'.  This will clean up the objects that `git prune`\n        /// leaves behind, but `git fsck --full` shows as\n        /// dangling.\n        /// +\n        /// Note that users fetching over dumb protocols will have to fetch the\n        /// whole new pack in order to get any contained object, no matter how many\n        /// other objects in that pack they already have locally.\n        /// \n        /// </summary>\n        public bool a { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as `-a`, unless '-d' is used.  Then any unreachable\n        /// objects in a previous pack become loose, unpacked objects,\n        /// instead of being left in the old pack.  Unreachable objects\n        /// are never intentionally added to a pack, even when repacking.\n        /// This option prevents unreachable objects from being immediately\n        /// deleted by way of being left in the old pack and then\n        /// removed.  Instead, the loose unreachable objects\n        /// will be pruned according to normal expiry rules\n        /// with the next 'git-gc' invocation. See linkgit:git-gc[1].\n        /// \n        /// </summary>\n        public bool A { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// After packing, if the newly created packs make some\n        /// existing packs redundant, remove the redundant packs.\n        /// Also run  'git-prune-packed' to remove redundant\n        /// loose object files.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass the `--local` option to 'git-pack-objects'. See\n        /// linkgit:git-pack-objects[1].\n        /// \n        /// </summary>\n        public bool L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass the `--no-reuse-object` option to `git-pack-objects`, see\n        /// linkgit:git-pack-objects[1].\n        /// \n        /// </summary>\n        public bool F { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Pass the `-q` option to 'git-pack-objects'. See\n        /// linkgit:git-pack-objects[1].\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not update the server information with\n        /// 'git-update-server-info'.  This option skips\n        /// updating local catalog files needed to publish\n        /// this repository (or a direct copy of it)\n        /// over HTTP or FTP.  See linkgit:git-update-server-info[1].\n        /// \n        /// </summary>\n        public bool N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These two options affect how the objects contained in the pack are\n        /// stored using delta compression. The objects are first internally\n        /// sorted by type, size and optionally names and compared against the\n        /// other objects within `--window` to see if using delta compression saves\n        /// space. `--depth` limits the maximum delta depth; making it too deep\n        /// affects the performance on the unpacker side, because delta data needs\n        /// to be applied that many times to get to the necessary object.\n        /// The default value for --window is 10 and --depth is 50.\n        /// \n        /// </summary>\n        public string Window { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// These two options affect how the objects contained in the pack are\n        /// stored using delta compression. The objects are first internally\n        /// sorted by type, size and optionally names and compared against the\n        /// other objects within `--window` to see if using delta compression saves\n        /// space. `--depth` limits the maximum delta depth; making it too deep\n        /// affects the performance on the unpacker side, because delta data needs\n        /// to be applied that many times to get to the necessary object.\n        /// The default value for --window is 10 and --depth is 50.\n        /// \n        /// </summary>\n        public string Depth { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option provides an additional limit on top of `--window`;\n        /// the window size will dynamically scale down so as to not take\n        /// up more than N bytes in memory.  This is useful in\n        /// repositories with a mix of large and small objects to not run\n        /// out of memory with a large window, but still be able to take\n        /// advantage of the large window for the smaller objects.  The\n        /// size can be suffixed with \"k\", \"m\", or \"g\".\n        /// `--window-memory=0` makes memory usage unlimited, which is the\n        /// default.\n        /// \n        /// </summary>\n        public string WindowMemory { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Maximum size of each output packfile, expressed in MiB.\n        /// If specified,  multiple packfiles may be created.\n        /// The default is unlimited.\n        /// \n        /// </summary>\n        public string MaxPackSize { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ReplaceCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ReplaceCommand\n        : AbstractCommand\n    {\n\n        public ReplaceCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If an existing replace ref for the same object exists, it will\n        /// be overwritten (instead of failing).\n        /// \n        /// </summary>\n        public bool F { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Delete existing replace refs for the given objects.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List replace refs for objects that match the given pattern (or\n        /// all if no pattern is given).\n        /// Typing \"git replace\" without arguments, also lists all replace\n        /// refs.\n        /// </summary>\n        public string L { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RequestPullCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RequestPullCommand\n        : AbstractCommand\n    {\n\n        public RequestPullCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ResetCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ResetCommand\n        : AbstractCommand\n    {\n\n        public ResetCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Resets the index but not the working tree (i.e., the changed files\n        /// are preserved but not marked for commit) and reports what has not\n        /// been updated. This is the default action.\n        /// \n        /// </summary>\n        public bool Mixed { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Does not touch the index file nor the working tree at all, but\n        /// requires them to be in a good order. This leaves all your changed\n        /// files \"Changes to be committed\", as 'git-status' would\n        /// put it.\n        /// \n        /// </summary>\n        public bool Soft { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Matches the working tree and index to that of the tree being\n        /// switched to. Any changes to tracked files in the working tree\n        /// since &lt;commit&gt; are lost.\n        /// \n        /// </summary>\n        public bool Hard { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Resets the index to match the tree recorded by the named commit,\n        /// and updates the files that are different between the named commit\n        /// and the current commit in the working tree.\n        /// \n        /// </summary>\n        public bool Merge { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Interactively select hunks in the difference between the index\n        /// and &lt;commit&gt; (defaults to HEAD).  The chosen hunks are applied\n        /// in reverse to the index.\n        /// +\n        /// This means that `git reset -p` is the opposite of `git add -p` (see\n        /// linkgit:git-add[1]).\n        /// \n        /// </summary>\n        public bool Patch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Be quiet, only report errors.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RevParseCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RevParseCommand\n        : AbstractCommand\n    {\n\n        public RevParseCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use 'git-rev-parse' in option parsing mode (see PARSEOPT section below).\n        /// \n        /// </summary>\n        public bool Parseopt { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only meaningful in `--parseopt` mode. Tells the option parser to echo\n        /// out the first `--` met instead of skipping it.\n        /// \n        /// </summary>\n        public bool KeepDashdash { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only meaningful in `--parseopt` mode.  Lets the option parser stop at\n        /// the first non-option argument.  This can be used to parse sub-commands\n        /// that take options themself.\n        /// \n        /// </summary>\n        public bool StopAtNonOption { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use 'git-rev-parse' in shell quoting mode (see SQ-QUOTE\n        /// section below). In contrast to the `--sq` option below, this\n        /// mode does only quoting. Nothing else is done to command input.\n        /// \n        /// </summary>\n        public bool SqQuote { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not output flags and parameters not meant for\n        /// 'git-rev-list' command.\n        /// \n        /// </summary>\n        public bool RevsOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not output flags and parameters meant for\n        /// 'git-rev-list' command.\n        /// \n        /// </summary>\n        public bool NoRevs { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not output non-flag parameters.\n        /// \n        /// </summary>\n        public bool Flags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not output flag parameters.\n        /// \n        /// </summary>\n        public bool NoFlags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If there is no parameter given by the user, use `&lt;arg&gt;`\n        /// instead.\n        /// \n        /// </summary>\n        public string Default { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The parameter given must be usable as a single, valid\n        /// object name.  Otherwise barf and abort.\n        /// \n        /// </summary>\n        public bool Verify { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only meaningful in `--verify` mode. Do not output an error\n        /// message if the first argument is not a valid object name;\n        /// instead exit with non-zero status silently.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the output is made one line per flag and\n        /// parameter.  This option makes output a single line,\n        /// properly quoted for consumption by shell.  Useful when\n        /// you expect your parameter to contain whitespaces and\n        /// newlines (e.g. when using pickaxe `-S` with\n        /// 'git-diff-\\*'). In contrast to the `--sq-quote` option,\n        /// the command input is still interpreted as usual.\n        /// \n        /// </summary>\n        public bool Sq { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When showing object names, prefix them with '{caret}' and\n        /// strip '{caret}' prefix from the object names that already have\n        /// one.\n        /// \n        /// </summary>\n        public bool Not { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the object names are output in SHA1 form (with\n        /// possible '{caret}' prefix); this option makes them output in a\n        /// form as close to the original input as possible.\n        /// \n        /// </summary>\n        public bool Symbolic { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is similar to \\--symbolic, but it omits input that\n        /// are not refs (i.e. branch or tag names; or more\n        /// explicitly disambiguating \"heads/master\" form, when you\n        /// want to name the \"master\" branch when there is an\n        /// unfortunately named tag \"master\"), and show them as full\n        /// refnames (e.g. \"refs/heads/master\").\n        /// \n        /// </summary>\n        public bool SymbolicFullName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// A non-ambiguous short name of the objects name.\n        /// The option core.warnAmbiguousRefs is used to select the strict\n        /// abbreviation mode.\n        /// \n        /// </summary>\n        public string AbbrevRef { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show all refs found in `$GIT_DIR/refs`.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show branch refs found in `$GIT_DIR/refs/heads`.\n        /// \n        /// </summary>\n        public bool Branches { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show tag refs found in `$GIT_DIR/refs/tags`.\n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show tag refs found in `$GIT_DIR/refs/remotes`.\n        /// \n        /// </summary>\n        public bool Remotes { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the command is invoked from a subdirectory, show the\n        /// path of the current directory relative to the top-level\n        /// directory.\n        /// \n        /// </summary>\n        public bool ShowPrefix { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the command is invoked from a subdirectory, show the\n        /// path of the top-level directory relative to the current\n        /// directory (typically a sequence of \"../\", or an empty string).\n        /// \n        /// </summary>\n        public bool ShowCdup { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show `$GIT_DIR` if defined else show the path to the .git directory.\n        /// \n        /// </summary>\n        public bool GitDir { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the current working directory is below the repository\n        /// directory print \"true\", otherwise \"false\".\n        /// \n        /// </summary>\n        public bool IsInsideGitDir { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the current working directory is inside the work tree of the\n        /// repository print \"true\", otherwise \"false\".\n        /// \n        /// </summary>\n        public bool IsInsideWorkTree { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When the repository is bare print \"true\", otherwise \"false\".\n        /// \n        /// </summary>\n        public bool IsBareRepository { get; set; }\n\n        ///// <summary>\n        ///// Not implemented\n        ///// \n        ///// Instead of outputting the full SHA1 values of object names try to\n        ///// abbreviate them to a shorter unique name. When no length is specified\n        ///// 7 is used. The minimum length is 4.\n        ///// \n        ///// </summary>\n        //public bool Short { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of outputting the full SHA1 values of object names try to\n        /// abbreviate them to a shorter unique name. When no length is specified\n        /// 7 is used. The minimum length is 4.\n        /// \n        /// </summary>\n        public string Short { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Parse the date string, and output the corresponding\n        /// --max-age= parameter for 'git-rev-list'.\n        /// \n        /// </summary>\n        public string Since { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Parse the date string, and output the corresponding\n        /// --max-age= parameter for 'git-rev-list'.\n        /// \n        /// </summary>\n        public string After { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Parse the date string, and output the corresponding\n        /// --min-age= parameter for 'git-rev-list'.\n        /// \n        /// </summary>\n        public string Until { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Parse the date string, and output the corresponding\n        /// --min-age= parameter for 'git-rev-list'.\n        /// \n        /// </summary>\n        public string Before { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RevertCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RevertCommand\n        : AbstractCommand\n    {\n\n        public RevertCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, 'git-revert' will let you edit the commit\n        /// message prior to committing the revert. This is the default if\n        /// you run the command from a terminal.\n        /// \n        /// </summary>\n        public bool Edit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually you cannot revert a merge because you do not know which\n        /// side of the merge should be considered the mainline.  This\n        /// option specifies the parent number (starting from 1) of\n        /// the mainline and allows revert to reverse the change\n        /// relative to the specified parent.\n        /// +\n        /// Reverting a merge commit declares that you will never want the tree changes\n        /// brought in by the merge.  As a result, later merges will only bring in tree\n        /// changes introduced by commits that are not ancestors of the previously\n        /// reverted merge.  This may or may not be what you want.\n        /// +\n        /// See the link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for\n        /// more details.\n        /// \n        /// </summary>\n        public bool Mainline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, 'git-revert' will not start the commit\n        /// message editor.\n        /// \n        /// </summary>\n        public bool NoEdit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the command automatically creates a commit with\n        /// a commit log message stating which commit was\n        /// reverted.  This flag applies the change necessary\n        /// to revert the named commit to your working tree\n        /// and the index, but does not make the commit.  In addition,\n        /// when this option is used, your index does not have to match\n        /// the HEAD commit.  The revert is done against the\n        /// beginning state of your index.\n        /// +\n        /// This is useful when reverting more than one commits'\n        /// effect to your index in a row.\n        /// \n        /// </summary>\n        public bool NoCommit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Add Signed-off-by line at the end of the commit message.\n        /// \n        /// </summary>\n        public bool Signoff { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/RmCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class RmCommand\n        : AbstractCommand\n    {\n\n        public RmCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Override the up-to-date check.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't actually remove any file(s).  Instead, just show\n        /// if they exist in the index and would otherwise be removed\n        /// by the command.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Allow recursive removal when a leading directory name is\n        ///         given.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use this option to unstage and remove paths only from the index.\n        /// Working tree files, whether modified or not, will be\n        /// left alone.\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Exit with a zero status even if no files matched.\n        /// \n        /// </summary>\n        public bool IgnoreUnmatch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// 'git-rm' normally outputs one line (in the form of an \"rm\" command)\n        /// for each file removed. This option suppresses that output.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/SendPackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class SendPackCommand\n        : AbstractCommand\n    {\n\n        public SendPackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Path to the 'git-receive-pack' program on the remote\n        /// end.  Sometimes useful when pushing to a remote\n        /// repository over ssh, and you do not have the program in\n        /// a directory on the default $PATH.\n        /// \n        /// </summary>\n        public string ReceivePack { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Same as \\--receive-pack=&lt;git-receive-pack&gt;.\n        /// \n        /// </summary>\n        public string Exec { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of explicitly specifying which refs to update,\n        /// update all heads that locally exist.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do everything except actually send the updates.\n        /// \n        /// </summary>\n        public bool DryRun { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually, the command refuses to update a remote ref that\n        /// is not an ancestor of the local ref used to overwrite it.\n        /// This flag disables the check.  What this means is that\n        /// the remote repository can lose commits; use it with\n        /// care.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Run verbosely.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Spend extra cycles to minimize the number of objects to be sent.\n        /// Use it on slower connection.\n        /// \n        /// </summary>\n        public bool Thin { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ShortlogCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ShortlogCommand\n        : AbstractCommand\n    {\n\n        public ShortlogCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Print a short usage message and exit.\n        /// \n        /// </summary>\n        public bool Help { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Sort output according to the number of commits per author instead\n        /// of author alphabetic order.\n        /// \n        /// </summary>\n        public bool Numbered { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Suppress commit description and provide a commit count summary only.\n        /// \n        /// </summary>\n        public bool Summary { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the email address of each author.\n        /// \n        /// </summary>\n        public bool Email { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Linewrap the output by wrapping each line at `width`.  The first\n        /// line of each entry is indented by `indent1` spaces, and the second\n        /// and subsequent lines are indented by `indent2` spaces. `width`,\n        /// `indent1`, and `indent2` default to 76, 6 and 9 respectively.\n        /// \n        /// </summary>\n        public string W { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ShowBranchCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ShowBranchCommand\n        : AbstractCommand\n    {\n\n        public ShowBranchCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show the remote-tracking branches.\n        /// \n        /// </summary>\n        public bool Remotes { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show both remote-tracking branches and local branches.\n        /// \n        /// </summary>\n        public bool All { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// With this option, the command includes the current\n        /// branch to the list of revs to be shown when it is not\n        /// given on the command line.\n        /// \n        /// </summary>\n        public bool Current { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         By default, the branches and their commits are shown in\n        ///         reverse chronological order.  This option makes them\n        ///         appear in topological order (i.e., descendant commits\n        ///         are shown before their parents).\n        /// \n        /// </summary>\n        public bool TopoOrder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is similar to '--topo-order' in the sense that no\n        /// parent comes before all of its children, but otherwise commits\n        /// are ordered according to their commit date.\n        /// \n        /// </summary>\n        public bool DateOrder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, the output omits merges that are reachable\n        /// from only one tip being shown.  This option makes them\n        /// visible.\n        /// \n        /// </summary>\n        public bool Sparse { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Usually the command stops output upon showing the commit\n        /// that is the common ancestor of all the branches.  This\n        /// flag tells the command to go &lt;n&gt; more common commits\n        /// beyond that.  When &lt;n&gt; is negative, display only the\n        /// &lt;reference&gt;s given, without showing the commit ancestry\n        /// tree.\n        /// \n        /// </summary>\n        public string More { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Synonym to `--more=-1`\n        /// \n        /// </summary>\n        public bool List { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the commit list, determine possible\n        /// merge bases for the specified commits. All merge bases\n        /// will be contained in all specified commits. This is\n        /// different from how linkgit:git-merge-base[1] handles\n        /// the case of three or more commits.\n        /// \n        /// </summary>\n        public bool MergeBase { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Among the &lt;reference&gt;s given, display only the ones that\n        /// cannot be reached from any other &lt;reference&gt;.\n        /// \n        /// </summary>\n        public string Independent { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not show naming strings for each commit.\n        /// \n        /// </summary>\n        public bool NoName { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of naming the commits using the path to reach\n        /// them from heads (e.g. \"master~2\" to mean the grandparent\n        /// of \"master\"), name them with the unique prefix of their\n        /// object names.\n        /// \n        /// </summary>\n        public bool Sha1Name { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Shows only commits that are NOT on the first branch given.\n        /// This helps track topic branches by hiding any commit that\n        /// is already in the main line of development.  When given\n        /// \"git show-branch --topics master topic1 topic2\", this\n        /// will show the revisions given by \"git rev-list {caret}master\n        /// topic1 topic2\"\n        /// \n        /// </summary>\n        public bool Topics { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Shows &lt;n&gt; most recent ref-log entries for the given\n        /// ref.  If &lt;base&gt; is given, &lt;n&gt; entries going back from\n        /// that entry.  &lt;base&gt; can be specified as count or date.\n        /// When no explicit &lt;ref&gt; parameter is given, it defaults to the\n        /// current branch (or `HEAD` if it is detached).\n        /// \n        /// </summary>\n        public string Reflog { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Color the status sign (one of these: `*` `!` `+` `-`) of each commit\n        /// corresponding to the branch it's in.\n        /// \n        /// </summary>\n        public bool Color { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Turn off colored output, even when the configuration file gives the\n        /// default to color output.\n        /// \n        /// </summary>\n        public bool NoColor { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ShowCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ShowCommand\n        : AbstractCommand\n    {\n\n        public ShowCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Pretty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Format { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal commit object\n        /// name, show only a partial prefix.  Non default number of\n        /// digits can be specified with \"--abbrev=&lt;n&gt;\" (which also modifies\n        /// diff output, if it is displayed).\n        /// +\n        /// This should make \"--pretty=oneline\" a whole lot more readable for\n        /// people using 80-column terminals.\n        /// \n        /// </summary>\n        public bool AbbrevCommit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is a shorthand for \"--pretty=oneline --abbrev-commit\"\n        /// used together.\n        /// \n        /// </summary>\n        public bool Oneline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The commit objects record the encoding used for the log message\n        /// in their encoding header; this option can be used to tell the\n        /// command to re-code the commit log message in the encoding\n        /// preferred by the user.  For non plumbing commands this\n        /// defaults to UTF-8.\n        /// </summary>\n        public string Encoding { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/ShowRefCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class ShowRefCommand\n        : AbstractCommand\n    {\n\n        public ShowRefCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Head { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Tags { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Heads { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Dereference { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Hash { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Verify { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Abbrev { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string ExcludeExisting { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/StripspaceCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class StripspaceCommand\n        : AbstractCommand\n    {\n\n        public StripspaceCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// In addition to empty lines, also strip lines starting with '#'.\n        /// \n        /// </summary>\n        public bool StripComments { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/SubmoduleCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class SubmoduleCommand\n        : AbstractCommand\n    {\n\n        public SubmoduleCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only print error messages.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Branch of repository to add as submodule.\n        /// \n        /// </summary>\n        public bool Branch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for status and summary commands.  These\n        /// commands typically use the commit found in the submodule HEAD, but\n        /// with this option, the commit stored in the index is used instead.\n        /// \n        /// </summary>\n        public bool Cached { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for the summary command. This command\n        /// compares the commit in the index with that in the submodule HEAD\n        /// when this option is used.\n        /// \n        /// </summary>\n        public bool Files { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for the summary command.\n        /// Limit the summary size (number of commits shown in total).\n        /// Giving 0 will disable the summary; a negative number means unlimited\n        /// (the default). This limit only applies to modified submodules. The\n        /// size is always limited to 1 for added/deleted/typechanged submodules.\n        /// \n        /// </summary>\n        public bool SummaryLimit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for the update command.\n        /// Don't fetch new objects from the remote site.\n        /// \n        /// </summary>\n        public bool NoFetch { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for the update command.\n        /// Merge the commit recorded in the superproject into the current branch\n        /// of the submodule. If this option is given, the submodule's HEAD will\n        /// not be detached. If a merge failure prevents this process, you will\n        /// have to resolve the resulting conflicts within the submodule with the\n        /// usual conflict resolution tools.\n        /// If the key `submodule.$name.update` is set to `merge`, this option is\n        /// implicit.\n        /// \n        /// </summary>\n        public bool Merge { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for the update command.\n        /// Rebase the current branch onto the commit recorded in the\n        /// superproject. If this option is given, the submodule's HEAD will not\n        /// be detached. If a a merge failure prevents this process, you will have\n        /// to resolve these failures with linkgit:git-rebase[1].\n        /// If the key `submodule.$name.update` is set to `rebase`, this option is\n        /// implicit.\n        /// \n        /// </summary>\n        public bool Rebase { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for add and update commands.  These\n        /// commands sometimes need to clone a remote repository. In this case,\n        /// this option will be passed to the linkgit:git-clone[1] command.\n        /// +\n        /// *NOTE*: Do *not* use this option unless you have read the note\n        /// for linkgit:git-clone[1]'s --reference and --shared options carefully.\n        /// \n        /// </summary>\n        public string Reference { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This option is only valid for foreach, update and status commands.\n        /// Traverse submodules recursively. The operation is performed not\n        /// only in the submodules of the current repo, but also\n        /// in any nested submodules inside those submodules (and so on).\n        /// \n        /// </summary>\n        public bool Recursive { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/SvnCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class SvnCommand\n        : AbstractCommand\n    {\n\n        public SvnCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'init' command.\n        /// These are passed directly to 'git init'.\n        /// \n        /// </summary>\n        public string Shared { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'init' command.\n        /// These are passed directly to 'git init'.\n        /// \n        /// </summary>\n        public string Template { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///    Used with the 'fetch' command.\n        /// +\n        /// This allows revision ranges for partial/cauterized history\n        /// to be supported.  $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),\n        /// $NUMBER:HEAD, and BASE:$NUMBER are all supported.\n        /// +\n        /// This can allow you to make partial mirrors when running fetch;\n        /// but is generally not recommended because history will be skipped\n        /// and lost.\n        /// \n        /// </summary>\n        public string Revision { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'set-tree' command.\n        /// +\n        /// Read a list of commits from stdin and commit them in reverse\n        /// order.  Only the leading sha1 is read from each line, so\n        /// 'git rev-list --pretty=oneline' output can be used.\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.\n        /// +\n        /// Remove directories from the SVN tree if there are no files left\n        /// behind.  SVN can version empty directories, and they are not\n        /// removed by default if there are no files left in them.  git\n        /// cannot version empty directories.  Enabling this flag will make\n        /// the commit to SVN act like git.\n        /// +\n        /// [verse]\n        /// config key: svn.rmdir\n        /// \n        /// </summary>\n        public bool Rmdir { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.\n        /// +\n        /// Edit the commit message before committing to SVN.  This is off by\n        /// default for objects that are commits, and forced on when committing\n        /// tree objects.\n        /// +\n        /// [verse]\n        /// config key: svn.edit\n        /// \n        /// </summary>\n        public bool Edit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.\n        /// +\n        /// They are both passed directly to 'git diff-tree'; see\n        /// linkgit:git-diff-tree[1] for more information.\n        /// +\n        /// [verse]\n        /// config key: svn.l\n        /// config key: svn.findcopiesharder\n        /// \n        /// </summary>\n        public string FindCopiesHarder { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// </summary>\n        public string AuthorsFile { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/SymbolicRefCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class SymbolicRefCommand\n        : AbstractCommand\n    {\n\n        public SymbolicRefCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not issue an error message if the &lt;name&gt; is not a\n        /// symbolic ref but a detached HEAD; instead exit with\n        /// non-zero status silently.\n        /// \n        /// </summary>\n        public bool Quiet { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Update the reflog for &lt;name&gt; with &lt;reason&gt;.  This is valid only\n        /// when creating or updating a symbolic ref.\n        /// </summary>\n        public string M { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/TagCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class TagCommand\n        : AbstractCommand\n    {\n\n        public TagCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make an unsigned, annotated tag object\n        /// \n        /// </summary>\n        public bool A { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make a GPG-signed tag, using the default e-mail address's key\n        /// \n        /// </summary>\n        public bool S { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Make a GPG-signed tag, using the given key\n        /// \n        /// </summary>\n        public string U { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Replace an existing tag with the given name (instead of failing)\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Delete existing tags with the given names.\n        /// \n        /// </summary>\n        public bool D { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Verify the gpg signature of the given tag names.\n        /// \n        /// </summary>\n        public bool V { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// &lt;num&gt; specifies how many lines from the annotation, if any,\n        /// are printed when using -l.\n        /// The default is not to print any annotation lines.\n        /// If no number is given to `-n`, only the first line is printed.\n        /// If the tag is not annotated, the commit message is displayed instead.\n        /// \n        /// </summary>\n        public string N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// List tags with names that match the given pattern (or all if no pattern is given).\n        /// Typing \"git tag\" without arguments, also lists all tags.\n        /// \n        /// </summary>\n        public string L { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only list tags which contain the specified commit.\n        /// \n        /// </summary>\n        public string Contains { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Use the given tag message (instead of prompting).\n        /// If multiple `-m` options are given, their values are\n        /// concatenated as separate paragraphs.\n        /// Implies `-a` if none of `-a`, `-s`, or `-u &lt;key-id&gt;`\n        /// is given.\n        /// \n        /// </summary>\n        public string M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Take the tag message from the given file.  Use '-' to\n        /// read the message from the standard input.\n        /// Implies `-a` if none of `-a`, `-s`, or `-u &lt;key-id&gt;`\n        /// is given.\n        /// \n        /// </summary>\n        public string F { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/TarTreeCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class TarTreeCommand\n        : AbstractCommand\n    {\n\n        public TarTreeCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of making a tar archive from local repository,\n        /// retrieve a tar archive from a remote repository.\n        /// </summary>\n        public string Remote { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UnpackFileCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UnpackFileCommand\n        : AbstractCommand\n    {\n\n        public UnpackFileCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UnpackObjectsCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UnpackObjectsCommand\n        : AbstractCommand\n    {\n\n        public UnpackObjectsCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Dry run.  Check the pack file without actually unpacking\n        /// the objects.\n        /// \n        /// </summary>\n        public bool N { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The command usually shows percentage progress.  This\n        /// flag suppresses it.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When unpacking a corrupt packfile, the command dies at\n        /// the first corruption.  This flag tells it to keep going\n        /// and make the best effort to recover as many objects as\n        /// possible.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Don't write objects with broken content or links.\n        /// \n        /// </summary>\n        public bool Strict { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UpdateIndexCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UpdateIndexCommand\n        : AbstractCommand\n    {\n\n        public UpdateIndexCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If a specified file isn't in the index already then it's\n        /// added.\n        /// Default behaviour is to ignore new files.\n        /// \n        /// </summary>\n        public bool Add { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// If a specified file is in the index but is missing then it's\n        /// removed.\n        /// Default behavior is to ignore removed file.\n        /// \n        /// </summary>\n        public bool Remove { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Looks at the current index and checks to see if merges or\n        /// updates are needed by checking stat() information.\n        /// \n        /// </summary>\n        public bool Refresh { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Quiet.  If --refresh finds that the index needs an update, the\n        ///         default behavior is to error out.  This option makes\n        /// 'git-update-index' continue anyway.\n        /// \n        /// </summary>\n        public bool Q { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not try to update submodules.  This option is only respected\n        /// when passed before --refresh.\n        /// \n        /// </summary>\n        public bool IgnoreSubmodules { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         If --refresh finds unmerged changes in the index, the default\n        /// behavior is to error out.  This option makes 'git-update-index'\n        ///         continue anyway.\n        /// \n        /// </summary>\n        public bool Unmerged { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Ignores missing files during a --refresh\n        /// \n        /// </summary>\n        public bool IgnoreMissing { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Directly insert the specified info into the index.\n        /// \n        /// </summary>\n        public string Cacheinfo { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Read index information from stdin.\n        /// \n        /// </summary>\n        public bool IndexInfo { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Set the execute permissions on the updated files.\n        /// \n        /// </summary>\n        public string Chmod { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When these flags are specified, the object names recorded\n        /// for the paths are not updated.  Instead, these options\n        /// set and unset the \"assume unchanged\" bit for the\n        /// paths.  When the \"assume unchanged\" bit is on, git stops\n        /// checking the working tree files for possible\n        /// modifications, so you need to manually unset the bit to\n        /// tell git when you change the working tree file. This is\n        /// sometimes helpful when working with a big project on a\n        /// filesystem that has very slow lstat(2) system call\n        /// (e.g. cifs).\n        /// +\n        /// This option can be also used as a coarse file-level mechanism\n        /// to ignore uncommitted changes in tracked files (akin to what\n        /// `.gitignore` does for untracked files).\n        /// You should remember that an explicit 'git add' operation will\n        /// still cause the file to be refreshed from the working tree.\n        /// Git will fail (gracefully) in case it needs to modify this file\n        /// in the index e.g. when merging in a commit;\n        /// thus, in case the assumed-untracked file is changed upstream,\n        /// you will need to handle the situation manually.\n        /// \n        /// </summary>\n        public bool AssumeUnchanged { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// When these flags are specified, the object names recorded\n        /// for the paths are not updated.  Instead, these options\n        /// set and unset the \"assume unchanged\" bit for the\n        /// paths.  When the \"assume unchanged\" bit is on, git stops\n        /// checking the working tree files for possible\n        /// modifications, so you need to manually unset the bit to\n        /// tell git when you change the working tree file. This is\n        /// sometimes helpful when working with a big project on a\n        /// filesystem that has very slow lstat(2) system call\n        /// (e.g. cifs).\n        /// +\n        /// This option can be also used as a coarse file-level mechanism\n        /// to ignore uncommitted changes in tracked files (akin to what\n        /// `.gitignore` does for untracked files).\n        /// You should remember that an explicit 'git add' operation will\n        /// still cause the file to be refreshed from the working tree.\n        /// Git will fail (gracefully) in case it needs to modify this file\n        /// in the index e.g. when merging in a commit;\n        /// thus, in case the assumed-untracked file is changed upstream,\n        /// you will need to handle the situation manually.\n        /// \n        /// </summary>\n        public bool NoAssumeUnchanged { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Like '--refresh', but checks stat information unconditionally,\n        /// without regard to the \"assume unchanged\" setting.\n        /// \n        /// </summary>\n        public bool ReallyRefresh { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Runs 'git-update-index' itself on the paths whose index\n        /// entries are different from those from the `HEAD` commit.\n        /// \n        /// </summary>\n        public bool Again { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Restores the 'unmerged' or 'needs updating' state of a\n        /// file during a merge if it was cleared by accident.\n        /// \n        /// </summary>\n        public bool Unresolve { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not create objects in the object database for all\n        /// &lt;file&gt; arguments that follow this flag; just insert\n        /// their object IDs into the index.\n        /// \n        /// </summary>\n        public bool InfoOnly { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Remove the file from the index even when the working directory\n        /// still has such a file. (Implies --remove.)\n        /// \n        /// </summary>\n        public bool ForceRemove { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, when a file `path` exists in the index,\n        /// 'git-update-index' refuses an attempt to add `path/file`.\n        /// Similarly if a file `path/file` exists, a file `path`\n        /// cannot be added.  With --replace flag, existing entries\n        /// that conflict with the entry being added are\n        /// automatically removed with warning messages.\n        /// \n        /// </summary>\n        public bool Replace { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of taking list of paths from the command line,\n        /// read list of paths from the standard input.  Paths are\n        /// separated by LF (i.e. one path per line) by default.\n        /// \n        /// </summary>\n        public bool Stdin { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        ///         Report what is being added and removed from index.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Only meaningful with `--stdin`; paths are separated with\n        /// NUL character instead of LF.\n        /// \n        /// </summary>\n        public bool Z { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UpdateServerInfoCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UpdateServerInfoCommand\n        : AbstractCommand\n    {\n\n        public UpdateServerInfoCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Update the info files from scratch.\n        /// \n        /// </summary>\n        public bool Force { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UploadArchiveCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UploadArchiveCommand\n        : AbstractCommand\n    {\n\n        public UploadArchiveCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/UploadPackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class UploadPackCommand\n        : AbstractCommand\n    {\n\n        public UploadPackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not try &lt;directory&gt;/.git/ if &lt;directory&gt; is no git directory.\n        /// \n        /// </summary>\n        public string Strict { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Interrupt transfer after &lt;n&gt; seconds of inactivity.\n        /// \n        /// </summary>\n        public string Timeout { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/VarCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class VarCommand\n        : AbstractCommand\n    {\n\n        public VarCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Cause the logical variables to be listed. In addition, all the\n        /// variables of the git configuration file .git/config are listed\n        /// as well. (However, the configuration variables listing functionality\n        /// is deprecated in favor of 'git config -l'.)\n        /// </summary>\n        public bool L { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/VerifyPackCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class VerifyPackCommand\n        : AbstractCommand\n    {\n\n        public VerifyPackCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// After verifying the pack, show list of objects contained\n        /// in the pack and a histogram of delta chain length.\n        /// \n        /// </summary>\n        public bool Verbose { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Do not verify the pack contents; only show the histogram of delta\n        /// chain length.  With `--verbose`, list of objects is also shown.\n        /// \n        /// </summary>\n        public bool StatOnly { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/VerifyTagCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class VerifyTagCommand\n        : AbstractCommand\n    {\n\n        public VerifyTagCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Stubs/WhatchangedCommand.cs",
    "content": "/*\n * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Commands\n{\n    public class WhatchangedCommand\n        : AbstractCommand\n    {\n\n        public WhatchangedCommand() {\n        }\n\n        // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.\n\n        #region Properties / Options\n        public List<string> Arguments { get; set; }\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show textual diffs, instead of the git internal diff\n        /// output format that is useful only to tell the changed\n        /// paths and their nature of changes.\n        /// \n        /// </summary>\n        public bool P { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Limit output to &lt;n&gt; commits.\n        /// \n        /// </summary>\n        public string n { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Show git internal diff output, but for the whole tree,\n        /// not just the top level.\n        /// \n        /// </summary>\n        public bool R { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// By default, differences for merge commits are not shown.\n        /// With this flag, show differences to that commit from all\n        /// of its parents.\n        /// +\n        /// However, it is not very useful in general, although it\n        /// *is* useful on a file-by-file basis.\n        /// \n        /// </summary>\n        public bool M { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Pretty { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// \n        /// </summary>\n        public string Format { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// Instead of showing the full 40-byte hexadecimal commit object\n        /// name, show only a partial prefix.  Non default number of\n        /// digits can be specified with \"--abbrev=&lt;n&gt;\" (which also modifies\n        /// diff output, if it is displayed).\n        /// +\n        /// This should make \"--pretty=oneline\" a whole lot more readable for\n        /// people using 80-column terminals.\n        /// \n        /// </summary>\n        public bool AbbrevCommit { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// This is a shorthand for \"--pretty=oneline --abbrev-commit\"\n        /// used together.\n        /// \n        /// </summary>\n        public bool Oneline { get; set; }\n\n        /// <summary>\n        /// Not implemented\n        /// \n        /// The commit objects record the encoding used for the log message\n        /// in their encoding header; this option can be used to tell the\n        /// command to re-code the commit log message in the encoding\n        /// preferred by the user.  For non plumbing commands this\n        /// defaults to UTF-8.\n        /// </summary>\n        public string Encoding { get; set; }\n\n        #endregion\n\n        public override void Execute()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp/Tag.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing CoreTag = GitSharp.Core.Tag;\n\nnamespace GitSharp\n{\n\t/// <summary>\n\t/// Represents a git tag.\n\t/// </summary>\n\tpublic class Tag : AbstractObject, IReferenceObject\n\t{\n\n\t\tpublic Tag(Repository repo, string name)\n\t\t\t: base(repo, name)\n\t\t{\n\t\t\t_name = name;\n\t\t}\n\n\t\tprivate string _name; // <--- need the name for resolving purposes only. once the internal tag is resolved, this field is not used any more.\n\n\t\tinternal Tag(Repository repo, CoreRef @ref)\n\t\t\t: base(repo, @ref.ObjectId)\n\t\t{\n\t\t\t_name = @ref.Name;\n\t\t}\n\n\t\tinternal Tag(Repository repo, CoreTag internal_tag)\n\t\t\t: base(repo, internal_tag.Id)\n\t\t{\n\t\t\t_internal_tag = internal_tag;\n\t\t}\n\n\t\tinternal Tag(Repository repo, ObjectId id, string name)\n\t\t\t: base(repo, id)\n\t\t{\n\t\t\t_name = name;\n\t\t}\n\n\t\tprivate CoreTag _internal_tag;\n\n\t\tprivate CoreTag InternalTag\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_internal_tag == null)\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_internal_tag = _repo._internal_repo.MapTag(_name, _id);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\t// the object is invalid. however, we can not allow exceptions here because they would not be expected.\n\t\t\t\t\t}\n\t\t\t\treturn _internal_tag;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsTag\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTag == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The tag name.\n\t\t/// </summary>\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTag == null)\n\t\t\t\t\treturn _name;\n\t\t\t\treturn InternalTag.TagName;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The object that has been tagged.\n\t\t/// </summary>\n\t\tpublic AbstractObject Target\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTag == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (InternalTag.TagId == InternalTag.Id) // <--- it can happen!\n\t\t\t\t\treturn this;\n\t\t\t\treturn AbstractObject.Wrap(_repo, InternalTag.Id);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Tag[\" + ShortHash + \"]\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Text.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Diff;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Represents a line-based text (delimited with standard line delimiters such as CR and/or LF) \n\t/// and allows access of lines by 1-based line number. Text holds a byte array internally which is used \n\t/// for the diff algorithms which work on byte level.\n\t/// <para/>\n\t/// Note: The first line number in the text is 1. \n\t/// </summary>\n\tpublic class Text\n\t{\n\n\t\t/// <summary>\n\t\t/// Create a text instance from a string. The encoding UTF8 is used as default for generating the underlying byte array. \n\t\t/// </summary>\n\t\t/// <param name=\"text\"></param>\n\t\tpublic Text(string text)\n\t\t\t: this(text, Encoding.UTF8)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a text instance from a string. The encoding is used for generating the underlying byte array. \n\t\t/// </summary>\n\t\t/// <param name=\"text\"></param>\n\t\t/// <param name=\"encoding\"></param>\n\t\tpublic Text(string text, Encoding encoding)\n\t\t\t: this(new RawText(encoding.GetBytes(text)), encoding)\n\t\t{\n\t\t}\n\n\t\tpublic Text(byte[] encoded_text)\n\t\t\t: this(new RawText(encoded_text), Encoding.UTF8)\n\t\t{\n\t\t}\n\n\t\tinternal Text(RawText raw_text, Encoding encoding)\n\t\t{\n\t\t\tm_raw_text = raw_text;\n\t\t\tEncoding = encoding;\n\t\t}\n\n\t\tprivate readonly RawText m_raw_text;\n\n\t\tpublic Encoding Encoding { get; set; }\n\n\t\tpublic static implicit operator RawText(Text text) // <-- [henon] undocumented cast operator to be able to get the wrapped core object.\n\t\t{\n\t\t\treturn text.m_raw_text;\n\t\t}\n\n\t\tpublic byte[] RawContent\n\t\t{\n\t\t\tget { return m_raw_text.Content; }\n\t\t}\n\n\t\tpublic int RawLength\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn RawContent.Length;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Length\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn ToString().Length;\n\t\t\t}\n\t\t}\n\n\t\tpublic int NumberOfLines\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn m_raw_text.size();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a line of the text as encoded byte array.\n\t\t/// <para/>\n\t\t/// Note: The first line number in the text is 1\n\t\t/// </summary>\n\t\t/// <param name=\"line\">1-based line number</param>\n\t\t/// <returns></returns>\n\t\tpublic byte[] GetRawLine(int line)\n\t\t{\n\t\t\tif (line <= 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"line\", line, \"Line index must not be <= 0\");\n\t\t\tif (line > NumberOfLines)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"line\", line, \"Line index is too large\");\n\t\t\tint line_start = m_raw_text.LineStartIndices.get(line);\n\t\t\tint line_end = RawContent.Length;\n\t\t\tif (line + 1 < m_raw_text.LineStartIndices.size())\n\t\t\t\tline_end = m_raw_text.LineStartIndices.get(line + 1);\n\t\t\treturn RawContent.Skip(line_start).Take(line_end - line_start).ToArray();\n\t\t}\n\n\t\tpublic string GetLine(int line)\n\t\t{\n\t\t\treturn Encoding.GetString(GetRawLine(line));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get a text block by lines as encoded byte array. The text block starts with begin of start_line and ends with start of end_line.\n\t\t/// <para/>\n\t\t/// Note: The first line number in the text is 1\n\t\t/// </summary>\n\t\t/// <param name=\"start_line\">1-based line number marking the start of the text block at the start of the specified line</param>\n\t\t/// <param name=\"end_line\">1-based line number markign the end of the text block at the start of the specified line</param>\n\t\t/// <returns></returns>\n\t\tpublic byte[] GetRawBlock(int start_line, int end_line)\n\t\t{\n\t\t\tif (end_line < start_line)\n\t\t\t\tthrow new ArgumentException(\"Block end index must be larger than or equal start index\", \"end_line\");\n\t\t\tif (start_line <= 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"start_line\", start_line, \"Line index must not be <= 0\");\n\t\t\tif (end_line > NumberOfLines + 1)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"end_line\", end_line, \"Line index is too large\");\n\t\t\tint block_start = m_raw_text.LineStartIndices.get(start_line);\n\t\t\tint block_end = RawContent.Length;\n\t\t\tif (end_line < m_raw_text.LineStartIndices.size())\n\t\t\t\tblock_end = m_raw_text.LineStartIndices.get(end_line);\n\t\t\treturn RawContent.Skip(block_start).Take(block_end - block_start).ToArray();\n\t\t}\n\n\t\tpublic string GetBlock(int start_line, int end_line)\n\t\t{\n\t\t\treturn Encoding.GetString(GetRawBlock(start_line, end_line));\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Encoding.GetString(RawContent);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/Tree.cs",
    "content": "/*\n * Copyright (C) 2009-2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing ObjectId = GitSharp.Core.ObjectId;\nusing CoreRef = GitSharp.Core.Ref;\nusing CoreCommit = GitSharp.Core.Commit;\nusing CoreTree = GitSharp.Core.Tree;\nusing FileTreeEntry = GitSharp.Core.FileTreeEntry;\n\nnamespace GitSharp\n{\n\n\t/// <summary>\n\t/// Represents a directory in the git repository.\n\t/// </summary>\n\tpublic class Tree : AbstractTreeNode\n\t{\n\t\tinternal Tree(Repository repo, ObjectId id) : base(repo, id) { }\n\n\t\tinternal Tree(Repository repo, CoreTree tree)\n\t\t\t: base(repo, tree.Id)\n\t\t{\n\t\t\t_internal_tree = tree;\n\t\t}\n\n\t\tprivate CoreTree _internal_tree;\n\n\t\tinternal CoreTree InternalTree\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_internal_tree == null)\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_internal_tree = _repo._internal_repo.MapTree(_id);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\t// the commit object is invalid. however, we can not allow exceptions here because they would not be expected.\n\t\t\t\t\t}\n\t\t\t\treturn _internal_tree;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (InternalTree.IsRoot)\n\t\t\t\t\treturn \"\";\n\t\t\t\treturn InternalTree.Name;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if the tree has no parent.\n\t\t/// </summary>\n\t\tpublic bool IsRoot\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn true;\n\t\t\t\treturn InternalTree.IsRoot;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Tree Parent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (InternalTree.Parent == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new Tree(_repo, InternalTree.Parent);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Entries of the tree. These are either Tree or Leaf objects representing sub-directories or files.\n\t\t/// </summary>\n\t\tpublic IEnumerable<AbstractObject> Children\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn new Leaf[0];\n\n\t\t\t\t// no GitLink support in JGit, so just skip them here to not cause problems\n\t\t\t\treturn InternalTree.Members.Where(te => !(te is GitLinkTreeEntry)).Select(\n\t\t\t\t\t tree_entry =>\n\t\t\t\t\t {\n\t\t\t\t\t\t if (tree_entry is FileTreeEntry)\n\t\t\t\t\t\t\t return new Leaf(_repo, tree_entry as FileTreeEntry) as AbstractObject;\n\n\t\t\t\t\t\t return new Tree(_repo, tree_entry as CoreTree) as AbstractObject;\n\t\t\t\t\t }).ToArray();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Tree entries representing this directory's subdirectories\n\t\t/// </summary>\n\t\tpublic IEnumerable<Tree> Trees\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Where(child => child.IsTree).Cast<Tree>().ToArray();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Leaf entries representing this directory's files\n\t\t/// </summary>\n\t\tpublic IEnumerable<Leaf> Leaves\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Children.Where(child => child.IsBlob).Cast<Leaf>().ToArray();\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Path\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (InternalTree.IsRoot)\n\t\t\t\t\treturn \"\";\n\t\t\t\treturn InternalTree.FullName;\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Permissions\n\t\t{\n\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (InternalTree == null)\n\t\t\t\t\treturn 0;\n\t\t\t\treturn InternalTree.Mode.Bits;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Tree[\" + ShortHash + \"]\";\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Find a Blob or Tree by traversing the tree along the given path. You can access not only direct children\n\t\t/// of the tree but any descendant of this tree.\n\t\t/// <para/>\n\t\t/// The path's directory seperators may be both forward or backslash, it is converted automatically to the internal representation.\n\t\t/// <para/>\n\t\t/// Throws IOException.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">Relative path to a file or directory in the git tree. For directories a trailing slash is allowed</param>\n\t\t/// <returns>A tree or blob object representing the referenced object</returns>\n\t\tpublic AbstractObject this[string path]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (path == \"\")\n\t\t\t\t\treturn this;\n\t\t\t\tvar tree_entry = _internal_tree.FindBlobMember(path);\n\t\t\t\tif (tree_entry == null)\n\t\t\t\t\ttree_entry = _internal_tree.findTreeMember(path);\n\t\t\t\tif (tree_entry == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (tree_entry.IsTree)\n\t\t\t\t\treturn new Tree(_repo, tree_entry as CoreTree);\n\t\t\t\telse if (tree_entry.IsBlob)\n\t\t\t\t\treturn new Leaf(_repo, tree_entry as FileTreeEntry);\n\t\t\t\telse // if (tree_entry.IsCommit || tree_entry.IsTag)\n\t\t\t\t\treturn AbstractObject.Wrap(_repo, tree_entry.Id);\n\t\t\t}\n\t\t}\n\n\t\tpublic static implicit operator CoreTree(Tree t)\n\t\t{\n\t\t\treturn t != null ? t._internal_tree : null;\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp/UserInfoProvider.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp\n{\n\n    public static class UserInfoProvider\n    {\n        public static Core.UserInfoProvider Provider\n        {\n            get\n            {\n                return Core.UserInfoProvider.Provider;\n            }\n            \n            set\n            {\n                Core.UserInfoProvider.Provider = value;\n            }\n        }\n    }\n    \n}"
  },
  {
    "path": "GitSharp licence.txt",
    "content": "Git# is Copyright (C) 2007-2009 by the Git Development Community\nSee source file headers for specific contributor copyrights\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, are permitted provided that the following\nconditions are met:\n\n- Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the following\n  disclaimer in the documentation and/or other materials provided\n  with the distribution.\n\n- Neither the name of the Git Development Community nor the\n  names of its contributors may be used to endorse or promote\n  products derived from this software without specific prior\n  written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\nCONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\nNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "GitSharp.Core/AbbreviatedObjectId.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A prefix abbreviation of an {@link ObjectId}.\n\t/// \n\t/// Sometimes Git produces abbreviated SHA-1 strings, using sufficient leading\n\t/// digits from the ObjectId name to still be unique within the repository the\n\t/// string was generated from. These ids are likely to be unique for a useful\n\t/// period of time, especially if they contain at least 6-10 hex digits.\n\t/// \n\t/// This class converts the hex string into a binary form, to make it more\n\t/// efficient for matching against an object.\n\t/// </summary>\n\t[Serializable]\n\tpublic class AbbreviatedObjectId\n\t{\n\t\t/// Number of half-bytes used by this id.\n\t\tprivate readonly int _nibbles;\n\n\t\treadonly int _w1;\n\t\treadonly int _w2;\n\t\treadonly int _w3;\n\t\treadonly int _w4;\n\t\treadonly int _w5;\n\n\t\t/// <summary>\n\t\t/// Convert an AbbreviatedObjectId from hex characters (US-ASCII).\n\t\t/// </summary>\n\t\t/// <param name=\"buf\">the US-ASCII buffer to read from.</param>\n\t\t/// <param name=\"offset\">position to read the first character from.</param>\n\t\t/// <param name=\"end\">\n\t\t/// one past the last position to read (<code>end-offset</code> is\n\t\t/// the Length of the string).\n\t\t/// </param>\n\t\t/// <returns>the converted object id.</returns>\n\t\tpublic static AbbreviatedObjectId FromString(byte[] buf, int offset, int end)\n\t\t{\n            if (end - offset > Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Invalid id\");\n\t\t\t}\n\n\t\t\treturn FromHexString(buf, offset, end);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert an AbbreviatedObjectId from hex characters.\n\t\t/// </summary>\n\t\t/// <param name=\"str\">\n\t\t/// the string to read from. Must be &lt;= 40 characters.\n\t\t/// </param>\n\t\t/// <returns>the converted object id.</returns>\n\t\tpublic static AbbreviatedObjectId FromString(string str)\n\t\t{\n\t\t\tif (str == null)\n\t\t\t\tthrow new ArgumentNullException (\"str\");\n            if (str.Length > Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Invalid id: \" + str);\n\t\t\t}\n\n\t\t\tbyte[] b = Constants.encodeASCII(str);\n\t\t\treturn FromHexString(b, 0, b.Length);\n\t\t}\n\n\t\tpublic static int Mask(int nibbles, int word, int v)\n\t\t{\n\t\t\tint b = (word - 1) * 8;\n\t\t\tif (b + 8 <= nibbles)\n\t\t\t{\n\t\t\t\t// We have all of the bits required for this word.\n\t\t\t\t//\n\t\t\t\treturn v;\n\t\t\t}\n\n\t\t\tif (nibbles <= b)\n\t\t\t{\n\t\t\t\t// We have none of the bits required for this word.\n\t\t\t\t//\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tint s = 32 - (nibbles - b) * 4;\n\t\t\treturn (int)((uint)v >> s) << s; // [henon] unsigned int needed to get the effect of java's rightshift operator >>>\n\t\t}\n\n\t\tpublic AbbreviatedObjectId(int nibbles, int w1, int w2, int w3, int w4, int w5)\n\t\t{\n\t\t\t_nibbles = nibbles;\n\t\t\t_w1 = w1;\n\t\t\t_w2 = w2;\n\t\t\t_w3 = w3;\n\t\t\t_w4 = w4;\n\t\t\t_w5 = w5;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Number of hex digits appearing in this id\n\t\t/// </summary>\n\t\tpublic int Length\n\t\t{\n\t\t\tget { return _nibbles; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if this ObjectId is actually a complete id.\n\t\t/// </returns>\n\t\tpublic bool isComplete()\n\t\t{\n            return Length == Constants.OBJECT_ID_STRING_LENGTH;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Return a complete <see cref=\"ObjectId\"/>; null if <see cref=\"isComplete\"/> is false.\n\t\t/// </returns>\n\t\tpublic ObjectId ToObjectId()\n\t\t{\n\t\t\treturn isComplete() ? new ObjectId(_w1, _w2, _w3, _w4, _w5) : null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compares this abbreviation to a full object id.\n\t\t/// </summary>\n\t\t/// <param name=\"other\">the other object id.</param>\n\t\t/// <returns>\n\t\t/// Return &lt;0 if this abbreviation names an object that is less than\n\t\t/// <code>other</code>; 0 if this abbreviation exactly matches the\n\t\t/// first <see cref=\"Length\"/> digits of <code>other.name()</code>;\n\t\t/// &gt;0 if this abbreviation names an object that is after\n\t\t/// <code>other</code>.\n\t\t/// </returns>\n\t\tpublic int prefixCompare(AnyObjectId other)\n\t\t{\n\t\t\tif (other == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"other\");\n\t\t\t}\n\t\t\t\n\t\t\tint cmp = NB.CompareUInt32(_w1, mask(1, other.W1));\n\t\t\tif (cmp != 0)\n\t\t\t{\n\t\t\t\treturn cmp;\n\t\t\t}\n\n\t\t\tcmp = NB.CompareUInt32(_w2, mask(2, other.W2));\n\t\t\tif (cmp != 0)\n\t\t\t{\n\t\t\t\treturn cmp;\n\t\t\t}\n\n\t\t\tcmp = NB.CompareUInt32(_w3, mask(3, other.W3));\n\t\t\tif (cmp != 0)\n\t\t\t{\n\t\t\t\treturn cmp;\n\t\t\t}\n\n\t\t\tcmp = NB.CompareUInt32(_w4, mask(4, other.W4));\n\t\t\tif (cmp != 0)\n\t\t\t{\n\t\t\t\treturn cmp;\n\t\t\t}\n\n\t\t\treturn NB.CompareUInt32(_w5, mask(5, other.W5));\n\t\t}\n\n\t\tprivate int mask(int word, int v)\n\t\t{\n\t\t\treturn Mask(_nibbles, word, v);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _w2;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tAbbreviatedObjectId b = (obj as AbbreviatedObjectId);\n\t\t\tif (b != null)\n\t\t\t{\n\t\t\t\treturn _nibbles == b._nibbles && _w1 == b._w1 && _w2 == b._w2\n\t\t\t\t\t\t&& _w3 == b._w3 && _w4 == b._w4 && _w5 == b._w5;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <returns>string form of the abbreviation, in lower case hexadecimal.</returns>\n\t\tpublic string name()\n\t\t{\n            var b = new char[Constants.OBJECT_ID_STRING_LENGTH];\n\n\t\t\tHex.FillHexCharArray(b, 0, _w1);\n\t\t\tif (_nibbles <= 8)\n\t\t\t{\n\t\t\t\treturn new string(b, 0, _nibbles);\n\t\t\t}\n\n\t\t\tHex.FillHexCharArray(b, 8, _w2);\n\t\t\tif (_nibbles <= 16)\n\t\t\t{\n\t\t\t\treturn new string(b, 0, _nibbles);\n\t\t\t}\n\n\t\t\tHex.FillHexCharArray(b, 16, _w3);\n\t\t\tif (_nibbles <= 24)\n\t\t\t{\n\t\t\t\treturn new string(b, 0, _nibbles);\n\t\t\t}\n\n\t\t\tHex.FillHexCharArray(b, 24, _w4);\n\t\t\tif (_nibbles <= 32)\n\t\t\t{\n\t\t\t\treturn new string(b, 0, _nibbles);\n\t\t\t}\n\n\t\t\tHex.FillHexCharArray(b, 32, _w5);\n\t\t\treturn new string(b, 0, _nibbles);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"AbbreviatedObjectId[\" + name() + \"]\";\n\t\t}\n\n\t\tprivate static AbbreviatedObjectId FromHexString(byte[] bs, int ptr, int end)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint a = Hex.HexUInt32(bs, ptr, end);\n\t\t\t\tint b = Hex.HexUInt32(bs, ptr + 8, end);\n\t\t\t\tint c = Hex.HexUInt32(bs, ptr + 16, end);\n\t\t\t\tint d = Hex.HexUInt32(bs, ptr + 24, end);\n\t\t\t\tint e = Hex.HexUInt32(bs, ptr + 32, end);\n\t\t\t\treturn new AbbreviatedObjectId(end - ptr, a, b, c, d, e);\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException e)\n\t\t\t{\n                throw new InvalidObjectIdException(bs, ptr, end - ptr, e);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/AbstractIndexTreeVisitor.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n    public class AbstractIndexTreeVisitor : IndexTreeVisitor\n    {\n        public delegate void FinishVisitTreeDelegate(Tree tree, Tree auxTree, string curDir);\n        public FinishVisitTreeDelegate FinishVisitTree { get; set; }\n\n        public delegate void FinishVisitTreeByIndexDelegate(Tree tree, int i, string curDir);\n        public FinishVisitTreeByIndexDelegate FinishVisitTreeByIndex { get; set; }\n\n        public delegate void VisitEntryDelegate(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file);\n        public VisitEntryDelegate VisitEntry { get; set; }\n\n        public delegate void VisitEntryAuxDelegate(TreeEntry treeEntry, TreeEntry auxEntry, GitIndex.Entry indexEntry, FileInfo file);\n        public VisitEntryAuxDelegate VisitEntryAux { get; set; }\n\n        #region IndexTreeVisitor Members\n\n        void IndexTreeVisitor.VisitEntry(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file)\n        {\n            VisitEntryDelegate handler = VisitEntry;\n            if (handler != null)\n            {\n                handler(treeEntry, indexEntry, file);\n            }\n        }\n\n        void IndexTreeVisitor.VisitEntry(TreeEntry treeEntry, TreeEntry auxEntry, GitIndex.Entry indexEntry, FileInfo file)\n        {\n            VisitEntryAuxDelegate handler = VisitEntryAux;\n            if (handler != null)\n            {\n                handler(treeEntry, auxEntry, indexEntry, file);\n            }\n        }\n\n        void IndexTreeVisitor.FinishVisitTree(Tree tree, Tree auxTree, string curDir)\n        {\n            FinishVisitTreeDelegate handler = FinishVisitTree;\n            if (handler != null)\n            {\n                handler(tree, auxTree, curDir);\n            }\n        }\n\n        void IndexTreeVisitor.FinishVisitTree(Tree tree, int i, string curDir)\n        {\n            FinishVisitTreeByIndexDelegate handler = FinishVisitTreeByIndex;\n            if (handler != null)\n            {\n                handler(tree, i, curDir);\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/AlternateRepositoryDatabase.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// An ObjectDatabase of another <see cref=\"Repository\"/>.\n    /// <para/>\n    /// This {@code ObjectDatabase} wraps around another {@code Repository}'s object\n    /// database, providing its contents to the caller, and closing the Repository\n    /// when this database is closed. The primary user of this class is\n    /// <see cref=\"ObjectDirectory\"/> , when the {@code info/alternates} file points at the\n    /// {@code objects/} directory of another repository.\n    /// </summary>\n    public sealed class AlternateRepositoryDatabase : ObjectDatabase\n    {\n        private readonly Repository _repository;\n        private readonly ObjectDatabase _objectDatabase;\n\n        /// <param name=\"alternateRepository\">the alternate repository to wrap and export.</param>\n        public AlternateRepositoryDatabase(Repository alternateRepository)\n        {\n            _repository = alternateRepository;\n            _objectDatabase = _repository.ObjectDatabase;\n        }\n\n        /// <returns>the alternate repository objects are borrowed from.</returns>\n        public Repository getRepository()\n        {\n            return _repository;\n        }\n\n        public override void closeSelf()\n        {\n            _repository.Dispose();\n        }\n\n        public override void create()\n        {\n            _repository.Create();\n        }\n\n        public override bool exists()\n        {\n            return _objectDatabase.exists();\n        }\n\n        public override bool hasObject1(AnyObjectId objectId)\n        {\n            return _objectDatabase.hasObject1(objectId);\n        }\n\n        public override bool tryAgain1()\n        {\n            return _objectDatabase.tryAgain1();\n        }\n\n        public override bool hasObject2(string objectName)\n        {\n            return _objectDatabase.hasObject2(objectName);\n        }\n\n        public override ObjectLoader openObject1(WindowCursor curs, AnyObjectId objectId)\n        {\n            return _objectDatabase.openObject1(curs, objectId);\n        }\n\n        public override ObjectLoader openObject2(WindowCursor curs, string objectName, AnyObjectId objectId)\n        {\n            return _objectDatabase.openObject2(curs, objectName, objectId);\n        }\n\n        public override void OpenObjectInAllPacksImplementation(ICollection<PackedObjectLoader> @out, WindowCursor windowCursor, AnyObjectId objectId)\n        {\n            _objectDatabase.OpenObjectInAllPacksImplementation(@out, windowCursor, objectId);\n        }\n\n        protected override ObjectDatabase[] loadAlternates()\n        {\n            return _objectDatabase.getAlternates();\n        }\n\n        public override void closeAlternates()\n        {\n            // Do nothing; these belong to odb to close, not us.\n        }\n\n        public override ObjectDatabase newCachedDatabase()\n        {\n            return _objectDatabase.newCachedDatabase();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/AnyObjectId.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// A (possibly mutable) SHA-1 abstraction.\n    /// <para />\n    /// If this is an instance of <seealso cref=\"MutableObjectId\"/> the concept of equality\n    /// with this instance can alter at any time, if this instance is modified to\n    /// represent a different object name.\n    /// </summary>\n    public abstract class AnyObjectId : IEquatable<AnyObjectId>,\n#if !__MonoCS__\n IComparable<ObjectId>,\n#endif\n IComparable\n    {\n        public static bool operator ==(AnyObjectId one, AnyObjectId another)\n        {\n            if (ReferenceEquals(one, another))\n            {\n                return true;\n            }\n\n            if (ReferenceEquals(one, null))\n            {\n                return false;\n            }\n\n            return one.Equals(another);\n        }\n\n        public static bool operator !=(AnyObjectId one, AnyObjectId another)\n        {\n            return !(one == another);\n        }\n\n        /// <summary>\n        /// Compare to object identifier byte sequences for equality.\n        /// </summary>\n        /// <param name=\"firstObjectId\">the first identifier to compare. Must not be null.</param>\n        /// <param name=\"secondObjectId\">the second identifier to compare. Must not be null.</param>\n        /// <returns></returns>\n        public static bool equals(AnyObjectId firstObjectId, AnyObjectId secondObjectId)\n        {\n            if (ReferenceEquals(firstObjectId, secondObjectId))\n            {\n                return true;\n            }\n\n            // We test word 2 first as odds are someone already used our\n            // word 1 as a hash code, and applying that came up with these\n            // two instances we are comparing for equality. Therefore the\n            // first two words are very likely to be identical. We want to\n            // break away from collisions as quickly as possible.\n            //\n            return firstObjectId.W2 == secondObjectId.W2\n                    && firstObjectId.W3 == secondObjectId.W3\n                    && firstObjectId.W4 == secondObjectId.W4\n                    && firstObjectId.W5 == secondObjectId.W5\n                    && firstObjectId.W1 == secondObjectId.W1;\n\n        }\n\n        /// <summary>\n        /// Determine if this ObjectId has exactly the same value as another.\n        /// </summary>\n        /// <param name=\"other\">the other id to compare to. May be null.</param>\n        /// <returns>true only if both ObjectIds have identical bits.</returns>\n        public virtual bool Equals(AnyObjectId other)\n        {\n            if (ReferenceEquals(other, null))\n            {\n                return false;\n            }\n\n            return equals(this, other);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (obj is AnyObjectId)\n            {\n                return Equals((AnyObjectId)obj);\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to an output writer in hex format.\n        /// </summary>\n        /// <param name=\"s\">the stream to copy to.</param>\n        public void CopyTo(BinaryWriter s)\n        {\n            s.Write(ToHexByteArray());\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to a StringBuilder in hex format.\n        /// </summary>\n        /// <param name=\"tmp\">\n        /// temporary char array to buffer construct into before writing.\n        /// Must be at least large enough to hold 2 digits for each byte\n        /// of object id (40 characters or larger).\n        /// </param>\n        /// <param name=\"w\">the string to append onto.</param>\n        public void CopyTo(char[] tmp, StringBuilder w)\n        {\n            ToHexCharArray(tmp);\n            w.Append(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to an output writer in hex format.\n        /// </summary>\n        /// <param name=\"tmp\">\n        /// temporary char array to buffer construct into before writing.\n        /// Must be at least large enough to hold 2 digits for each byte\n        /// of object id (40 characters or larger).\n        /// </param>\n        /// <param name=\"w\">the stream to copy to.</param>\n        public void CopyTo(char[] tmp, StreamWriter w)\n        {\n            ToHexCharArray(tmp);\n            w.Write(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);\n        }\n\n        public void CopyTo(char[] tmp, Encoding e, Stream w)\n        {\n            ToHexCharArray(tmp);\n            var data = e.GetBytes(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH);\n            w.Write(data, 0, data.Length);\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to an output writer in hex format.\n        /// </summary>\n        /// <param name=\"s\">the stream to copy to.</param>\n        public void copyRawTo(Stream s)\n        {\n            var buf = new byte[20];\n            NB.encodeInt32(buf, 0, W1);\n            NB.encodeInt32(buf, 4, W2);\n            NB.encodeInt32(buf, 8, W3);\n            NB.encodeInt32(buf, 12, W4);\n            NB.encodeInt32(buf, 16, W5);\n            s.Write(buf, 0, 20);\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to a byte array.\n        /// </summary>\n        /// <param name=\"buf\">the buffer to copy to.</param>\n        /// <param name=\"off\">the offset within b to write at.</param>\n        public void copyRawTo(byte[] buf, int off)\n        {\n            NB.encodeInt32(buf, 0 + off, W1);\n            NB.encodeInt32(buf, 4 + off, W2);\n            NB.encodeInt32(buf, 8 + off, W3);\n            NB.encodeInt32(buf, 12 + off, W4);\n            NB.encodeInt32(buf, 16 + off, W5);\n        }\n\n        /// <summary>\n        /// Copy this ObjectId to a int array.\n        /// </summary>\n        /// <param name=\"b\">the buffer to copy to.</param>\n        /// <param name=\"offset\">the offset within b to write at.</param>\n        public void copyRawTo(int[] b, int offset)\n        {\n            b[offset] = W1;\n            b[offset + 1] = W2;\n            b[offset + 2] = W3;\n            b[offset + 3] = W4;\n            b[offset + 4] = W5;\n        }\n\n        private byte[] ToHexByteArray()\n        {\n            var dst = new byte[Constants.OBJECT_ID_STRING_LENGTH];\n\n            Hex.FillHexByteArray(dst, 0, W1);\n            Hex.FillHexByteArray(dst, 8, W2);\n            Hex.FillHexByteArray(dst, 16, W3);\n            Hex.FillHexByteArray(dst, 24, W4);\n            Hex.FillHexByteArray(dst, 32, W5);\n\n            return dst;\n        }\n\n        public override int GetHashCode()\n        {\n            return W2;\n        }\n\n        /// <summary>\n        /// Return unique abbreviation (prefix) of this object SHA-1.\n        /// <para/>\n        /// This method is a utility for <code>abbreviate(repo, 8)</code>.\n        /// </summary>\n        /// <param name=\"repo\">repository for checking uniqueness within.</param>\n        /// <returns>SHA-1 abbreviation.</returns>\n        public AbbreviatedObjectId Abbreviate(Repository repo)\n        {\n            return Abbreviate(repo, 8);\n        }\n\n        /// <summary>\n        /// Return unique abbreviation (prefix) of this object SHA-1.\n        /// <para/>\n        /// Current implementation is not guaranteeing uniqueness, it just returns\n        /// fixed-length prefix of SHA-1 string.\n        /// </summary>\n        /// <param name=\"repo\">repository for checking uniqueness within.</param>\n        /// <param name=\"len\">minimum length of the abbreviated string.</param>\n        /// <returns>SHA-1 abbreviation.</returns>\n        public AbbreviatedObjectId Abbreviate(Repository repo, int len)\n        {\n            int a = AbbreviatedObjectId.Mask(len, 1, W1);\n            int b = AbbreviatedObjectId.Mask(len, 2, W2);\n            int c = AbbreviatedObjectId.Mask(len, 3, W3);\n            int d = AbbreviatedObjectId.Mask(len, 4, W4);\n            int e = AbbreviatedObjectId.Mask(len, 5, W5);\n            return new AbbreviatedObjectId(len, a, b, c, d, e);\n        }\n\n        protected AnyObjectId(AnyObjectId other)\n        {\n            if ((ReferenceEquals(other, null)))\n            {\n                throw new ArgumentNullException(\"other\");\n            }\n\n            W1 = other.W1;\n            W2 = other.W2;\n            W3 = other.W3;\n            W4 = other.W4;\n            W5 = other.W5;\n        }\n\n        protected AnyObjectId(int w1, int w2, int w3, int w4, int w5)\n        {\n            W1 = w1;\n            W2 = w2;\n            W3 = w3;\n            W4 = w4;\n            W5 = w5;\n        }\n\n        public int W1 { get; protected set; }\n        public int W2 { get; protected set; }\n        public int W3 { get; protected set; }\n        public int W4 { get; protected set; }\n        public int W5 { get; protected set; }\n\n        /// <summary>\n        /// For ObjectIdMap\n        /// </summary>\n        /// <returns>A discriminator usable for a fan-out style map</returns>\n        public int GetFirstByte()\n        {\n            return (byte)(((uint)W1) >> 24); // W1 >>> 24 in java\n        }\n\n        #region IComparable<ObjectId> Members\n\n        /// <summary>\n        /// Compare this ObjectId to another and obtain a sort ordering.\n        /// </summary>\n        /// <param name=\"other\">the other id to compare to. Must not be null.</param>\n        /// <returns>\n        /// &lt; 0 if this id comes before other; 0 if this id is equal to\n        /// other; &gt; 0 if this id comes after other.\n        /// </returns>\n        public int CompareTo(ObjectId other)\n        {\n            if (this == other)\n                return 0;\n\n            int cmp = NB.CompareUInt32(W1, other.W1);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W2, other.W2);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W3, other.W3);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W4, other.W4);\n            if (cmp != 0)\n                return cmp;\n\n            return NB.CompareUInt32(W5, other.W5);\n        }\n\n        public int CompareTo(byte[] bs, int p)\n        {\n            int cmp = NB.CompareUInt32(W1, NB.DecodeInt32(bs, p));\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W2, NB.DecodeInt32(bs, p + 4));\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W3, NB.DecodeInt32(bs, p + 8));\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W4, NB.DecodeInt32(bs, p + 12));\n            if (cmp != 0)\n                return cmp;\n\n            return NB.CompareUInt32(W5, NB.DecodeInt32(bs, p + 16));\n        }\n\n        public int CompareTo(int[] bs, int p)\n        {\n            int cmp = NB.CompareUInt32(W1, bs[p]);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W2, bs[p + 1]);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W3, bs[p + 2]);\n            if (cmp != 0)\n                return cmp;\n\n            cmp = NB.CompareUInt32(W4, bs[p + 3]);\n            if (cmp != 0)\n                return cmp;\n\n            return NB.CompareUInt32(W5, bs[p + 4]);\n        }\n\n        #endregion\n\n        #region IComparable Members\n\n        public int CompareTo(object obj)\n        {\n            return this.CompareTo((ObjectId)obj);\n        }\n\n        #endregion\n\n        /// <summary>\n        /// Tests if this ObjectId starts with the given abbreviation.\n        /// </summary>\n        /// <param name=\"abbr\">the abbreviation.</param>\n        /// <returns>\n        /// True if this ObjectId begins with the abbreviation; else false.\n        /// </returns>\n        public bool startsWith(AbbreviatedObjectId abbr)\n        {\n            return abbr.prefixCompare(this) == 0;\n        }\n\n        private char[] ToHexCharArray()\n        {\n            var dest = new char[Constants.OBJECT_ID_STRING_LENGTH];\n            ToHexCharArray(dest);\n            return dest;\n        }\n\n        private void ToHexCharArray(char[] dest)\n        {\n            Hex.FillHexCharArray(dest, 0, W1);\n            Hex.FillHexCharArray(dest, 8, W2);\n            Hex.FillHexCharArray(dest, 16, W3);\n            Hex.FillHexCharArray(dest, 24, W4);\n            Hex.FillHexCharArray(dest, 32, W5);\n        }\n\n        /// <summary>\n        /// string form of the SHA-1, in lower case hexadecimal.\n        /// </summary>\n        public string Name\n        {\n            get { return new string(ToHexCharArray()); }\n        }\n\n        public override String ToString()\n        {\n            return \"AnyObjectId[\" + Name + \"]\";\n        }\n\n        /// <summary>\n        /// Obtain an immutable copy of this current object name value.\n        /// <para/>\n        /// Only returns <code>this</code> if this instance is an unsubclassed\n        /// instance of {@link ObjectId}; otherwise a new instance is returned\n        /// holding the same value.\n        /// <para/>\n        /// This method is useful to shed any additional memory that may be tied to\n        /// the subclass, yet retain the unique identity of the object id for future\n        /// lookups within maps and repositories.\n        /// </summary>\n        /// <returns>an immutable copy, using the smallest memory footprint possible.</returns>\n        public ObjectId Copy()\n        {\n            if (GetType() == typeof(ObjectId))\n            {\n                return (ObjectId)this;\n            }\n            return new ObjectId(this);\n        }\n\n        /// <summary>\n        /// Obtain an immutable copy of this current object name value.\n        /// <para/>\n        /// See <see cref=\"Copy\"/> if <code>this</code> is a possibly subclassed (but\n        /// immutable) identity and the application needs a lightweight identity\n        /// <i>only</i> reference.\n        /// </summary>\n        /// <returns>\n        /// an immutable copy. May be <code>this</code> if this is already\n        /// an immutable instance.\n        /// </returns>\n        public abstract ObjectId ToObjectId();\n\n        #region Nested Types\n\n        internal class AnyObjectIdEqualityComparer<T> : IEqualityComparer<T>\n            where T : AnyObjectId\n        {\n            #region Implementation of IEqualityComparer<ObjectId>\n\n            /// <summary>\n            /// Determines whether the specified objects are equal.\n            /// </summary>\n            /// <returns>\n            /// true if the specified objects are equal; otherwise, false.\n            /// </returns>\n            /// <param name=\"x\">\n            /// The first object of type <see cref=\"ObjectId\"/> to compare.\n            /// </param>\n            /// <param name=\"y\">\n            /// The second object of type <see cref=\"ObjectId\"/> to compare.\n            /// </param>\n            public bool Equals(T x, T y)\n            {\n                return x == y;\n            }\n\n            /// <summary>\n            /// Returns a hash code for the specified object.\n            /// </summary>\n            /// <returns>\n            /// A hash code for the specified object.\n            /// </returns>\n            /// <param name=\"obj\">\n            /// The <see cref=\"ObjectId\"/> for which a hash code is to be returned.\n            /// </param>\n            /// <exception cref=\"ArgumentNullException\">\n            /// The type of <paramref name=\"obj\"/> is a reference type and <paramref name=\"obj\"/> is null.\n            /// </exception>\n            public int GetHashCode(T obj)\n            {\n                return obj.GetHashCode();\n            }\n\n            #endregion\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/BinaryDelta.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Recreate a stream from a base stream and a GIT pack delta.\n\t/// <para />\n\t/// This entire class is heavily cribbed from <code>patch-delta.c</code> in the\n\t/// GIT project. The original delta patching code was written by Nicolas Pitre\n\t/// (&lt;nico@cam.org&gt;).\n\t/// </summary>\n\tpublic static class BinaryDelta\n\t{\n\t\t///\t<summary>\n\t\t/// Apply the changes defined by delta to the data in base, yielding a new\n\t\t/// array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"baseData\">some byte representing an object of some kind.</param>\n\t\t///\t<param name=\"delta\">\n\t\t/// A git pack delta defining the transform from one version to\n\t\t/// another.\n\t\t/// </param>\n\t\t///\t<returns>Patched base</returns>\n\t\tpublic static byte[] Apply(byte[] baseData, byte[] delta)\n\t\t{\n\t\t\tint deltaPtr = 0;\n\n\t\t\t// Length of the base object (a variable Length int).\n\t\t\t//\n\t\t\tint baseLen = 0;\n\t\t\tint c, shift = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tc = delta[deltaPtr++] & 0xff;\n\t\t\t\tbaseLen |= (c & 0x7f) << shift;\n\t\t\t\tshift += 7;\n\t\t\t} while ((c & 0x80) != 0);\n\n\t\t\tif (baseData.Length != baseLen)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"baseData Length incorrect\");\n\t\t\t}\n\n\t\t\t// Length of the resulting object (a variable Length int).\n\t\t\t//\n\t\t\tint resLen = 0;\n\t\t\tshift = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tc = delta[deltaPtr++] & 0xff;\n\t\t\t\tresLen |= (c & 0x7f) << shift;\n\t\t\t\tshift += 7;\n\t\t\t} while ((c & 0x80) != 0);\n\n\t\t\tvar result = new byte[resLen];\n\t\t\tint resultPtr = 0;\n\t\t\twhile (deltaPtr < delta.Length)\n\t\t\t{\n\t\t\t\tint cmd = delta[deltaPtr++] & 0xff;\n\t\t\t\tif ((cmd & 0x80) != 0)\n\t\t\t\t{\n\t\t\t\t\t// Determine the segment of the base which should\n\t\t\t\t\t// be copied into the output. The segment is given\n\t\t\t\t\t// as an offset and a Length.\n\t\t\t\t\t//\n\t\t\t\t\tint copyOffset = 0;\n\t\t\t\t\tif ((cmd & 0x01) != 0)\n\t\t\t\t\t\tcopyOffset = delta[deltaPtr++] & 0xff;\n\t\t\t\t\tif ((cmd & 0x02) != 0)\n\t\t\t\t\t\tcopyOffset |= (delta[deltaPtr++] & 0xff) << 8;\n\t\t\t\t\tif ((cmd & 0x04) != 0)\n\t\t\t\t\t\tcopyOffset |= (delta[deltaPtr++] & 0xff) << 16;\n\t\t\t\t\tif ((cmd & 0x08) != 0)\n\t\t\t\t\t\tcopyOffset |= (delta[deltaPtr++] & 0xff) << 24;\n\n\t\t\t\t\tint copySize = 0;\n\t\t\t\t\tif ((cmd & 0x10) != 0)\n\t\t\t\t\t\tcopySize = delta[deltaPtr++] & 0xff;\n\t\t\t\t\tif ((cmd & 0x20) != 0)\n\t\t\t\t\t\tcopySize |= (delta[deltaPtr++] & 0xff) << 8;\n\t\t\t\t\tif ((cmd & 0x40) != 0)\n\t\t\t\t\t\tcopySize |= (delta[deltaPtr++] & 0xff) << 16;\n\t\t\t\t\tif (copySize == 0)\n\t\t\t\t\t\tcopySize = 0x10000;\n\n\t\t\t\t\tArray.Copy(baseData, copyOffset, result, resultPtr, copySize);\n\t\t\t\t\tresultPtr += copySize;\n\t\t\t\t}\n\t\t\t\telse if (cmd != 0)\n\t\t\t\t{\n\t\t\t\t\t// Anything else the data is literal within the delta\n\t\t\t\t\t// itself.\n\t\t\t\t\t//\n\t\t\t\t\tArray.Copy(delta, deltaPtr, result, resultPtr, cmd);\n\t\t\t\t\tdeltaPtr += cmd;\n\t\t\t\t\tresultPtr += cmd;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// cmd == 0 has been reserved for future encoding but\n\t\t\t\t\t// for now its not acceptable.\n\t\t\t\t\t//\n\t\t\t\t\tthrow new ArgumentException(\"unsupported command 0\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/BlobBasedConfig.cs",
    "content": "/*\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// The configuration file based on the blobs stored in the repository.\n\t/// </summary>\n\tpublic class BlobBasedConfig : Config\n\t{\n\t\t///\t<summary>\n\t\t/// The constructor from a byte array\n\t\t/// </summary>\n\t\t///\t<param name=\"base\">the base configuration file </param>\n\t\t///\t<param name=\"blob\">the byte array, should be UTF-8 encoded text. </param>\n\t\t///\t<exception cref=\"ConfigInvalidException\">\n\t\t///\tThe byte array is not a valid configuration format.\n\t\t/// </exception>\n\n\t\tpublic BlobBasedConfig(Config @base, byte[] blob)\n\t\t\t: base(@base)\n\t\t{\n\t\t\tfromText(RawParseUtils.decode(blob));\n\t\t}\n\n\t\t///\t<summary> * The constructor from object identifier\n\t\t///\t</summary>\n\t\t///\t<param name=\"base\">the base configuration file </param>\n\t\t///\t<param name=\"repo\">the repository</param>\n\t\t/// <param name=\"objectid\">the object identifier</param>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// the blob cannot be read from the repository. </exception>\n\t\t/// <exception cref=\"ConfigInvalidException\">\n\t\t/// the blob is not a valid configuration format.\n\t\t/// </exception> \n\t\tpublic BlobBasedConfig(Config @base, Repository repo, ObjectId objectid)\n\t\t\t: base(@base)\n\t\t{\n\t\t\tif (repo == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"repo\");\n\t\t\t}\n\t\t\t\n\t\t\tObjectLoader loader = repo.OpenBlob(objectid);\n\t\t\tif (loader == null)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Blob not found: \" + objectid);\n\t\t\t}\n\t\t\tfromText(RawParseUtils.decode(loader.Bytes));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// The constructor from commit and path\n\t\t///\t</summary>\n\t\t///\t<param name=\"base\">The base configuration file</param>\n\t\t///\t<param name=\"commit\">The commit that contains the object</param>\n\t\t///\t<param name=\"path\">The path within the tree of the commit</param>\n\t\t/// <exception cref=\"FileNotFoundException\">\n\t\t/// the path does not exist in the commit's tree.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// the tree and/or blob cannot be accessed.\n\t\t/// </exception>\n\t\t/// <exception cref=\"ConfigInvalidException\">\n\t\t/// the blob is not a valid configuration format.\n\t\t/// </exception>\n\t\tpublic BlobBasedConfig(Config @base, Commit commit, string path)\n\t\t\t: base(@base)\n\t\t{\n\t\t\tif (commit == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"commit\");\n\t\t\t}\n\t\t\t\n\t\t\tObjectId treeId = commit.TreeId;\n\t\t\tRepository r = commit.Repository;\n\t\t\tTreeWalk.TreeWalk tree = TreeWalk.TreeWalk.ForPath(r, path, treeId);\n\t\t\tif (tree == null)\n\t\t\t{\n\t\t\t\tthrow new FileNotFoundException(\"Entry not found by path: \" + path);\n\t\t\t}\n\t\t\tObjectId blobId = tree.getObjectId(0);\n\t\t\tObjectLoader loader = tree.Repository.OpenBlob(blobId);\n\t\t\t\n\t\t\tif (loader == null)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Blob not found: \" + blobId + \" for path: \" + path);\n\t\t\t}\n\n\t\t\tfromText(RawParseUtils.decode(loader.Bytes));\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/ByteArrayExtensions.cs",
    "content": "using System;\n\nnamespace GitSharp.Core\n{\n    public static class ByteArrayExtensions\n    {\n        public class ParsedLine\n        {\n            public int NextIndex { get; private set;}\n            public byte[] Buffer { get; private set; }\n\n            public ParsedLine(int nextIndex, byte[] buffer)\n            {\n                NextIndex = nextIndex;\n                Buffer = buffer;\n            }\n        }\n\n        public static bool StartsWith(this byte[] buffer, byte[] bufferToCompareWith)\n        {\n\t\t\tif (buffer == null)\n            {\n                throw new ArgumentNullException(\"buffer\");\n            }\n            if (bufferToCompareWith == null)\n            {\n                throw new ArgumentNullException(\"bufferToCompareWith\");\n            }\n\n            if (buffer.Length < bufferToCompareWith.Length)\n            {\n                return false;\n            }\n\n            int curpos = -1;\n\n            while (++curpos < bufferToCompareWith.Length)\n            {\n                if (bufferToCompareWith[curpos] != buffer[curpos])\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        public static ParsedLine ReadLine(this byte[] source, int startIndex)\n        {\n\t\t\tif (source == null)\n            {\n                throw new ArgumentNullException(\"source\");\n            }\n            if (startIndex < 0)\n            {\n                throw new ArgumentOutOfRangeException(\"startIndex\", \"Parameter is expected gretaer or equal than zero.\");\n            }\n\n            if (startIndex >= source.Length)\n            {\n                return new ParsedLine(-1, null);\n            }\n\n            int currentIndex = startIndex - 1;\n            int indexModifier = 0;\n\n            while (indexModifier == 0 && ++currentIndex < source.Length)\n            {\n                int num = source[currentIndex];\n                switch (num)\n                {\n                    case 13:\n                        if ((currentIndex != (source.Length - 1)) && (source[currentIndex + 1] == 10))\n                        {\n                            indexModifier = 2;\n                        }\n                        break;\n\n                    case 10:\n                        indexModifier = 1;\n                        break;\n                }\n            }\n\n            var output = new byte[currentIndex - startIndex];\n            Array.Copy(source, startIndex, output, 0, currentIndex - startIndex);\n\n            return new ParsedLine (currentIndex + indexModifier, output);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ByteArrayWindow.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A <seealso cref=\"ByteWindow\"/> with an underlying byte array for storage.\n\t/// </summary>\n    internal class ByteArrayWindow : ByteWindow\n    {\n        private readonly byte[] _array;\n\n        internal ByteArrayWindow(PackFile pack, long o, byte[] b)\n            : base(pack, o, b.Length)\n        {\n            _array = b;\n        }\n\n\t\tprotected override int copy(int pos, byte[] dstbuf, int dstoff, int cnt)\n\t\t{\n\t\t\tcnt = Math.Min(_array.Length - pos, cnt);\n\t\t\tArray.Copy(_array, pos, dstbuf, dstoff, cnt);\n\t\t\treturn cnt;\n\t\t}\n\n\t\tprotected override int Inflate(int pos, byte[] dstbuf, int dstoff, Inflater inf)\n        {\n            while (!inf.IsFinished)\n            {\n                if (inf.IsNeedingInput)\n                {\n                    inf.SetInput(_array, pos, _array.Length - pos);\n                    break;\n                }\n                dstoff += inf.Inflate(dstbuf, dstoff, dstbuf.Length - dstoff);\n            }\n            while (!inf.IsFinished && !inf.IsNeedingInput)\n                dstoff += inf.Inflate(dstbuf, dstoff, dstbuf.Length - dstoff);\n            return dstoff;\n        }\n\n\t\tprotected override void inflateVerify(int pos, Inflater inf)\n        {\n            while (!inf.IsFinished)\n            {\n                if (inf.IsNeedingInput)\n                {\n                    inf.SetInput(_array, pos, _array.Length - pos);\n                    break;\n                }\n                inf.Inflate(VerifyGarbageBuffer, 0, VerifyGarbageBuffer.Length);\n            }\n            while (!inf.IsFinished && !inf.IsNeedingInput)\n                inf.Inflate(VerifyGarbageBuffer, 0, VerifyGarbageBuffer.Length);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ByteBufferWindow.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A window for accessing git packs using a <see cref=\"Stream\"/> for storage.\n\t/// </summary>\n    internal class ByteBufferWindow : ByteWindow, IDisposable\n    {\n        private readonly Stream _stream;\n\n        internal ByteBufferWindow(PackFile pack, long o, Stream b)\n            : base(pack, o, b.Length)\n        {\n            _stream = b;\n        }\n\n\t\tprotected override int copy(int pos, byte[] dstbuf, int dstoff, int cnt)\n        {\n            _stream.Position = pos;\n\t\t\tcnt = (int)Math.Min(_stream.Length - pos, cnt);\n            _stream.Read(dstbuf, dstoff, cnt);\n\t\t\treturn cnt;\n        }\n\n    \tprotected override int Inflate(int pos, byte[] dstbuf, int dstoff, Inflater inf)\n        {\n            var tmp = new byte[512];\n            var s = _stream;\n            s.Position=pos;\n            while ((s.Length-s.Position) > 0 && !inf.IsFinished)\n            {\n                if (inf.IsNeedingInput)\n                {\n                    var n = (int)Math.Min((s.Length - s.Position), tmp.Length);\n                    s.Read(tmp, 0, n);\n                    inf.SetInput(tmp, 0, n);\n                }\n                dstoff += inf.Inflate(dstbuf, dstoff, dstbuf.Length - dstoff);\n            }\n            while (!inf.IsFinished && !inf.IsNeedingInput)\n                dstoff += inf.Inflate(dstbuf, dstoff, dstbuf.Length - dstoff);\n            return dstoff;\n        }\n\n        protected override void inflateVerify(int pos, Inflater inf)\n        {\n            var tmp = new byte[512];\n            var s = _stream;\n            s.Position = pos;\n            while ((s.Length - s.Position) > 0 && !inf.IsFinished)\n            {\n                if (inf.IsNeedingInput)\n                {\n                    var n = (int)Math.Min((s.Length - s.Position), tmp.Length);\n                    s.Read(tmp, 0, n);\n                    inf.SetInput(tmp, 0, n);\n                }\n                inf.Inflate(VerifyGarbageBuffer, 0, VerifyGarbageBuffer.Length);\n            }\n            while (!inf.IsFinished && !inf.IsNeedingInput)\n                inf.Inflate(VerifyGarbageBuffer, 0, VerifyGarbageBuffer.Length);\n        }\n\t\t\n\t\tpublic override void Dispose ()\n\t\t{\n            base.Dispose();\n\t\t\t_stream.Dispose();\n\t\t}\n\t\t\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/ByteWindow.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A window of data currently stored within a cache.\n\t/// <para />\n\t/// All bytes in the window can be assumed to be \"immediately available\", that is\n\t/// they are very likely already in memory, unless the operating system's memory\n\t/// is very low and has paged part of this process out to disk. Therefore copying\n\t/// bytes from a window is very inexpensive.\n\t/// </summary>\n\tinternal abstract class ByteWindow : IDisposable\n\t{\n\t\tprotected static readonly byte[] VerifyGarbageBuffer = new byte[2048];\n\n\t\tprivate readonly PackFile _pack;\n\t\tprivate readonly long _start;\n\t\tprivate readonly long _end;\n\n\t\tprotected ByteWindow(PackFile p, long s, long n)\n\t\t{\n\t\t\t_pack = p;\n\t\t\t_start = s;\n\t\t\t_end = _start + n;\n\t\t}\n\n\t\tinternal bool contains(PackFile neededFile, long neededPos)\n\t\t{\n\t\t\treturn _pack == neededFile && _start <= neededPos && neededPos < _end;\n\t\t}\n\n\t\t///\t<summary> * Copy bytes from the window to a caller supplied buffer.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pos\">offset within the file to start copying from.</param>\n\t\t///\t<param name=\"dstbuf\">destination buffer to copy into. </param>\n\t\t///\t<param name=\"dstoff\">\n\t\t/// Offset within <paramref name=\"dstbuf\"/> to start copying into.\n\t\t/// </param>\n\t\t///\t<param name=\"cnt\">\n\t\t/// number of bytes to copy. This value may exceed the number of\n\t\t/// bytes remaining in the window starting at offset\n\t\t/// <paramref name=\"pos\" />.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// Number of bytes actually copied; this may be less than\n\t\t/// <paramref name=\"cnt\" /> if <paramref name=\"cnt\" /> exceeded the number of\n\t\t/// bytes available. </returns>\n\t\tinternal int copy(long pos, byte[] dstbuf, int dstoff, int cnt)\n\t\t{\n\t\t\treturn copy((int)(pos - _start), dstbuf, dstoff, cnt);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Copy bytes from the window to a caller supplied buffer.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pos\">\n\t\t/// offset within the window to start copying from.\n\t\t/// </param>\n\t\t///\t<param name=\"dstbuf\">destination buffer to copy into.</param>\n\t\t///\t<param name=\"dstoff\">\n\t\t/// offset within <paramref name=\"dstbuf\"/> to start copying into.\n\t\t/// </param>\n\t\t///\t<param name=\"cnt\">\n\t\t/// number of bytes to copy. This value may exceed the number of\n\t\t/// bytes remaining in the window starting at offset\n\t\t/// <paramref name=\"pos\" />.\n\t\t/// </param>\n\t\t/// <returns> \n\t\t/// Number of bytes actually copied; this may be less than\n\t\t/// <paramref name=\"cnt\" /> if <paramref name=\"cnt\" /> exceeded \n\t\t/// the number of bytes available.\n\t\t/// </returns>\n\t\tprotected abstract int copy(int pos, byte[] dstbuf, int dstoff, int cnt);\n\n\t\t///\t<summary>\n\t\t/// Pump bytes into the supplied inflater as input.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pos\">\n\t\t/// offset within the file to start supplying input from.\n\t\t/// </param>\n\t\t///\t<param name=\"dstbuf\">\n\t\t/// destination buffer the inflater should output decompressed\n\t\t/// data to.\n\t\t/// </param>\n\t\t///\t<param name=\"dstoff\">\n\t\t/// current offset within <paramref name=\"dstbuf\"/> to inflate into.\n\t\t/// </param>\n\t\t///\t<param name=\"inf\">\n\t\t/// the inflater to feed input to. The caller is responsible for\n\t\t/// initializing the inflater as multiple windows may need to\n\t\t/// supply data to the same inflater to completely decompress\n\t\t/// something.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// Updated <paramref name=\"dstoff\"/> based on the number of bytes\n\t\t/// successfully copied into <paramref name=\"dstbuf\"/> by\n\t\t/// <paramref name=\"inf\"/>. If the inflater is not yet finished then\n\t\t/// another window's data must still be supplied as input to finish\n\t\t/// decompression.\n\t\t/// </returns>\n\t\t///\t<exception cref=\"InvalidOperationException\">\n\t\t/// the inflater encountered an invalid chunk of data. Data\n\t\t/// stream corruption is likely.\n\t\t/// </exception>\n\t\tinternal int Inflate(long pos, byte[] dstbuf, int dstoff, Inflater inf)\n\t\t{\n\t\t\treturn Inflate((int)(pos - _start), dstbuf, dstoff, inf);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Pump bytes into the supplied inflater as input.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pos\">\n\t\t/// offset within the file to start supplying input from.\n\t\t/// </param>\n\t\t///\t<param name=\"dstbuf\">\n\t\t/// destination buffer the inflater should output decompressed\n\t\t/// data to.\n\t\t/// </param>\n\t\t///\t<param name=\"dstoff\">\n\t\t/// current offset within <paramref name=\"dstbuf\"/> to inflate into.\n\t\t/// </param>\n\t\t///\t<param name=\"inf\">\n\t\t/// the inflater to feed input to. The caller is responsible for\n\t\t/// initializing the inflater as multiple windows may need to\n\t\t/// supply data to the same inflater to completely decompress\n\t\t/// something.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// Updated <paramref name=\"dstoff\"/> based on the number of bytes\n\t\t/// successfully copied into <paramref name=\"dstbuf\"/> by\n\t\t/// <paramref name=\"inf\"/>. If the inflater is not yet finished then\n\t\t/// another window's data must still be supplied as input to finish\n\t\t/// decompression.\n\t\t/// </returns>\n\t\t///\t<exception cref=\"InvalidOperationException\">\n\t\t/// the inflater encountered an invalid chunk of data. Data\n\t\t/// stream corruption is likely.\n\t\t/// </exception>\n\t\tprotected abstract int Inflate(int pos, byte[] dstbuf, int dstoff, Inflater inf);\n\n\t\tinternal void inflateVerify(long pos, Inflater inf)\n\t\t{\n\t\t\tinflateVerify((int)(pos - _start), inf);\n\t\t}\n\n\t\tprotected abstract void inflateVerify(int pos, Inflater inf);\n\n\t\tpublic long End\n\t\t{\n\t\t\tget { return _end; }\n\t\t}\n\n\t\tpublic long Start\n\t\t{\n\t\t\tget { return _start; }\n\t\t}\n\n\t\tpublic PackFile Pack\n\t\t{\n\t\t\tget { return _pack; }\n\t\t}\n\n\t\tinternal int Size\n\t\t{\n\t\t\tget { return (int)(_end - _start); }\n\t\t}\n\t\t\n\t\tpublic virtual void Dispose ()\n\t\t{\n\t\t\t_pack.Dispose();\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/CachedObjectDatabase.cs",
    "content": "﻿/*\n * Copyright (C) 2010, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// <see cref=\"ObjectDatabase\"/> wrapper providing temporary lookup caching.\n    /// <para/>\n    /// The base class for {@code ObjectDatabase}s that wrap other database instances\n    /// and optimize querying for objects by caching some database dependent\n    /// information. Instances of this class (or any of its subclasses) can be\n    /// returned from the method <see cref=\"ObjectDatabase.newCachedDatabase\"/>. This\n    /// class can be used in scenarios where the database does not change, or when\n    /// changes in the database while some operation is in progress is an acceptable\n    /// risk.\n    /// <para/>\n    /// The default implementation delegates all requests to the wrapped database.\n    /// The instance might be indirectly invalidated if the wrapped instance is\n    /// closed. Closing the delegating instance does not implies closing the wrapped\n    /// instance. For alternative databases, cached instances are used as well.\n    /// </summary>\n    public class CachedObjectDatabase : ObjectDatabase {\n        /// <summary>\n        /// The wrapped database instance\n        /// </summary>\n        protected ObjectDatabase wrapped;\n\n        /// <summary>\n        /// Create the delegating database instance\n        /// </summary>\n        /// <param name=\"wrapped\">the wrapped object database</param>\n        public CachedObjectDatabase(ObjectDatabase wrapped) {\n            this.wrapped = wrapped;\n        }\n\n        public override bool hasObject1(AnyObjectId objectId) {\n            return wrapped.hasObject1(objectId);\n        }\n\n        public override ObjectLoader openObject1(WindowCursor curs, AnyObjectId objectId)\n        {\n            return wrapped.openObject1(curs, objectId);\n        }\n\n        public override bool hasObject2(string objectName) {\n            return wrapped.hasObject2(objectName);\n        }\n\n        protected override ObjectDatabase[] loadAlternates() {\n            ObjectDatabase[] loaded = wrapped.getAlternates();\n            var result = new ObjectDatabase[loaded.Length];\n            for (int i = 0; i < loaded.Length; i++) {\n                result[i] = loaded[i].newCachedDatabase();\n            }\n            return result;\n        }\n\n        public override ObjectLoader openObject2(WindowCursor curs, string objectName,\n                                                 AnyObjectId objectId) {\n            return wrapped.openObject2(curs, objectName, objectId);\n                                                 }\n\n        public override void OpenObjectInAllPacks(ICollection<PackedObjectLoader> @out,\n                                                  WindowCursor curs, AnyObjectId objectId)  {\n            wrapped.OpenObjectInAllPacks(@out, curs, objectId);\n                                                  }\n\n        public override bool tryAgain1() {\n            return wrapped.tryAgain1();\n        }\n\n        public override ObjectDatabase newCachedDatabase() {\n            // Note that \"this\" is not returned since subclasses might actually do something,\n            // on closeSelf() (for example closing database connections or open repositories).\n            // The situation might become even more tricky if we will consider alternates.\n            return wrapped.newCachedDatabase();\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/CachedObjectDirectory.cs",
    "content": "﻿/*\n * Copyright (C) 2010, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// The cached instance of an <see cref=\"ObjectDirectory\"/>.\n    /// <para/>\n    /// This class caches the list of loose objects in memory, so the file system is\n    /// not queried with stat calls.\n    /// </summary>\n    public class CachedObjectDirectory : CachedObjectDatabase {\n        /// <summary>\n        /// The set that contains unpacked objects identifiers, it is created when\n        /// the cached instance is created.\n        /// </summary>\n        private readonly ObjectIdSubclassMap<ObjectId> _unpackedObjects = new ObjectIdSubclassMap<ObjectId>();\n\n        /// <summary>\n        /// The constructor\n        /// </summary>\n        /// <param name=\"wrapped\">the wrapped database</param>\n        public CachedObjectDirectory(ObjectDirectory wrapped) : base(wrapped) {\n            DirectoryInfo objects = wrapped.getDirectory();\n            string[] fanout = objects.GetDirectories().Select(x => x.FullName).ToArray();\n            if (fanout == null)\n                fanout = new string[0];\n            foreach (string d in fanout) {\n                if (d.Length != 2)\n                    continue;\n                string[] entries = PathUtil.CombineDirectoryPath(objects, d).GetFiles().Select(x => x.FullName).ToArray();\n                if (entries == null)\n                    continue;\n                foreach (string e in entries) {\n                    if (e.Length != Constants.OBJECT_ID_STRING_LENGTH - 2)\n                        continue;\n                    try {\n                        _unpackedObjects.Add(ObjectId.FromString(d + e));\n                    } catch (ArgumentException) {\n                        // ignoring the file that does not represent loose object\n                    }\n                }\n            }\n        }\n\n        public override ObjectLoader openObject2(WindowCursor curs, String objectName,\n                                                 AnyObjectId objectId) {\n            if (_unpackedObjects.Get(objectId) == null)\n                return null;\n            return base.openObject2(curs, objectName, objectId);\n                                                 }\n\n        public override bool hasObject1(AnyObjectId objectId) {\n            if (_unpackedObjects.Get(objectId) != null)\n                return true; // known to be loose\n            return base.hasObject1(objectId);\n        }\n\n        public override bool hasObject2(String name) {\n            return false; // loose objects were tested by hasObject1\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/Codec.cs",
    "content": "using System;\n/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2008, Novell, Inc <miguel@novell.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    internal static class Codec\n    {\n        public static ObjectType DecodeTypeString(ObjectId id, byte[] typeString, byte endMark, ref int offset)\n        {\n            try\n            {\n                switch (typeString[offset])\n                {\n                    case (byte)'b':\n                        if (typeString[offset + 1] != (byte)'l' ||\n                        typeString[offset + 2] != (byte)'o' ||\n                        typeString[offset + 3] != (byte)'b' ||\n                        typeString[offset + 4] != endMark) break;\n                        offset += 5;\n                        return ObjectType.Blob;\n\n                    case (byte)'c':\n                        if (typeString[offset + 1] != (byte)'o' || typeString[offset + 2] != (byte)'m' ||\n                        typeString[offset + 3] != (byte)'m' || typeString[offset + 4] != (byte)'i' ||\n                        typeString[offset + 5] != (byte)'t' || typeString[offset + 6] != endMark) break;\n                        offset += 7;\n                        return ObjectType.Commit;\n\n                    case (byte)'t':\n                        switch (typeString[offset + 1])\n                        {\n                            case (byte)'a':\n                                if (typeString[offset + 2] != (byte)'g' || typeString[offset + 2] != endMark)\n                                {\n                                    throw new CorruptObjectException(id, \"invalid type\");\n                                }\n                                offset += 4;\n                                return ObjectType.Tag;\n\n                            case (byte)'r':\n                                if (typeString[offset + 2] != (byte)'e' || typeString[offset + 3] != (byte)'e' || typeString[offset + 4] != endMark)\n                                {\n                                    throw new CorruptObjectException(id, \"invalid type\");\n                                }\n                                offset += 5;\n                                return ObjectType.Tree;\n\n                        }\n                        break;\n                }\n            }\n            catch (IndexOutOfRangeException)\n            {\n            }\n            throw new CorruptObjectException(id, \"invalid type\");\n        }\n\n        public static string TypeString(ObjectType objectType)\n        {\n            switch (objectType)\n            {\n                case ObjectType.Commit:\n                    return Constants.TYPE_COMMIT;\n\n                case ObjectType.Tree:\n                    return Constants.TYPE_TREE;\n\n                case ObjectType.Blob:\n                    return Constants.TYPE_BLOB;\n\n                case ObjectType.Tag:\n                    return Constants.TYPE_TAG;\n\n                default:\n                    throw new ArgumentException(\"Bad object type was passed\", \"objectType\");\n            }\n        }\n\n        public static byte[] EncodedTypeString(ObjectType objectType)\n        {\n            switch (objectType)\n            {\n                case ObjectType.Commit:\n                    return Constants.EncodedTypeCommit;\n\n                case ObjectType.Tree:\n                    return Constants.EncodedTypeTree;\n\n                case ObjectType.Blob:\n                    return Constants.EncodedTypeBlob;\n\n                case ObjectType.Tag:\n                    return Constants.EncodedTypeTag;\n\n                default:\n                    throw new ArgumentException(\"Bad object type was passed\", \"objectType\");\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Commit.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Instances of this class represent a Commit object. It represents a snapshot\n\t/// in a Git repository, who created it and when.\n\t/// </summary>\n\tpublic class Commit : Treeish\n\t{\n\t\tprivate static readonly ObjectId[] EmptyObjectidList = new ObjectId[0];\n\n\t\tprivate byte[] _raw;\n\t\tprivate ObjectId _treeId;\n\t\tprivate Tree _treeEntry;\n\n\t    ///\t<summary>\n\t\t/// Create an empty commit object. More information must be fed to this\n\t\t/// object to make it useful.\n\t\t/// </summary>\n\t\t/// <param name=\"db\">\n\t\t/// The repository with which to associate it.\n\t\t/// </param>\n\t\tpublic Commit(Repository db)\n\t\t\t: this(db, EmptyObjectidList)\n\t\t{\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a commit associated with these parents and associate it with a\n\t\t/// repository.\n\t\t/// </summary>\n\t\t/// <param name=\"db\">\n\t\t///\tThe repository to which this commit object belongs.\n\t\t/// </param>\n\t\t///\t<param name=\"parentIds\">\n\t\t///\tId's of the parent(s).\n\t\t/// </param>\n\t\tpublic Commit(Repository db, ObjectId[] parentIds)\n\t\t{\n\t\t\tRepository = db;\n\t\t\tParentIds = parentIds;\n\t\t}\n\t\t///\t<summary>\n\t\t/// Create a commit object with the specified id and data from an existing\n\t\t/// commit object in a repository.\n\t\t/// </summary>\n\t\t/// <param name=\"db\">\n\t\t/// The repository to which this commit object belongs.\n\t\t/// </param>\n\t\t/// <param name=\"id\">Commit id.</param>\n\t\t/// <param name=\"raw\">Raw commit object data.</param>\n\t\tpublic Commit(Repository db, ObjectId id, byte[] raw)\n\t\t{\n\t\t\tRepository = db;\n\t\t\tCommitId = id;\n\t\t\t_treeId = ObjectId.FromString(raw, 5);\n\t\t\tParentIds = new ObjectId[1];\n\t\t\tint np = 0;\n\t\t\tint rawPtr = 46;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (raw[rawPtr] != 'p') break;\n\n\t\t\t\tif (np == 0)\n\t\t\t\t{\n\t\t\t\t\tParentIds[np++] = ObjectId.FromString(raw, rawPtr + 7);\n\t\t\t\t}\n\t\t\t\telse if (np == 1)\n\t\t\t\t{\n\t\t\t\t\tParentIds = new[] { ParentIds[0], ObjectId.FromString(raw, rawPtr + 7) };\n\t\t\t\t\tnp++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (ParentIds.Length <= np)\n\t\t\t\t\t{\n\t\t\t\t\t\tObjectId[] old = ParentIds;\n\t\t\t\t\t\tParentIds = new ObjectId[ParentIds.Length+32];\n\t\t\t\t\t\tfor (int i=0; i<np; ++i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tParentIds[i] = old[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tParentIds[np++] = ObjectId.FromString(raw, rawPtr + 7);\n\t\t\t\t}\n\t\t\t\trawPtr += 48;\n\t\t\t}\n\n\t\t\tif (np != ParentIds.Length)\n\t\t\t{\n\t\t\t\tObjectId[] old = ParentIds;\n\t\t\t\tParentIds = new ObjectId[np];\n\t\t\t\tfor (int i = 0; i < np; ++i)\n\t\t\t\t{\n\t\t\t\t\tParentIds[i] = old[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (np == 0)\n\t\t\t\t{\n\t\t\t\t\tParentIds = EmptyObjectidList;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_raw = raw;\n\t\t    Decode();\n\t\t}\n\n\t\t#region Treeish Members\n\n\t\tpublic ObjectId TreeId\n\t\t{\n\t\t\tget { return _treeId; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_treeId == null || !_treeId.Equals(value))\n\t\t\t\t{\n\t\t\t\t\t_treeEntry = null;\n\t\t\t\t}\n\t\t\t\t_treeId = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Tree TreeEntry\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_treeEntry == null)\n\t\t\t\t{\n\t\t\t\t\t_treeEntry = Repository.MapTree(TreeId);\n\t\t\t\t\tif (_treeEntry == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new MissingObjectException(TreeId, ObjectType.Tree);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn _treeEntry;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_treeId = value.TreeId;\n\t\t\t\t_treeEntry = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic ObjectId CommitId { get; private set; }\n\t\tpublic ObjectId[] ParentIds { get; set; }\n        \n        public Repository Repository { get; private set; }\n\n        public Encoding Encoding { get; set; }\n        \n        public string Message { get; set; }  \n\t\t\n        public PersonIdent Committer { get; set; }\n\t\t\n        public PersonIdent Author { get; set; }\n\n        private void Decode()\n        {\n            if (_raw == null) return;\n\n            int pos = 0;\n\n            ByteArrayExtensions.ParsedLine res = _raw.ReadLine(pos);\n            if (res.Buffer == null || !res.Buffer.StartsWith(\"tree \".getBytes()))\n            {\n                throw new CorruptObjectException(CommitId, \"no tree\");\n            }\n\n            bool skip;\n            do\n            {\n                skip = false;\n\n                res = _raw.ReadLine(res.NextIndex);\n\n                if ((res.Buffer == null) || !res.Buffer.StartsWith(\"parent \".getBytes()))\n                {\n                    skip = true;\n                }\n\n            } while (!skip);\n\n            const string authorPrefix = \"author \";\n            if (res.Buffer == null || !res.Buffer.StartsWith(authorPrefix.getBytes()))\n            {\n                throw new CorruptObjectException(CommitId, \"no author\");\n            }\n\n            byte[] rawAuthor = ExtractTrailingBytes(res.Buffer, authorPrefix);\n\n            res = _raw.ReadLine(res.NextIndex);\n\n            const string committerPrefix = \"committer \";\n            if (res.Buffer == null || !res.Buffer.StartsWith(committerPrefix.getBytes()))\n            {\n                throw new CorruptObjectException(CommitId, \"no committer\");\n            }\n\n            byte[] rawCommitter = ExtractTrailingBytes(res.Buffer, committerPrefix);\n\n            res = _raw.ReadLine(res.NextIndex);\n\n            const string encodingPrefix = \"encoding \";\n            if (res.Buffer != null && res.Buffer.StartsWith(encodingPrefix.getBytes()))\n            {\n                byte[] rawEncoding = ExtractTrailingBytes(res.Buffer, encodingPrefix);\n                Encoding = Charset.forName(new ASCIIEncoding().GetString(rawEncoding));\n            }\n            else if (res.Buffer == null || res.Buffer.Length != 0)\n            {\n                throw new CorruptObjectException(CommitId, \"malformed header:\" + new ASCIIEncoding().GetString(res.Buffer ?? new byte[0]));\n            }\n\n            pos = res.NextIndex;\n\n            var readBuf = new byte[_raw.Length - pos];\n            Array.Copy(_raw, pos, readBuf, 0, _raw.Length - pos);\n            int msgstart = readBuf.Length != 0 ? (readBuf[0] == '\\n' ? 1 : 0) : 0;\n\n            // If encoding is not specified, the default for commit is UTF-8\n            if (Encoding == null) Encoding = Constants.CHARSET;\n\n            // TODO: this isn't reliable so we need to guess the encoding from the actual content\n            Author = new PersonIdent(Encoding.GetString(rawAuthor));\n            Committer = new PersonIdent(Encoding.GetString(rawCommitter));\n            Message = Encoding.GetString(readBuf, msgstart, readBuf.Length - msgstart);\n\n            _raw = null;\n        }\n\n        private static byte[] ExtractTrailingBytes(byte[] source, string prefix)\n        {\n            var rawAuthor2 = new byte[source.Length - prefix.Length];\n            Array.Copy(source, prefix.Length, rawAuthor2, 0, source.Length - prefix.Length);\n            return rawAuthor2;\n        }\n\n\t\t///\t<summary>\n\t\t/// Persist this commit object\n\t\t/// </summary>\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic void Save() // [henon] was Commit() in java, but c# won't allow it\n\t\t{\n\t\t\tif (CommitId != null)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"exists \" + CommitId);\n\t\t\t}\n\n\t\t\tCommitId = new ObjectWriter(Repository).WriteCommit(this);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Commit[\" + CommitId + \" \" + Author + \"]\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/CompleteAttribute.cs",
    "content": "﻿using System;\n\nnamespace GitSharp.Core\n{\n    [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]\n    sealed class CompleteAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Config.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Thad Hughes <thadh@thad.corp.google.com>\n * Copyright (C) 2009, JetBrains s.r.o.\n * Copyright (C) 2009, Google, Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing Tamir.SharpSsh.java.lang;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Git style <code>.config</code>, <code>.gitconfig</code>, <code>.gitmodules</code> file.\n    /// </summary>\n    public class Config\n    {\n        private static readonly string[] EmptyStringArray = new string[0];\n\n        private const long GiB = 1024 * MiB;\n        private const long KiB = 1024;\n        private const long MiB = 1024 * KiB;\n\n        ///\t<summary>\n        /// Immutable current state of the configuration data.\n        ///\t<para />\n        /// This state is copy-on-write. It should always contain an immutable list\n        /// of the configuration keys/values.\n        /// </summary>\n        internal AtomicReference<State> _state;\n\n        /// Magic value indicating a missing entry.\n        ///\tThis value is tested for reference equality in some contexts, so we\n        ///\tmust ensure it is a special copy of the empty string.  It also must\n        ///\tbe treated like the empty string.\n        private static readonly string MagicEmptyValue = string.Empty;\n\n        private readonly Config _baseConfig;\n\n        /// <summary>\n        /// Create a configuration with no default fallback.\n        /// </summary>\n        public Config()\n            : this(null)\n        {\n        }\n\n        ///\t<summary>\n        /// Create an empty configuration with a fallback for missing keys.\n        ///\t</summary>\n        ///\t<param name=\"defaultConfig\">\n        ///\tthe base configuration to be consulted when a key is missing\n        /// from this configuration instance.\n        /// </param>\n        public Config(Config defaultConfig)\n        {\n            _baseConfig = defaultConfig;\n            _state = new AtomicReference<State>(newState());\n        }\n\n        ///\t<summary>\n        /// Escape the value before saving\n        /// </summary>\n        /// <param name=\"x\">The value to escape.</param>\n        ///\t<returns>The escaped value.</returns>\n        private static string EscapeValue(string x)\n        {\n            bool inquote = false;\n            int lineStart = 0;\n            var r = new StringBuilder(x.Length);\n\n            for (int k = 0; k < x.Length; k++)\n            {\n                char c = x[k];\n                switch (c)\n                {\n                    case '\\n':\n                        if (inquote)\n                        {\n                            r.Append('\"');\n                            inquote = false;\n                        }\n                        r.Append(\"\\\\n\\\\\\n\");\n                        lineStart = r.Length;\n                        break;\n\n                    case '\\t':\n                        r.Append(\"\\\\t\");\n                        break;\n\n                    case '\\b':\n                        r.Append(\"\\\\b\");\n                        break;\n\n                    case '\\\\':\n                        r.Append(\"\\\\\\\\\");\n                        break;\n\n                    case '\"':\n                        r.Append(\"\\\\\\\"\");\n                        break;\n\n                    case ';':\n                    case '#':\n                        if (!inquote)\n                        {\n                            r.Insert(lineStart, '\"');\n                            inquote = true;\n                        }\n                        r.Append(c);\n                        break;\n\n                    case ' ':\n                        if (!inquote && r.Length > 0 && r[r.Length - 1] == ' ')\n                        {\n                            r.Insert(lineStart, '\"');\n                            inquote = true;\n                        }\n                        r.Append(' ');\n                        break;\n\n                    default:\n                        r.Append(c);\n                        break;\n                }\n            }\n\n            if (inquote)\n            {\n                r.Append('\"');\n            }\n\n            return r.ToString();\n        }\n\n        ///\t<summary>\n        /// Obtain an integer value from the configuration.\n        ///\t</summary>\n        ///\t<param name=\"section\">Section the key is grouped within.</param>\n        ///\t<param name=\"name\">Name of the key to get.</param>\n        ///\t<param name=\"defaultValue\">\n        ///\tDefault value to return if no value was present.\n        /// </param>\n        ///\t<returns>\n        /// An integer value from the configuration, or <paramref name=\"defaultValue\"/>.\n        /// </returns>\n        public int getInt(string section, string name, int defaultValue)\n        {\n            return getInt(section, null, name, defaultValue);\n        }\n\n        ///\t<summary>\n        /// Obtain an integer value from the configuration.\n        ///\t</summary>\n        ///\t<param name=\"section\">Section the key is grouped within.</param>\n        ///\t<param name=\"subsection\">\n        /// Subsection name, such a remote or branch name.\n        /// </param>\n        ///\t<param name=\"name\">Name of the key to get.</param>\n        ///\t<param name=\"defaultValue\">\n        /// Default value to return if no value was present. </param>\n        ///\t<returns>\n        /// An integer value from the configuration, or <paramref name=\"defaultValue\"/>.\n        /// </returns>\n        public int getInt(string section, string subsection, string name, int defaultValue)\n        {\n            long val = getLong(section, subsection, name, defaultValue);\n            if (int.MinValue <= val && val <= int.MaxValue)\n                return (int)val;\n            throw new ArgumentException(\"Integer value \" + section + \".\" + name + \" out of range\");\n        }\n\n        ///\t<summary>\n        /// Obtain an integer value from the configuration.\n        /// </summary>\n        ///\t<param name=\"section\">Section the key is grouped within.</param>\n        ///\t<param name=\"subsection\">\n        /// Subsection name, such a remote or branch name.\n        /// </param>\n        ///\t<param name=\"name\">Name of the key to get.</param>\n        ///\t<param name=\"defaultValue\">\n        /// Default value to return if no value was present.\n        /// </param>\n        ///\t<returns>\n        /// An integer value from the configuration, or <paramref name=\"defaultValue\"/>.\n        /// </returns>\n        public long getLong(string section, string subsection, string name, long defaultValue)\n        {\n            string str = getString(section, subsection, name);\n            if (str == null)\n                return defaultValue;\n\n            string n = str.Trim();\n            if (n.Length == 0)\n                return defaultValue;\n\n            long mul = 1;\n            switch (StringUtils.toLowerCase(n[n.Length - 1]))\n            {\n                case 'g':\n                    mul = GiB;\n                    break;\n\n                case 'm':\n                    mul = MiB;\n                    break;\n\n                case 'k':\n                    mul = KiB;\n                    break;\n            }\n\n            if (mul > 1)\n                n = n.Slice(0, n.Length - 1).Trim();\n\n            if (n.Length == 0)\n                return defaultValue;\n\n            try\n            {\n                return mul * long.Parse(n);\n            }\n            catch (FormatException nfe)\n            {\n                throw new ArgumentException(\"Invalid long value: \" + section + \".\" + name + \"=\" + str, nfe);\n            }\n        }\n\n        ///\t<summary>\n        /// Get a boolean value from the git config.\n        /// </summary>\n        /// <param name=\"section\">Section the key is grouped within.</param>\n        ///\t<param name=\"name\">Name of the key to get.</param>\n        ///\t<param name=\"defaultValue\">\n        /// Default value to return if no value was present.\n        /// </param>\n        ///\t<returns>\n        /// True if any value or <paramref name=\"defaultValue\"/> is true, false \n        /// for missing or explicit false.\n        /// </returns>\n        public bool getBoolean(string section, string name, bool defaultValue)\n        {\n            return getBoolean(section, null, name, defaultValue);\n        }\n\n        ///\t<summary>\n        /// Get a boolean value from the git config.\n        /// </summary>\n        ///\t<param name=\"section\">Section the key is grouped within.</param>\n        ///\t<param name=\"subsection\">\n        /// Subsection name, such a remote or branch name.\n        /// </param>\n        ///\t<param name=\"name\">Name of the key to get.</param>\n        ///\t<param name=\"defaultValue\">\n        /// Default value to return if no value was present.\n        /// </param>\n        ///\t<returns>\n        /// True if any value or defaultValue is true, false for missing or\n        /// explicit false.\n        /// </returns>\n        public bool getBoolean(string section, string subsection, string name, bool defaultValue)\n        {\n            string n = getRawString(section, subsection, name);\n            if (n == null)\n                return defaultValue;\n\n            if (MagicEmptyValue == n)\n            {\n                return true;\n            }\n\n            try\n            {\n                return StringUtils.toBoolean(n);\n            }\n            catch (ArgumentException e)\n            {\n                throw new ArgumentException(\"Invalid boolean value: \" + section + \".\" + name + \"=\" + n, e);\n            }\n\n        }\n\n        ///\t<summary>\n        /// Get string value.\n        ///\t</summary>\n        ///\t<param name=\"section\">The section.</param>\n        ///\t<param name=\"subsection\">The subsection for the value.</param>\n        ///\t<param name=\"name\">The key name.</param>\n        ///\t<returns>A <see cref=\"String\"/> value from git config.</returns>\n        public string getString(string section, string subsection, string name)\n        {\n            return getRawString(section, subsection, name);\n        }\n\n        ///\t<summary>\n        /// Get a list of string values\n        ///\t<para />\n        /// If this instance was created with a base, the base's values are returned\n        /// first (if any).\n        /// </summary>\n        /// <param name=\"section\">The section.</param>\n        ///\t<param name=\"subsection\">The subsection for the value.</param>\n        ///\t<param name=\"name\">The key name.</param>\n        ///\t<returns>Array of zero or more values from the configuration.</returns>\n        public string[] getStringList(string section, string subsection, string name)\n        {\n            string[] baseList = _baseConfig != null ? _baseConfig.getStringList(section, subsection, name) : EmptyStringArray;\n\n            List<string> lst = getRawStringList(section, subsection, name);\n            if (lst != null)\n            {\n                var res = new string[baseList.Length + lst.Count];\n                int idx = baseList.Length;\n\n                Array.Copy(baseList, 0, res, 0, idx);\n\n                foreach (string val in lst)\n                {\n                    res[idx++] = val;\n                }\n\n                return res;\n            }\n\n            return baseList;\n        }\n\n        ///\t<param name=\"section\">Section to search for. </param>\n        ///\t<returns> set of all subsections of specified section within this\n        /// configuration and its base configuration; may be empty if no\n        /// subsection exists.\n        /// </returns>\n        public IList<string> getSubsections(string section)\n        {\n            return get(new SubsectionNames(section));\n        }\n\n        ///\t<summary>\n        /// Obtain a handle to a parsed set of configuration values.\n        /// </summary>\n        ///\t<param name=\"parser\">\n        /// Parser which can create the model if it is not already\n        /// available in this configuration file. The parser is also used\n        /// as the key into a cache and must obey the hashCode and equals\n        /// contract in order to reuse a parsed model.\n        /// </param>\n        ///\t<returns>\n        /// The parsed object instance, which is cached inside this config.\n        /// </returns>\n        /// <typeparam name=\"T\">Type of configuration model to return.</typeparam>\n        public T get<T>(SectionParser<T> parser)\n        {\n            State myState = getState();\n            T obj = (T)myState.Cache.get<object, object>(parser);\n            if (Equals(obj, default(T)))\n            {\n                obj = (T)parser.parse(this);\n                myState.Cache.put<object, object>(parser, obj);\n            }\n            return obj;\n        }\n\n        /// <summary>\n        /// Remove a cached configuration object.\n        ///\t<para />\n        /// If the associated configuration object has not yet been cached, this\n        /// method has no effect.\n        /// </summary>\n        ///\t<param name=\"parser\">Parser used to obtain the configuration object.</param>\n        ///\t<seealso cref=\"get{T}\"/>\n        public void uncache<T>(SectionParser<T> parser)\n        {\n            _state.get().Cache.Remove(parser);\n        }\n\n        private string getRawString(string section, string subsection, string name)\n        {\n            List<string> lst = getRawStringList(section, subsection, name);\n\n            if (lst != null && lst.Count > 0)\n                return lst[0];\n\n            if (_baseConfig != null)\n                return _baseConfig.getRawString(section, subsection, name);\n\n            return null;\n        }\n\n        private List<string> getRawStringList(string section, string subsection, string name)\n        {\n            List<string> r = null;\n            foreach (Entry e in _state.get().EntryList)\n            {\n                if (e.match(section, subsection, name))\n                    r = add(r, e.value);\n            }\n\n            return r;\n        }\n\n        private static List<string> add(List<string> curr, string value)\n        {\n            if (curr == null)\n                return new List<string> { value };\n\n            curr.Add(value);\n            return curr;\n        }\n\n        internal State getState()\n        {\n            State cur, upd;\n            do\n            {\n                cur = _state.get();\n                State @base = getBaseState();\n                if (cur.baseState == @base)\n                    return cur;\n                upd = new State(cur.EntryList, @base);\n            } while (!_state.compareAndSet(cur, upd));\n            return upd;\n        }\n\n        private State getBaseState()\n        {\n            return _baseConfig != null ? _baseConfig.getState() : null;\n        }\n\n        /// <summary>\n        /// Add or modify a configuration value. The parameters will result in a\n        /// configuration entry like this.\n        /// <para />\n        /// <pre>\n        /// [section &quot;subsection&quot;]\n        /// name = value\n        /// </pre>\n        ///\t</summary>\n        ///\t<param name=\"section\">Section name, e.g \"branch\"</param>\n        ///\t<param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        ///\t<param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        ///\t<param name=\"value\">Parameter value.</param>\n        public void setInt(string section, string subsection, string name, int value)\n        {\n            setLong(section, subsection, name, value);\n        }\n\n        ///\t<summary>\n        /// Add or modify a configuration value. The parameters will result in a\n        ///\tconfiguration entry like this.\n        /// <para />\n        /// <pre>\n        /// [section &quot;subsection&quot;]\n        /// name = value\n        /// </pre>\n        ///\t</summary>\n        ///\t<param name=\"section\">Section name, e.g \"branch\"</param>\n        ///\t<param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        ///\t<param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        ///\t<param name=\"value\">Parameter value.</param>\n        public void setLong(string section, string subsection, string name, long value)\n        {\n            string s;\n            if (value >= GiB && (value % GiB) == 0)\n                s = (value / GiB) + \" g\";\n            else if (value >= MiB && (value % MiB) == 0)\n                s = (value / MiB) + \" m\";\n            else if (value >= KiB && (value % KiB) == 0)\n                s = (value / KiB) + \" k\";\n            else\n                s = value.ToString();\n\n            setString(section, subsection, name, s);\n        }\n\n        ///\t<summary>\n        /// Add or modify a configuration value. The parameters will result in a\n        ///\tconfiguration entry like this.\n        /// <para />\n        /// <pre>\n        /// [section &quot;subsection&quot;]\n        /// name = value\n        /// </pre>\n        ///\t</summary>\n        ///\t<param name=\"section\">Section name, e.g \"branch\"</param>\n        ///\t<param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        ///\t<param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        ///\t<param name=\"value\">Parameter value.</param>\n        public void setBoolean(string section, string subsection, string name, bool value)\n        {\n            setString(section, subsection, name, value ? \"true\" : \"false\");\n        }\n\n        ///\t<summary>\n        /// Add or modify a configuration value. The parameters will result in a\n        ///\tconfiguration entry like this.\n        /// <para />\n        /// <pre>\n        /// [section &quot;subsection&quot;]\n        /// name = value\n        /// </pre>\n        ///\t</summary>\n        ///\t<param name=\"section\">Section name, e.g \"branch\"</param>\n        ///\t<param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        ///\t<param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        ///\t<param name=\"value\">Parameter value.</param>\n        public void setString(string section, string subsection, string name, string value)\n        {\n            setStringList(section, subsection, name, new List<string> { value });\n        }\n\n        ///\t<summary>\n        /// Remove a configuration value.\n        /// </summary>\n        /// <param name=\"section\">Section name, e.g \"branch\".</param>\n        /// <param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        /// <param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        public void unset(string section, string subsection, string name)\n        {\n            setStringList(section, subsection, name, new List<string>());\n        }\n\n        /// <summary>\n        /// Remove all configuration values under a single section.\n        /// </summary>\n        /// <param name=\"section\">section name, e.g \"branch\"</param>\n        /// <param name=\"subsection\">optional subsection value, e.g. a branch name</param>\n        public void unsetSection(string section, string subsection)\n        {\n            State src, res;\n            do\n            {\n                src = _state.get();\n                res = unsetSection(src, section, subsection);\n            } while (!_state.compareAndSet(src, res));\n        }\n\n        private State unsetSection(State srcState, string section,\n                string subsection)\n        {\n            int max = srcState.EntryList.Count;\n            var r = new List<Entry>(max);\n\n            bool lastWasMatch = false;\n            foreach (Entry e in srcState.EntryList)\n            {\n                if (e.match(section, subsection))\n                {\n                    // Skip this record, it's for the section we are removing.\n                    lastWasMatch = true;\n                    continue;\n                }\n\n                if (lastWasMatch && e.section == null && e.subsection == null)\n                    continue; // skip this padding line in the section.\n                r.Add(e);\n            }\n\n            return newState(r);\n        }\n\n        ///\t<summary>\n        /// Set a configuration value.\n        /// <para />\n        /// <pre>\n        /// [section &quot;subsection&quot;]\n        /// name = value\n        /// </pre>\n        ///\t</summary><param name=\"section\">Section name, e.g \"branch\".</param>\n        ///\t<param name=\"subsection\">Optional subsection value, e.g. a branch name.</param>\n        /// <param name=\"name\">Parameter name, e.g. \"filemode\".</param>\n        /// <param name=\"values\">List of zero or more values for this key.</param>\n        public void setStringList(string section, string subsection, string name, List<string> values)\n        {\n            State src, res;\n            do\n            {\n                src = _state.get();\n                res = replaceStringList(src, section, subsection, name, values);\n            } while (!_state.compareAndSet(src, res));\n        }\n\n        private State replaceStringList(State srcState, string section, string subsection, string name, IList<string> values)\n        {\n            List<Entry> entries = copy(srcState, values);\n            int entryIndex = 0;\n            int valueIndex = 0;\n            int insertPosition = -1;\n\n            // Reset the first n Entry objects that match this input name.\n            //\n            while (entryIndex < entries.Count && valueIndex < values.Count)\n            {\n                Entry e = entries[entryIndex];\n                if (e.match(section, subsection, name))\n                {\n                    entries[entryIndex] = e.forValue(values[valueIndex++]);\n                    insertPosition = entryIndex + 1;\n                }\n                entryIndex++;\n            }\n\n            // Remove any extra Entry objects that we no longer need.\n            //\n            if (valueIndex == values.Count && entryIndex < entries.Count)\n            {\n                while (entryIndex < entries.Count)\n                {\n                    Entry e = entries[entryIndex++];\n                    if (e.match(section, subsection, name))\n                    {\n                        entries.RemoveAt(--entryIndex);\n                    }\n                }\n            }\n\n            // Insert new Entry objects for additional/new values.\n            //\n            if (valueIndex < values.Count && entryIndex == entries.Count)\n            {\n                if (insertPosition < 0)\n                {\n                    // We didn't find a matching key above, but maybe there\n                    // is already a section available that matches. Insert\n                    // after the last key of that section.\n                    //\n                    insertPosition = findSectionEnd(entries, section, subsection);\n                }\n\n                if (insertPosition < 0)\n                {\n                    // We didn't find any matching section header for this key,\n                    // so we must create a new section header at the end.\n                    //\n                    var e = new Entry { section = section, subsection = subsection };\n                    entries.Add(e);\n                    insertPosition = entries.Count;\n                }\n\n                while (valueIndex < values.Count)\n                {\n                    var e = new Entry\n                                {\n                                    section = section,\n                                    subsection = subsection,\n                                    name = name,\n                                    value = values[valueIndex++]\n                                };\n\n                    entries.Insert(insertPosition++, e);\n                }\n            }\n\n            return newState(entries);\n        }\n\n        private static List<Entry> copy(State src, ICollection<string> values)\n        {\n            // At worst we need to insert 1 line for each value, plus 1 line\n            // for a new section header. Assume that and allocate the space.\n            //\n            int max = src.EntryList.Count + values.Count + 1;\n            var r = new List<Entry>(max);\n            r.AddRange(src.EntryList);\n            return r;\n        }\n\n        private static int findSectionEnd(IList<Entry> entries, string section, string subsection)\n        {\n            for (int i = 0; i < entries.Count; i++)\n            {\n                Entry e = entries[i];\n                if (e.match(section, subsection, null))\n                {\n                    i++;\n                    while (i < entries.Count)\n                    {\n                        e = entries[i];\n                        if (e.match(section, subsection, e.name))\n                            i++;\n                        else\n                            break;\n                    }\n                    return i;\n                }\n            }\n            return -1;\n        }\n\n        ///\t<returns>\n        /// This configuration, formatted as a Git style text file.\n        /// </returns>\n        public string toText()\n        {\n            var o = new StringBuilder();\n            foreach (Entry e in _state.get().EntryList)\n            {\n                if (e.prefix != null)\n                    o.Append(e.prefix);\n                if (e.section != null && e.name == null)\n                {\n                    o.Append('[');\n                    o.Append(e.section);\n\n                    if (e.subsection != null)\n                    {\n                        o.Append(' ');\n                        o.Append('\"');\n                        o.Append(EscapeValue(e.subsection));\n                        o.Append('\"');\n                    }\n\n                    o.Append(']');\n                }\n                else if (e.section != null && e.name != null)\n                {\n                    if (e.prefix == null || string.Empty.Equals(e.prefix))\n                    {\n                        o.Append('\\t');\n                    }\n\n                    o.Append(e.name);\n\n                    if (MagicEmptyValue != e.value)\n                    {\n                        o.Append(\" =\");\n                        if (e.value != null)\n                        {\n                            o.Append(\" \");\n                            o.Append(EscapeValue(e.value));\n                        }\n                    }\n\n                    if (e.suffix != null)\n                    {\n                        o.Append(' ');\n                    }\n                }\n\n                if (e.suffix != null)\n                    o.Append(e.suffix);\n                {\n                    o.Append('\\n');\n                }\n            }\n            return o.ToString();\n        }\n\n        /// <summary>\n        /// Clear this configuration and reset to the contents of the parsed string.\n        ///\t</summary>\n        ///\t<param name=\"text\">\n        /// Git style text file listing configuration properties.\n        /// </param>\n        ///\t<exception cref=\"ConfigInvalidException\">\n        /// The text supplied is not formatted correctly. No changes were\n        /// made to this.</exception>\n        public void fromText(string text)\n        {\n            var newEntries = new List<Entry>();\n            var i = new ConfigReader(text);\n            Entry last = null;\n            var e = new Entry();\n\n            while (true)\n            {\n                int input = i.Read();\n                if (-1 == input)\n                {\n                    break;\n                }\n\n                var c = (char)input;\n                if ('\\n' == c)\n                {\n                    newEntries.Add(e);\n                    if (e.section != null)\n                        last = e;\n                    e = new Entry();\n                }\n                else if (e.suffix != null)\n                {\n                    // Everything up until the end-of-line is in the suffix.\n                    e.suffix += c;\n                }\n                else if (';' == c || '#' == c)\n                {\n                    // The rest of this line is a comment; put into suffix.\n                    e.suffix = new string(c, 1);\n                }\n                else if (e.section == null && char.IsWhiteSpace(c))\n                {\n                    // Save the leading whitespace (if any).\n                    if (e.prefix == null)\n                    {\n                        e.prefix = string.Empty;\n                    }\n                    e.prefix += c;\n                }\n                else if ('[' == c)\n                {\n                    // This is a section header.\n                    e.section = readSectionName(i);\n                    input = i.Read();\n                    if ('\"' == input)\n                    {\n                        e.subsection = ReadValue(i, true, '\"');\n                        input = i.Read();\n                    }\n\n                    if (']' != input)\n                    {\n                        throw new ConfigInvalidException(\"Bad group header\");\n                    }\n\n                    e.suffix = string.Empty;\n                }\n                else if (last != null)\n                {\n                    // Read a value.\n                    e.section = last.section;\n                    e.subsection = last.subsection;\n                    i.Reset();\n                    e.name = readKeyName(i);\n                    if (e.name.EndsWith(\"\\n\"))\n                    {\n                        e.name = e.name.Slice(0, e.name.Length - 1);\n                        e.value = MagicEmptyValue;\n                    }\n                    else\n                    {\n                        e.value = ReadValue(i, false, -1);\n                    }\n                }\n                else\n                {\n                    throw new ConfigInvalidException(\"Invalid line in config file\");\n                }\n            }\n\n            _state.set(newState(newEntries));\n        }\n\n        private static string ReadValue(ConfigReader i, bool quote, int eol)\n        {\n            var value = new StringBuilder();\n            bool space = false;\n            for (; ; )\n            {\n                int c = i.Read();\n                if (c < 0)\n                {\n                    if (value.Length == 0)\n                        throw new ConfigInvalidException(\"Unexpected end of config file\");\n                    break;\n                }\n\n                if ('\\n' == c)\n                {\n                    if (quote)\n                        throw new ConfigInvalidException(\"Newline in quotes not allowed\");\n                    i.Reset();\n                    break;\n                }\n\n                if (eol == c)\n                    break;\n\n                if (!quote)\n                {\n                    if (char.IsWhiteSpace((char)c))\n                    {\n                        space = true;\n                        continue;\n                    }\n\n                    if (';' == c || '#' == c)\n                    {\n                        i.Reset();\n                        break;\n                    }\n                }\n\n                if (space)\n                {\n                    if (value.Length > 0)\n                        value.Append(' ');\n                    space = false;\n                }\n\n                if ('\\\\' == c)\n                {\n                    c = i.Read();\n                    switch (c)\n                    {\n                        case -1:\n                            throw new ConfigInvalidException(\"End of file in escape\");\n\n                        case '\\n':\n                            continue;\n\n                        case 't':\n                            value.Append('\\t');\n                            continue;\n\n                        case 'b':\n                            value.Append('\\b');\n                            continue;\n\n                        case 'n':\n                            value.Append('\\n');\n                            continue;\n\n                        case '\\\\':\n                            value.Append('\\\\');\n                            continue;\n\n                        case '\"':\n                            value.Append('\"');\n                            continue;\n\n                        default:\n                            throw new ConfigInvalidException(\"Bad escape: \" + ((char)c));\n                    }\n                }\n\n                if ('\"' == c)\n                {\n                    quote = !quote;\n                    continue;\n                }\n\n                value.Append((char)c);\n            }\n\n            return value.Length > 0 ? value.ToString() : null;\n        }\n\n        private State newState()\n        {\n            return new State(new List<Entry>(), getBaseState());\n        }\n\n        private State newState(List<Entry> entries)\n        {\n            return new State(entries, getBaseState());\n        }\n\n        protected void clear()\n        {\n            _state.set(newState());\n        }\n\n        private static string readSectionName(ConfigReader i)\n        {\n            var name = new StringBuilder();\n            for (; ; )\n            {\n                int c = i.Read();\n                if (c < 0)\n                    throw new ConfigInvalidException(\"Unexpected end of config file\");\n\n                if (']' == c)\n                {\n                    i.Reset();\n                    break;\n                }\n\n                if (' ' == c || '\\t' == c)\n                {\n                    for (; ; )\n                    {\n                        c = i.Read();\n                        if (c < 0)\n                            throw new ConfigInvalidException(\"Unexpected end of config file\");\n\n                        if ('\"' == c)\n                        {\n                            i.Reset();\n                            break;\n                        }\n\n                        if (' ' == c || '\\t' == c)\n                        {\n                            continue;\n                        }\n                        throw new ConfigInvalidException(\"Bad section entry: \" + name);\n                    }\n                    break;\n                }\n\n                if (char.IsLetterOrDigit((char)c) || '.' == c || '-' == c)\n                    name.Append((char)c);\n                else\n                    throw new ConfigInvalidException(\"Bad section entry: \" + name);\n            }\n            return name.ToString();\n        }\n\n        private static string readKeyName(ConfigReader i)\n        {\n            var name = new StringBuffer();\n            for (; ; )\n            {\n                int c = i.Read();\n                if (c < 0)\n                    throw new ConfigInvalidException(\"Unexpected end of config file\");\n\n                if ('=' == c)\n                    break;\n\n                if (' ' == c || '\\t' == c)\n                {\n                    for (; ; )\n                    {\n                        c = i.Read();\n                        if (c < 0)\n                            throw new ConfigInvalidException(\"Unexpected end of config file\");\n\n                        if ('=' == c)\n                            break;\n\n                        if (';' == c || '#' == c || '\\n' == c)\n                        {\n                            i.Reset();\n                            break;\n                        }\n\n                        if (' ' == c || '\\t' == c)\n                            continue;\n                        throw new ConfigInvalidException(\"Bad entry delimiter\");\n                    }\n                    break;\n                }\n\n                if (char.IsLetterOrDigit((char)c) || c == '-')\n                {\n                    name.append((char)c);\n                }\n                else if ('\\n' == c)\n                {\n                    i.Reset();\n                    name.append((char)c);\n                    break;\n                }\n                else\n                    throw new ConfigInvalidException(\"Bad entry name: \" + name);\n            }\n\n            return name.ToString();\n        }\n\n        #region Nested type: ConfigReader\n\n        private class ConfigReader\n        {\n            private readonly string data;\n            private readonly int len;\n            private int position;\n\n            public ConfigReader(string text)\n            {\n                data = text;\n                len = data.Length;\n            }\n\n            public int Read()\n            {\n                int ret = -1;\n                if (position < len)\n                {\n                    ret = data[position];\n                    position++;\n                }\n                return ret;\n            }\n\n            public void Reset()\n            {\n                // no idea what the java pendant actually does..\n                //position = 0;\n                --position;\n            }\n        }\n\n        #endregion\n\n        #region Nested type: Entry\n\n        /// <summary>\n        /// The configuration file entry.\n        /// </summary>\n        internal class Entry\n        {\n            /// <summary>\n            /// The key name.\n            /// </summary>\n            public string name;\n\n            /// <summary>\n            /// The text content before entry.\n            /// </summary>\n            public string prefix;\n\n            /// <summary>\n            /// The section name for the entry.\n            /// </summary>\n            public string section;\n\n            /// <summary>\n            /// Subsection name.\n            /// </summary>\n            public string subsection;\n\n            /// <summary>\n            /// The text content after entry.\n            /// </summary>\n            public string suffix;\n\n            /// <summary>\n            /// The value\n            /// </summary>\n            public string value;\n\n            public Entry forValue(string newValue)\n            {\n                var e = new Entry\n                            {\n                                prefix = prefix,\n                                section = section,\n                                subsection = subsection,\n                                name = name,\n                                value = newValue,\n                                suffix = suffix\n                            };\n                return e;\n            }\n\n            public bool match(string aSection, string aSubsection, string aKey)\n            {\n                return eqIgnoreCase(section, aSection)\n                       && eqSameCase(subsection, aSubsection)\n                       && eqIgnoreCase(name, aKey);\n            }\n\n            public bool match(string aSection, string aSubsection)\n            {\n                return eqIgnoreCase(section, aSection)\n                        && eqSameCase(subsection, aSubsection);\n            }\n            private static bool eqIgnoreCase(string a, string b)\n            {\n                if (a == null && b == null)\n                    return true;\n                if (a == null || b == null)\n                    return false;\n                return StringUtils.equalsIgnoreCase(a, b);\n            }\n\n            private static bool eqSameCase(string a, string b)\n            {\n                if (a == null && b == null)\n                    return true;\n                if (a == null || b == null)\n                    return false;\n                return a.Equals(b);\n            }\n        }\n\n        #endregion\n\n        #region Nested type: SectionParser\n\n        ///\t<summary>\n        /// Parses a section of the configuration into an application model object.\n        ///\t<para />\n        ///\tInstances must implement hashCode and equals such that model objects can\n        ///\tbe cached by using the <see cref=\"SectionParser{T}\"/> as a key of a\n        /// Dictionary.\n        ///\t<para />\n        ///\tAs the <see cref=\"SectionParser{T}\"/> itself is used as the key of the internal\n        ///\tDictionary applications should be careful to ensure the SectionParser key\n        ///\tdoes not retain unnecessary application state which may cause memory to\n        ///\tbe held longer than expected.\n        ///\t</summary>\n        /// <typeparam name=\"T\">type of the application model created by the parser.</typeparam>\n        public interface SectionParser<T>\n        {\n            ///\t<summary>\n            /// Create a model object from a configuration.\n            ///\t</summary>\n            ///\t<param name=\"cfg\">\n            ///\tThe configuration to read values from.\n            /// </param>\n            ///\t<returns>The application model instance.</returns>\n            T parse(Config cfg);\n        }\n\n        #endregion\n\n        #region Nested type: State\n\n        internal class State\n        {\n            public readonly State baseState;\n            public readonly Dictionary<object, object> Cache;\n            public readonly List<Entry> EntryList;\n\n            public State(List<Entry> entries, State @base)\n            {\n                EntryList = entries;\n                Cache = new Dictionary<object, object>();\n                baseState = @base;\n            }\n        }\n\n        #endregion\n\n        #region Nested type: SubsectionNames\n\n        private class SubsectionNames : SectionParser<IList<string>>\n        {\n            private readonly string section;\n\n            public SubsectionNames(string sectionName)\n            {\n                section = sectionName;\n            }\n\n            #region SectionParser<List<string>> Members\n\n            public IList<string> parse(Config cfg)\n            {\n                var result = new List<string>();\n                while (cfg != null)\n                {\n                    foreach (Entry e in cfg._state.get().EntryList)\n                    {\n                        if (e.subsection != null && e.name == null && StringUtils.equalsIgnoreCase(section, e.section))\n                            result.Add(e.subsection);\n                    }\n                    cfg = cfg._baseConfig;\n                }\n                return result.AsReadOnly();\n            }\n\n            #endregion\n\n            public override int GetHashCode()\n            {\n                return section.GetHashCode();\n            }\n\n            public override bool Equals(object obj)\n            {\n                SubsectionNames oSub = (obj as SubsectionNames);\n                if (oSub != null)\n                    return section.Equals(oSub.section);\n                return false;\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ConsoleUserInfoProvider.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n    \n    public class ConsoleUserInfoProvider : UserInfoProvider\n    {\n        public override bool promptPassword(string message)\n        {\n            Console.Write(Environment.NewLine + message + \": \");\n            Password = Console.ReadLine();\n            Console.WriteLine();\n            return true;\n        }\n\n        public override bool promptPassphrase(string message)\n        {\n            Console.Write(Environment.NewLine + message + \": \");\n            Passphrase = Console.ReadLine();\n            Console.WriteLine();\n            return true;\n        }\n\n        public override bool promptYesNo(string message)\n        {\n            Console.Write(Environment.NewLine + message + \": \");\n            var answer = Console.ReadKey();\n            Console.WriteLine();\n            return answer.KeyChar == 'Y' || answer.KeyChar == 'y';\n        }\n\n        public override void showMessage(string message)\n        {\n            Console.WriteLine(message);\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Constants.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\nusing System;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n    public static class Constants\n    {\n        /// <summary>\n        /// Hash function used natively by Git for all objects.\n        /// </summary>\n        private const string HASH_FUNCTION = \"SHA-1\";\n\n        /// <summary>\n        /// A Git object hash is 160 bits, i.e. 20 bytes.\n        /// <para>\n        /// Changing this assumption is not going to be as easy as changing this declaration.\n        /// </para>\n        /// </summary>\n        public const int OBJECT_ID_LENGTH = 20;\n\n        /// <summary>\n        /// A Git object can be expressed as a 40 character string of hexadecimal digits. <see cref=\"OBJECT_ID_LENGTH\"/>\n        /// </summary>\n        public const int OBJECT_ID_STRING_LENGTH = OBJECT_ID_LENGTH * 2;\n\n        /// <summary>\n        /// Special name for the \"HEAD\" symbolic-ref.\n        /// </summary>\n        public const string HEAD = \"HEAD\";\n\n        /// <summary>\n        /// Text string that identifies an object as a commit.\n        /// <para />\n        /// Commits connect trees into a string of project histories, where each\n        /// commit is an assertion that the best way to continue is to use this other\n        /// tree (set of files).\n        /// </summary>\n        public const string TYPE_COMMIT = \"commit\";\n\n        /// <summary>\n        /// Text string that identifies an object as a blob.\n        /// <para />\n        /// Blobs store whole file revisions. They are used for any user file, as\n        /// well as for symlinks. Blobs form the bulk of any project's storage space.\n        /// </summary>\n        public const string TYPE_BLOB = \"blob\";\n\n        /// <summary>\n        /// Text string that identifies an object as a tree.\n        /// <para />\n        /// Trees attach object ids (hashes) to names and file modes. The normal use\n        /// for a tree is to store a version of a directory and its contents.\n        /// </summary>\n        public const string TYPE_TREE = \"tree\";\n\n        /// <summary>\n        /// Text string that identifies an object as an annotated tag.\n        /// <para />\n        /// Annotated tags store a pointer to any other object, and an additional\n        /// message. It is most commonly used to record a stable release of the\n        /// project.\n        /// </summary>\n        public const string TYPE_TAG = \"tag\";\n\n        public static readonly byte[] EncodedTypeCommit = encodeASCII(TYPE_COMMIT);\n        public static readonly byte[] EncodedTypeBlob = encodeASCII(TYPE_BLOB);\n        public static readonly byte[] EncodedTypeTree = encodeASCII(TYPE_TREE);\n        public static readonly byte[] EncodedTypeTag = encodeASCII(TYPE_TAG);\n\n        /// <summary>\n        /// An unknown or invalid object type code.\n        /// </summary>\n        public const int OBJ_BAD = -1;\n\n        /// <summary>\n        /// In-pack object type: extended types.\n        /// <para />\n        /// This header code is reserved for future expansion. It is currently\n        /// undefined/unsupported.\n        /// </summary>\n        public const int OBJ_EXT = 0;\n\n        /// <summary>\n        /// In-pack object type: commit.\n        /// <para />\n        /// Indicates the associated object is a commit.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// <seealso cref=\"TYPE_COMMIT\"/>\n        /// </summary>\n        public const int OBJ_COMMIT = 1;\n\n        /// <summary>\n        /// In-pack object type: tree.\n        /// <para />\n        /// Indicates the associated object is a tree.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        /// <seealso cref=\"TYPE_BLOB\"/>\n        public const int OBJ_TREE = 2;\n\n        /// <summary>\n        /// In-pack object type: blob.\n        /// <para />\n        /// Indicates the associated object is a blob.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        /// <seealso cref=\"TYPE_BLOB\"/>\n        public const int OBJ_BLOB = 3;\n\n        /// <summary>\n        /// In-pack object type: annotated tag.\n        /// <para />\n        /// Indicates the associated object is an annotated tag.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        /// <seealso cref=\"TYPE_TAG\"/>\n        public const int OBJ_TAG = 4;\n\n        /// <summary>\n        /// In-pack object type: reserved for future use.\n        /// </summary>\n        public const int OBJ_TYPE_5 = 5;\n\n        /// <summary>\n        /// In-pack object type: offset delta\n        /// <para />\n        /// Objects stored with this type actually have a different type which must\n        /// be obtained from their delta base object. Delta objects store only the\n        /// changes needed to apply to the base object in order to recover the\n        /// original object.\n        /// <para />\n        /// An offset delta uses a negative offset from the start of this object to\n        /// refer to its delta base. The base object must exist in this packfile\n        /// (even in the case of a thin pack).\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        public const int OBJ_OFS_DELTA = 6;\n\n        /// <summary>\n        /// In-pack object type: reference delta\n        /// <para />\n        /// Objects stored with this type actually have a different type which must\n        /// be obtained from their delta base object. Delta objects store only the\n        /// changes needed to apply to the base object in order to recover the\n        /// original object.\n        /// <para />\n        /// A reference delta uses a full object id (hash) to reference the delta\n        /// base. The base object is allowed to be omitted from the packfile, but\n        /// only in the case of a thin pack being transferred over the network.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        public const int OBJ_REF_DELTA = 7;\n\n        /// <summary>\n        /// Pack file signature that occurs at file header - identifies file as Git\n        /// packfile formatted.\n        /// <para />\n        /// <b>This constant is fixed and is defined by the Git packfile format.</b>\n        /// </summary>\n        public static readonly byte[] PACK_SIGNATURE = { (byte)'P', (byte)'A', (byte)'C', (byte)'K' };\n\n        /// <summary>\n        /// Native character encoding for commit messages, file names...\n        /// </summary>\n        public static readonly Encoding CHARSET = Charset.forName(\"UTF-8\");\n\n        /// <summary>\n        /// Default main branch name\n        /// </summary>\n        public const string MASTER = \"master\";\n\n        /// <summary>\n        /// Prefix for branch refs\n        /// </summary>\n        public const string R_HEADS = \"refs/heads/\";\n\n        /// <summary>\n        /// Prefix for remotes refs\n        /// </summary>\n        public const string R_REMOTES = \"refs/remotes/\";\n\n        /// <summary>\n        /// Prefix for tag refs\n        /// </summary>\n        public const string R_TAGS = \"refs/tags/\";\n\n        /// <summary>\n        /// Prefix for any ref\n        /// </summary>\n        public const string R_REFS = \"refs/\";\n\n        /// <summary>\n        /// Logs folder name\n        /// </summary>\n        public const string LOGS = \"logs\";\n\n        /// <summary>\n        /// Info refs folder\n        /// </summary>\n        public const string INFO_REFS = \"info/refs\";\n\n        /// <summary>\n        /// Packed refs file\n        /// </summary>\n        public const string PACKED_REFS = \"packed-refs\";\n\n        /// <summary>\n        /// The environment variable that contains the system user name\n        /// </summary>\n        public const string OS_USER_NAME_KEY = \"user.name\";\n\n        /// <summary>\n        /// The environment variable that contains the author's name\n        /// </summary>\n        public const string GIT_AUTHOR_NAME_KEY = \"GIT_AUTHOR_NAME\";\n\n        /// <summary>\n        /// The environment variable that contains the author's email\n        /// </summary>\n        public const string GIT_AUTHOR_EMAIL_KEY = \"GIT_AUTHOR_EMAIL\";\n\n        /// <summary>\n        /// The environment variable that contains the commiter's name\n        /// </summary>\n        public const string GIT_COMMITTER_NAME_KEY = \"GIT_COMMITTER_NAME\";\n\n        /// <summary>\n        /// The environment variable that contains the commiter's email\n        /// </summary>\n        public const string GIT_COMMITTER_EMAIL_KEY = \"GIT_COMMITTER_EMAIL\";\n\n        /// <summary>\n        /// The environment variable that limits how close to the root of the file systems JGit will traverse when looking for a repository root.\n        /// </summary>\n        public const string GIT_CEILING_DIRECTORIES_KEY = \"GIT_CEILING_DIRECTORIES\";\n\n        /// <summary>\n        /// The environment variable that tells us which directory is the \".git\" directory\n        /// </summary>\n        public const string GIT_DIR_KEY = \"GIT_DIR\";\n\n        /// <summary>\n        /// The environment variable that tells us which directory is the working directory.\n        /// </summary>\n        public const string GIT_WORK_TREE_KEY = \"GIT_WORK_TREE\";\n\n        /// <summary>\n        /// The environment variable that tells us which file holds the Git index.\n        /// </summary>\n        public const string GIT_INDEX_KEY = \"GIT_INDEX\";\n\n        /// <summary>\n        /// The environment variable that tells us where objects are stored\n        /// </summary>\n        public const string GIT_OBJECT_DIRECTORY_KEY = \"GIT_OBJECT_DIRECTORY\";\n\n        /// <summary>\n        /// The environment variable that tells us where to look for objects, besides the default objects directory.\n        /// </summary>\n        public const string GIT_ALTERNATE_OBJECT_DIRECTORIES_KEY = \"GIT_ALTERNATE_OBJECT_DIRECTORIES\";\n\n        /// <summary>\n        /// Default value for the user name if no other information is available\n        /// </summary>\n        public const string UNKNOWN_USER_DEFAULT = \"unknown-user\";\n\n        /// <summary>\n        /// Beginning of the common \"Signed-off-by: \" commit message line\n        /// </summary>\n        public const string SIGNED_OFF_BY_TAG = \"Signed-off-by: \";\n\n        /// <summary>\n        /// Default remote name used by clone, push and fetch operations\n        /// </summary>\n        public const string DEFAULT_REMOTE_NAME = \"origin\";\n\n        /// <summary>\n        /// Default name for the Git repository directory\n        /// </summary>\n        public const string DOT_GIT = \".git\";\n\n        /// <summary>\n        /// A bare repository typically ends with this string\n        /// </summary>\n        public const string DOT_GIT_EXT = \".git\";\n\n        /// <summary>\n        /// A gitignore file name\n        /// </summary>\n        public const string GITIGNORE_FILENAME = \".gitignore\";\n\n        /// <summary>\n        /// Create a new digest function for objects.\n        /// </summary>\n        /// <returns>A new digest object.</returns>\n        public static MessageDigest newMessageDigest()\n        {\n            return MessageDigest.getInstance(HASH_FUNCTION);\n        }\n\n        /// <summary>\n        /// Convert an OBJ_* type constant to a TYPE_* type constant.\n        /// </summary>\n        /// <param name=\"typeCode\">\n        /// typeCode the type code, from a pack representation.\n        /// </param>\n        /// <returns>The canonical string name of this type.</returns>\n        public static string typeString(int typeCode)\n        {\n            switch (typeCode)\n            {\n                case OBJ_COMMIT:\n                    return TYPE_COMMIT;\n                case OBJ_TREE:\n                    return TYPE_TREE;\n                case OBJ_BLOB:\n                    return TYPE_BLOB;\n                case OBJ_TAG:\n                    return TYPE_TAG;\n                default:\n                    throw new ArgumentException(\"Bad object type: \" + typeCode);\n            }\n        }\n\n        /// <summary>\n        /// Convert an OBJ_* type constant to an ASCII encoded string constant.\n        /// <para />\n        /// The ASCII encoded string is often the canonical representation of\n        /// the type within a loose object header, or within a tag header.\n        /// </summary>\n        /// <param name=\"typeCode\">\n        /// typeCode the type code, from a pack representation.\n        /// </param>\n        /// <returns>\n        /// The canonical ASCII encoded name of this type.\n        /// </returns>\n        public static byte[] encodedTypeString(int typeCode)\n        {\n            switch (typeCode)\n            {\n                case OBJ_COMMIT:\n                    return EncodedTypeCommit;\n                case OBJ_TREE:\n                    return EncodedTypeTree;\n                case OBJ_BLOB:\n                    return EncodedTypeBlob;\n                case OBJ_TAG:\n                    return EncodedTypeTag;\n                default:\n                    throw new ArgumentException(\"Bad object type: \" + typeCode);\n            }\n        }\n\n        /// <summary>\n        /// Parse an encoded type string into a type constant.\n        /// </summary>\n        /// <param name=\"id\">\n        /// <see cref=\"ObjectId\" /> this type string came from; may be null if \n        /// that is not known at the time the parse is occurring.\n        /// </param>\n        /// <param name=\"typeString\">string version of the type code.</param>\n        /// <param name=\"endMark\">\n        /// Character immediately following the type string. Usually ' '\n        /// (space) or '\\n' (line feed).\n        /// </param>\n        /// <param name=\"offset\">\n        /// Position within <paramref name=\"typeString\"/> where the parse\n        /// should start. Updated with the new position (just past\n        /// <paramref name=\"endMark\"/> when the parse is successful).\n        /// </param>\n        /// <returns>\n        /// A type code constant (one of <see cref=\"OBJ_BLOB\"/>,\n        /// <see cref=\"OBJ_COMMIT\"/>, <see cref=\"OBJ_TAG\"/>, <see cref=\"OBJ_TREE\"/>\n        /// </returns>\n        /// <exception cref=\"CorruptObjectException\"></exception>\n        public static int decodeTypeString(AnyObjectId id, byte[] typeString, byte endMark, MutableInteger offset)\n        {\n            try\n            {\n                int position = offset.value;\n                switch (typeString[position])\n                {\n                    case (byte)'b':\n                        if (typeString[position + 1] != (byte)'l'\n                            || typeString[position + 2] != (byte)'o'\n                            || typeString[position + 3] != (byte)'b'\n                            || typeString[position + 4] != endMark)\n                        {\n                            throw new CorruptObjectException(id, \"invalid type\");\n                        }\n                        offset.value = position + 5;\n                        return OBJ_BLOB;\n\n                    case (byte)'c':\n                        if (typeString[position + 1] != (byte)'o'\n                                || typeString[position + 2] != (byte)'m'\n                                || typeString[position + 3] != (byte)'m'\n                                || typeString[position + 4] != (byte)'i'\n                                || typeString[position + 5] != (byte)'t'\n                                || typeString[position + 6] != endMark)\n                        {\n                            throw new CorruptObjectException(id, \"invalid type\");\n                        }\n                        offset.value = position + 7;\n                        return OBJ_COMMIT;\n\n                    case (byte)'t':\n                        switch (typeString[position + 1])\n                        {\n                            case (byte)'a':\n                                if (typeString[position + 2] != (byte)'g'\n                                    || typeString[position + 3] != endMark)\n                                    throw new CorruptObjectException(id, \"invalid type\");\n                                offset.value = position + 4;\n                                return OBJ_TAG;\n\n                            case (byte)'r':\n                                if (typeString[position + 2] != (byte)'e'\n                                        || typeString[position + 3] != (byte)'e'\n                                        || typeString[position + 4] != endMark)\n                                    throw new CorruptObjectException(id, \"invalid type\");\n                                offset.value = position + 5;\n                                return OBJ_TREE;\n\n                            default:\n                                throw new CorruptObjectException(id, \"invalid type\");\n                        }\n\n                    default:\n                        throw new CorruptObjectException(id, \"invalid type\");\n                }\n            }\n            catch (IndexOutOfRangeException)\n            {\n                throw new CorruptObjectException(id, \"invalid type\");\n            }\n        }\n\n        /// <summary>\n        /// Convert an integer into its decimal representation.\n        /// </summary>\n        /// <param name=\"s\">the integer to convert.</param>\n        /// <returns>\n        /// Decimal representation of the input integer. The returned array\n        /// is the smallest array that will hold the value.\n        /// </returns>\n        public static byte[] encodeASCII(long s)\n        {\n            return encodeASCII(Convert.ToString(s));\n        }\n\n        /// <summary>\n        /// Convert a string to US-ASCII encoding.       \n        /// </summary>\n        /// <param name=\"s\">\n        /// The string to convert. Must not contain any characters over\n        /// 127 (outside of 7-bit ASCII).\n        /// </param>\n        /// <returns>\n        /// A byte array of the same Length as the input string, holding the\n        /// same characters, in the same order.\n        /// </returns>\n        /// <exception cref=\"ArgumentException\">\n        /// The input string contains one or more characters outside of\n        /// the 7-bit ASCII character space.\n        /// </exception>\n        public static byte[] encodeASCII(string s)\n        {\n            var r = new byte[s.Length];\n            for (int k = r.Length - 1; k >= 0; k--)\n            {\n                char c = s[k];\n                if (c > 127)\n                {\n                    throw new ArgumentException(\"Not ASCII string: \" + s);\n                }\n                r[k] = (byte)c;\n            }\n            return r;\n        }\n\n        /// <summary>\n        /// Convert a string to a byte array in UTF-8 character encoding.\n        /// </summary>\n        /// <param name=\"str\">\n        /// The string to convert. May contain any Unicode characters.\n        /// </param>\n        /// <returns>\n        /// A byte array representing the requested string, encoded using the\n        /// default character encoding (UTF-8).\n        /// </returns>\n        public static byte[] encode(string str)\n        {\n            return CHARSET.GetBytes(str);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/CoreConfig.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n    public class CoreConfig\n    {\n        private class SectionParser : Config.SectionParser<CoreConfig>\n        {\n            public CoreConfig parse(Config cfg)\n            {\n                return new CoreConfig(cfg);\n            }\n        }\n\n        public static Config.SectionParser<CoreConfig> KEY = new SectionParser();\n\n        private readonly int compression;\n        private readonly int packIndexVersion;\n        private readonly bool logAllRefUpdates;\n        private readonly string excludesFile;\n\n        private CoreConfig(Config rc)\n        {\n            compression = rc.getInt(\"core\", \"compression\", Deflater.DEFAULT_COMPRESSION);\n            packIndexVersion = rc.getInt(\"pack\", \"indexversion\", 2);\n            logAllRefUpdates = rc.getBoolean(\"core\", \"logallrefupdates\", true);\n            excludesFile = rc.getString(\"core\", null, \"excludesfile\");\n        }\n\n        public string getExcludesFile()\n        {\n            return excludesFile;\n        }\n\n        public int getCompression()\n        {\n            return compression;\n        }\n\n        public int getPackIndexVersion()\n        {\n            return packIndexVersion;\n        }\n\n        ///<summary>\n        ///Return whether to log all refUpdates\n        ///</summary>\n        public bool isLogAllRefUpdates()\n        {\n            return logAllRefUpdates;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/DeltaOfsPackedObjectLoader.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    class DeltaOfsPackedObjectLoader : DeltaPackedObjectLoader\n    {\n        private readonly long _deltaBase;\n\n        public DeltaOfsPackedObjectLoader(PackFile pr, long dataOffset, long objectOffset, int deltaSz, long @base)\n            : base(pr, dataOffset, objectOffset, deltaSz)\n        {\n            _deltaBase = @base;\n        }\n\n        public override PackedObjectLoader GetBaseLoader(WindowCursor windowCursor)\n        {\n            return PackFile.ResolveBase(windowCursor, _deltaBase);\n        }\n\n    \tpublic override int RawType\n    \t{\n    \t\tget { return Constants.OBJ_OFS_DELTA; }\n    \t}\n\n    \tpublic override ObjectId DeltaBase\n    \t{\n    \t\tget\n    \t\t{\n    \t\t\tObjectId id = PackFile.FindObjectForOffset(_deltaBase);\n    \t\t\tif (id == null)\n    \t\t\t{\n    \t\t\t\tthrow new CorruptObjectException(\"Offset-written delta base for object not found in a pack\");\n    \t\t\t}\n    \t\t\treturn id;\n    \t\t}\n    \t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DeltaPackedObjectLoader.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n\t/// Reader for a deltified object Stored in a pack file.\n    /// </summary>\n    public abstract class DeltaPackedObjectLoader : PackedObjectLoader\n    {\n        private const int ObjCommit = Constants.OBJ_COMMIT;\n        private readonly int _deltaSize;\n\n    \tprotected DeltaPackedObjectLoader(PackFile pr, long dataOffset, long objectOffset, int deltaSz)\n            : base(pr, dataOffset, objectOffset)\n        {\n            Type = -1;\n            _deltaSize = deltaSz;\n        }\n\n        public override void Materialize(WindowCursor curs)\n        {\n\t\t\tif ( curs == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"curs\");\n\t\t\t}\n\t\t\t\n            if (CachedBytes != null)\n            {\n                return;\n            }\n\n            if (Type != ObjCommit)\n            {\n                UnpackedObjectCache.Entry cache = PackFile.readCache(DataOffset);\n                if (cache != null)\n                {\n                    curs.Release();\n                    Type = cache.type;\n                    Size = cache.data.Length;\n                    CachedBytes = cache.data;\n                    return;\n                }\n            }\n\n            try\n            {\n                PackedObjectLoader baseLoader = GetBaseLoader(curs);\n                baseLoader.Materialize(curs);\n                CachedBytes = BinaryDelta.Apply(baseLoader.CachedBytes, PackFile.decompress(DataOffset, _deltaSize, curs));\n                curs.Release();\n                Type = baseLoader.Type;\n                Size = CachedBytes.Length;\n                if (Type != ObjCommit)\n                {\n                \tPackFile.saveCache(DataOffset, CachedBytes, Type);\n                }\n            }\n            catch (IOException dfe)\n            {\n\t\t\t\tthrow new CorruptObjectException(\"object at \" + DataOffset + \" in \"\n                    + PackFile.File.FullName + \" has bad zlib stream\", dfe);\n            }\n        }\n\n    \tpublic override long RawSize\n    \t{\n    \t\tget { return _deltaSize; }\n    \t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"windowCursor\">\n\t\t/// Temporary thread storage during data access.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// The object loader for the base object\n\t\t/// </returns>\n        public abstract PackedObjectLoader GetBaseLoader(WindowCursor windowCursor);\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DeltaRefPackedObjectLoader.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n\t/// Reads a deltified object which uses an <see cref=\"ObjectId\"/> to find its base.\n    /// </summary>\n    public class DeltaRefPackedObjectLoader : DeltaPackedObjectLoader\n    {\n        private readonly ObjectId _deltaBase;\n\n        public DeltaRefPackedObjectLoader(PackFile pr, long dataOffset, long objectOffset, int deltaSz, ObjectId @base)\n            : base(pr, dataOffset, objectOffset, deltaSz)\n        {\n            _deltaBase = @base;\n        }\n\n        public override PackedObjectLoader GetBaseLoader(WindowCursor windowCursor)\n        {\n            PackedObjectLoader or = PackFile.Get(windowCursor, _deltaBase);\n            if (or == null)\n            {\n            \tthrow new MissingObjectException(_deltaBase, \"delta base\");\n            }\n            return or;\n        }\n\n    \tpublic override int RawType\n    \t{\n    \t\tget { return Constants.OBJ_REF_DELTA; }\n    \t}\n\n    \tpublic override ObjectId DeltaBase\n    \t{\n    \t\tget { return _deltaBase; }\n    \t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Diff/DiffFormatter.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Johannes E. Schindelin <johannes.schindelin@gmx.de>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Patch;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Diff\n{\n\t/// <summary>\n\t/// Format an <seealso cref=\"EditList\"/> as a Git style unified patch script.\n\t/// </summary>\n\tpublic class DiffFormatter\n\t{\n\t\tprivate static readonly byte[] NoNewLine = \n\t\t\tConstants.encodeASCII(\"\\\\ No newline at end of file\\n\");\n\n\t\tprivate int _context;\n\n\t\t/// <summary>\n\t\t/// Create a new formatter with a default level of context.\n\t\t/// </summary>\n\t\tpublic DiffFormatter()\n\t\t{\n\t\t\tsetContext(3);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Change the number of lines of context to display.\n\t\t///\t</summary>\n\t\t///\t<param name=\"lineCount\">\n\t\t/// Number of lines of context to see before the first\n\t\t/// modification and After the last modification within a hunk of\n\t\t/// the modified file.\n\t\t/// </param>\n\t\tpublic void setContext(int lineCount)\n\t\t{\n\t\t\tif (lineCount < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"context must be >= 0\");\n\t\t\t}\n\n\t\t\t_context = lineCount;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Format a patch script, reusing a previously parsed FileHeader.\n\t\t///\t<para />\n\t\t///\tThis formatter is primarily useful for editing an existing patch script\n\t\t///\tto increase or reduce the number of lines of context within the script.\n\t\t///\tAll header lines are reused as-is from the supplied FileHeader.\n\t\t/// </summary>\n\t\t/// <param name=\"out\">stream to write the patch script out to.</param>\n\t\t/// <param name=\"head\">existing file header containing the header lines to copy.</param>\n\t\t/// <param name=\"a\">\n\t\t/// Text source for the pre-image version of the content. \n\t\t/// This must match the content of <seealso cref=\"FileHeader.getOldId()\"/>.\n\t\t/// </param>\n\t\t/// <param name=\"b\">writing to the supplied stream failed.</param>\n\t\tpublic void format(Stream @out, FileHeader head, RawText a, RawText b)\n\t\t{\n\t\t\tif ( head == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"head\");\n\t\t\t}\n\t\t\tif ( @out == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"out\");\n\t\t\t}\n\t\t\t\n\t\t\t// Reuse the existing FileHeader as-is by blindly copying its\n\t\t\t// header lines, but avoiding its hunks. Instead we recreate\n\t\t\t// the hunks from the text instances we have been supplied.\n\t\t\t//\n\t\t\tint start = head.StartOffset;\n\t\t\tint end = head.EndOffset;\n\n\t\t\tif (!head.Hunks.isEmpty())\n\t\t\t{\n\t\t\t\tend = head.Hunks[0].StartOffset;\n\t\t\t}\n\n\t\t\t@out.Write(head.Buffer, start, end - start);\n\n\t\t\tFormatEdits(@out, a, b, head.ToEditList());\n\t\t}\n\n        /// <summary>\n        /// Formats a list of edits in unified diff format\n        /// </summary>\n        /// <param name=\"out\">where the unified diff is written to</param>\n        /// <param name=\"a\">the text A which was compared</param>\n        /// <param name=\"b\">the text B which was compared</param>\n        /// <param name=\"edits\">some differences which have been calculated between A and B</param>\n\t\tpublic void FormatEdits(Stream @out, RawText a, RawText b, EditList edits)\n\t\t{\n\t\t\tfor (int curIdx = 0; curIdx < edits.Count; /* */)\n\t\t\t{\n\t\t\t\tEdit curEdit = edits.get(curIdx);\n\t\t\t\tint endIdx = FindCombinedEnd(edits, curIdx);\n\t\t\t\tEdit endEdit = edits.get(endIdx);\n\n\t\t\t\tint aCur = Math.Max(0, curEdit.BeginA - _context);\n\t\t\t\tint bCur = Math.Max(0, curEdit.BeginB - _context);\n\t\t\t\tint aEnd = Math.Min(a.size(), endEdit.EndA + _context);\n\t\t\t\tint bEnd = Math.Min(b.size(), endEdit.EndB + _context);\n\n\t\t\t\tWriteHunkHeader(@out, aCur, aEnd, bCur, bEnd);\n\n\t\t\t\twhile (aCur < aEnd || bCur < bEnd)\n\t\t\t\t{\n\t\t\t\t\tif (aCur < curEdit.BeginA || endIdx + 1 < curIdx)\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteLine(@out, ' ', a, aCur);\n\t\t\t\t\t\taCur++;\n\t\t\t\t\t\tbCur++;\n\t\t\t\t\t}\n\t\t\t\t\telse if (aCur < curEdit.EndA)\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteLine(@out, '-', a, aCur++);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (bCur < curEdit.EndB)\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteLine(@out, '+', b, bCur++);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (End(curEdit, aCur, bCur) && ++curIdx < edits.Count)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurEdit = edits.get(curIdx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void WriteHunkHeader(Stream @out, int aCur, int aEnd, int bCur, int bEnd)\n\t\t{\n\t\t\t@out.WriteByte(Convert.ToByte('@'));\n\t\t\t@out.WriteByte(Convert.ToByte('@'));\n\t\t\tWriteRange(@out, '-', aCur + 1, aEnd - aCur);\n\t\t\tWriteRange(@out, '+', bCur + 1, bEnd - bCur);\n\t\t\t@out.WriteByte(Convert.ToByte(' '));\n\t\t\t@out.WriteByte(Convert.ToByte('@'));\n\t\t\t@out.WriteByte(Convert.ToByte('@'));\n\t\t\t@out.WriteByte(Convert.ToByte('\\n'));\n\t\t}\n\n\t\tprivate static void WriteRange(Stream @out, char prefix, int begin, int cnt)\n\t\t{\n\t\t\t@out.WriteByte(Convert.ToByte(' '));\n\t\t\t@out.WriteByte(Convert.ToByte(prefix));\n\n\t\t\tswitch (cnt)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t// If the range is empty, its beginning number must be the\n\t\t\t\t\t// line just before the range, or 0 if the range is at the\n\t\t\t\t\t// start of the file stream. Here, begin is always 1 based,\n\t\t\t\t\t// so an empty file would produce \"0,0\".\n\t\t\t\t\t//\n\t\t\t\t\tWriteInteger(@out, begin - 1);\n\t\t\t\t\t@out.WriteByte(Convert.ToByte(','));\n\t\t\t\t\t@out.WriteByte(Convert.ToByte('0'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\t// If the range is exactly one line, produce only the number.\n\t\t\t\t\t//\n                    WriteInteger(@out, begin);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n                    WriteInteger(@out, begin);\n                    @out.WriteByte(Convert.ToByte(','));\n\t\t\t\t\tWriteInteger(@out, cnt);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprivate static void WriteInteger(Stream @out, int count)\n\t\t{\n\t\t\tvar buffer = Constants.encodeASCII(count);\n\t\t\t@out.Write(buffer, 0, buffer.Length);\n\t\t}\n\n\t\tprivate static void WriteLine(Stream @out, char prefix, RawText text, int cur)\n\t\t{\n\t\t\t@out.WriteByte(Convert.ToByte(prefix));\n\t\t\ttext.writeLine(@out, cur);\n\t\t\t@out.WriteByte(Convert.ToByte('\\n'));\n\t\t\tif (cur + 1 == text.size() && text.isMissingNewlineAtEnd())\n\t\t\t{\n\t\t\t\t@out.Write(NoNewLine, 0, NoNewLine.Length);\n\t\t\t}\n\t\t}\n\n\t\tprivate int FindCombinedEnd(IList<Edit> edits, int i)\n\t\t{\n\t\t\tint end = i + 1;\n\t\t\twhile (end < edits.Count && (CombineA(edits, end) || CombineB(edits, end)))\n\t\t\t{\n\t\t\t\tend++;\n\t\t\t}\n\t\t\treturn end - 1;\n\t\t}\n\n\t\tprivate bool CombineA(IList<Edit> e, int i)\n\t\t{\n\t\t\treturn e[i].BeginA - e[i - 1].EndA <= 2 * _context;\n\t\t}\n\n\t\tprivate bool CombineB(IList<Edit> e, int i)\n\t\t{\n\t\t\treturn e[i].BeginB - e[i - 1].EndB <= 2 * _context;\n\t\t}\n\n\t\tprivate static bool End(Edit edit, int a, int b)\n\t\t{\n\t\t\treturn edit.EndA <= a && edit.EndB <= b;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Diff/Edit.cs",
    "content": "/*\n * Copyright (C) 2008, Johannes E. Schindelin <johannes.schindelin@gmx.de>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Diff\n{\n\t/// <summary>\n\t/// A modified region detected between two versions of roughly the same content.\n\t/// <para />\n\t/// Regions should be specified using 0 based notation, so add 1 to the\n\t/// start and end marks for line numbers in a file.\n\t/// <para />\n\t/// An edit where <code>beginA == endA &amp;&amp; beginB &gt; endB</code> is an insert edit,\n\t/// that is sequence B inserted the elements in region\n\t/// <code>[beginB, endB)</code> at <code>beginA</code>.\n\t/// <para />\n\t/// An edit where <code>beginA &gt; endA &amp;&amp; beginB &gt; endB</code> is a replace edit,\n\t/// that is sequence B has replaced the range of elements between\n\t/// <code>[beginA, endA)</code> with those found in <code>[beginB, endB)</code>.\n\t/// </summary>\n\tpublic class Edit\n\t{\n\t\t/// <summary>\n\t\t/// Type of edit\n\t\t/// </summary>\n\t\t[Serializable]\n\t\tpublic enum Type\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Sequence B has inserted the region.\n\t\t\t/// </summary>\n\t\t\tINSERT,\n\n\t\t\t/// <summary>\n\t\t\t/// Sequence B has removed the region.\n\t\t\t/// </summary>\n\t\t\tDELETE,\n\n\t\t\t/// <summary>\n\t\t\t/// Sequence B has replaced the region with different content.\n\t\t\t/// </summary>\n\t\t\tREPLACE,\n\n\t\t\t/// <summary>\n\t\t\t/// Sequence A and B have zero length, describing nothing.\n\t\t\t/// </summary>\n\t\t\tEMPTY\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new empty edit.\n\t\t/// </summary>\n\t\t/// <param name=\"aStart\">beginA: start and end of region in sequence A; 0 based.</param>\n\t\t/// <param name=\"bStart\">beginB: start and end of region in sequence B; 0 based.</param>\n\t\tpublic Edit(int aStart, int bStart)\n\t\t\t: this(aStart, aStart, bStart, bStart)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new empty edit.\n\t\t/// </summary>\n\t\t/// <param name=\"aStart\">beginA: start and end of region in sequence A; 0 based.</param>\n\t\t/// <param name=\"aEnd\">endA: end of region in sequence A; must be >= as.</param>\n\t\t/// <param name=\"bStart\">beginB: start and end of region in sequence B; 0 based.</param>\n\t\t/// <param name=\"bEnd\">endB: end of region in sequence B; must be >= bs.</param>\n\t\tpublic Edit(int aStart, int aEnd, int bStart, int bEnd)\n\t\t{\n\t\t\tBeginA = aStart;\n\t\t\tEndA = aEnd;\n\n\t\t\tBeginB = bStart;\n\t\t\tEndB = bEnd;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the type of this region.\n\t\t/// </summary>\n\t\tpublic Type EditType\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (BeginA == EndA && BeginB < EndB)\n\t\t\t\t{\n\t\t\t\t\treturn Type.INSERT;\n\t\t\t\t}\n\t\t\t\tif (BeginA < EndA && BeginB == EndB)\n\t\t\t\t{\n\t\t\t\t\treturn Type.DELETE;\n\t\t\t\t}\n\t\t\t\tif (BeginA == EndA && BeginB == EndB)\n\t\t\t\t{\n\t\t\t\t\treturn Type.EMPTY;\n\t\t\t\t}\n\n\t\t\t\treturn Type.REPLACE;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Start point in sequence A.\n\t\t/// </summary>\n\t\tpublic int BeginA { get; set; }\n\n\t\t/// <summary>\n\t\t/// End point in sequence A.\n\t\t/// </summary>\n\t\tpublic int EndA { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Start point in sequence B.\n\t\t/// </summary>\n\t\tpublic int BeginB { get; private set; }\n\n\t\t/// <summary>\n\t\t/// End point in sequence B.\n\t\t/// </summary>\n\t\tpublic int EndB { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Increase <see cref=\"EndA\"/> by 1.\n\t\t/// </summary>\n\t\tpublic void ExtendA()\n\t\t{\n\t\t\tEndA++;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Increase <see cref=\"EndB\"/> by 1.\n\t\t/// </summary>\n\t\tpublic void ExtendB()\n\t\t{\n\t\t\tEndB++;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Swap A and B, so the edit goes the other direction.\n\t\t/// </summary>\n\t\tpublic void Swap()\n\t\t{\n\t\t\tint sBegin = BeginA;\n\t\t\tint sEnd = EndA;\n\n\t\t\tBeginA = BeginB;\n\t\t\tEndA = EndB;\n\n\t\t\tBeginB = sBegin;\n\t\t\tEndB = sEnd;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn BeginA ^ EndA;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines whether the specified <see cref=\"T:System.Object\"/> is\n\t\t/// equal to the current <see cref=\"T:System.Object\"/>.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if the specified <see cref=\"T:System.Object\"/> is equal to the\n\t\t/// current <see cref=\"T:System.Object\"/>; otherwise, false.\n\t\t/// </returns>\n\t\t/// <param name=\"obj\">The <see cref=\"T:System.Object\"/> to compare with\n\t\t/// the current <see cref=\"T:System.Object\"/>.\n\t\t/// </param>\n\t\t/// <exception cref=\"T:System.NullReferenceException\">\n\t\t/// The <paramref name=\"obj\"/> parameter is null.\n\t\t/// </exception>\n\t\t/// <filterpriority>2</filterpriority>\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tEdit e = (obj as Edit);\n\t\t\tif (e != null)\n\t\t\t{\n\t\t\t\treturn BeginA == e.BeginA && EndA == e.EndA && BeginB == e.BeginB && EndB == e.EndB;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool operator ==(Edit left, Edit right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(Edit left, Edit right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tType t = EditType;\n\t\t\treturn t + \"(\" + BeginA + \"-\" + EndA + \",\" + BeginB + \"-\" + EndB + \")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Diff/EditList.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Diff\n{\n    /// <summary>\n    ///   Specialized list of\n    ///   <seealso cref=\"Edit\" />\n    ///   s in a document.\n    /// </summary>\n    public class EditList : List<Edit>, IIterable<Edit>\n    {\n        public int size()\n        {\n            return Count;\n        }\n\n        public Edit get(int index)\n        {\n            return this[index];\n        }\n\n        public Edit set(int index, Edit element)\n        {\n            Edit retval = this[index];\n            this[index] = element;\n            return retval;\n        }\n\n        public void Add(int index, Edit element)\n        {\n            Insert(index, element);\n        }\n\n        public void remove(int index)\n        {\n            RemoveAt(index);\n        }\n\n        public override string ToString()\n        {\n            /* Unfortunately, C#'s List does not implement ToString the same\n\t\t\t * way Java's ArrayList does. It simply inherits from the base class\n\t\t\t * object. This means that ToString returns the string identifier of\n\t\t\t * the type.\n\t\t\t * Until a better solution is found, I'm implementing ToString myself.\n\t\t\t */\n            string retval = \"EditList[\";\n            foreach (Edit e in this)\n            {\n                retval = retval + e;\n            }\n            retval = retval + \"]\";\n            return retval;\n        }\n\n        /* This method did not exist in the original Java code.\n\t\t * In Java, the AbstractList has a method named isEmpty\n\t\t * C#'s AbstractList has no such method\n\t\t */\n\n        public bool isEmpty()\n        {\n            return (Count == 0);\n        }\n\n        private bool isEqual(EditList o)\n        {\n            if (Count != o.Count)\n            {\n                return false;\n            }\n\n            for (int i = 0; i < Count; i++)\n            {\n                if (!this[i].Equals(o[i]))\n                {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n\n        private bool isEqual(string s)\n        {\n            return ToString().Equals(s);\n        }\n\n        public override bool Equals(object obj)\n        {\n            EditList e = (obj as EditList);\n            if (e != null)\n            {\n                return isEqual(e);\n            }\n\n            string s = (obj as string);\n            if (s != null)\n            {\n                return isEqual(s);\n            }\n\n            return false;\n        }\n\n        public override int GetHashCode()\n        {\n            return ToString().GetHashCode();\n        }\n\n        public IteratorBase<Edit> iterator()\n        {\n            return new BasicIterator<Edit>(this);\n        }\n\n    }\n\n   \n}"
  },
  {
    "path": "GitSharp.Core/Diff/MyersDiff.cs",
    "content": "/*\n * Copyright (C) 2008-2009 Johannes E. Schindelin <johannes.schindelin@gmx.de>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n/*\n * \n * \n *\n * \n * \n * \n * \n * \n *\n * \n * \n * \n * \n * \n *\n * \n *\n * \n * \n * \n * \n * \n *\n * \n * \n *\n * \n * \n *\n * \n * \n * \n *\n * \n * \n * \n * \n *\n * \n *\n * \n *\n *\n *\n *\n * \n * \n *\n * \n * \n */\nusing System;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Diff\n{\n    /// <summary>\n    /// Diff algorithm, based on \"An O(ND) Difference Algorithm and its\n    /// Variations\", by Eugene Myers.\n    /// \n    /// The basic idea is to put the line numbers of text A as columns (\"x\") and the\n    /// lines of text B as rows (\"y\").  Now you try to find the shortest \"edit path\"\n    /// from the upper left corner to the lower right corner, where you can\n    /// always go horizontally or vertically, but diagonally from (x,y) to\n    /// (x+1,y+1) only if line x in text A is identical to line y in text B.\n    /// \n    /// Myers' fundamental concept is the \"furthest reaching D-path on diagonal k\":\n    /// a D-path is an edit path starting at the upper left corner and containing\n    /// exactly D non-diagonal elements (\"differences\").  The furthest reaching\n    /// D-path on diagonal k is the one that contains the most (diagonal) elements\n    /// which ends on diagonal k (where k = y - x).\n    /// \n    /// Example:\n    /// \n    ///    H E L L O   W O R L D\n    ///    ____\n    ///  L     \\___\n    ///  O         \\___\n    ///  W             \\________\n    /// \n    /// Since every D-path has exactly D horizontal or vertical elements, it can\n    /// only end on the diagonals -D, -D+2, ..., D-2, D.\n    /// \n    /// Since every furthest reaching D-path contains at least one furthest\n    /// reaching (D-1)-path (except for D=0), we can construct them recursively.\n    /// \n    /// Since we are really interested in the shortest edit path, we can start\n    /// looking for a 0-path, then a 1-path, and so on, until we find a path that\n    /// ends in the lower right corner.\n    /// \n    /// To save space, we do not need to store all paths (which has quadratic space\n    /// requirements), but generate the D-paths simultaneously from both sides.\n    /// When the ends meet, we will have found \"the middle\" of the path.  From the\n    /// end points of that diagonal part, we can generate the rest recursively.\n    /// \n    /// This only requires linear space.\n    /// \n    /// The overall (runtime) complexity is\n    /// \n    /// \tO(N * D^2 + 2 * N/2 * (D/2)^2 + 4 * N/4 * (D/4)^2 + ...)\n    /// \t= O(N * D^2 * 5 / 4) = O(N * D^2),\n    /// \n    /// (With each step, we have to find the middle parts of twice as many regions\n    /// as before, but the regions (as well as the D) are halved.)\n    /// \n    /// So the overall runtime complexity stays the same with linear space,\n    /// albeit with a larger constant factor.\n    /// </summary>\n    public class MyersDiff\n    {\n        /// <summary>\n        /// The list of edits found during the last call to <see cref=\"calculateEdits()\"/>\n        /// </summary>\n        protected EditList edits;\n\n        /// <summary>\n        /// The first text to be compared. Referred to as \"Text A\" in the comments\n        /// </summary>\n        protected Sequence a;\n\n        /// <summary>\n        /// The second text to be compared. Referred to as \"Text B\" in the comments\n        /// </summary>\n        protected Sequence b;\n\n        /// <summary>\n        /// The only constructor\n        /// </summary>\n        /// <param name=\"a\">the text A which should be compared</param>\n        /// <param name=\"b\">the text B which should be compared</param>\n        public MyersDiff(Sequence a, Sequence b)\n        {\n            this.a = a;\n            this.b = b;\n            middle = new MiddleEdit(a, b);\n            calculateEdits();\n        }\n\n        /// <returns>the list of edits found during the last call to {@link #calculateEdits()}</returns>\n        public EditList getEdits()\n        {\n            return edits;\n        }\n\n        // TODO: use ThreadLocal for future multi-threaded operations\n        MiddleEdit middle;\n\n        /// <summary>\n        /// Entrypoint into the algorithm this class is all about. This method triggers that the\n        /// differences between A and B are calculated in form of a list of edits.\n        /// </summary>\n        protected void calculateEdits()\n        {\n            edits = new EditList();\n\n            middle.initialize(0, a.size(), 0, b.size());\n            if (middle.beginA >= middle.endA &&\n                middle.beginB >= middle.endB)\n                return;\n\n            calculateEdits(middle.beginA, middle.endA,\n                middle.beginB, middle.endB);\n        }\n\n        /// <summary>\n        /// Calculates the differences between a given part of A against another given part of B\n        /// </summary>\n        /// <param name=\"beginA\">start of the part of A which should be compared (0&lt;=beginA&lt;sizeof(A))</param>\n        /// <param name=\"endA\">end of the part of A which should be compared (beginA&lt;=endA&lt;sizeof(A))</param>\n        /// <param name=\"beginB\">start of the part of B which should be compared (0&lt;=beginB&lt;sizeof(B))</param>\n        /// <param name=\"endB\">end of the part of B which should be compared (beginB&lt;=endB&lt;sizeof(B))</param>\n        protected void calculateEdits(int beginA, int endA,\n            int beginB, int endB)\n        {\n            Edit edit = middle.calculate(beginA, endA, beginB, endB);\n\n            if (beginA < edit.BeginA || beginB < edit.BeginB)\n            {\n                int k = edit.BeginB - edit.BeginA;\n                int x = middle.backward.snake(k, edit.BeginA);\n                calculateEdits(beginA, x, beginB, k + x);\n            }\n\n            if (edit.EditType != Edit.Type.EMPTY)\n                edits.Add(edit);\n\n\n            // after middle\n            if (endA > edit.EndA || endB > edit.EndB)\n            {\n                int k = edit.EndB - edit.EndA;\n                int x = middle.forward.snake(k, edit.EndA);\n                calculateEdits(x, endA, k + x, endB);\n            }\n        }\n\n        /// <summary>\n        /// A class to help bisecting the sequences a and b to find minimal\n        /// edit paths.\n        /// \n        /// As the arrays are reused for space efficiency, you will need one\n        /// instance per thread.\n        /// \n        /// The entry function is the calculate() method.\n        /// </summary>\n        class MiddleEdit\n        {\n            private readonly Sequence _a;\n            private readonly Sequence _b;\n\n            public MiddleEdit(Sequence a, Sequence b)\n            {\n                _a = a;\n                _b = b;\n                forward = new ForwardEditPaths(this);\n                backward = new BackwardEditPaths(this);\n            }\n\n            public void initialize(int beginA, int endA, int beginB, int endB)\n            {\n                this.beginA = beginA; this.endA = endA;\n                this.beginB = beginB; this.endB = endB;\n\n                // strip common parts on either end\n                int k = beginB - beginA;\n                this.beginA = forward.snake(k, beginA);\n                this.beginB = k + this.beginA;\n\n                k = endB - endA;\n                this.endA = backward.snake(k, endA);\n                this.endB = k + this.endA;\n            }\n\n            /// <summary>\n            /// This function calculates the \"middle\" Edit of the shortest\n            /// edit path between the given subsequences of a and b.\n            /// \n            /// Once a forward path and a backward path meet, we found the\n            /// middle part.  From the last snake end point on both of them,\n            /// we construct the Edit.\n            /// \n            /// It is assumed that there is at least one edit in the range.\n            /// </summary>\n            // TODO: measure speed impact when this is synchronized\n            public Edit calculate(int beginA, int endA, int beginB, int endB)\n            {\n                if (beginA == endA || beginB == endB)\n                    return new Edit(beginA, endA, beginB, endB);\n                this.beginA = beginA; this.endA = endA;\n                this.beginB = beginB; this.endB = endB;\n\n                /*\n                 * Following the conventions in Myers' paper, \"k\" is\n                 * the difference between the index into \"b\" and the\n                 * index into \"a\".\n                 */\n                int minK = beginB - endA;\n                int maxK = endB - beginA;\n\n                forward.initialize(beginB - beginA, beginA, minK, maxK);\n                backward.initialize(endB - endA, endA, minK, maxK);\n\n                for (int d = 1; ; d++)\n                    if (forward.calculate(d) ||\n                        backward.calculate(d))\n                    {\n                        return _edit;\n                    }\n            }\n\n            /*\n             * For each d, we need to hold the d-paths for the diagonals\n             * k = -d, -d + 2, ..., d - 2, d.  These are stored in the\n             * forward (and backward) array.\n             *\n             * As we allow subsequences, too, this needs some refinement:\n             * the forward paths start on the diagonal forwardK =\n             * beginB - beginA, and backward paths start on the diagonal\n             * backwardK = endB - endA.\n             *\n             * So, we need to hold the forward d-paths for the diagonals\n             * k = forwardK - d, forwardK - d + 2, ..., forwardK + d and\n             * the analogue for the backward d-paths.  This means that\n             * we can turn (k, d) into the forward array index using this\n             * formula:\n             *\n             *\ti = (d + k - forwardK) / 2\n             *\n             * There is a further complication: the edit paths should not\n             * leave the specified subsequences, so k is bounded by\n             * minK = beginB - endA and maxK = endB - beginA.  However,\n             * (k - forwardK) _must_ be odd whenever d is odd, and it\n             * _must_ be even when d is even.\n             *\n             * The values in the \"forward\" and \"backward\" arrays are\n             * positions (\"x\") in the sequence a, to get the corresponding\n             * positions (\"y\") in the sequence b, you have to calculate\n             * the appropriate k and then y:\n             *\n             *\tk = forwardK - d + i * 2\n             *\ty = k + x\n             *\n             * (substitute backwardK for forwardK if you want to get the\n             * y position for an entry in the \"backward\" array.\n             */\n            public EditPaths forward;\n            public EditPaths backward;\n\n            /* Some variables which are shared between methods */\n            public int beginA;\n            public int endA;\n            public int beginB;\n            public int endB;\n            protected Edit _edit;\n\n            internal abstract class EditPaths\n            {\n                protected readonly MiddleEdit _middleEdit;\n                private IntList x = new IntList();\n                private LongList _snake = new LongList();\n                public int beginK;\n                public int endK;\n                public int middleK;\n                int prevBeginK, prevEndK;\n                /* if we hit one end early, no need to look further */\n                protected int minK, maxK; // TODO: better explanation\n\n                protected EditPaths(MiddleEdit middleEdit)\n                {\n                    _middleEdit = middleEdit;\n                }\n\n                int getIndex(int d, int k)\n                {\n                    // TODO: remove\n                    if (((d + k - middleK) % 2) == 1)\n                        throw new InvalidOperationException(\"odd: \" + d + \" + \" + k + \" - \" + middleK);\n                    return (d + k - middleK) / 2;\n                }\n\n                public int getX(int d, int k)\n                {\n                    // TODO: remove\n                    if (k < beginK || k > endK)\n                        throw new InvalidOperationException(\"k \" + k + \" not in \" + beginK + \" - \" + endK);\n                    return x.get(getIndex(d, k));\n                }\n\n                public long getSnake(int d, int k)\n                {\n                    // TODO: remove\n                    if (k < beginK || k > endK)\n                        throw new InvalidOperationException(\"k \" + k + \" not in \" + beginK + \" - \" + endK);\n                    return _snake.get(getIndex(d, k));\n                }\n\n                private int forceKIntoRange(int k)\n                {\n                    /* if k is odd, so must be the result */\n                    if (k < minK)\n                        return minK + ((k ^ minK) & 1);\n                    else if (k > maxK)\n                        return maxK - ((k ^ maxK) & 1);\n                    return k;\n                }\n\n                public void initialize(int k, int x, int minK, int maxK)\n                {\n                    this.minK = minK;\n                    this.maxK = maxK;\n                    beginK = endK = middleK = k;\n                    this.x.clear();\n                    this.x.add(x);\n                    _snake.clear();\n                    _snake.add(newSnake(k, x));\n                }\n\n                public abstract int snake(int k, int x);\n                protected abstract int getLeft(int x);\n                protected abstract int getRight(int x);\n                protected abstract bool isBetter(int left, int right);\n                protected abstract void adjustMinMaxK(int k, int x);\n                protected abstract bool meets(int d, int k, int x, long snake);\n\n                long newSnake(int k, int x)\n                {\n                    long y = k + x;\n                    long ret = ((long)x) << 32;\n                    return ret | y;\n                }\n\n                int snake2x(long snake)\n                {\n                    return (int)((ulong)snake >> 32);\n                }\n\n                int snake2y(long snake)\n                {\n                    return (int)snake;\n                }\n\n                protected bool makeEdit(long snake1, long snake2)\n                {\n                    int x1 = snake2x(snake1), x2 = snake2x(snake2);\n                    int y1 = snake2y(snake1), y2 = snake2y(snake2);\n\n                    /*\n                     * Check for incompatible partial edit paths:\n                     * when there are ambiguities, we might have\n                     * hit incompatible (i.e. non-overlapping)\n                     * forward/backward paths.\n                     *\n                     * In that case, just pretend that we have\n                     * an empty edit at the end of one snake; this\n                     * will force a decision which path to take\n                     * in the next recursion step.\n                     */\n                    if (x1 > x2 || y1 > y2)\n                    {\n                        x1 = x2;\n                        y1 = y2;\n                    }\n                    _middleEdit._edit = new Edit(x1, x2, y1, y2);\n                    return true;\n                }\n\n                public bool calculate(int d)\n                {\n                    prevBeginK = beginK;\n                    prevEndK = endK;\n                    beginK = forceKIntoRange(middleK - d);\n                    endK = forceKIntoRange(middleK + d);\n                    // TODO: handle i more efficiently\n                    // TODO: walk snake(k, getX(d, k)) only once per (d, k)\n                    // TODO: move end points out of the loop to avoid conditionals inside the loop\n                    // go backwards so that we can avoid temp vars\n                    for (int k = endK; k >= beginK; k -= 2)\n                    {\n                        int left = -1, right = -1;\n                        long leftSnake = -1L, rightSnake = -1L;\n                        // TODO: refactor into its own function\n                        int i;\n                        if (k > prevBeginK)\n                        {\n                            i = getIndex(d - 1, k - 1);\n                            left = x.get(i);\n                            int end = snake(k - 1, left);\n                            leftSnake = left != end ?\n                                                        newSnake(k - 1, end) :\n                                                                                 _snake.get(i);\n\n                            if (meets(d, k - 1, end, leftSnake))\n                                return true;\n                            left = getLeft(end);\n                        }\n                        if (k < prevEndK)\n                        {\n                            i = getIndex(d - 1, k + 1);\n                            right = x.get(i);\n                            int end = snake(k + 1, right);\n                            rightSnake = right != end ?\n                                                          newSnake(k + 1, end) :\n                                                                                   _snake.get(i);\n\n                            if (meets(d, k + 1, end, rightSnake))\n                                return true;\n                            right = getRight(end);\n                        }\n                        int newX;\n                        long newSnakeTmp;\n                        if (k >= prevEndK ||\n                            (k > prevBeginK &&\n                                isBetter(left, right)))\n                        {\n                            newX = left;\n                            newSnakeTmp = leftSnake;\n                        }\n                        else\n                        {\n                            newX = right;\n                            newSnakeTmp = rightSnake;\n                        }\n\n                        if (meets(d, k, newX, newSnakeTmp))\n                            return true;\n                        adjustMinMaxK(k, newX);\n                        i = getIndex(d, k);\n                        x.set(i, newX);\n                        _snake.set(i, newSnakeTmp);\n                    }\n                    return false;\n                }\n            }\n\n            class ForwardEditPaths : EditPaths\n            {\n                public ForwardEditPaths(MiddleEdit middleEdit)\n                    : base(middleEdit)\n                {\n                }\n\n                public override int snake(int k, int x)\n                {\n                    for (; x < _middleEdit.endA && k + x < _middleEdit.endB; x++)\n                        if (!_middleEdit._a.equals(x, _middleEdit._b, k + x))\n                            break;\n                    return x;\n                }\n\n                protected override int getLeft(int x)\n                {\n                    return x;\n                }\n\n                protected override int getRight(int x)\n                {\n                    return x + 1;\n                }\n\n                protected override bool isBetter(int left, int right)\n                {\n                    return left > right;\n                }\n\n                protected override void adjustMinMaxK(int k, int x)\n                {\n                    if (x >= _middleEdit.endA || k + x >= _middleEdit.endB)\n                    {\n                        if (k > _middleEdit.backward.middleK)\n                            maxK = k;\n                        else\n                            minK = k;\n                    }\n                }\n\n                protected override bool meets(int d, int k, int x, long snake)\n                {\n                    if (k < _middleEdit.backward.beginK || k > _middleEdit.backward.endK)\n                        return false;\n                    // TODO: move out of loop\n                    if (((d - 1 + k - _middleEdit.backward.middleK) % 2) == 1)\n                        return false;\n                    if (x < _middleEdit.backward.getX(d - 1, k))\n                        return false;\n                    makeEdit(snake, _middleEdit.backward.getSnake(d - 1, k));\n                    return true;\n                }\n            }\n\n            class BackwardEditPaths : EditPaths\n            {\n                public BackwardEditPaths(MiddleEdit middleEdit)\n                    : base(middleEdit)\n                {\n                }\n\n                public override int snake(int k, int x)\n                {\n                    for (; x > _middleEdit.beginA && k + x > _middleEdit.beginB; x--)\n                        if (!_middleEdit._a.equals(x - 1, _middleEdit._b, k + x - 1))\n                            break;\n                    return x;\n                }\n\n                protected override int getLeft(int x)\n                {\n                    return x - 1;\n                }\n\n                protected override int getRight(int x)\n                {\n                    return x;\n                }\n\n                protected override bool isBetter(int left, int right)\n                {\n                    return left < right;\n                }\n\n                protected override void adjustMinMaxK(int k, int x)\n                {\n                    if (x <= _middleEdit.beginA || k + x <= _middleEdit.beginB)\n                    {\n                        if (k > _middleEdit.forward.middleK)\n                            maxK = k;\n                        else\n                            minK = k;\n                    }\n                }\n\n                protected override bool meets(int d, int k, int x, long snake)\n                {\n                    if (k < _middleEdit.forward.beginK || k > _middleEdit.forward.endK)\n                        return false;\n                    // TODO: move out of loop\n                    if (((d + k - _middleEdit.forward.middleK) % 2) == 1)\n                        return false;\n                    if (x > _middleEdit.forward.getX(d, k))\n                        return false;\n                    makeEdit(_middleEdit.forward.getSnake(d, k), snake);\n                    return true;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Diff/RawText.cs",
    "content": "/*\n * Copyright (C) 2008, Johannes E. Schindelin <johannes.schindelin@gmx.de>\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Diff\n{\n\n\n\t/// <summary>\n\t/// A sequence supporting UNIX formatted text in byte[] format.\n\t/// <para />\n\t/// Elements of the sequence are the lines of the file, as delimited by the UNIX\n\t/// newline character ('\\n'). The file content is treated as 8 bit binary text,\n\t/// with no assumptions or requirements on character encoding.\n\t/// <para />\n\t/// Note that the first line of the file is element 0, as defined by the Sequence\n\t/// interface API. Traditionally in a text editor a patch file the first line is\n\t/// line number 1. Callers may need to subtract 1 prior to invoking methods if\n\t/// they are converting from \"line number\" to \"element index\".\n\t/// </summary>\n\tpublic class RawText : Sequence\n\t{\n\t\t// The file content for this sequence.\n\t\tprivate readonly byte[] content;\n\n        /// <summary>\n        /// The content of the raw text as byte array.\n        /// </summary>\n        public byte[] Content // <--- [henon] added accessor to be able to reuse the data structure from the api.\n\t    {\n\t        get\n\t        {\n\t            return content;\n\t        }\n\t    }\n\n\t\t// Map of line number to starting position within content.\n\t\tprivate readonly IntList lines;\n\n        /// <summary>\n        /// Represents starting points of lines in Content. Note: the line indices are 1-based and \n        /// are mapped to 0-based positions in the Content byte array. As line indices are based on 1 the result of line 0 is undefined.\n        /// </summary>\n\t    public IntList LineStartIndices // <--- [henon] added accessor to be able to reuse the data structure from the api.\n\t    {\n\t        get\n\t        {\n\t            return lines;\n\t        }\n\t    }\n\n\t\t// Hash code for each line, for fast equality elimination.\n\t\tprivate readonly IntList hashes;\n\n\t\t///\t<summary>\n\t\t/// Create a new sequence from an existing content byte array.\n\t\t///\t<para />\n\t\t///\tThe entire array (indexes 0 through length-1) is used as the content.\n\t\t///\t</summary>\n\t\t///\t<param name=\"input\">\n\t\t///\tthe content array. The array is never modified, so passing\n\t\t///\tthrough cached arrays is safe.\n\t\t/// </param>\n\t\tpublic RawText(byte[] input)\n\t\t{\n\t\t\tcontent = input;\n\t\t\tlines = RawParseUtils.lineMap(content, 0, content.Length);\n\t\t\thashes = computeHashes();\n\t\t}\n\n        /// <summary>\n        /// Create a new sequence from a file.\n        /// <para>The entire file contents are used.</para>\n        /// </summary>\n        /// <param name=\"file\">the text file.</param>\n\t    public RawText(FileInfo file) : this(IO.ReadFully(file))\n\t    {}\n\n\n\t\tpublic int size()\n\t\t{\n\t\t\t// The line map is always 2 entries larger than the number of lines in\n\t\t\t// the file. Index 0 is padded out/unused. The last index is the total\n\t\t\t// length of the buffer, and acts as a sentinel.\n\t\t\t//\n\t\t\treturn lines.size() - 2;\n\t\t}\n\n\t\tpublic bool equals(int thisIdx, Sequence other, int otherIdx)\n\t\t{\n\t\t\treturn equals(this, thisIdx + 1, (RawText) other, otherIdx + 1);\n\t\t}\n\n\t\tprivate static bool equals(RawText a, int ai, RawText b, int bi)\n\t\t{\n\t\t\tif (a.hashes.get(ai) != b.hashes.get(bi))\n\t\t\t\treturn false;\n\n\t\t\tint a_start = a.lines.get(ai);\n\t\t\tint b_start = b.lines.get(bi);\n\t\t\tint a_end = a.lines.get(ai + 1);\n\t\t\tint b_end = b.lines.get(bi + 1);\n\n\t\t\tif (a_end - a_start != b_end - b_start)\n\t\t\t\treturn false;\n\n\t\t\twhile (a_start < a_end) {\n\t\t\t\tif (a.content[a_start++] != b.content[b_start++])\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Write a specific line to the output stream, without its trailing LF.\n\t\t///\t<para />\n\t\t///\tThe specified line is copied as-is, with no character encoding\n\t\t///\ttranslation performed.\n\t\t///\t<para />\n\t\t///\tIf the specified line ends with an LF ('\\n'), the LF is <b>not</b>\n\t\t///\tcopied. It is up to the caller to write the LF, if desired, between\n\t\t///\toutput lines.\n\t\t///\t</summary>\n\t\t///\t<param name=\"out\">\n\t\t///\tStream to copy the line data onto. </param>\n\t\t///\t<param name=\"i\">\n\t\t///\tIndex of the line to extract. Note this is 0-based, so line\n\t\t///\tnumber 1 is actually index 0. </param>\n\t\t///\t<exception cref=\"IOException\">\n\t\t///\tthe stream write operation failed.\n\t\t/// </exception>\n\t\tpublic void writeLine(Stream @out, int i)\n\t\t{\n\t\t\tint start = lines.get(i + 1);\n\t\t\tint end = lines.get(i + 2);\n\t\t\tif (content[end - 1] == '\\n')\n\t\t\t{\n\t\t\t\tend--;\n\t\t\t}\n\t\t\t@out.Write(content, start, end - start);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Determine if the file ends with a LF ('\\n').\n\t\t///\t</summary>\n\t\t///\t<returns> true if the last line has an LF; false otherwise. </returns>\n\t\tpublic bool isMissingNewlineAtEnd()\n\t\t{\n\t\t\tint end = lines.get(lines.size() - 1);\n\t\t\tif (end == 0)\n\t\t\t\treturn true;\n\t\t\treturn content[end - 1] != '\\n';\n\t\t}\n\n\t\tprivate IntList computeHashes()\n\t\t{\n\t\t\tvar r = new IntList(lines.size());\n\t\t\tr.add(0);\n\t\t\tfor (int lno = 1; lno < lines.size() - 1; lno++)\n\t\t\t{\n\t\t\t\tint ptr = lines.get(lno);\n\t\t\t\tint end = lines.get(lno + 1);\n\t\t\t\tr.add(HashLine(content, ptr, end));\n\t\t\t}\n\t\t\tr.add(0);\n\t\t\treturn r;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Compute a hash code for a single line.\n\t\t///\t</summary>\n\t\t///\t<param name=\"raw\">The raw file content. </param>\n\t\t///\t<param name=\"ptr\">\n\t\t///\tFirst byte of the content line to hash. </param>\n\t\t///\t<param name=\"end\">\n\t\t/// 1 past the last byte of the content line.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// Hash code for the region <code>[ptr, end)</code> of raw.\n\t\t/// </returns>\n\t\tprivate static int HashLine(byte[] raw, int ptr, int end)\n\t\t{\n\t\t\tint hash = 5381;\n\t\t\tfor (; ptr < end; ptr++)\n\t\t\t{\n\t\t\t\thash = (hash << 5) ^ (raw[ptr] & 0xff);\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Diff/Sequence.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Johannes E. Schindelin <johannes.schindelin@gmx.de>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Diff\n{\n\t/// <summary>\n\t/// Arbitrary sequence of elements with fast comparison support.\n\t/// <para />\n\t/// A sequence of elements is defined to contain elements in the index range\n\t/// <code>[0, <seealso cref=\"size()\"/>)</code>, like a standard Java List implementation.\n\t/// Unlike a List, the members of the sequence are not directly obtainable, but\n\t/// element equality can be tested if two Sequences are the same implementation.\n\t/// <para />\n\t/// An implementation may chose to implement the equals semantic as necessary,\n\t/// including fuzzy matching rules such as ignoring insignificant sub-elements,\n\t/// e.g. ignoring whitespace differences in text.\n\t/// <para />\n\t/// Implementations of Sequence are primarily intended for use in content\n\t/// difference detection algorithms, to produce an <seealso cref=\"EditList\"/> of\n\t/// <seealso cref=\"Edit\"/> instances describing how two Sequence instances differ. \n\t/// </summary>\n\tpublic interface Sequence\n\t{\n\t\t/// <returns>\n\t\t/// Total number of items in the sequence.\n\t\t/// </returns>\n\t\tint size();\n\n\t\t///\t<summary>\n\t\t///  Determine if the i-th member is equal to the j-th member.\n\t\t///\t<para />\n\t\t///\tImplementations must ensure <code>equals(thisIdx,other,otherIdx)</code>\n\t\t///\treturns the same as <code>other.equals(otherIdx,this,thisIdx)</code>.\n\t\t///\t</summary>\n\t\t///\t<param name=\"thisIdx\">\n\t\t///\tIndex within <code>this</code> sequence; must be in the range\n\t\t///\t<code>[ 0, this.size() )</code>.\n\t\t/// </param>\n\t\t///\t<param name=\"other\">\n\t\t/// Another sequence; must be the same implementation class, that\n\t\t///\tis <code>this.getClass() == other.getClass()</code>. </param>\n\t\t///\t<param name=\"otherIdx\">\n\t\t///\tIndex within <code>other</code> sequence; must be in the range\n\t\t///\t<code>[ 0, other.size() )</code>. </param>\n\t\t///\t<returns>\n\t\t/// true if the elements are equal; false if they are not equal.\n\t\t/// </returns>\n\t\tbool equals(int thisIdx, Sequence other, int otherIdx);\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/BaseDirCacheEditor.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n\t/// <summary>\n\t/// Generic update/editing support for <seealso cref=\"DirCache\"/>.\n\t/// <para />\n\t/// The different update strategies extend this class to provide their \n\t/// own unique services to applications. \n\t/// </summary>\n\tpublic abstract class BaseDirCacheEditor\n\t{\n\t\t// The cache instance this editor updates during finish.\n\t\tprivate readonly DirCache _cache;\n\n\t\t///\t<summary>\n\t\t/// Entry table this builder will eventually replace into <seealso cref=\"Cache\"/>.\n\t\t///\t<para />\n\t\t/// Use <seealso cref=\"FastAdd(DirCacheEntry)\"/> or <seealso cref=\"FastKeep(int, int)\"/> to\n\t\t/// make additions to this table. The table is automatically expanded if it\n\t\t/// is too small for a new addition.\n\t\t/// <para />\n\t\t/// Typically the entries in here are sorted by their path names, just like\n\t\t/// they are in the DirCache instance.\n\t\t/// </summary>\n\t\tprivate DirCacheEntry[] _entries;\n\n\t\t// Total number of valid entries in Entries.\n\t\tprivate int _entryCnt;\n\n\t\t///\t<summary>\n\t\t/// Construct a new editor.\n\t\t///\t</summary>\n\t\t/// <param name=\"dc\">\n\t\t/// the cache this editor will eventually update.\n\t\t/// </param>\n\t\t///\t<param name=\"ecnt\">\n\t\t/// estimated number of entries the editor will have upon\n\t\t/// completion. This sizes the initial entry table.\n\t\t/// </param>\n\t\tprotected BaseDirCacheEditor(DirCache dc, int ecnt)\n\t\t{\n\t\t\t_cache = dc;\n\t\t\t_entries = new DirCacheEntry[ecnt];\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t///\t<returns> \n\t\t/// The cache we will update on <seealso cref=\"finish()\"/>.\n\t\t/// </returns>\n\t\tpublic DirCache getDirCache()\n\t\t{\n\t\t\treturn _cache;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Append one entry into the resulting entry list.\n\t\t/// <para />\n\t\t/// The entry is placed at the end of the entry list. The caller is\n\t\t/// responsible for making sure the final table is correctly sorted.\n\t\t/// <para />\n\t\t///\tThe <seealso cref=\"Entries\"/> table is automatically expanded \n\t\t/// if there is insufficient space for the new addition.\n\t\t/// </summary>\n\t\t/// <param name=\"newEntry\">The new entry to add.</param>\n\t\tprotected void FastAdd(DirCacheEntry newEntry)\n\t\t{\n\t\t\tif (_entries.Length == _entryCnt)\n\t\t\t{\n\t\t\t\tvar n = new DirCacheEntry[(_entryCnt + 16) * 3 / 2];\n\t\t\t\tArray.Copy(_entries, 0, n, 0, _entryCnt);\n\t\t\t\t_entries = n;\n\t\t\t}\n\t\t\t_entries[_entryCnt++] = newEntry;\n\t\t}\n\n\t\tprotected DirCacheEntry[] Entries\n\t\t{\n\t\t\tget { return _entries; }\n\t\t}\n\n\t\tprotected DirCache Cache\n\t\t{\n\t\t\tget { return _cache; }\n\t\t}\n\n\t\tprotected int EntryCnt\n\t\t{\n\t\t\tget { return _entryCnt; }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add a range of existing entries from the destination cache.\n\t\t/// <para />\n\t\t/// The entries are placed at the end of the entry list, preserving their\n\t\t/// current order. The caller is responsible for making sure the final table\n\t\t/// is correctly sorted.\n\t\t/// <para />\n\t\t/// This method copies from the destination cache, which has not yet been\n\t\t/// updated with this editor's new table. So all offsets into the destination\n\t\t/// cache are not affected by any updates that may be currently taking place\n\t\t/// in this editor.\n\t\t/// <para />\n\t\t/// The <seealso cref=\"Entries\"/> table is automatically expanded if there is\n\t\t/// insufficient space for the new additions.\n\t\t/// </summary>\n\t\t/// <param name=\"pos\">First entry to copy from the destination cache. </param>\n\t\t/// <param name=\"cnt\">Number of entries to copy.</param>\n\t\tprotected void FastKeep(int pos, int cnt)\n\t\t{\n\t\t\tif (_entryCnt + cnt > _entries.Length)\n\t\t\t{\n\t\t\t\tint m1 = (_entryCnt + 16) * 3 / 2;\n\t\t\t\tint m2 = _entryCnt + cnt;\n\t\t\t\tvar n = new DirCacheEntry[Math.Max(m1, m2)];\n\t\t\t\tArray.Copy(_entries, 0, n, 0, _entryCnt);\n\t\t\t\t_entries = n;\n\t\t\t}\n\n\t\t\t_cache.toArray(pos, _entries, _entryCnt, cnt);\n\t\t\t_entryCnt += cnt;\n\t\t}\n\n\t\t///\t<summary> * Finish this builder and update the destination <seealso cref=\"DirCache\"/>.\n\t\t///\t<para />\n\t\t/// When this method completes this builder instance is no longer usable by\n\t\t/// the calling application. A new builder must be created to make additional\n\t\t/// changes to the index entries.\n\t\t/// <para />\n\t\t/// After completion the DirCache returned by <seealso cref=\"getDirCache()\"/> will\n\t\t/// contain all modifications.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// <i>Note to implementors:</i> Make sure <seealso cref=\"Entries\"/> is fully sorted\n\t\t/// then invoke <seealso cref=\"Replace()\"/> to update the DirCache with the new table. \n\t\t/// </remarks>\n\t\tpublic abstract void finish();\n\n\t\t///\t<summary>\n\t\t/// Update the DirCache with the contents of <seealso cref=\"Entries\"/>.\n\t\t///\t<para />\n\t\t/// This method should be invoked only during an implementation of\n\t\t/// <seealso cref=\"finish()\"/>, and only after <seealso cref=\"Entries\"/> is sorted.\n\t\t/// </summary>\n\t\tprotected void Replace()\n\t\t{\n\t\t\tif (_entryCnt < _entries.Length / 2)\n\t\t\t{\n\t\t\t\tvar n = new DirCacheEntry[_entryCnt];\n\t\t\t\tArray.Copy(_entries, 0, n, 0, _entryCnt);\n\t\t\t\t_entries = n;\n\t\t\t}\n\t\t\t_cache.replace(_entries, _entryCnt);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Finish, write, commit this change, and release the index lock.\n\t\t/// <para />\n\t\t/// If this method fails (returns false) the lock is still released.\n\t\t/// <para />\n\t\t/// This is a utility method for applications as the finish-write-commit\n\t\t/// pattern is very common after using a builder to update entries.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True if the commit was successful and the file contains the new\n\t\t/// data; false if the commit failed and the file remains with the\n\t\t/// old data.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// The output file could not be created. The caller no longer\n\t\t/// holds the lock.\n\t\t/// </exception>\n\t\tpublic virtual bool commit()\n\t\t{\n\t\t\tfinish();\n\t\t\t_cache.write();\n\t\t\treturn _cache.commit();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCache.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n    /// <summary>\n    /// Support for the Git dircache (aka index file).\n    /// <para />\n    /// The index file keeps track of which objects are currently checked out in the\n    /// working directory, and the last modified time of those working files. Changes\n    /// in the working directory can be detected by comparing the modification times\n    /// to the cached modification time within the index file.\n    /// <para />\n    /// Index files are also used during merges, where the merge happens within the\n    /// index file first, and the working directory is updated as a post-merge step.\n    /// Conflicts are stored in the index file to allow tool (and human) based\n    /// resolutions to be easily performed.\n    /// </summary>\n    public class DirCache\n    {\n        private static readonly byte[] SigDirc = { (byte)'D', (byte)'I', (byte)'R', (byte)'C' };\n        private static readonly DirCacheEntry[] NoEntries = { };\n        private const int ExtTree = 0x54524545 /* 'TREE' */;\n        private const int InfoLen = DirCacheEntry.INFO_LEN;\n\n        internal static readonly Comparison<DirCacheEntry> EntryComparer = (o1, o2) =>\n        {\n            int cr = Compare(o1, o2);\n            if (cr != 0)\n            {\n                return cr;\n            }\n            return o1.getStage() - o2.getStage();\n        };\n\n        public static int Compare(DirCacheEntry a, DirCacheEntry b)\n        {\n            return Compare(a.Path, a.Path.Length, b);\n        }\n\n        private static int Compare(byte[] aPath, int aLen, DirCacheEntry b)\n        {\n            return Compare(aPath, aLen, b.Path, b.Path.Length);\n        }\n\n        public static int Compare(byte[] aPath, int aLen, byte[] bPath, int bLen)\n        {\n            for (int cPos = 0; cPos < aLen && cPos < bLen; cPos++)\n            {\n                int cmp = (aPath[cPos] & 0xff) - (bPath[cPos] & 0xff);\n                if (cmp != 0)\n                {\n                    return cmp;\n                }\n            }\n\n            return aLen - bLen;\n        }\n\n        ///\t<summary>\n        /// Create a new empty index which is never stored on disk.\n        ///\t</summary>\n        ///\t<returns>\n        /// An empty cache which has no backing store file. The cache may not\n        /// be read or written, but it may be queried and updated (in memory).\n        /// </returns>\n        public static DirCache newInCore()\n        {\n            return new DirCache(null);\n        }\n\n        ///\t<summary>\n        /// Create a new in-core index representation and read an index from disk.\n        ///\t<para />\n        ///\tThe new index will be read before it is returned to the caller. Read\n        /// failures are reported as exceptions and therefore prevent the method from\n        /// returning a partially populated index.\n        /// </summary>\n        /// <param name=\"indexLocation\">Location of the index file on disk.</param>\n        /// <returns> a cache representing the contents of the specified index file (if\n        /// it exists) or an empty cache if the file does not exist.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The index file is present but could not be read.\n        /// </exception>\n        /// <exception cref=\"CorruptObjectException\">\n        /// The index file is using a format or extension that this\n        /// library does not support.\n        /// </exception>\n        public static DirCache read(FileInfo indexLocation)\n        {\n            var c = new DirCache(indexLocation);\n            c.read();\n            return c;\n        }\n\n        ///\t<summary>\n        /// Create a new in-core index representation and read an index from disk.\n        /// <para />\n        /// The new index will be read before it is returned to the caller. Read\n        /// failures are reported as exceptions and therefore prevent the method from\n        /// returning a partially populated index.\n        /// </summary>\n        /// <param name=\"db\">\n        /// repository the caller wants to read the default index of.\n        /// </param>\n        /// <returns>\n        /// A cache representing the contents of the specified index file (if\n        /// it exists) or an empty cache if the file does not exist.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The index file is present but could not be read.\n        /// </exception>\n        /// <exception cref=\"CorruptObjectException\">\n        /// The index file is using a format or extension that this\n        /// library does not support.\n        /// </exception>\n        public static DirCache read(Repository db)\n        {\n            return read(new FileInfo(db.Directory + \"/index\"));\n        }\n\n        ///\t<summary>\n        /// Create a new in-core index representation, lock it, and read from disk.\n        /// <para />\n        /// The new index will be locked and then read before it is returned to the\n        /// caller. Read failures are reported as exceptions and therefore prevent\n        /// the method from returning a partially populated index.  On read failure,\n        /// the lock is released.\n        /// </summary>\n        /// <param name=\"indexLocation\">\n        /// location of the index file on disk.\n        /// </param>\n        /// <returns>\n        /// A cache representing the contents of the specified index file (if\n        /// it exists) or an empty cache if the file does not exist.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The index file is present but could not be read, or the lock\n        /// could not be obtained.\n        /// </exception>\n        /// <exception cref=\"CorruptObjectException\">\n        /// the index file is using a format or extension that this\n        /// library does not support.\n        /// </exception>\n        public static DirCache Lock(FileInfo indexLocation)\n        {\n            var c = new DirCache(indexLocation);\n            if (!c.Lock())\n            {\n                throw new IOException(\"Cannot lock \" + indexLocation);\n            }\n\n            try\n            {\n                c.read();\n            }\n            catch (Exception)\n            {\n                c.unlock();\n                throw;\n            }\n\n            return c;\n        }\n\n        ///\t<summary>\n        /// Create a new in-core index representation, lock it, and read from disk.\n        ///\t<para />\n        ///\tThe new index will be locked and then read before it is returned to the\n        ///\tcaller. Read failures are reported as exceptions and therefore prevent\n        ///\tthe method from returning a partially populated index.\n        ///\t</summary>\n        ///\t<param name=\"db\">\n        /// Repository the caller wants to read the default index of.\n        /// </param>\n        /// <returns>\n        /// A cache representing the contents of the specified index file (if\n        /// it exists) or an empty cache if the file does not exist.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The index file is present but could not be read, or the lock\n        /// could not be obtained.\n        /// </exception>\n        /// <exception cref=\"CorruptObjectException\">\n        /// The index file is using a format or extension that this\n        /// library does not support.\n        /// </exception>\n        public static DirCache Lock(Repository db)\n        {\n            return Lock(new FileInfo(db.Directory + \"/index\"));\n        }\n\n        // Location of the current version of the index file.\n        private readonly FileInfo _liveFile;\n\n        // Modification time of the file at the last Read/write we did.\n        private long _lastModified;\n\n        // Individual file index entries, sorted by path name.\n        private DirCacheEntry[] _sortedEntries;\n\n        // Number of positions within sortedEntries that are valid.\n        private int _entryCnt;\n\n        // Cache tree for this index; null if the cache tree is not available.\n        private DirCacheTree _cacheTree;\n\n        // Our active lock (if we hold it); null if we don't have it locked.\n        private LockFile _myLock;\n\n        ///\t<summary>\n        /// Create a new in-core index representation.\n        ///\t<para />\n        ///\tThe new index will be empty. Callers may wish to read from the on disk\n        ///\tfile first with <seealso cref=\"read()\"/>.\n        ///\t</summary>\n        ///\t<param name=\"indexLocation\">location of the index file on disk. </param>\n        public DirCache(FileInfo indexLocation)\n        {\n            _liveFile = indexLocation;\n            clear();\n        }\n\n        ///\t<summary>\n        /// Create a new builder to update this cache.\n        /// <para />\n        /// Callers should add all entries to the builder, then use\n        /// <seealso cref=\"DirCacheBuilder.finish()\"/> to update this instance.\n        /// </summary>\n        /// <returns>A new builder instance for this cache.</returns>\n        public DirCacheBuilder builder()\n        {\n            return new DirCacheBuilder(this, _entryCnt + 16);\n        }\n\n        /// <summary>\n        /// Create a new editor to recreate this cache.\n        /// <para />\n        /// Callers should add commands to the editor, then use\n        /// <seealso cref=\"DirCacheEditor.finish()\"/> to update this instance.\n        ///\t</summary>\n        ///\t<returns>A new builder instance for this cache.</returns>\n        public DirCacheEditor editor()\n        {\n            return new DirCacheEditor(this, _entryCnt + 16);\n        }\n\n        public void replace(DirCacheEntry[] e, int cnt)\n        {\n            _sortedEntries = e;\n            _entryCnt = cnt;\n            _cacheTree = null;\n        }\n\n        /// <summary>\n        /// Read the index from disk, if it has changed on disk.\n        /// <para />\n        /// This method tries to avoid loading the index if it has not changed since\n        /// the last time we consulted it. A missing index file will be treated as\n        /// though it were present but had no file entries in it.\n        /// </summary>\n        /// <exception cref=\"IOException\">\n        /// The index file is present but could not be read. This\n        /// <see cref=\"DirCache\"/> instance may not be populated correctly.\n        /// </exception>\n        /// <exception cref=\"CorruptObjectException\">\n        /// The index file is using a format or extension that this\n        /// library does not support.\n        /// </exception>\n        public void read()\n        {\n            if (_liveFile == null)\n            {\n                throw new IOException(\"DirCache does not have a backing file\");\n            }\n            if (!_liveFile.Exists)\n            {\n                clear();\n            }\n            else if (_liveFile.lastModified() != _lastModified)\n            {\n                try\n                {\n                    var inStream = new FileStream(_liveFile.FullName, System.IO.FileMode.Open, FileAccess.Read);\n                    try\n                    {\n                        clear();\n                        ReadFrom(inStream);\n                    }\n                    finally\n                    {\n                        try\n                        {\n                            inStream.Close();\n                        }\n                        catch (IOException)\n                        {\n                            // Ignore any close failures.\n                        }\n                    }\n                }\n                catch (FileNotFoundException)\n                {\n                    // Someone must have deleted it between our exists test\n                    // and actually opening the path. That's fine, its empty.\n                    //\n                    clear();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Empty this index, removing all entries.\n        /// </summary>\n        public void clear()\n        {\n            _lastModified = 0;\n            _sortedEntries = NoEntries;\n            _entryCnt = 0;\n            _cacheTree = null;\n        }\n\n        private void ReadFrom(Stream inStream)\n        {\n            var @in = new StreamReader(inStream);\n            MessageDigest md = Constants.newMessageDigest();\n\n            // Read the index header and verify we understand it.\n            //\n            var hdr = new byte[20];\n            IO.ReadFully(inStream, hdr, 0, 12);\n            md.Update(hdr, 0, 12);\n            if (!IsDIRC(hdr))\n            {\n                throw new CorruptObjectException(\"Not a DIRC file.\");\n            }\n\n            int ver = NB.DecodeInt32(hdr, 4);\n            if (ver != 2)\n            {\n                throw new CorruptObjectException(\"Unknown DIRC version \" + ver);\n            }\n\n            _entryCnt = NB.DecodeInt32(hdr, 8);\n            if (_entryCnt < 0)\n            {\n                throw new CorruptObjectException(\"DIRC has too many entries.\");\n            }\n\n            // Load the individual file entries.\n            //\n            var infos = new byte[InfoLen * _entryCnt];\n            _sortedEntries = new DirCacheEntry[_entryCnt];\n            for (int i = 0; i < _entryCnt; i++)\n            {\n                _sortedEntries[i] = new DirCacheEntry(infos, i * InfoLen, inStream, md);\n            }\n            _lastModified = _liveFile.lastModified();\n\n            // After the file entries are index extensions, and then a footer.\n            //\n            while (true)\n            {\n                var pos = inStream.Position;\n                IO.ReadFully(inStream, hdr, 0, 20);\n\n                if (inStream.ReadByte() < 0)\n                {\n                    // No extensions present; the file ended where we expected.\n                    //\n                    break;\n                }\n                inStream.Seek(pos, SeekOrigin.Begin);\n                md.Update(hdr, 0, 8);\n                IO.skipFully(inStream, 8);\n\n                long sz = NB.decodeUInt32(hdr, 4);\n\n                switch (NB.DecodeInt32(hdr, 0))\n                {\n                    case ExtTree:\n                        if (int.MaxValue < sz)\n                        {\n                            throw new CorruptObjectException(\"DIRC extension \"\n                                        + formatExtensionName(hdr) + \" is too large at \"\n                                        + sz + \" bytes.\");\n                        }\n                        byte[] raw = new byte[(int)sz];\n                        IO.ReadFully(inStream, raw, 0, raw.Length);\n                        md.Update(raw, 0, raw.Length);\n                        _cacheTree = new DirCacheTree(raw, new MutableInteger(), null);\n                        break;\n\n                    default:\n                        if (hdr[0] >= (byte)'A' && hdr[0] <= (byte)'Z')\n                        {\n                            // The extension is optional and is here only as\n                            // a performance optimization. Since we do not\n                            // understand it, we can safely skip past it, after\n                            // we include its data in our checksum.\n                            //\n                            skipOptionalExtension(inStream, md, hdr, sz);\n                        }\n                        else\n                        {\n                            // The extension is not an optimization and is\n                            // _required_ to understand this index format.\n                            // Since we did not trap it above we must abort.\n                            //\n                            throw new CorruptObjectException(\"DIRC extension \"\n                                    + formatExtensionName(hdr)\n                                    + \" not supported by this version.\");\n                        }\n\n                        break;\n                }\n            }\n\n            byte[] exp = md.Digest();\n            if (!exp.SequenceEqual(hdr))\n            {\n                throw new CorruptObjectException(\"DIRC checksum mismatch\");\n            }\n        }\n\n        private void skipOptionalExtension(Stream inStream, MessageDigest md, byte[] hdr, long sz)\n        {\n            byte[] b = new byte[4096];\n            while (0 < sz)\n            {\n                int n = inStream.Read(b, 0, (int)Math.Min(b.Length, sz));\n                if (n < 0)\n                {\n                    throw new EndOfStreamException(\"Short read of optional DIRC extension \"\n                            + formatExtensionName(hdr) + \"; expected another \" + sz\n                            + \" bytes within the section.\");\n                }\n                md.Update(b, 0, n);\n                sz -= n;\n            }\n        }\n\n        private static String formatExtensionName(byte[] hdr)\n        {\n            return \"'\" + Charset.forName(\"ISO-8859-1\").GetString(hdr, 0, 4) + \"'\";\n        }\n\n        private static bool IsDIRC(byte[] header)\n        {\n            if (header.Length < SigDirc.Length)\n            {\n                return false;\n            }\n\n            for (int i = 0; i < SigDirc.Length; i++)\n            {\n                if (header[i] != SigDirc[i]) return false;\n            }\n\n            return true;\n        }\n\n        /// <summary>\n        /// Try to establish an update lock on the cache file.\n        /// </summary>\n        /// <returns>\n        /// True if the lock is now held by the caller; false if it is held\n        /// by someone else.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The output file could not be created. The caller does not\n        /// hold the lock.\n        /// </exception>\n        public bool Lock()\n        {\n            if (_liveFile == null)\n            {\n                throw new IOException(\"DirCache does not have a backing file\");\n            }\n\n            _myLock = new LockFile(_liveFile);\n            if (_myLock.Lock())\n            {\n                _myLock.NeedStatInformation = true;\n                return true;\n            }\n\n            return false;\n        }\n\n        /// <summary>\n        /// Write the entry records from memory to disk.\n        /// <para />\n        /// The cache must be locked first by calling <seealso cref=\"Lock()\"/> and receiving\n        /// true as the return value. Applications are encouraged to lock the index,\n        /// then invoke <seealso cref=\"read()\"/> to ensure the in-memory data is current,\n        /// prior to updating the in-memory entries.\n        /// <para />\n        /// Once written the lock is closed and must be either committed with\n        /// <seealso cref=\"commit()\"/> or rolled back with <seealso cref=\"unlock()\"/>.\n        /// </summary>\n        /// <exception cref=\"IOException\">\n        /// The output file could not be created. The caller no longer\n        /// holds the lock.\n        /// </exception>\n        public void write()\n        {\n            LockFile tmp = _myLock;\n            RequireLocked(tmp);\n            try\n            {\n                WriteTo(tmp.GetOutputStream());\n            }\n            catch (Exception)\n            {\n                tmp.Unlock();\n                throw;\n            }\n        }\n\n        private void WriteTo(Stream os)\n        {\n            MessageDigest foot = Constants.newMessageDigest();\n            var dos = new DigestOutputStream(os, foot);\n\n            // Write the header.\n            //\n            var tmp = new byte[128];\n            Array.Copy(SigDirc, 0, tmp, 0, SigDirc.Length);\n            NB.encodeInt32(tmp, 4, /* version */2);\n            NB.encodeInt32(tmp, 8, _entryCnt);\n            dos.Write(tmp, 0, 12);\n\n            // Write the individual file entries.\n            //\n            if (_lastModified <= 0) \n            {\n                // Write a new index, as no entries require smudging.\n                //\n                for (int i = 0; i < _entryCnt; i++)\n                {\n                    _sortedEntries[i].write(dos);\n                }\n            }\n            else\n            {\n                int smudge_s = (int)(_lastModified / 1000);\n                int smudge_ns = ((int)(_lastModified % 1000)) * 1000000;\n                for (int i = 0; i < _entryCnt; i++)\n                {\n                    DirCacheEntry e = _sortedEntries[i];\n                    if (e.mightBeRacilyClean(smudge_s, smudge_ns))\n                        e.smudgeRacilyClean();\n                    e.write(dos);\n                }\n            }\n\n            if (_cacheTree != null)\n            {\n                var bb = new LocalFileBuffer();\n                _cacheTree.write(tmp, bb);\n                bb.close();\n\n                NB.encodeInt32(tmp, 0, ExtTree);\n                NB.encodeInt32(tmp, 4, (int)bb.Length);\n                dos.Write(tmp, 0, 8);\n                bb.writeTo(dos, null);\n            }\n            var hash = foot.Digest();\n            os.Write(hash, 0, hash.Length);\n            os.Close();\n        }\n\n        ///\t<summary>\n        /// Commit this change and release the lock.\n        /// <para />\n        /// If this method fails (returns false) the lock is still released.\n        /// </summary>\n        /// <returns>\n        /// True if the commit was successful and the file contains the new\n        /// data; false if the commit failed and the file remains with the\n        /// old data.\n        /// </returns>\n        ///\t<exception cref=\"InvalidOperationException\">\n        /// the lock is not held.\n        /// </exception>\n        public bool commit()\n        {\n            LockFile tmp = _myLock;\n            RequireLocked(tmp);\n            _myLock = null;\n            if (!tmp.Commit()) return false;\n            _lastModified = tmp.CommitLastModified;\n            return true;\n        }\n\n        private void RequireLocked(LockFile tmp)\n        {\n            if (_liveFile == null)\n            {\n                throw new InvalidOperationException(\"DirCache is not locked\");\n            }\n            if (tmp == null)\n            {\n                throw new InvalidOperationException(\"DirCache \" + _liveFile.FullName + \" not locked.\");\n            }\n        }\n\n        /// <summary>\n        /// Unlock this file and abort this change.\n        /// <para />\n        /// The temporary file (if created) is deleted before returning.\n        /// </summary>\n        public void unlock()\n        {\n            LockFile tmp = _myLock;\n            if (tmp != null)\n            {\n                _myLock = null;\n                tmp.Unlock();\n            }\n        }\n\n        /// <summary>\n        /// Locate the position a path's entry is at in the index.\n        /// <para />\n        /// If there is at least one entry in the index for this path the position of\n        /// the lowest stage is returned. Subsequent stages can be identified by\n        /// testing consecutive entries until the path differs.\n        /// <para />\n        /// If no path matches the entry -(position+1) is returned, where position is\n        /// the location it would have gone within the index.\n        /// </summary>\n        /// <param name=\"path\">The path to search for.</param>\n        /// <returns>\n        /// if >= 0 then the return value is the position of the entry in the\n        /// index; pass to <seealso cref=\"getEntry(int)\"/> to obtain the entry\n        /// information. If &gt; 0 the entry does not exist in the index.\n        /// </returns>\n        ///\n        public int findEntry(string path)\n        {\n            if (_entryCnt == 0)\n                return -1;\n            byte[] p = Constants.encode(path);\n            return findEntry(p, p.Length);\n        }\n\n        public int findEntry(byte[] p, int pLen)\n        {\n            int low = 0;\n            int high = _entryCnt;\n\n            while (low < high)\n            {\n                var mid = (int)(((uint)(low + high)) >> 1);\n                int cmp = Compare(p, pLen, _sortedEntries[mid]);\n                if (cmp < 0)\n                {\n                    high = mid;\n                }\n                else if (cmp == 0)\n                {\n                    while (mid > 0 && Compare(p, pLen, _sortedEntries[mid - 1]) == 0)\n                    {\n                        mid--;\n                    }\n                    return mid;\n                }\n                else\n                {\n                    low = mid + 1;\n                }\n\n            }\n\n            return -(low + 1);\n        }\n\n        /// <summary>\n        /// Determine the next index position past all entries with the same name.\n        /// <para />\n        /// As index entries are sorted by path name, then stage number, this method\n        /// advances the supplied position to the first position in the index whose\n        /// path name does not match the path name of the supplied position's entry.\n        ///\t</summary>\n        ///\t<param name=\"position\">\n        /// entry position of the path that should be skipped.\n        /// </param>\n        /// <returns>\n        /// Position of the next entry whose path is after the input.\n        /// </returns>\n        public int nextEntry(int position)\n        {\n            DirCacheEntry last = _sortedEntries[position];\n            int nextIdx = position + 1;\n            while (nextIdx < _entryCnt)\n            {\n                DirCacheEntry next = _sortedEntries[nextIdx];\n                if (Compare(last, next) != 0) break;\n                last = next;\n                nextIdx++;\n            }\n            return nextIdx;\n        }\n\n        public int nextEntry(byte[] p, int pLen, int nextIdx)\n        {\n            while (nextIdx < _entryCnt)\n            {\n                DirCacheEntry next = _sortedEntries[nextIdx];\n                if (!DirCacheTree.peq(p, next.Path, pLen)) break;\n                nextIdx++;\n            }\n            return nextIdx;\n        }\n\n        /// <summary>\n        /// Total number of file entries stored in the index.\n        /// <para />\n        /// This count includes unmerged stages for a file entry if the file is\n        /// currently conflicted in a merge. This means the total number of entries\n        /// in the index may be up to 3 times larger than the number of files in the\n        /// working directory.\n        /// <para />\n        /// Note that this value counts only <i>files</i>.\n        /// </summary>\n        /// <returns>Number of entries available.</returns>\n        /// <seealso cref=\"getEntry(int)\"/>\n        public int getEntryCount()\n        {\n            return _entryCnt;\n        }\n\n        /// <summary>\n        /// Get a specific entry.\n        /// </summary>\n        /// <param name=\"i\">\n        /// position of the entry to get.\n        /// </param>\n        ///\t<returns> The entry at position <paramref name=\"i\"/>.</returns>\n        public DirCacheEntry getEntry(int i)\n        {\n            return _sortedEntries[i];\n        }\n\n        /// <summary>\n        /// Get a specific entry.\n        /// </summary>\n        /// <param name=\"path\">The path to search for.</param>\n        ///\t<returns>The entry at position <paramref name=\"i\"/>.</returns>\n        public DirCacheEntry getEntry(string path)\n        {\n            int i = findEntry(path);\n            return i < 0 ? null : _sortedEntries[i];\n        }\n\n        /// <summary>\n        /// Recursively get all entries within a subtree.\n        /// </summary>\n        /// <param name=\"path\">\n        /// The subtree path to get all entries within.\n        /// </param>\n        /// <returns>\n        /// All entries recursively contained within the subtree.\n        /// </returns>\n        public DirCacheEntry[] getEntriesWithin(string path)\n        {\n            if (!path.EndsWith(\"/\"))\n            {\n                path += \"/\";\n            }\n\n            byte[] p = Constants.encode(path);\n            int pLen = p.Length;\n\n            int eIdx = findEntry(p, pLen);\n            if (eIdx < 0)\n            {\n                eIdx = -(eIdx + 1);\n            }\n            int lastIdx = nextEntry(p, pLen, eIdx);\n            var r = new DirCacheEntry[lastIdx - eIdx];\n            Array.Copy(_sortedEntries, eIdx, r, 0, r.Length);\n            return r;\n        }\n\n        public void toArray(int i, DirCacheEntry[] dst, int off, int cnt)\n        {\n            Array.Copy(_sortedEntries, i, dst, off, cnt);\n        }\n\n        /// <summary>\n        /// Obtain (or build) the current cache tree structure.\n        /// <para />\n        /// This method can optionally recreate the cache tree, without flushing the\n        /// tree objects themselves to disk.\n        /// </summary>\n        ///\t<param name=\"build\">\n        /// If true and the cache tree is not present in the index it will\n        /// be generated and returned to the caller.\n        /// </param>\n        ///\t<returns>\n        /// The cache tree; null if there is no current cache tree available\n        /// and <paramref name=\"build\"/> was false.\n        /// </returns>\n        public DirCacheTree getCacheTree(bool build)\n        {\n            if (build)\n            {\n                if (_cacheTree == null)\n                {\n                    _cacheTree = new DirCacheTree();\n                }\n                _cacheTree.validate(_sortedEntries, _entryCnt, 0, 0);\n            }\n            return _cacheTree;\n        }\n\n        ///\t<summary>\n        /// Write all index trees to the object store, returning the root tree.\n        ///\t</summary>\n        ///\t<param name=\"ow\">\n        /// The writer to use when serializing to the store.\n        /// </param>\n        ///\t<returns> identity for the root tree. </returns>\n        ///\t<exception cref=\"UnmergedPathException\">\n        /// One or more paths contain higher-order stages (stage > 0),\n        /// which cannot be stored in a tree object.\n        /// </exception>\n        ///\t<exception cref=\"InvalidOperationException\">\n        /// One or more paths contain an invalid mode which should never\n        /// appear in a tree object.\n        /// </exception>\n        ///\t<exception cref=\"IOException\">\n        /// An unexpected error occurred writing to the object store.\n        /// </exception>\n        public ObjectId writeTree(ObjectWriter ow)\n        {\n            return getCacheTree(true).writeTree(_sortedEntries, 0, 0, ow);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheBuildIterator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n\t/// <summary>\n\t/// Iterate and update a <see cref=\"DirCache\"/> as part of a <see cref=\"TreeWalk\"/>.\n\t/// <para />\n\t/// Like <see cref=\"DirCacheIterator\"/> this iterator allows a <see cref=\"DirCache\"/>\n\t/// to be used in parallel with other sorts of iterators in a <see cref=\"TreeWalk\"/>. \n\t/// However any entry which appears in the source <see cref=\"DirCache\"/> and which \n\t/// is skipped by the <see cref=\"TreeFilter\"/> is automatically copied into \n\t/// <see cref=\"DirCacheBuilder\"/>, thus retaining it in the newly updated index.\n\t/// <para/>\n\t/// This iterator is suitable for update processes, or even a simple delete\n\t/// algorithm. For example deleting a path:\n\t/// <para/>\n\t/// <example>\n\t/// DirCache dirc = DirCache.lock(db);\n\t/// DirCacheBuilder edit = dirc.builder();\n\t/// \n\t/// TreeWalk walk = new TreeWalk(db);\n\t/// walk.reset();\n\t/// walk.setRecursive(true);\n\t/// walk.setFilter(PathFilter.Create(&quot;name/to/remove&quot;));\n\t/// walk.addTree(new DirCacheBuildIterator(edit));\n\t/// \n\t/// while (walk.next())\n\t/// ; // do nothing on a match as we want to remove matches\n\t/// edit.commit();\n\t/// </example>\n\t/// </summary>\n    public class DirCacheBuildIterator : DirCacheIterator\n    {\n        private readonly DirCacheBuilder _builder;\n\n\t\t/// <summary>\n\t\t/// Create a new iterator for an already loaded <see cref=\"DirCache\"/> instance.\n\t\t/// <para/>\n\t\t/// The iterator implementation may copy part of the cache's data during\n\t\t/// construction, so the cache must be Read in prior to creating the\n\t\t/// iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"builder\">\n\t\t/// The cache builder for the cache to walk. The cache must be\n\t\t/// already loaded into memory.\n\t\t/// </param>\n        public DirCacheBuildIterator(DirCacheBuilder builder)\n            : base(builder.getDirCache())\n        {\n\t\t\tif ( builder == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"builder\");\n\t\t\t}\n            _builder = builder;\n        }\n\n\t\t/// <summary>\n\t\t/// Create a new iterator for an already loaded <see cref=\"DirCache\"/> instance.\n\t\t/// <para/>\n\t\t/// The iterator implementation may copy part of the cache's data during\n\t\t/// construction, so the cache must be Read in prior to creating the\n\t\t/// iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"parentIterator\">The parent iterator</param>\n\t\t/// <param name=\"cacheTree\">The cache tree</param>\n        DirCacheBuildIterator(DirCacheBuildIterator parentIterator, DirCacheTree cacheTree)\n            : base(parentIterator, cacheTree)\n        {\n\t\t\tif (parentIterator == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"parentIterator\");\n\t\t\t\n            _builder = parentIterator._builder;\n        }\n\n        public override AbstractTreeIterator createSubtreeIterator(Repository repo)\n        {\n            if (CurrentSubtree == null)\n            {\n            \tthrow new IncorrectObjectTypeException(getEntryObjectId(),\n            \t                                       Constants.TYPE_TREE);\n            }\n\n            return new DirCacheBuildIterator(this, CurrentSubtree);\n        }\n\n        public override void skip()\n        {\n            if (CurrentSubtree != null)\n            {\n            \t_builder.keep(Pointer, CurrentSubtree.getEntrySpan());\n            }\n            else\n            {\n            \t_builder.keep(Pointer, 1);\n            }\n            next(1);\n        }\n\n        public override void stopWalk()\n        {\n            int cur = Pointer;\n            int cnt = Cache.getEntryCount();\n            if (cur < cnt)\n            {\n            \t_builder.keep(cur, cnt - cur);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheBuilder.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n    /// <summary>\n    /// Updates a <seealso cref=\"DirCache\"/> by adding individual <seealso cref=\"DirCacheEntry\"/>s.\n    /// <para />\n    /// A builder always starts from a clean slate and appends in every single\n    /// <seealso cref=\"DirCacheEntry\" /> which the final updated index must have to reflect\n    /// its new content.\n    /// <para />\n    /// For maximum performance applications should add entries in path name order.\n    /// Adding entries out of order is permitted, however a final sorting pass will\n    /// be implicitly performed during <seealso cref=\"finish()\"/> to correct any out-of-order\n    /// entries. Duplicate detection is also delayed until the sorting is complete.\n    /// </summary>\n    /// <seealso cref=\"DirCacheEditor\"/>\n    public class DirCacheBuilder : BaseDirCacheEditor\n    {\n        private bool _sorted;\n\n        /// <summary>\n        /// Construct a new builder.\n        /// </summary>\n        /// <param name=\"dc\">\n        /// the cache this builder will eventually update.\n        /// </param>\n        /// <param name=\"ecnt\">\n        /// Estimated number of entries the builder will have upon\n        /// completion. This sizes the initial entry table.\n        /// </param>\n        public DirCacheBuilder(DirCache dc, int ecnt)\n            : base(dc, ecnt)\n        {\n        }\n\n        /// <summary>\n        /// Append one entry into the resulting entry list.\n        /// <para />\n        /// The entry is placed at the end of the entry list. If the entry causes the\n        /// list to now be incorrectly sorted a final sorting phase will be\n        /// automatically enabled within <seealso cref=\"finish()\"/>.\n        /// <para />\n        /// The internal entry table is automatically expanded if there is\n        /// insufficient space for the new addition.\n        /// </summary>\n        /// <param name=\"newEntry\">the new entry to add.</param>\n        public void add(DirCacheEntry newEntry)\n        {\n            if (newEntry.getRawMode() == 0)\n            {\n                throw new ArgumentException(\"FileMode not set for path \"\n                    + newEntry.getPathString());\n            }\n\n            BeforeAdd(newEntry);\n            FastAdd(newEntry);\n        }\n\n        ///\t<summary>\n        /// Add a range of existing entries from the destination cache.\n        /// <para />\n        /// The entries are placed at the end of the entry list. If any of the\n        /// entries causes the list to now be incorrectly sorted a final sorting\n        /// phase will be automatically enabled within <seealso cref=\"finish()\"/>.\n        /// <para />\n        /// This method copies from the destination cache, which has not yet been\n        /// updated with this editor's new table. So all offsets into the destination\n        /// cache are not affected by any updates that may be currently taking place\n        /// in this editor.\n        /// <para />\n        /// The internal entry table is automatically expanded if there is\n        /// insufficient space for the new additions.\n        /// </summary>\n        /// <param name=\"pos\">\n        /// First entry to copy from the destination cache.\n        /// </param>\n        /// <param name=\"cnt\">Number of entries to copy.</param>\n        public void keep(int pos, int cnt)\n        {\n            BeforeAdd(Cache.getEntry(pos));\n            FastKeep(pos, cnt);\n        }\n\n        ///\t<summary>\n        /// Recursively add an entire tree into this builder.\n        /// <para />\n        /// If pathPrefix is \"a/b\" and the tree contains file \"c\" then the resulting\n        /// DirCacheEntry will have the path \"a/b/c\".\n        /// <para />\n        /// All entries are inserted at stage 0, therefore assuming that the\n        /// application will not insert any other paths with the same pathPrefix.\n        /// </summary>\n        /// <param name=\"pathPrefix\">\n        /// UTF-8 encoded prefix to mount the tree's entries at. If the\n        /// path does not end with '/' one will be automatically inserted\n        /// as necessary.\n        /// </param>\n        /// <param name=\"stage\">Stage of the entries when adding them.</param>\n        /// <param name=\"db\">\n        /// Repository the tree(s) will be read from during recursive\n        /// traversal. This must be the same repository that the resulting\n        /// <see cref=\"DirCache\"/> would be written out to (or used in) otherwise \n        /// the caller is simply asking for deferred MissingObjectExceptions.\n        /// </param>\n        /// <param name=\"tree\">\n        /// The tree to recursively add. This tree's contents will appear\n        /// under <paramref name=\"pathPrefix\"/>. The ObjectId must be that of a\n        /// tree; the caller is responsible for dereferencing a tag or\n        /// commit (if necessary).\n        /// </param>\n        /// <exception cref=\"IOException\">\n        /// A tree cannot be read to iterate through its entries.\n        /// </exception>\n        public void addTree(byte[] pathPrefix, int stage, Repository db, AnyObjectId tree)\n        {\n            var tw = new TreeWalk.TreeWalk(db);\n            tw.reset();\n            var curs = new WindowCursor();\n            try\n            {\n                tw.addTree(new CanonicalTreeParser(pathPrefix, db, tree.ToObjectId(), curs));\n            }\n            finally\n            {\n                curs.Release();\n            }\n            tw.Recursive = true;\n\n            if (!tw.next()) return;\n\n            DirCacheEntry newEntry = ToEntry(stage, tw);\n            BeforeAdd(newEntry);\n            FastAdd(newEntry);\n            while (tw.next())\n            {\n                FastAdd(ToEntry(stage, tw));\n            }\n        }\n\n        private static DirCacheEntry ToEntry(int stage, TreeWalk.TreeWalk tw)\n        {\n            var e = new DirCacheEntry(tw.getRawPath(), stage);\n            var iterator = tw.getTree<AbstractTreeIterator>(0, typeof(AbstractTreeIterator));\n            e.setFileMode(tw.getFileMode(0));\n            e.setObjectIdFromRaw(iterator.idBuffer(), iterator.idOffset());\n            return e;\n        }\n\n        public override void finish()\n        {\n            if (!_sorted)\n            {\n                Resort();\n            }\n            Replace();\n        }\n\n        private void BeforeAdd(DirCacheEntry newEntry)\n        {\n            if (_sorted && EntryCnt > 0)\n            {\n                DirCacheEntry lastEntry = Entries[EntryCnt - 1];\n                int cr = DirCache.Compare(lastEntry, newEntry);\n                if (cr > 0)\n                {\n                    // The new entry sorts before the old entry; we are\n                    // no longer sorted correctly. We'll need to redo\n                    // the sorting before we can close out the build.\n                    //\n                    _sorted = false;\n                }\n                else if (cr == 0)\n                {\n                    // Same file path; we can only insert this if the\n                    // stages won't be violated.\n                    //\n                    int peStage = lastEntry.getStage();\n                    int dceStage = newEntry.getStage();\n                    if (peStage == dceStage)\n                        throw Bad(newEntry, \"Duplicate stages not allowed\");\n                    if (peStage == 0 || dceStage == 0)\n                        throw Bad(newEntry, \"Mixed stages not allowed\");\n                    if (peStage > dceStage)\n                        _sorted = false;\n                }\n            }\n        }\n\n        private void Resort()\n        {\n            Array.Sort(Entries, 0, EntryCnt, new GenericComparer<DirCacheEntry>(DirCache.EntryComparer));\n\n            for (int entryIdx = 1; entryIdx < EntryCnt; entryIdx++)\n            {\n                DirCacheEntry pe = Entries[entryIdx - 1];\n                DirCacheEntry ce = Entries[entryIdx];\n                int cr = DirCache.Compare(pe, ce);\n                if (cr == 0)\n                {\n                    // Same file path; we can only allow this if the stages\n                    // are 1-3 and no 0 exists.\n                    //\n                    int peStage = pe.getStage();\n                    int ceStage = ce.getStage();\n\n                    if (peStage == ceStage)\n                    {\n                        throw Bad(ce, \"Duplicate stages not allowed\");\n                    }\n\n                    if (peStage == 0 || ceStage == 0)\n                    {\n                        throw Bad(ce, \"Mixed stages not allowed\");\n                    }\n                }\n            }\n\n            _sorted = true;\n        }\n\n        private static InvalidOperationException Bad(DirCacheEntry a, string msg)\n        {\n            return new InvalidOperationException(msg + \": \" + a.getStage() + \" \" + a.getPathString());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheEditor.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n    /// <summary>\n    /// Updates a <see cref=\"DirCache\"/> by supplying discrete edit commands.\n    /// <para/>\n    /// An editor updates a <see cref=\"DirCache\"/> by taking a list of\n    /// <see cref=\"PathEdit\"/> commands and executing them against the entries\n    /// of the destination cache to produce a new cache. This edit style allows\n    /// applications to insert a few commands and then have the editor compute\n    /// the proper entry indexes necessary to perform an efficient in-order\n    /// update of the index records. This can be easier to use than\n    /// <see cref=\"DirCacheBuilder\"/>.\n    /// </summary>\n    /// <seealso cref=\"DirCacheBuilder\"/>\n    public class DirCacheEditor : BaseDirCacheEditor\n    {\n        private static readonly Comparison<PathEdit> EditComparison = (o1, o2) =>\n        {\n            byte[] a = o1.Path;\n            byte[] b = o2.Path;\n            return DirCache.Compare(a, a.Length, b, b.Length);\n        };\n\n        private readonly List<PathEdit> _edits;\n\n        /// <summary>\n        /// Construct a new editor.\n        /// </summary>\n        /// <param name=\"dirCache\">\n        /// The cache this editor will eventually update.\n        /// </param>\n        /// <param name=\"entryCount\">\n        /// Estimated number of entries the editor will have upon\n        /// completion. This sizes the initial entry table.\n        /// </param>\n        public DirCacheEditor(DirCache dirCache, int entryCount)\n            : base(dirCache, entryCount)\n        {\n            _edits = new List<PathEdit>();\n        }\n\n        /// <summary>\n        /// Append one edit command to the list of commands to be applied.\n        /// <para />\n        /// Edit commands may be added in any order chosen by the application. They\n        /// are automatically rearranged by the builder to provide the most efficient\n        /// update possible.\n        /// </summary>\n        /// <param name=\"edit\">Another edit command.</param>\n        public void add(PathEdit edit)\n        {\n            _edits.Add(edit);\n        }\n\n        public override bool commit()\n        {\n            if (_edits.Count == 0) // isEmpty()\n            {\n                // No changes? Don't rewrite the index.\n                //\n                Cache.unlock();\n                return true;\n            }\n            return base.commit();\n        }\n\n        public override void finish()\n        {\n            if (_edits.Count <= 0) return;\n            ApplyEdits();\n            Replace();\n        }\n\n        private void ApplyEdits()\n        {\n            _edits.Sort(EditComparison);\n\n            int maxIdx = Cache.getEntryCount();\n            int lastIdx = 0;\n            foreach (PathEdit e in _edits)\n            {\n                int eIdx = Cache.findEntry(e.Path, e.Path.Length);\n                bool missing = eIdx < 0;\n                if (eIdx < 0)\n                {\n                    eIdx = -(eIdx + 1);\n                }\n                int cnt = Math.Min(eIdx, maxIdx) - lastIdx;\n                if (cnt > 0)\n                {\n                    FastKeep(lastIdx, cnt);\n                }\n                lastIdx = missing ? eIdx : Cache.nextEntry(eIdx);\n\n                if (e is DeletePath) continue;\n                if (e is DeleteTree)\n                {\n                    lastIdx = Cache.nextEntry(e.Path, e.Path.Length, eIdx);\n                    continue;\n                }\n\n                DirCacheEntry ent;\n                if (missing)\n                {\n                    ent = new DirCacheEntry(e.Path);\n                    e.Apply(ent);\n                    if (ent.getRawMode() == 0)\n                        throw new ArgumentException(\"FileMode not set\"\n                                + \" for path \" + ent.getPathString());\n                }\n                else\n                {\n                    ent = Cache.getEntry(eIdx);\n                    e.Apply(ent);\n                }\n                FastAdd(ent);\n            }\n\n            int count = maxIdx - lastIdx;\n            if (count > 0)\n            {\n                FastKeep(lastIdx, count);\n            }\n        }\n\n        #region Nested Types\n\n        /// <summary>\n        /// Any index record update.\n        /// <para />\n        /// Applications should subclass and provide their own implementation for the\n        /// <see cref=\"Apply\"/> method. The editor will invoke apply once\n        /// for each record in the index which matches the path name. If there are\n        /// multiple records (for example in stages 1, 2 and 3), the edit instance\n        /// will be called multiple times, once for each stage.\n        /// </summary>\n        public abstract class PathEdit\n        {\n            private readonly byte[] _path;\n\n            /// <summary>\n            /// Create a new update command by path name.\n            /// </summary>\n            /// <param name=\"entryPath\">path of the file within the repository.</param>\n            protected PathEdit(string entryPath)\n            {\n                _path = Constants.encode(entryPath);\n            }\n\n            /// <summary>\n            /// Create a new update command for an existing entry instance.\n            /// </summary>\n            /// <param name=\"ent\">\n            /// Entry instance to match path of. Only the path of this\n            /// entry is actually considered during command evaluation.\n            /// </param>\n            protected PathEdit(DirCacheEntry ent)\n            {\n                _path = ent.Path;\n            }\n\n            public byte[] Path\n            {\n                get { return _path; }\n            }\n\n            /// <summary>\n            /// Apply the update to a single cache entry matching the path.\n            /// <para />\n            /// After apply is invoked the entry is added to the output table, and\n            /// will be included in the new index.\n            /// </summary>\n            /// <param name=\"ent\">\n            /// The entry being processed. All fields are zeroed out if\n            /// the path is a new path in the index.\n            /// </param>\n            public abstract void Apply(DirCacheEntry ent);\n        }\n\n        /// <summary>\n        /// Deletes a single file entry from the index.\n        /// <para />\n        /// This deletion command removes only a single file at the given location,\n        /// but removes multiple stages (if present) for that path. To remove a\n        /// complete subtree use <see cref=\"DeleteTree\"/> instead.\n        /// </summary>\n        /// <seealso cref=\"DeleteTree\"/>\n        public class DeletePath : PathEdit\n        {\n            /// <summary>\n            /// Create a new deletion command by path name.\n            /// </summary>\n            /// <param name=\"entryPath\">\n            /// Path of the file within the repository.\n            /// </param>\n            public DeletePath(string entryPath)\n                : base(entryPath)\n            {\n            }\n\n            ///\t<summary>\n            /// Create a new deletion command for an existing entry instance.\n            /// </summary>\n            /// <param name=\"ent\">\n            /// Entry instance to remove. Only the path of this entry is\n            /// actually considered during command evaluation.\n            /// </param>\n            public DeletePath(DirCacheEntry ent)\n                : base(ent)\n            {\n            }\n\n            public override void Apply(DirCacheEntry ent)\n            {\n                throw new NotSupportedException(\"No apply in delete\");\n            }\n        }\n\n        ///\t<summary>\n        /// Recursively deletes all paths under a subtree.\n        /// <para />\n        /// This deletion command is more generic than <seealso cref=\"DeletePath\"/> as it can\n        /// remove all records which appear recursively under the same subtree.\n        /// Multiple stages are removed (if present) for any deleted entry.\n        /// <para />\n        /// This command will not remove a single file entry. To remove a single file\n        /// use <seealso cref=\"DeletePath\"/>.\n        /// </summary>\n        /// <seealso cref=\"DeletePath\"/>\n        public class DeleteTree : PathEdit\n        {\n            ///\t<summary>\n            /// Create a new tree deletion command by path name.\n            /// </summary>\n            /// <param name=\"entryPath\">\n            /// Path of the subtree within the repository. If the path\n            /// does not end with \"/\" a \"/\" is implicitly added to ensure\n            /// only the subtree's contents are matched by the command.\n            /// </param>\n            public DeleteTree(string entryPath)\n                : base(entryPath.EndsWith(\"/\") ? entryPath : entryPath + \"/\")\n            {\n            }\n\n            public override void Apply(DirCacheEntry ent)\n            {\n                throw new NotSupportedException(\"No apply in delete\");\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheEntry.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n    /// <summary>\n    /// A single file (or stage of a file) in a <seealso cref=\"DirCache\"/>.\n    /// <para />\n    /// An entry represents exactly one stage of a file. If a file path is unmerged\n    /// then multiple DirCacheEntry instances may appear for the same path name.\n    /// </summary>\n    public class DirCacheEntry\n    {\n        private static readonly byte[] NullPad = new byte[8];\n\n        /** The standard (fully merged) stage for an entry. */\n        public const int STAGE_0 = 0;\n\n        /** The base tree revision for an entry. */\n        public const int STAGE_1 = 1;\n\n        /** The first tree revision (usually called \"ours\"). */\n        public const int STAGE_2 = 2;\n\n        /** The second tree revision (usually called \"theirs\"). */\n        public const int STAGE_3 = 3;\n\n        // private const  int P_CTIME = 0;\n        // private const  int P_CTIME_NSEC = 4;\n        private const int PMtime = 8;\n        // private const  int P_MTIME_NSEC = 12;\n        // private const  int P_DEV = 16;\n        // private const  int P_INO = 20;\n        private const int PMode = 24;\n        // private const  int P_UID = 28;\n        // private const  int P_GID = 32;\n        private const int PSize = 36;\n        private const int PObjectid = 40;\n        private const int PFlags = 60;\n\n        public const int INFO_LEN = 62;\n\n        /// <summary>\n        /// Mask applied to data in <see cref=\"PFlags\"/> to get the name Length.\n        /// </summary>\n        private const int NameMask = 0xfff;\n        private const int AssumeValid = 0x80;\n\n        /// <summary>\n        /// (Possibly shared) header information storage.\n        /// </summary>\n        private readonly byte[] _info;\n\n        /// <summary>\n        /// First location within <see cref=\"_info\"/> where our header starts.\n        /// </summary>\n        private readonly int _infoOffset;\n\n        /// <summary>\n        /// Our encoded path name, from the root of the repository.\n        /// </summary>\n        private readonly byte[] _path;\n\n        public DirCacheEntry(byte[] sharedInfo, int infoAt, Stream @in, MessageDigest md)\n        {\n            _info = sharedInfo;\n            _infoOffset = infoAt;\n\n            IO.ReadFully(@in, _info, _infoOffset, INFO_LEN);\n            md.Update(_info, _infoOffset, INFO_LEN);\n\n            int pathLen = NB.decodeUInt16(_info, _infoOffset + PFlags) & NameMask;\n            int skipped = 0;\n            if (pathLen < NameMask)\n            {\n                _path = new byte[pathLen];\n                IO.ReadFully(@in, _path, 0, pathLen);\n                md.Update(_path, 0, pathLen);\n            }\n            else\n            {\n                var tmp = new MemoryStream();\n                {\n                    var buf = new byte[NameMask];\n                    IO.ReadFully(@in, buf, 0, NameMask);\n                    tmp.Write(buf, 0, buf.Length);\n                }\n\n                while (true)\n                {\n                    int c = @in.ReadByte();\n                    if (c < 0)\n                    {\n                        throw new EndOfStreamException(\"Short Read of block.\");\n                    }\n\n                    if (c == 0) break;\n\n                    tmp.Write(new[] { (byte)c }, 0, 1);\n                }\n\n                _path = tmp.ToArray();\n                pathLen = _path.Length;\n                skipped = 1; // we already skipped 1 '\\0' above to break the loop.\n                md.Update(_path, 0, pathLen);\n                md.Update(0);\n            }\n\n            // Index records are padded out to the next 8 byte alignment\n            // for historical reasons related to how C Git Read the files.\n            //\n            int actLen = INFO_LEN + pathLen;\n            int expLen = (actLen + 8) & ~7;\n            int padLen = expLen - actLen - skipped;\n            if (padLen > 0)\n            {\n                IO.skipFully(@in, padLen);\n                md.Update(NullPad, 0, padLen);\n            }\n        }\n\n        ///\t<summary>\n        /// Create an empty entry at stage 0.\n        /// </summary>\n        /// <param name=\"newPath\">Name of the cache entry.</param>\n        public DirCacheEntry(string newPath)\n            : this(Constants.encode(newPath))\n        {\n        }\n\n        ///\t<summary>\n        /// Create an empty entry at the specified stage.\n        /// </summary>\n        /// <param name=\"newPath\">name of the cache entry.</param>\n        /// <param name=\"stage\">the stage index of the new entry.</param>\n        public DirCacheEntry(string newPath, int stage)\n            : this(Constants.encode(newPath), stage)\n        {\n        }\n\n        /// <summary>\n        /// Create an empty entry at stage 0.\n        /// </summary>\n        /// <param name=\"newPath\">\n        /// name of the cache entry, in the standard encoding.\n        /// </param>\n        public DirCacheEntry(byte[] newPath)\n            : this(newPath, STAGE_0)\n        {\n        }\n\n        /// <summary>\n        /// Create an empty entry at the specified stage.\n        /// </summary>\n        /// <param name=\"newPath\">\n        /// Name of the cache entry, in the standard encoding.\n        /// </param>\n        /// <param name=\"stage\">The stage index of the new entry.</param>\n        public DirCacheEntry(byte[] newPath, int stage)\n        {\n            if (!isValidPath(newPath))\n                throw new ArgumentException(\"Invalid path: \"\n                        + toString(newPath));\n            if (stage < 0 || 3 < stage)\n                throw new ArgumentException(\"Invalid stage \" + stage\n                    + \" for path \" + toString(newPath));\n\n            _info = new byte[INFO_LEN];\n            _infoOffset = 0;\n            _path = newPath;\n\n            int flags = ((stage & 0x3) << 12);\n            if (_path.Length < NameMask)\n            {\n                flags |= _path.Length;\n            }\n            else\n            {\n                flags |= NameMask;\n            }\n\n            NB.encodeInt16(_info, _infoOffset + PFlags, flags);\n        }\n\n        public void write(Stream os)\n        {\n            int pathLen = _path.Length;\n            os.Write(_info, _infoOffset, INFO_LEN);\n            os.Write(_path, 0, pathLen);\n\n            // Index records are padded out to the next 8 byte alignment\n            // for historical reasons related to how C Git Read the files.\n            //\n            int actLen = INFO_LEN + pathLen;\n            int expLen = (actLen + 8) & ~7;\n            if (actLen != expLen)\n            {\n                os.Write(NullPad, 0, expLen - actLen);\n            }\n        }\n\n        ///\t<summary>\n        /// Is it possible for this entry to be accidentally assumed clean?\n        /// <para />\n        /// The \"racy git\" problem happens when a work file can be updated faster\n        /// than the filesystem records file modification timestamps. It is possible\n        /// for an application to edit a work file, update the index, then edit it\n        /// again before the filesystem will give the work file a new modification\n        /// timestamp. This method tests to see if file was written out at the same\n        /// time as the index.\n        /// </summary>\n        /// <param name=\"smudge_s\">\n        /// Seconds component of the index's last modified time.\n        /// </param>\n        /// <param name=\"smudge_ns\">\n        /// Nanoseconds component of the index's last modified time.\n        /// </param>\n        /// <returns>true if extra careful checks should be used.</returns>\n        public bool mightBeRacilyClean(int smudge_s, int smudge_ns)\n        {\n            // If the index has a modification time then it came from disk\n            // and was not generated from scratch in memory. In such cases\n            // the entry is 'racily clean' if the entry's cached modification\n            // time is equal to or later than the index modification time. In\n            // such cases the work file is too close to the index to tell if\n            // it is clean or not based on the modification time alone.\n            //\n            int @base = _infoOffset + PMtime;\n            int mtime = NB.DecodeInt32(_info, @base);\n            if (smudge_s < mtime) return true;\n\n            if (smudge_s == mtime)\n                return smudge_ns <= NB.DecodeInt32(_info, @base + 4) / 1000000;\n\n            return false;\n        }\n\n        /// <summary>\n        /// Force this entry to no longer match its working tree file.\n        /// <para />\n        /// This avoids the \"racy git\" problem by making this index entry no longer\n        /// match the file in the working directory. Later git will be forced to\n        /// compare the file content to ensure the file matches the working tree.\n        /// </summary>\n        public void smudgeRacilyClean()\n        {\n            // We don't use the same approach as C Git to smudge the entry,\n            // as we cannot compare the working tree file to our SHA-1 and\n            // thus cannot use the \"size to 0\" trick without accidentally\n            // thinking a zero Length file is clean.\n            //\n            // Instead we force the mtime to the largest possible value, so\n            // it is certainly After the index's own modification time and\n            // on a future Read will cause mightBeRacilyClean to say \"yes!\".\n            // It is also unlikely to match with the working tree file.\n            //\n            // I'll see you again before Jan 19, 2038, 03:14:07 AM GMT.\n            //\n            int @base = _infoOffset + PMtime;\n            _info.Fill(@base, @base + 8, (byte)127);\n        }\n\n        public byte[] idBuffer()\n        {\n            return _info;\n        }\n\n        public int idOffset()\n        {\n            return _infoOffset + PObjectid;\n        }\n\n        ///\t<summary>\n        /// Is this entry always thought to be unmodified?\n        /// <para />\n        /// Most entries in the index do not have this flag set. Users may however\n        /// set them on if the file system stat() costs are too high on this working\n        /// directory, such as on NFS or SMB volumes.\n        /// </summary>\n        /// <returns> true if we must assume the entry is unmodified. </returns>\n        public bool isAssumeValid()\n        {\n            return (_info[_infoOffset + PFlags] & AssumeValid) != 0;\n        }\n\n        /// <summary>\n        /// Set the assume valid flag for this entry,\n        /// </summary>\n        /// <param name=\"assume\">\n        /// True to ignore apparent modifications; false to look at last\n        /// modified to detect file modifications. \n        /// </param>\n        public void setAssumeValid(bool assume)\n        {\n            unchecked\n            {\n                if (assume)\n                    _info[_infoOffset + PFlags] |= (byte)AssumeValid;\n                else\n                    _info[_infoOffset + PFlags] &= (byte)~AssumeValid; // [henon] (byte)-129 results in an overflow\n            }\n        }\n\n        /// <summary>\n        /// Get the stage of this entry.\n        /// <para />\n        /// Entries have one of 4 possible stages: 0-3.\n        /// </summary>\n        /// <returns> the stage of this entry. </returns>\n        public int getStage()\n        {\n            return (int)((uint)(_info[_infoOffset + PFlags]) >> 4) & 0x3;\n        }\n\n        ///\t<summary>\n        /// Obtain the raw <seealso cref=\"FileMode\"/> bits for this entry.\n        ///\t</summary>\n        ///\t<returns> mode bits for the entry. </returns>\n        ///\t<seealso cref=\"FileMode.FromBits(int)\"/>\n        public int getRawMode()\n        {\n            return NB.DecodeInt32(_info, _infoOffset + PMode);\n        }\n\n        /// <summary>\n        /// Obtain the <seealso cref=\"FileMode\"/> for this entry.\n        /// </summary>\n        /// <returns>The file mode singleton for this entry.</returns>\n        public FileMode getFileMode()\n        {\n            return FileMode.FromBits(getRawMode());\n        }\n\n        ///\t<summary>\n        /// Set the file mode for this entry.\n        ///\t</summary>\n        ///\t<param name=\"mode\"> The new mode constant. </param>\n        public void setFileMode(FileMode mode)\n        {\n            switch (mode.Bits & FileMode.TYPE_MASK)\n            {\n                case FileMode.TYPE_MISSING:\n                case FileMode.TYPE_TREE:\n                    throw new ArgumentException(\"Invalid mode \" + mode.Bits\n                        + \" for path \" + getPathString());\n            }\n\n            NB.encodeInt32(_info, _infoOffset + PMode, mode.Bits);\n        }\n\n        ///\t<summary>\n        /// Get the cached last modification date of this file, in milliseconds.\n        ///\t<para />\n        /// One of the indicators that the file has been modified by an application\n        /// changing the working tree is if the last modification time for the file\n        /// differs from the time stored in this entry.\n        /// </summary>\n        /// <returns> last modification time of this file, in milliseconds since the\n        /// Java epoch (midnight Jan 1, 1970 UTC).\n        /// </returns>\n        public long getLastModified()\n        {\n            return DecodeTimestamp(PMtime);\n        }\n\n        /// <summary>\n        /// Set the cached last modification date of this file, using milliseconds.\n        /// </summary>\n        /// <param name=\"when\">\n        /// new cached modification date of the file, in milliseconds.\n        /// </param>\n        public void setLastModified(long when)\n        {\n            EncodeTimestamp(PMtime, when);\n        }\n\n        /// <summary>\n        /// Get the cached size (in bytes) of this file.\n        /// <para />\n        /// One of the indicators that the file has been modified by an application\n        /// changing the working tree is if the size of the file (in bytes) differs\n        /// from the size stored in this entry.\n        /// <para />\n        /// Note that this is the length of the file in the working directory, which\n        /// may differ from the size of the decompressed blob if work tree filters\n        /// are being used, such as LF&lt;-&gt;CRLF conversion.\n        /// </summary>\n        /// <returns> cached size of the working directory file, in bytes. </returns>\n        public int getLength()\n        {\n            return NB.DecodeInt32(_info, _infoOffset + PSize);\n        }\n\n        /// <summary>\n        /// Set the cached size (in bytes) of this file.\n        /// </summary>\n        /// <param name=\"sz\">new cached size of the file, as bytes.</param>\n        public void setLength(int sz)\n        {\n            NB.encodeInt32(_info, _infoOffset + PSize, sz);\n        }\n\n        /// <summary>\n        /// Obtain the ObjectId for the entry.\n        /// <para />\n        /// Using this method to compare ObjectId values between entries is\n        /// inefficient as it causes memory allocation.\n        /// </summary>\n        /// <returns> object identifier for the entry. </returns>\n        public ObjectId getObjectId()\n        {\n            return ObjectId.FromRaw(idBuffer(), idOffset());\n        }\n\n        ///\t<summary>\n        /// Set the ObjectId for the entry.\n        ///\t</summary>\n        ///\t<param name=\"id\">\n        /// New object identifier for the entry. May be\n        /// <seealso cref=\"ObjectId.ZeroId\"/> to remove the current identifier.\n        /// </param>\n        public void setObjectId(AnyObjectId id)\n        {\n            id.copyRawTo(idBuffer(), idOffset());\n        }\n\n        /// <summary>\n        /// Set the ObjectId for the entry from the raw binary representation.\n        /// </summary>\n        /// <param name=\"bs\">\n        /// The raw byte buffer to read from. At least 20 bytes after <paramref name=\"p\"/>\n        /// must be available within this byte array. \n        /// </param>\n        /// <param name=\"p\">position to read the first byte of data from. </param>\n        public void setObjectIdFromRaw(byte[] bs, int p)\n        {\n            Array.Copy(bs, p, idBuffer(), idOffset(), Constants.OBJECT_ID_LENGTH);\n        }\n\n        ///\t<summary>\n        /// Get the entry's complete path.\n        /// <para />\n        /// This method is not very efficient and is primarily meant for debugging\n        /// and final output generation. Applications should try to avoid calling it,\n        /// and if invoked do so only once per interesting entry, where the name is\n        /// absolutely required for correct function.\n        /// </summary>\n        /// <returns>\n        /// Complete path of the entry, from the root of the repository. If\n        /// the entry is in a subtree there will be at least one '/' in the\n        /// returned string. \n        /// </returns>\n        public string getPathString()\n        {\n            return toString(_path);\n        }\n\n        ///\t<summary>\n        /// Copy the ObjectId and other meta fields from an existing entry.\n        ///\t<para />\n        ///\tThis method copies everything except the path from one entry to another,\n        ///\tsupporting renaming.\n        ///\t</summary>\n        ///\t<param name=\"src\">\n        /// The entry to copy ObjectId and meta fields from.\n        /// </param>\n        public void copyMetaData(DirCacheEntry src)\n        {\n            int pLen = NB.decodeUInt16(_info, _infoOffset + PFlags) & NameMask;\n            Array.Copy(src._info, src._infoOffset, _info, _infoOffset, INFO_LEN);\n\n            NB.encodeInt16(_info, _infoOffset + PFlags, pLen\n                    | NB.decodeUInt16(_info, _infoOffset + PFlags) & ~NameMask);\n        }\n\n        private long DecodeTimestamp(int pIdx)\n        {\n            int @base = _infoOffset + pIdx;\n            int sec = NB.DecodeInt32(_info, @base);\n            int ms = NB.DecodeInt32(_info, @base + 4) / 1000000;\n            return 1000L * sec + ms;\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <param name=\"pIdx\"></param>\n        /// <param name=\"when\">\n        /// New cached modification date of the file, in milliseconds.\n        /// </param>\n        private void EncodeTimestamp(int pIdx, long when)\n        {\n            int @base = _infoOffset + pIdx;\n            NB.encodeInt32(_info, @base, (int)(when / 1000));\n            NB.encodeInt32(_info, @base + 4, ((int)(when % 1000)) * 1000000);\n        }\n\n        public byte[] Path\n        {\n            get { return _path; }\n        }\n\n        private static String toString(byte[] path)\n        {\n            return Constants.CHARSET.GetString(path);\n        }\n\n        public static bool isValidPath(byte[] path)\n        {\n            if (path.Length == 0)\n                return false; // empty path is not permitted.\n\n            bool componentHasChars = false;\n            foreach (byte c in path)\n            {\n                switch (c)\n                {\n                    case 0:\n                        return false; // NUL is never allowed within the path.\n\n                    case (byte)'/':\n                        if (componentHasChars)\n                            componentHasChars = false;\n                        else\n                            return false;\n                        break;\n\n                    default:\n                        componentHasChars = true;\n                        break;\n                }\n            }\n            return componentHasChars;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheIterator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n\t/// <summary>\n\t/// Iterate a <see cref=\"DirCache\"/> as part of a <see cref=\"TreeWalk\"/>.\n\t/// <para/>\n\t/// This is an iterator to adapt a loaded <see cref=\"DirCache\"/> instance (such as\n\t/// Read from an existing <code>.git/index</code> file) to the tree structure\n\t/// used by a <see cref=\"TreeWalk\"/>, making it possible for applications to walk\n\t/// over any combination of tree objects already in the object database, index\n\t/// files, or working directories.\n\t/// </summary>\n\t/// <seealso cref=\"TreeWalk\"/>\n\tpublic class DirCacheIterator : AbstractTreeIterator\n\t{\n\t\tprivate int _pointer;\n\t\tprivate int _nextSubtreePos;\n\t\tprivate DirCacheEntry _currentEntry;\n\t\tprivate DirCacheTree _currentSubtree;\n\n\t\t/// <summary>\n\t\t/// Create a new iterator for an already loaded DirCache instance.\n\t\t/// <para/>\n\t\t/// The iterator implementation may copy part of the cache's data during\n\t\t/// construction, so the cache must be Read in prior to creating the\n\t\t/// iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"dc\">\n\t\t/// The cache to walk. It must be already loaded into memory.\n\t\t/// </param>\n\t\tpublic DirCacheIterator(DirCache dc)\n\t\t{\n\t\t\tCache = dc;\n\t\t\tTree = dc.getCacheTree(true);\n\t\t\tTreeStart = 0;\n\t\t\tTreeEnd = Tree.getEntrySpan();\n\t\t\tSubtreeId = new byte[Constants.OBJECT_ID_LENGTH];\n\n\t\t\tif (!eof())\n\t\t\t{\n\t\t\t\tParseEntry();\n\t\t\t}\n\t\t}\n\n\t\tpublic DirCacheIterator(DirCacheIterator parentIterator, DirCacheTree cacheTree)\n\t\t\t: base(parentIterator, parentIterator.Path, parentIterator.PathLen + 1)\n\t\t{\n\t\t\tif ( parentIterator == null)\n\t\t\t{\n\t\t\t\tthrow new System.ArgumentNullException(\"parentIterator\");\n\t\t\t}\n\t\t\tCache = parentIterator.Cache;\n\t\t\tTree = cacheTree;\n\t\t\tTreeStart = parentIterator._pointer;\n\t\t\tTreeEnd = TreeStart + Tree.getEntrySpan();\n\t\t\tSubtreeId = parentIterator.SubtreeId;\n\t\t\t_pointer = parentIterator._pointer;\n\t\t\tParseEntry();\n\t\t}\n\n\t\tpublic override AbstractTreeIterator createSubtreeIterator(Repository repo)\n\t\t{\n\t\t\tif (_currentSubtree == null)\n\t\t\t{\n\t\t\t\tthrow new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE);\n\t\t\t}\n\n\t\t\treturn new DirCacheIterator(this, _currentSubtree);\n\t\t}\n\n\t\tpublic override EmptyTreeIterator createEmptyTreeIterator()\n\t\t{\n\t\t\tvar newPath = new byte[Math.Max(PathLen + 1, DEFAULT_PATH_SIZE)];\n\t\t\tArray.Copy(Path, 0, newPath, 0, PathLen);\n\t\t\tnewPath[PathLen] = (byte)'/';\n\t\t\treturn new EmptyTreeIterator(this, newPath, PathLen + 1);\n\t\t}\n\n\t\tpublic override byte[] idBuffer()\n\t\t{\n\t\t\tif (_currentSubtree != null)\n\t\t\t{\n\t\t\t\treturn SubtreeId;\n\t\t\t}\n\n\t\t\tif (_currentEntry != null)\n\t\t\t{\n\t\t\t\treturn _currentEntry.idBuffer();\n\t\t\t}\n\n\t\t\treturn ZeroId;\n\t\t}\n\n\t\tpublic override int idOffset()\n\t\t{\n\t\t\tif (_currentSubtree != null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (_currentEntry != null)\n\t\t\t{\n\t\t\t\treturn _currentEntry.idOffset();\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic override bool first()\n\t\t{\n\t\t\treturn _pointer == TreeStart;\n\t\t}\n\n\t\tpublic override bool eof()\n\t\t{\n\t\t\treturn _pointer == TreeEnd;\n\t\t}\n\n\t\tpublic override void next(int delta)\n\t\t{\n\t\t\twhile (--delta >= 0)\n\t\t\t{\n\t\t\t\tif (_currentSubtree != null)\n\t\t\t\t{\n\t\t\t\t\t_pointer += _currentSubtree.getEntrySpan();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_pointer++;\n\t\t\t\t}\n\n\t\t\t\tif (eof()) break;\n\n\t\t\t\tParseEntry();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void back(int delta)\n\t\t{\n\t\t\twhile (--delta >= 0)\n\t\t\t{\n\t\t\t\tif (_currentSubtree != null)\n\t\t\t\t{\n\t\t\t\t\t_nextSubtreePos--;\n\t\t\t\t}\n\n\t\t\t\t_pointer--;\n\t\t\t\tParseEntry();\n\t\t\t\t\n\t\t\t\tif (_currentSubtree != null)\n\t\t\t\t{\n\t\t\t\t\t_pointer -= _currentSubtree.getEntrySpan() - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void ParseEntry()\n\t\t{\n\t\t\t_currentEntry = Cache.getEntry(_pointer);\n\t\t\tbyte[] cep = _currentEntry.Path;\n\n\t\t\tif (_nextSubtreePos != Tree.getChildCount())\n\t\t\t{\n\t\t\t\tDirCacheTree s = Tree.getChild(_nextSubtreePos);\n\t\t\t\tif (s.contains(cep, PathOffset, cep.Length))\n\t\t\t\t{\n\t\t\t\t\t// The current position is the first file of this subtree.\n\t\t\t\t\t// Use the subtree instead as the current position.\n\t\t\t\t\t//\n\t\t\t\t\t_currentSubtree = s;\n\t\t\t\t\t_nextSubtreePos++;\n\n\t\t\t\t\tif (s.isValid())\n\t\t\t\t\t{\n\t\t\t\t\t\ts.getObjectId().copyRawTo(SubtreeId, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSubtreeId.Fill((byte)0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tMode = FileMode.Tree.Bits;\n\n\t\t\t\t\tPath = cep;\n\t\t\t\t\tPathLen = PathOffset + s.nameLength();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The current position is a file/symlink/gitlink so we\n\t\t\t// do not have a subtree located here.\n\t\t\t//\n\t\t\tMode = _currentEntry.getRawMode();\n\t\t\tPath = cep;\n\t\t\tPathLen = cep.Length;\n\t\t\t_currentSubtree = null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The cache this iterator was created to walk.\n\t\t/// </summary>\n\t\tpublic DirCache Cache { get; private set; }\n\n\t\t/// <summary>\n\t\t/// The tree this iterator is walking.\n\t\t/// </summary>\n\t\tpublic DirCacheTree Tree { get; private set; }\n\n\t\t/// <summary>\n\t\t/// First position in this tree.\n\t\t/// </summary>\n\t\tpublic int TreeStart { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Last position in this tree.\n\t\t/// </summary>\n\t\tpublic int TreeEnd { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Special buffer to hold the <see cref=\"ObjectId\"/> of <see cref=\"CurrentSubtree\"/>.\n\t\t/// </summary>\n\t\tpublic byte[] SubtreeId { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Index of entry within <see cref=\"Cache\"/>.\n\t\t/// </summary>\n\t\tpublic int Pointer\n\t\t{\n\t\t\tget { return _pointer; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Next subtree to consider within <see cref=\"Tree\"/>.\n\t\t/// </summary>\n\t\tpublic int NextSubtreePos\n\t\t{\n\t\t\tget { return _nextSubtreePos; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The current file entry from <see cref=\"Cache\"/>.\n\t\t/// </summary>\n\t\tpublic DirCacheEntry CurrentEntry\n\t\t{\n\t\t\tget { return _currentEntry; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The subtree containing <see cref=\"CurrentEntry\"/> if this is first entry.\n\t\t/// </summary>\n\t\tpublic DirCacheTree CurrentSubtree\n\t\t{\n\t\t\tget { return _currentSubtree; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the DirCacheEntry for the current file.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The current cache entry, if this iterator is positioned on a\n\t\t/// non-tree.\n\t\t/// </returns>\n\t\tpublic DirCacheEntry getDirCacheEntry()\n\t\t{\n\t\t\treturn _currentSubtree == null ? _currentEntry : null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/DirectoryCache/DirCacheTree.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.DirectoryCache\n{\n    /// <summary>\n    /// Single tree record from the 'TREE' <seealso cref=\"DirCache\"/> extension.\n    /// <para />\n    /// A valid cache tree record contains the object id of a tree object and the\n    /// total number of <seealso cref=\"DirCacheEntry\"/> instances (counted recursively) from\n    /// the DirCache contained within the tree. This information facilitates faster\n    /// traversal of the index and quicker generation of tree objects prior to\n    /// creating a new commit.\n    /// <para />\n    /// An invalid cache tree record indicates a known subtree whose file entries\n    /// have changed in ways that cause the tree to no longer have a known object id.\n    /// Invalid cache tree records must be revalidated prior to use.\n    /// </summary>\n    public class DirCacheTree\n    {\n        private static readonly byte[] NoName = { };\n        private static readonly DirCacheTree[] NoChildren = { };\n\n        private static readonly Comparison<DirCacheTree> TreeComparison = (o1, o2) =>\n        {\n            byte[] a = o1._encodedName;\n            byte[] b = o2._encodedName;\n            int aLen = a.Length;\n            int bLen = b.Length;\n            int cPos;\n\n            for (cPos = 0; cPos < aLen && cPos < bLen; cPos++)\n            {\n                int cmp = (a[cPos] & 0xff) - (b[cPos] & (byte)0xff);\n                if (cmp != 0)\n                {\n                    return cmp;\n                }\n            }\n\n            if (aLen == bLen)\n            {\n                return 0;\n            }\n\n            if (aLen < bLen)\n            {\n                return '/' - (b[cPos] & 0xff);\n            }\n\n            return (a[cPos] & 0xff) - '/';\n        };\n\n        // Tree this tree resides in; null if we are the root.\n        private readonly DirCacheTree _parent;\n\n        // Name of this tree within its parent.\n        private readonly byte[] _encodedName;\n\n        // Number of DirCacheEntry records that belong to this tree.\n        private int _entrySpan;\n\n        // Unique SHA-1 of this tree; null if invalid.\n        private ObjectId _id;\n\n        // Child trees, if any, sorted by EncodedName.\n        private DirCacheTree[] _children;\n\n        // Number of valid children.\n        private int _childCount;\n\n        public DirCacheTree()\n        {\n            _encodedName = NoName;\n            _children = NoChildren;\n            _childCount = 0;\n            _entrySpan = -1;\n        }\n\n        private DirCacheTree(DirCacheTree myParent, byte[] path, int pathOff, int pathLen)\n        {\n            _parent = myParent;\n            _encodedName = new byte[pathLen];\n            Array.Copy(path, pathOff, _encodedName, 0, pathLen);\n            _children = NoChildren;\n            _childCount = 0;\n            _entrySpan = -1;\n        }\n\n        public DirCacheTree(byte[] @in, MutableInteger off, DirCacheTree myParent)\n        {\n            _parent = myParent;\n\n            int ptr = RawParseUtils.next(@in, off.value, (byte)'\\0');\n            int nameLen = ptr - off.value - 1;\n            if (nameLen > 0)\n            {\n                _encodedName = new byte[nameLen];\n                Array.Copy(@in, off.value, _encodedName, 0, nameLen);\n            }\n            else\n            {\n                _encodedName = NoName;\n            }\n\n            _entrySpan = RawParseUtils.parseBase10(@in, ptr, off);\n            int subcnt = RawParseUtils.parseBase10(@in, off.value, off);\n            off.value = RawParseUtils.next(@in, off.value, (byte)'\\n');\n\n            if (_entrySpan >= 0)\n            {\n                // Valid trees have a positive entry count and an id of a\n                // tree object that should exist in the object database.\n                //\n                _id = ObjectId.FromRaw(@in, off.value);\n                off.value += Constants.OBJECT_ID_LENGTH;\n            }\n\n            if (subcnt > 0)\n            {\n                bool alreadySorted = true;\n                _children = new DirCacheTree[subcnt];\n                for (int i = 0; i < subcnt; i++)\n                {\n                    _children[i] = new DirCacheTree(@in, off, this);\n\n                    // C Git's ordering differs from our own; it prefers to\n                    // sort by Length first. This sometimes produces a sort\n                    // we do not desire. On the other hand it may have been\n                    // created by us, and be sorted the way we want.\n                    //\n                    if (alreadySorted && i > 0\n                            && TreeComparison(_children[i - 1], _children[i]) > 0)\n                    {\n                        alreadySorted = false;\n                    }\n                }\n\n                if (!alreadySorted)\n                {\n                    Array.Sort(_children, TreeComparison);\n                }\n            }\n            else\n            {\n                // Leaf level trees have no children, only (file) entries.\n                //\n                _children = NoChildren;\n            }\n            _childCount = subcnt;\n        }\n\n        public void write(byte[] tmp, TemporaryBuffer os)\n        {\n            int ptr = tmp.Length;\n            tmp[--ptr] = (byte)'\\n';\n            ptr = RawParseUtils.formatBase10(tmp, ptr, _childCount);\n            tmp[--ptr] = (byte)' ';\n            ptr = RawParseUtils.formatBase10(tmp, ptr, isValid() ? _entrySpan : -1);\n            tmp[--ptr] = 0;\n\n            os.write(_encodedName, 0, _encodedName.Length);\n            os.write(tmp, ptr, tmp.Length - ptr);\n\n            if (isValid())\n            {\n                _id.copyRawTo(tmp, 0);\n                os.write(tmp, 0, Constants.OBJECT_ID_LENGTH);\n            }\n\n            for (int i = 0; i < _childCount; i++)\n            {\n                _children[i].write(tmp, os);\n            }\n        }\n\n        /// <summary>\n        /// Determine if this cache is currently valid.\n        /// <para />\n        /// A valid cache tree knows how many <seealso cref=\"DirCacheEntry\"/> instances from\n        /// the parent <seealso cref=\"DirCache\"/> reside within this tree (recursively\n        /// enumerated). It also knows the object id of the tree, as the tree should\n        /// be readily available from the repository's object database.\n        /// </summary>\n        /// <returns>\n        /// True if this tree is knows key details about itself; false if the\n        /// tree needs to be regenerated.\n        /// </returns>\n        public bool isValid()\n        {\n            return _id != null;\n        }\n\n        /// <summary>\n        /// Get the number of entries this tree spans within the DirCache.\n        /// <para />\n        /// If this tree is not valid (see <seealso cref=\"isValid()\"/>) this method's return\n        /// value is always strictly negative (less than 0) but is otherwise an\n        /// undefined result.\n        /// </summary>\n        /// <returns>\n        /// Total number of entries (recursively) contained within this tree.\n        /// </returns>\n        public int getEntrySpan()\n        {\n            return _entrySpan;\n        }\n\n        /// <summary>\n        /// Get the number of cached subtrees contained within this tree.\n        /// </summary>\n        /// <returns>\n        /// Number of child trees available through this tree.\n        /// </returns>\n        public int getChildCount()\n        {\n            return _childCount;\n        }\n\n        /// <summary>\n        /// Get the i-th child cache tree.\n        /// </summary>\n        /// <param name=\"i\">Index of the child to obtain.</param>\n        /// <returns>The child tree.</returns>\n        public DirCacheTree getChild(int i)\n        {\n            return _children[i];\n        }\n\n        public ObjectId getObjectId()\n        {\n            return _id;\n        }\n\n        /// <summary>\n        /// Get the tree's name within its parent.\n        /// <para />\n        /// This method is not very efficient and is primarily meant for debugging\n        /// and final output generation. Applications should try to avoid calling it,\n        /// and if invoked do so only once per interesting entry, where the name is\n        /// absolutely required for correct function.\n        /// </summary>\n        /// <returns>\n        /// Name of the tree. This does not contain any '/' characters.\n        /// </returns>\n        public string getNameString()\n        {\n            return Constants.CHARSET.GetString(_encodedName);\n        }\n\n        /// <summary>\n        /// Get the tree's path within the repository.\n        /// <para />\n        /// This method is not very efficient and is primarily meant for debugging\n        /// and final output generation. Applications should try to avoid calling it,\n        /// and if invoked do so only once per interesting entry, where the name is\n        /// absolutely required for correct function.\n        /// </summary>\n        /// <returns>\n        /// Path of the tree, relative to the repository root. If this is not\n        /// the root tree the path ends with '/'. The root tree's path string\n        /// is the empty string (\"\").\n        /// </returns>\n        public string getPathString()\n        {\n            var sb = new StringBuilder();\n            AppendName(sb);\n            return sb.ToString();\n        }\n\n        ///\t<summary>\n        /// Write (if necessary) this tree to the object store.\n        ///\t</summary>\n        ///\t<param name=\"cacheEntry\">the complete cache from DirCache.</param>\n        ///\t<param name=\"cIdx\">\n        /// first position of <code>cache</code> that is a member of this\n        /// tree. The path of <code>cache[cacheIdx].path</code> for the\n        /// range <code>[0,pathOff-1)</code> matches the complete path of\n        /// this tree, from the root of the repository. </param>\n        ///\t<param name=\"pathOffset\">\n        /// number of bytes of <code>cache[cacheIdx].path</code> that\n        /// matches this tree's path. The value at array position\n        /// <code>cache[cacheIdx].path[pathOff-1]</code> is always '/' if\n        /// <code>pathOff</code> is > 0.\n        /// </param>\n        ///\t<param name=\"ow\">\n        /// the writer to use when serializing to the store.\n        /// </param>\n        ///\t<returns>identity of this tree.</returns>\n        ///\t<exception cref=\"UnmergedPathException\">\n        /// one or more paths contain higher-order stages (stage > 0),\n        /// which cannot be stored in a tree object.\n        /// </exception>\n        ///\t<exception cref=\"IOException\">\n        /// an unexpected error occurred writing to the object store.\n        /// </exception>\n        public ObjectId writeTree(DirCacheEntry[] cacheEntry, int cIdx, int pathOffset, ObjectWriter ow)\n        {\n            if (_id == null)\n            {\n                int endIdx = cIdx + _entrySpan;\n                int size = ComputeSize(cacheEntry, cIdx, pathOffset, ow);\n                var @out = new MemoryStream(size);\n                int childIdx = 0;\n                int entryIdx = cIdx;\n\n                while (entryIdx < endIdx)\n                {\n                    DirCacheEntry e = cacheEntry[entryIdx];\n                    byte[] ep = e.Path;\n                    if (childIdx < _childCount)\n                    {\n                        DirCacheTree st = _children[childIdx];\n                        if (st.contains(ep, pathOffset, ep.Length))\n                        {\n                            FileMode.Tree.CopyTo(@out);\n                            @out.Write(new[] { (byte)' ' }, 0, 1);\n                            @out.Write(st._encodedName, 0, st._encodedName.Length);\n                            @out.Write(new[] { (byte)0 }, 0, 1);\n                            st._id.copyRawTo(@out);\n\n                            entryIdx += st._entrySpan;\n                            childIdx++;\n                            continue;\n                        }\n                    }\n\n                    e.getFileMode().CopyTo(@out);\n                    @out.Write(new[] { (byte)' ' }, 0, 1);\n                    @out.Write(ep, pathOffset, ep.Length - pathOffset);\n                    @out.Write(new byte[] { 0 }, 0, 1);\n                    @out.Write(e.idBuffer(), e.idOffset(), Constants.OBJECT_ID_LENGTH);\n                    entryIdx++;\n                }\n\n                _id = ow.WriteCanonicalTree(@out.ToArray());\n            }\n\n            return _id;\n        }\n\n        private int ComputeSize(DirCacheEntry[] cache, int cIdx, int pathOffset, ObjectWriter ow)\n        {\n            int endIdx = cIdx + _entrySpan;\n            int childIdx = 0;\n            int entryIdx = cIdx;\n            int size = 0;\n\n            while (entryIdx < endIdx)\n            {\n                DirCacheEntry e = cache[entryIdx];\n                if (e.getStage() != 0)\n                {\n                    throw new UnmergedPathException(e);\n                }\n\n                byte[] ep = e.Path;\n                if (childIdx < _childCount)\n                {\n                    DirCacheTree st = _children[childIdx];\n                    if (st.contains(ep, pathOffset, ep.Length))\n                    {\n                        int stOffset = pathOffset + st.nameLength() + 1;\n                        st.writeTree(cache, entryIdx, stOffset, ow);\n\n                        size += FileMode.Tree.copyToLength();\n                        size += st.nameLength();\n                        size += Constants.OBJECT_ID_LENGTH + 2;\n\n                        entryIdx += st._entrySpan;\n                        childIdx++;\n                        continue;\n                    }\n                }\n\n                FileMode mode = e.getFileMode();\n\n                size += mode.copyToLength();\n                size += ep.Length - pathOffset;\n                size += Constants.OBJECT_ID_LENGTH + 2;\n                entryIdx++;\n            }\n\n            return size;\n        }\n\n        private void AppendName(StringBuilder sb)\n        {\n            if (_parent != null)\n            {\n                _parent.AppendName(sb);\n                sb.Append(getNameString());\n                sb.Append('/');\n            }\n            else if (nameLength() > 0)\n            {\n                sb.Append(getNameString());\n                sb.Append('/');\n            }\n        }\n\n        public int nameLength()\n        {\n            return _encodedName.Length;\n        }\n\n        public bool contains(byte[] a, int aOff, int aLen)\n        {\n            byte[] e = _encodedName;\n            int eLen = e.Length;\n            for (int eOff = 0; eOff < eLen && aOff < aLen; eOff++, aOff++)\n            {\n                if (e[eOff] != a[aOff]) return false;\n            }\n\n            if (aOff == aLen) return false;\n            return a[aOff] == '/';\n        }\n\n        ///\t<summary>\n        /// Update (if necessary) this tree's entrySpan.\n        ///\t</summary>\n        ///\t<param name=\"cache\">the complete cache from DirCache. </param>\n        ///\t<param name=\"cCnt\">\n        /// Number of entries in <code>cache</code> that are valid for\n        /// iteration.\n        /// </param>\n        ///\t<param name=\"cIdx\">\n        /// First position of <code>cache</code> that is a member of this\n        /// tree. The path of <code>cache[cacheIdx].path</code> for the\n        /// range <code>[0,pathOff-1)</code> matches the complete path of\n        /// this tree, from the root of the repository.\n        /// </param>\n        ///\t<param name=\"pathOff\">\n        /// number of bytes of <code>cache[cacheIdx].path</code> that\n        /// matches this tree's path. The value at array position\n        /// <code>cache[cacheIdx].path[pathOff-1]</code> is always '/' if\n        /// <code>pathOff</code> is > 0.\n        /// </param>\n        public void validate(DirCacheEntry[] cache, int cCnt, int cIdx, int pathOff)\n        {\n            if (_entrySpan >= 0)\n            {\n                // If we are valid, our children are also valid.\n                // We have no need to validate them.\n                //\n                return;\n            }\n\n            _entrySpan = 0;\n            if (cCnt == 0)\n            {\n                // Special case of an empty index, and we are the root tree.\n                //\n                return;\n            }\n\n            byte[] firstPath = cache[cIdx].Path;\n            int stIdx = 0;\n            while (cIdx < cCnt)\n            {\n                byte[] currPath = cache[cIdx].Path;\n                if (pathOff > 0 && !peq(firstPath, currPath, pathOff))\n                {\n                    // The current entry is no longer in this tree. Our\n                    // span is updated and the remainder goes elsewhere.\n                    //\n                    break;\n                }\n\n                DirCacheTree st = stIdx < _childCount ? _children[stIdx] : null;\n                int cc = NameComparison(currPath, pathOff, st);\n                if (cc > 0)\n                {\n                    // This subtree is now empty.\n                    //\n                    RemoveChild(stIdx);\n                    continue;\n                }\n\n                if (cc < 0)\n                {\n                    int p = Slash(currPath, pathOff);\n                    if (p < 0)\n                    {\n                        // The entry has no '/' and thus is directly in this\n                        // tree. Count it as one of our own.\n                        //\n                        cIdx++;\n                        _entrySpan++;\n                        continue;\n                    }\n\n                    // Build a new subtree for this entry.\n                    //\n                    st = new DirCacheTree(this, currPath, pathOff, p - pathOff);\n                    InsertChild(stIdx, st);\n                }\n\n                // The entry is contained in this subtree.\n                //\n                st.validate(cache, cCnt, cIdx, pathOff + st.nameLength() + 1);\n                cIdx += st._entrySpan;\n                _entrySpan += st._entrySpan;\n                stIdx++;\n            }\n\n            if (stIdx < _childCount)\n            {\n                // None of our remaining children can be in this tree\n                // as the current cache entry is After our own name.\n                //\n                var dct = new DirCacheTree[stIdx];\n                Array.Copy(_children, 0, dct, 0, stIdx);\n                _children = dct;\n            }\n        }\n\n        private void InsertChild(int stIdx, DirCacheTree st)\n        {\n            DirCacheTree[] c = _children;\n            if (_childCount + 1 <= c.Length)\n            {\n                if (stIdx < _childCount)\n                {\n                    Array.Copy(c, stIdx, c, stIdx + 1, _childCount - stIdx);\n                }\n                c[stIdx] = st;\n                _childCount++;\n                return;\n            }\n\n            int n = c.Length;\n            var a = new DirCacheTree[n + 1];\n            if (stIdx > 0)\n            {\n                Array.Copy(c, 0, a, 0, stIdx);\n            }\n            a[stIdx] = st;\n            if (stIdx < n)\n            {\n                Array.Copy(c, stIdx, a, stIdx + 1, n - stIdx);\n            }\n            _children = a;\n            _childCount++;\n        }\n\n        private void RemoveChild(int stIdx)\n        {\n            int n = --_childCount;\n            if (stIdx < n)\n            {\n                Array.Copy(_children, stIdx + 1, _children, stIdx, n - stIdx);\n            }\n            _children[n] = null;\n        }\n\n        internal static bool peq(byte[] a, byte[] b, int aLen)\n        {\n            if (b.Length < aLen) return false;\n\n            for (aLen--; aLen >= 0; aLen--)\n            {\n                if (a[aLen] != b[aLen]) return false;\n            }\n\n            return true;\n        }\n\n        private static int NameComparison(byte[] a, int aPos, DirCacheTree ct)\n        {\n            if (ct == null) return -1;\n\n            byte[] b = ct._encodedName;\n            int aLen = a.Length;\n            int bLen = b.Length;\n            int bPos = 0;\n            for (; aPos < aLen && bPos < bLen; aPos++, bPos++)\n            {\n                int cmp = (a[aPos] & 0xff) - (b[bPos] & 0xff);\n                if (cmp != 0)\n                {\n                    return cmp;\n                }\n            }\n\n            if (bPos == bLen)\n            {\n                return a[aPos] == '/' ? 0 : -1;\n            }\n\n            return aLen - bLen;\n        }\n\n        private static int Slash(byte[] a, int aPos)\n        {\n            int aLen = a.Length;\n            for (; aPos < aLen; aPos++)\n            {\n                if (a[aPos] == '/')\n                {\n                    return aPos;\n                }\n            }\n            return -1;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Ensure.cs",
    "content": "﻿using System.Diagnostics;\n\nnamespace GitSharp.Core\n{\n    public static class Ensure\n    {\n        public static void That(bool istrue)\n        {\n            Debug.Assert(istrue);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/CancelledException.cs",
    "content": "﻿using System;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t[Serializable]\n\tpublic class CancelledException : Exception\n\t{\n        private const long serialVersionUID = 1L;\n\n\t\t//\n\t\t// For guidelines regarding the creation of new exception types, see\n\t\t//    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n\t\t// and\n\t\t//    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n\t\t//\n\n\t\tpublic CancelledException()\n\t\t{\n\t\t}\n\n\t\tpublic CancelledException(string message) : base(message)\n\t\t{\n\t\t}\n\n\t\tpublic CancelledException(string message, Exception inner) : base(message, inner)\n\t\t{\n\t\t}\n\n\t\tprotected CancelledException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/CheckoutConflictException.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [Serializable]\n    public class CheckoutConflictException : Exception\n    {\n        /// <summary>\n        /// Construct a <see cref=\"CheckoutConflictException\"/> for the specified file\n        /// </summary>\n        public CheckoutConflictException(string file)\n            : base(\"Checkout conflict with file: \" + file)\n        {\n        }\n        /// <summary>\n        /// Construct a <see cref=\"CheckoutConflictException\"/> for the specified file\n        /// </summary>\n        public CheckoutConflictException(string file, Exception inner)\n            : base(\"Checkout conflict with file: \" + file, inner)\n        {\n        }\n\n        /// <summary>\n        /// Construct a <see cref=\"CheckoutConflictException\"/> for the specified file\n        /// </summary>\n        /// <param name=\"files\"></param>\n        public CheckoutConflictException(IEnumerable<string> files)\n            : base(\"Checkout conflict with files: \" + BuildList(files))\n        {\n        }\n\n        private static string BuildList(IEnumerable<string> files)\n        {\n            var builder = new StringBuilder();\n            foreach (string file in files)\n            {\n                builder.Append(Environment.NewLine);\n                builder.Append(file);\n            }\n\n            return builder.ToString();\n        }\n\t\t\n\t\tprotected CheckoutConflictException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/CompoundException.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Text;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// An exception detailing multiple reasons for failure.\n\t/// </summary>\n\t[Serializable]\n\tpublic class CompoundException : GitException\n\t{\n\t\tprivate readonly IList<Exception> _causeList;\n\n\t\tprivate static string Format(IEnumerable<Exception> causes)\n\t\t{\n\t\t\tvar msg = new StringBuilder();\n\t\t\tmsg.Append(\"Failure due to one of the following:\");\n\n\t\t\tforeach (Exception c in causes)\n\t\t\t{\n\t\t\t\tmsg.Append(\"  \");\n\t\t\t\tmsg.Append(c.Message);\n\t\t\t\tmsg.Append(\"\\n\");\n\t\t\t}\n\n\t\t\treturn msg.ToString();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Constructs an exception detailing many potential reasons for failure.\n\t\t/// </summary>\n\t\t/// <param name=\"why\">\n\t\t/// Two or more exceptions that may have been the problem. \n\t\t/// </param>\n\t\tpublic CompoundException(IEnumerable<Exception> why)\n\t\t\t: base(Format(why))\n\t\t{\n\t\t\t_causeList = new List<Exception>(why);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get the complete list of reasons why this failure happened.\n\t\t///\t</summary>\n\t\t///\t<returns>\n\t\t/// Unmodifiable collection of all possible reasons.\n\t\t/// </returns>\n\t\tpublic IEnumerable<Exception> AllCauses\n\t\t{\n\t\t\tget { return new ReadOnlyCollection<Exception>(_causeList); }\n\t\t}\n\t\t\n\t\tprotected CompoundException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/ConfigInvalidException.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n    /// <summary>\n\t/// Indicates a text string is not a valid Git style configuration.\n    /// </summary>\n    [Serializable]\n    public class ConfigInvalidException : Exception\n    {\n\t\t/// <summary>\n\t\t/// Construct an invalid configuration error.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">Why the configuration is invalid.</param>\n        public ConfigInvalidException(string message)\n            : base(message)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct an invalid configuration error.\n\t\t/// </summary>\n\t\t/// <param name=\"message\">why the configuration is invalid.</param>\n\t\t/// <param name=\"inner_exception\">Construct an invalid configuration error.</param>\n        public ConfigInvalidException(string message, Exception inner_exception)\n            : base(message, inner_exception)\n        {\n        }\n\t\t\n\t\tprotected ConfigInvalidException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/CorruptObjectException.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class CorruptObjectException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public CorruptObjectException(AnyObjectId id, string message) : base(string.Format(\"object {0} is corrupt: {1}\", id, message)) { }\n        public CorruptObjectException(string message) : base(message) { }\n        public CorruptObjectException(string message, Exception inner) : base(message, inner) { }\n        public CorruptObjectException(AnyObjectId id, string message, Exception inner) : base(string.Format(\"object {0} is corrupt: {1}\", id, message), inner) { }\n        internal CorruptObjectException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/EntryExistsException.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t[Serializable]\n    public class EntryExistsException : Exception\n    {\n        public EntryExistsException(string name)\n            : base(string.Format(\"Tree entry \\\"{0}\\\" already exists.\", name))\n        {\n        }\n\t\t\n        public EntryExistsException(string name, Exception inner)\n            : base(string.Format(\"Tree entry \\\"{0}\\\" already exists.\", name),inner)\n        {\n        }\n\t\t\n\t\tprotected EntryExistsException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/ExceptionExtensions.cs",
    "content": "﻿using System;\nusing System.Text;\n\nnamespace GitSharp.Core.Exceptions\n{\n    public static class ExceptionExtensions\n    {\n        public static void printStackTrace(this Exception self)\n        {\n            Console.Error.WriteLine(self.FormatPretty());\n        }\n\n        public static string FormatPretty(this Exception exception)\n        {\n            if (exception == null) return string.Empty;\n            var sb = new StringBuilder();\n            PrintRecursive(exception, sb, string.Empty);\n            return sb.ToString();\n        }\n\n        private static void PrintRecursive(Exception exception, StringBuilder sb, string indent)\n        {\n            var stars = new string('*', 80);\n            sb.AppendLine(indent + stars);\n\t\t\tsb.AppendFormat(indent + \"{0}: \\\"{1}\\\"\\n\", exception.GetType().Name, exception.Message);\n\t\t\tsb.AppendLine(indent + new string('-', 80));\n\n            if (exception.InnerException != null)\n            {\n\t\t\t\tsb.AppendLine(indent + \"InnerException:\");\n\t\t\t\tPrintRecursive(exception.InnerException, sb, indent + \"   \");\n            }\n\n            foreach (string line in exception.StackTrace.Split(new[] { \" at \" }, StringSplitOptions.RemoveEmptyEntries))\n            {\n                if (string.IsNullOrEmpty(line.Trim())) continue;\n\n            \tstring[] parts = line.Trim().Split(new[] { \" in \" }, StringSplitOptions.RemoveEmptyEntries);\n                string classInfo = parts[0];\n\n                if (parts.Length == 2)\n                {\n                    parts = parts[1].Trim().Split(new[] { \"line\" }, StringSplitOptions.RemoveEmptyEntries);\n                    if (parts.Length == 2)\n                    {\n                        string srcFile = parts[0];\n                        int lineNr = int.Parse(parts[1]);\n\t\t\t\t\t\tsb.AppendFormat(indent + \"  {0}({1},1):   {2}\\n\", srcFile.TrimEnd(':'), lineNr, classInfo);\n                    }\n                    else\n                    {\n\t\t\t\t\t\tsb.AppendLine(indent + \"  \" + classInfo);\n                    }\n                }\n                else\n                {\n                \tsb.AppendLine(indent + \"  \" + classInfo);\n                }\n            }\n\n\t\t\tsb.AppendLine(indent + stars);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/FileLockedException.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class FileLockedException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public FileLockedException() { }\n        public FileLockedException(string message) : base(message) { }\n        public FileLockedException(string message, Exception inner) : base(message, inner) { }\n        internal FileLockedException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/GitlinksNotSupportedException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Jonas Fonseca <fonseca@diku.dk>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// An exception thrown when a gitlink entry is found and cannot be\n\t/// handled.\n\t/// </summary>\n\t[Serializable]\n    public class GitlinksNotSupportedException : IOException\n    {\n        //private static  long serialVersionUID = 1L;\n\n        /// <summary>\n\t\t/// Construct a GitlinksNotSupportedException for the specified link\n\t\t/// </summary>\n\t\t/// <param name=\"s\">\n\t\t/// Name of link in tree or workdir\n\t\t/// </param>\n        public GitlinksNotSupportedException(string s)\n            : base(s)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct a GitlinksNotSupportedException for the specified link\n\t\t/// </summary>\n\t\t/// <param name=\"s\">Name of link in tree or workdir</param>\n        /// <param name=\"inner\">Inner Exception</param>\n        public GitlinksNotSupportedException(string s, Exception inner)\n            : base(s, inner)\n        {\n        }\n\t\t\n\t\tprotected GitlinksNotSupportedException(SerializationInfo info, StreamingContext context) \n\t\t\t: base(info, context)\n\t\t{\n\t\t}\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/IncorrectObjectTypeException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// An inconsistency with respect to handling different object types.\n    ///\n    /// This most likely signals a programming error rather than a corrupt\n    /// object database.\n\t/// </summary>\n    [Serializable]\n    public class IncorrectObjectTypeException : Exception\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n\t\t/// <summary>\n\t\t/// Construct and IncorrectObjectTypeException for the specified object id.\n\t\t///\n\t\t/// Provide the type to make it easier to track down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// SHA-1\n\t\t/// </param>\n\t\t/// <param name=\"type\">\n\t\t/// Object type\n\t\t/// </param>\n        public IncorrectObjectTypeException(ObjectId id, ObjectType type)\n            : base(string.Format(\"object {0} is not a {1}.\", id, type))\n        {\n\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Construct and IncorrectObjectTypeException for the specified object id.\n\t\t/// Provide the type to make it easier to track down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public IncorrectObjectTypeException(ObjectId id, ObjectType type, Exception inner) \n\t\t\t: base(string.Format(\"object {0} is not a {1}.\", id, type), inner) { }\n\t\t\n\t\t/// <summary>\n\t\t/// Construct and IncorrectObjectTypeException for the specified object id.\n\t\t///\n\t\t/// Provide the type to make it easier to track down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// SHA-1\n\t\t/// </param>\n\t\t/// <param name=\"type\">\n\t\t/// Object type\n\t\t/// </param>\n        public IncorrectObjectTypeException(ObjectId id, int type)\n            : base(string.Format(\"object {0} is not a {1}.\", id, (ObjectType)type))\n        {\n\n        }\n\n\n        public IncorrectObjectTypeException(ObjectId id, string type, Exception inner) : base(string.Format(\"object {0} is not a {1}.\", id, type), inner) { }\n\n        /// <summary>\n\t\t/// Construct and IncorrectObjectTypeException for the specified object id.\n\t\t///\n\t\t/// Provide the type to make it easier to track down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// SHA-1\n\t\t/// </param>\n\t\t/// <param name=\"type\">\n\t\t/// Object type\n\t\t/// </param>\n        public IncorrectObjectTypeException(ObjectId id, string type)\n            : base(string.Format(\"object {0} is not a {1}.\", id, type))\n        {\n\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Construct and IncorrectObjectTypeException for the specified object id.\n\t\t/// Provide the type to make it easier to track down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public IncorrectObjectTypeException(ObjectId id, int type, Exception inner) \n\t\t    : base(string.Format(\"object {0} is not a {1}.\", id, (ObjectType)type), inner) { }\n        \n\t\tprotected IncorrectObjectTypeException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/InvalidObjectIdException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Jonas Fonseca <fonseca@diku.dk>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing System.Runtime.Serialization;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// Thrown when an invalid object id is passed in as an argument.\n\t/// </summary>\n    [Serializable]\n\tpublic class InvalidObjectIdException : ArgumentException\n    {\n\t\t/// <summary>\n\t\t/// Create exception with bytes of the invalid object id.\n\t\t/// </summary>\n\t\t/// <param name=\"bytes\">containing the invalid id.</param>\n\t\t/// <param name=\"offset\">offset in the byte array where the error occurred.</param>\n\t\t/// <param name=\"length\">length of the sequence of invalid bytes.</param>\n        public InvalidObjectIdException(byte[] bytes, int offset, int length)\n            : base(\"Invalid id\" + AsAscii(bytes, offset, length))\n        {\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Create exception with bytes of the invalid object id.\n\t\t/// </summary>\n\t\t/// <param name=\"bytes\">containing the invalid id.</param>\n\t\t/// <param name=\"offset\">offset in the byte array where the error occurred.</param>\n\t\t/// <param name=\"length\">length of the sequence of invalid bytes.</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public InvalidObjectIdException(byte[] bytes, int offset, int length, Exception inner)\n            : base(\"Invalid id\" + AsAscii(bytes, offset, length), inner)\n        {\n        }\n\n        private static string AsAscii(byte[] bytes, int offset, int length)\n        {\n            try\n            {\n                return \": \" + Charset.forName(\"US-ASCII\").GetString(bytes, offset, length);\n            }\n            catch (DecoderFallbackException)\n            {\n                return string.Empty;\n            }\n            catch (IndexOutOfRangeException)\n            {\n\t\t\t\treturn string.Empty;\n            }\n        }\n\t\t\n\t\tprotected InvalidObjectIdException(SerializationInfo info, StreamingContext context)\n            : base(info, context) { }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/InvalidPackException.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n        [global::System.Serializable]\n    public class PackInvalidException : IOException\n    {\n                //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public PackInvalidException(ObjectId id, string message) : base(string.Format(\"object {0} is corrupt: {1}\", id, message)) { }\n        public PackInvalidException(string message) : base(message) { }\n        public PackInvalidException(string message, Exception inner) : base(message, inner) { }\n        public PackInvalidException(ObjectId id, string message, Exception inner) : base(string.Format(\"object {0} is corrupt: {1}\", id, message), inner) { }\n        internal PackInvalidException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/InvalidPatternException.cs",
    "content": "/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [Serializable]\n    public class InvalidPatternException : Exception\n    {\n        private readonly string _pattern;\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public InvalidPatternException(string pattern)\n        {\n            _pattern = pattern;\n        }\n\n        public InvalidPatternException(string message, string pattern)\n            : base(message)\n        {\n            _pattern = pattern;\n        }\n\n        public InvalidPatternException(string message, Exception inner)\n            : base(message, inner)\n        {\n        }\n\t\t\n        public InvalidPatternException(string message, string pattern, Exception inner)\n            : base(message, inner)\n        {\n            _pattern = pattern;\n        }\n\n        protected InvalidPatternException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n\n        ///\t<returns>\n        /// The invalid pattern.\n        /// </returns>\n        public virtual string Pattern\n        {\n            get { return _pattern; }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/MissingBundlePrerequisiteException.cs",
    "content": "/* Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core.Transport;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n    /// <summary>\n    /// Indicates a base/common object was required, but is not found.\n    /// </summary>\n\t[Serializable]\n    public class MissingBundlePrerequisiteException : TransportException\n    {\n        private const long serialVersionUID = 1L;\n\n        private static string format(IDictionary<ObjectId, string> missingCommits)\n        {\n            var r = new StringBuilder();\n            r.Append(\"missing prerequisite commits:\");\n            foreach (KeyValuePair<ObjectId, string> e in missingCommits)\n            {\n                r.Append(\"\\n  \");\n                r.Append(e.Key.Name);\n                if (e.Value != null)\n                    r.Append(\" \").Append(e.Value);\n            }\n            return r.ToString();\n        }\n\n        /// <summary>\n        /// Constructs a MissingBundlePrerequisiteException for a set of objects.\n        /// </summary>\n        /// <param name=\"uri\">URI used for transport</param>\n        /// <param name=\"missingCommits\">\n        /// the Map of the base/common object(s) we don't have. Keys are\n        /// ids of the missing objects and values are short descriptions.\n        /// </param>\n        public MissingBundlePrerequisiteException(URIish uri, IDictionary<ObjectId, string> missingCommits)\n        : base(uri, format(missingCommits))\n        {\n        }\n\n        public MissingBundlePrerequisiteException(URIish uri, IDictionary<ObjectId, string> missingCommits, Exception inner)\n        : base(uri, format(missingCommits), inner)\n        {\n        }\n\n        protected MissingBundlePrerequisiteException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/MissingObjectException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// An expected object is missing.\n\t/// </summary>\n    [Serializable]\n\tpublic class MissingObjectException : IOException\n    {\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        public MissingObjectException(ObjectId id, ObjectType type)\n            : base(\"Missing \" + type + \" \" + id)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        public MissingObjectException(ObjectId id, string type)\n            : base(\"Missing \" + type + \" \" + id)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        public MissingObjectException(ObjectId id, int type)\n            : this(id, Constants.typeString(type))\n        {\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public MissingObjectException(ObjectId id, ObjectType type, Exception inner)\n            : base(\"Missing \" + type + \" \" + id, inner)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public MissingObjectException(ObjectId id, string type, Exception inner)\n            : base(\"Missing \" + type + \" \" + id, inner)\n        {\n        }\n\n\t\t/// <summary>\n\t\t/// Construct a MissingObjectException for the specified object id.\n\t\t/// Expected type is reported to simplify tracking down the problem.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">SHA-1</param>\n\t\t/// <param name=\"type\">Object type</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public MissingObjectException(ObjectId id, int type, Exception inner)\n            : this(id, Constants.typeString(type), inner)\n        {\n        }\n\n        protected MissingObjectException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/NoClosingBracketException.cs",
    "content": "/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [Serializable]\n    public class NoClosingBracketException : InvalidPatternException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public NoClosingBracketException(int indexOfOpeningBracket, string openingBracket, string closingBracket, string pattern)\n            : base(CreateMessage(indexOfOpeningBracket, openingBracket, closingBracket), pattern)\n        {\n        }\n\t\t\n\t\tpublic NoClosingBracketException(int indexOfOpeningBracket, string openingBracket, string closingBracket, string pattern, Exception inner)\n            : base(CreateMessage(indexOfOpeningBracket, openingBracket, closingBracket), pattern, inner)\n        {\n        }\n\n        private static string CreateMessage(int indexOfOpeningBracket, string openingBracket, string closingBracket)\n        {\n            return string.Format(\"No closing {0} found for {1} at index {2}.\", closingBracket, openingBracket, Convert.ToInt32(indexOfOpeningBracket));\n        }\n\n        protected NoClosingBracketException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/NoRemoteRepositoryException.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t[Serializable]\n    public class NoRemoteRepositoryException : TransportException\n    {\n        private const long serialVersionUID = 1L;\n\n        public NoRemoteRepositoryException(URIish uri, string s)\n            : base(uri, s)\n        {\n        }\n\t\t\n\t\tpublic NoRemoteRepositoryException(URIish uri, string s, Exception inner)\n            : base(uri, s, inner)\n        {\n        }\n\n        protected NoRemoteRepositoryException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/ObjectWritingException.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class ObjectWritingException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public ObjectWritingException() { }\n        public ObjectWritingException(string message) : base(message) { }\n        public ObjectWritingException(string message, Exception inner) : base(message, inner) { }\n        internal ObjectWritingException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/PackMismatchException.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class PackMismatchException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public PackMismatchException(ObjectId id, string message) : base(string.Format(\"object {0} is corrupt: {1}\", id, message)) { }\n        public PackMismatchException(string message) : base(message) { }\n        public PackMismatchException(string message, Exception inner) : base(message, inner) { }\n        public PackMismatchException(ObjectId id, string message, Exception inner) : base(string.Format(\"object {0} is corrupt: {1}\", id, message), inner) { }\n        internal PackMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/PackProtocolException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t[Serializable]\n    public class PackProtocolException : TransportException\n    {\n        public PackProtocolException(URIish uri, string s)\n            : base(uri + \": \" + s)\n        {            \n        }\n\n        public PackProtocolException(URIish uri, string s, Exception cause)\n            : base(uri + \": \" + s, cause)\n        {\n        }\n\n        public PackProtocolException(string s)\n            : base(s)\n        {\n        }\n\n        public PackProtocolException(string s, Exception cause)\n            : base(s, cause)\n        {\n        }\n\n        protected PackProtocolException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/RepositoryNotFoundException.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// Indicates a local repository does not exist\n\t/// </summary>\n    [Serializable]\n\tpublic class RepositoryNotFoundException : TransportException\n    {\n        //private static  long serialVersionUID = 1L;\n\n\t\t/// <summary>\n\t\t/// Constructs an exception indicating a local repository does not exist\n\t\t/// </summary>\n\t\t/// <param name=\"location\">\n\t\t/// Description of the repository not found, usually file path\n\t\t/// </param>\n        public RepositoryNotFoundException(DirectoryInfo location)\n            : this(location.ToString())\n        {\n        }\n\n        /// <summary>\n\t\t/// Constructs an exception indicating a local repository does not exist\n\t\t/// </summary>\n\t\t/// <param name=\"location\">\n\t\t/// Description of the repository not found, usually file path\n\t\t/// </param>\n        public RepositoryNotFoundException(string location)\n            : base(\"repository not found: \" + location)\n        {\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Constructs an exception indicating a local repository does not exist\n\t\t/// </summary>\n\t\t/// <param name=\"location\">Description of the repository not found, usually file path</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public RepositoryNotFoundException(DirectoryInfo location, Exception inner)\n            : this(location.ToString(),inner)\n        {\n        }\n\n        /// <summary>\n\t\t/// Constructs an exception indicating a local repository does not exist\n\t\t/// </summary>\n\t\t/// <param name=\"location\">Description of the repository not found, usually file path</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public RepositoryNotFoundException(string location, Exception inner)\n            : base(\"repository not found: \" + location, inner)\n        {\n        }\n\n        protected RepositoryNotFoundException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/RevWalkException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// Indicates a checked exception was thrown inside of <see cref=\"RevWalk\"/>.\n\t/// <para/>\n\t/// Usually this exception is thrown from the Iterator created around a RevWalk\n\t/// instance, as the Iterator API does not allow checked exceptions to be thrown\n\t/// from hasNext() or next(). The <see cref=\"Exception.Message\"/> of this exception\n\t/// is the original checked exception that we really wanted to throw back to the\n\t/// application for handling and recovery.\n\t/// </summary>\n\t[Serializable]\n\tpublic class RevWalkException : Exception\n\t{\n\t\t/// <summary>\n\t\t/// Create a new walk exception an original cause.\n\t\t/// </summary>\n\t\t/// <param name=\"cause\">The checked exception that describes why the walk failed.</param>\n\t\tpublic RevWalkException(Exception cause)\n\t\t\t: base(\"Walk failure.\", cause)\n\t\t{\n\t\t}\n\n        protected RevWalkException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/RevisionSyntaxException.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class RevisionSyntaxException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n        public string Revision { get; private set; }\n        public RevisionSyntaxException(string revstr)\n        {\n            this.Revision = revstr;\n        }\n\n        public RevisionSyntaxException(string revstr, string message)\n            : base(message)\n        {\n            this.Revision = revstr;\n        }\n\n\n        public RevisionSyntaxException(string message, Exception inner) : base(message, inner) { }\n        internal RevisionSyntaxException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n\n        public override string ToString()\n        {\n            return base.ToString() + \":\" + this.Revision;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/StopWalkException.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Runtime.Serialization;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// Stops the driver loop of walker and finish with current result\n\t/// </summary>\n\t[Serializable]\n    public class StopWalkException : Exception\n    {\n\n        /** Singleton instance for throwing within a filter. */\n        public static StopWalkException INSTANCE = new StopWalkException();\n\n        private StopWalkException()\n        {\n            // Nothing.\n        }\n\n        protected StopWalkException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/SymlinksNotSupportedException.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Exceptions\n{\n    [global::System.Serializable]\n    public class SymlinksNotSupportedException : IOException\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public SymlinksNotSupportedException() { }\n        public SymlinksNotSupportedException(string message) : base(message) { }\n        public SymlinksNotSupportedException(string message, Exception inner) : base(message, inner) { }\n        internal SymlinksNotSupportedException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Exceptions/TransportException.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t[Serializable]\n    public class TransportException : IOException\n    {\n        public TransportException(URIish uri, string s)\n            : base(uri.SetPass(null) + \": \" + s)\n        {\n        }\n\n        public TransportException(URIish uri, string s, Exception cause)\n            : base(uri.SetPass(null) + \": \" + s, cause)\n        {\n        }\n\n        public TransportException(string s) : base(s)\n        {\n        }\n\n        public TransportException(string s, Exception cause)\n            : base(s, cause)\n        {\n        }\n\n        protected TransportException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Exceptions/UnmergedPathException.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing GitSharp.Core.DirectoryCache;\n\nnamespace GitSharp.Core.Exceptions\n{\n\t/// <summary>\n\t/// Indicates one or more paths in a DirCache have non-zero stages present.\n\t/// </summary>\n    [Serializable]\n\tpublic class UnmergedPathException : IOException\n    {\n        private readonly DirCacheEntry _entry;\n\n\t\t/// <summary>\n\t\t/// Create a new unmerged path exception.\n\t\t/// </summary>\n\t\t/// <param name=\"entry\">The first non-zero stage of the unmerged path.</param>\n        public UnmergedPathException(DirCacheEntry entry) \n            : base(\"Unmerged path: \" + entry.getPathString())\n        {\n            _entry = entry;\n        }\n\t\t\n\t\t/// <summary>\n\t\t/// Create a new unmerged path exception.\n\t\t/// </summary>\n\t\t/// <param name=\"entry\">The first non-zero stage of the unmerged path.</param>\n        /// <param name=\"inner\">Inner Exception.</param>\n        public UnmergedPathException(DirCacheEntry entry, Exception inner) \n            : base(\"Unmerged path: \" + entry.getPathString(), inner)\n        {\n            _entry = entry;\n        }\n\n        /// <summary>\n\t\t/// Returns the first non-zero stage of the unmerged path.\n        /// </summary>\n        /// <returns></returns>\n        public DirCacheEntry DirCacheEntry\n        {\n            get { return _entry; }\n        }\n\n        protected UnmergedPathException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FileBasedConfig.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Thad Hughes <thadh@thad.corp.google.com>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\n    public class FileBasedConfig : Config\n    {\n        private readonly FileInfo configFile;\n\n        public FileBasedConfig(FileInfo cfgLocation)\n            : this(null, cfgLocation)\n        {\n            \n        }\n\n        public FileBasedConfig(Config @base, FileInfo cfgLocation)\n            : base(@base)\n        {\n            configFile = cfgLocation;\n        }\n\n        public FileInfo getFile()\n        {\n            return configFile;\n        }\n\n        public virtual void load()\n        {\n            try\n            {\n                fromText(RawParseUtils.decode(IO.ReadFully(getFile())));\n            }\n            catch (FileNotFoundException)\n            {\n                clear();\n            }\n            catch (DirectoryNotFoundException)\n            {\n                clear();\n            }\n            catch (IOException e)\n            {\n                var e2 = new IOException(\"Cannot read \" + getFile(), e);\n                throw e2;\n            }\n            catch (ConfigInvalidException e)\n            {\n                throw new ConfigInvalidException(\"Cannot read \" + getFile(), e);\n            }\n        }\n\n        public void save()\n        {\n            byte[] o = Constants.encode(toText());\n            using(LockFile lf = new LockFile(getFile()))\n\t\t\t{\n\t            if (!lf.Lock())\n\t                throw new IOException(\"Cannot lock \" + getFile());\n\n                lf.Write(o);\n                if (!lf.Commit())\n                    throw new IOException(\"Cannot commit write to \" + getFile());\n\t\t\t}\n        }\n\n        public override string ToString()\n        {\n            return GetType() + \"[\" + getFile() + \"]\";\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/FileMode.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\n\tpublic class FileMode : IEquatable<FileMode>\n\t{\n\t\t// [henon] c# does not support octal literals, so every number starting with 0 in java code had to be converted to decimal!\n\t\t// Here are the octal literals used by jgit and their decimal counterparts:\n\t\t// decimal ... octal\n\t\t// 33188 ... 0100644\n\t\t// 33261 ... 0100755\n\t\t// 61440 ... 0170000\n\t\t// 16384 ... 0040000\n\t\t// 32768 ... 0100000\n\t\t// 40960 ... 0120000\n\t\t// 57344 ... 0160000\n\t\t// 73 ... 0111\n\n\t\tpublic delegate bool EqualsDelegate(int bits);\n\n\t\tpublic const int OCTAL_0100644 = 33188;\n\t\tpublic const int OCTAL_0100755 = 33261;\n\t\tpublic const int OCTAL_0111 = 73;\n\n\t\t/// <summary> Bit pattern for <see cref=\"TYPE_MASK\"/> matching <see cref=\"RegularFile\"/>.</summary>\n\t\tpublic const int TYPE_FILE = 32768;\n\n\t\t/// <summary> Bit pattern for <see cref=\"TYPE_MASK\"/> matching <see cref=\"GitLink\"/>. </summary>\n\t\tpublic const int TYPE_GITLINK = 57344;\n\n\t\t/// <summary>\n\t\t/// Mask to apply to a file mode to obtain its type bits.\n\t\t/// <para/>\n\t\t///  <see cref=\"TYPE_TREE\"/>\n\t\t///  <see cref=\"TYPE_SYMLINK\"/>\n\t\t///  <see cref=\"TYPE_FILE\"/>\n\t\t///  <see cref=\"TYPE_GITLINK\"/>\n\t\t///  <see cref=\"TYPE_MISSING\"/>\n\t\t/// </summary>\n\t\tpublic const int TYPE_MASK = 61440;\n\n\t\t/// <summary>  Bit pattern for <see cref=\"TYPE_MASK\"/> matching <see cref=\"Missing\"/>. </summary>\n\t\tpublic const int TYPE_MISSING = 0;\n\t\tpublic const int TYPE_SYMLINK = 40960;\n\t\tpublic const int TYPE_TREE = 16384;\n\n\t\tpublic static readonly FileMode ExecutableFile =\n\t\t\t new FileMode(OCTAL_0100755, ObjectType.Blob,\n\t\t\t\t  modeBits => (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & OCTAL_0111) != 0);\n\n\t\tpublic static readonly FileMode GitLink =\n\t\t\t new FileMode(TYPE_GITLINK, ObjectType.Commit,\n\t\t\t\t  modeBits => (modeBits & TYPE_MASK) == TYPE_GITLINK);\n\n\t\tpublic static readonly FileMode Missing =\n\t\t\t new FileMode(0, ObjectType.Bad, modeBits => modeBits == 0);\n\n\t\tpublic static readonly FileMode RegularFile =\n\t\t\t new FileMode(OCTAL_0100644, ObjectType.Blob,\n\t\t\t\t  modeBits => (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & OCTAL_0111) == 0);\n\n\t\tpublic static readonly FileMode Symlink =\n\t\t\t new FileMode(TYPE_SYMLINK, ObjectType.Blob,\n\t\t\t\t  modeBits => (modeBits & TYPE_MASK) == TYPE_SYMLINK);\n\n\t\t[field: NonSerialized]\n\t\tpublic static readonly FileMode Tree =\n\t\t\t new FileMode(TYPE_TREE, ObjectType.Tree,\n\t\t\t\t  modeBits => (modeBits & TYPE_MASK) == TYPE_TREE);\n\n\t\tpublic static FileMode FromBits(int bits)\n\t\t{\n\t\t\tswitch (bits & TYPE_MASK) // octal 0170000\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\tif (bits == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Missing;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TYPE_TREE: // octal 0040000\n\t\t\t\t\treturn Tree;\n\n\t\t\t\tcase TYPE_FILE: // octal 0100000\n\t\t\t\t\treturn (bits & OCTAL_0111) != 0 ? ExecutableFile : RegularFile;\n\n\t\t\t\tcase TYPE_SYMLINK: // octal 0120000\n\t\t\t\t\treturn Symlink;\n\n\t\t\t\tcase TYPE_GITLINK: // octal 0160000\n\t\t\t\t\treturn GitLink;\n\t\t\t}\n\n\t\t\treturn new FileMode(bits, ObjectType.Bad, a => bits == a);\n\t\t}\n\n\t\tprivate readonly byte[] _octalBytes;\n\n\t\tprivate FileMode(int mode, ObjectType type, Func<int, bool> equalityFunction)\n\t\t{\n\t\t\tif (equalityFunction == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"equalityFunction\");\n\t\t\t}\n\n\t\t\tEqualityFunction = equalityFunction;\n\n\t\t\tBits = mode;\n\t\t\tObjectType = type;\n\n\t\t\tif (mode != 0)\n\t\t\t{\n\t\t\t\tvar tmp = new byte[10];\n\t\t\t\tint p = tmp.Length;\n\n\t\t\t\twhile (mode != 0)\n\t\t\t\t{\n\t\t\t\t\ttmp[--p] = (byte)((byte)'0' + (mode & 07));\n\t\t\t\t\tmode >>= 3;\n\t\t\t\t}\n\n\t\t\t\t_octalBytes = new byte[tmp.Length - p];\n\t\t\t\tfor (int k = 0; k < _octalBytes.Length; k++)\n\t\t\t\t{\n\t\t\t\t\t_octalBytes[k] = tmp[p + k];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_octalBytes = new[] { (byte)'0' };\n\t\t\t}\n\t\t}\n\n\t\tpublic Func<int, bool> EqualityFunction { get; private set; }\n\n\t\tpublic int Bits { get; private set; }\n\t\tpublic ObjectType ObjectType { get; private set; }\n\n\t\tpublic void CopyTo(Stream stream)\n\t\t{\n\t\t\tnew BinaryWriter(stream).Write(_octalBytes);\n\t\t}\n\n\t\t/// <returns>Returns the number of bytes written by <see cref=\"CopyTo(Stream)\"/></returns>\n\t\tpublic int copyToLength()\n\t\t{\n\t\t\treturn _octalBytes.Length;\n\t\t}\n\n\t\tpublic bool Equals(FileMode other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn EqualityFunction(other.Bits);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() == typeof(int)) return Equals(FromBits((int)obj));\n\t\t\tif (obj.GetType() != typeof(FileMode)) return false;\n\t\t\treturn Equals((FileMode)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (EqualityFunction.GetHashCode() * 397) ^ ObjectType.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(FileMode left, FileMode right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(FileMode left, FileMode right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/FileTreeEntry.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    public class FileTreeEntry : TreeEntry \n    {\n        public FileTreeEntry(Tree parent, ObjectId id, byte[] nameUTF8, bool execute)\n            : base(parent,id, nameUTF8)\n        {\n            this.SetExecutable(execute);\n        }\n\n        private FileMode _mode;\n        public override FileMode Mode\n        {\n            get { return _mode ; }\n        }\n\n        public override void Accept(TreeVisitor tv, int flags)\n        {\n            if ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !IsModified)\n                return;\n\n            tv.VisitFile(this);\n        }\n\n        public bool IsExecutable\n        {\n            get\n            {\n                return this.Mode == FileMode.ExecutableFile;\n            }\n        }\n\n        public void SetExecutable(bool execute)\n        {\n            _mode = execute ? FileMode.ExecutableFile : FileMode.RegularFile;\n        }\n\n        public ObjectLoader OpenReader()\n        {\n            return this.Repository.OpenBlob(this.Id);\n        }\n\n        public override string ToString()\n        {\n            StringBuilder r = new StringBuilder();\n            r.Append(ObjectId.ToString(this.Id));\n            r.Append(' ');\n            r.Append(this.IsExecutable ? 'X' : 'F');\n            r.Append(' ');\n            r.Append(this.FullName);\n            return r.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/AbstractHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.FnMatch\n{\n    internal abstract class AbstractHead : IHead\n    {\n        private IList<IHead> _newHeads;\n\n        private readonly bool _star;\n\n        protected internal abstract bool matches(char c);\n\n        protected AbstractHead(bool star)\n        {\n            _star = star;\n        }\n\n        /// <summary>\n        /// </summary>\n        /// <param name=\"newHeads\">A list of <seealso cref=\"IHead\"/>s which will not be modified.</param>\n        public void setNewHeads(IList<IHead> newHeads)\n        {\n            if (_newHeads != null)\n            {\n                throw new InvalidOperationException(\"Property is already non null\");\n            }\n            \n            _newHeads = newHeads;\n        }\n\n        public virtual IList<IHead> GetNextHeads(char c)\n        {\n            if (matches(c))\n            {\n                return _newHeads;\n            }\n            \n            return FileNameMatcher.EmptyHeadList;\n        }\n\n        internal virtual bool IsStar\n        {\n            get { return _star; }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/CharacterHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.FnMatch\n{\n    internal class CharacterHead : AbstractHead\n    {\n        private readonly char _expectedChar;\n\n        public CharacterHead(char expectedChar) \n            : base(false)\n        {\n            _expectedChar = expectedChar;\n        }\n\n        protected internal override bool matches(char c)\n        {\n            return c == _expectedChar;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/FileNameMatcher.cs",
    "content": "/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.FnMatch\n{\n\t/// <summary>\n\t/// This class can be used to match filenames against fnmatch like patterns. \n\t/// It is not thread save.\n\t/// <para />\n\t/// Supported are the wildcard characters * and ? and groups with:\n\t/// <ul>\n\t/// <li> characters e.g. [abc]</li>\n\t/// <li> ranges e.g. [a-z]</li>\n\t/// <li> the following character classes\n\t/// <ul>\n\t/// <li>[:alnum:]</li>\n\t/// <li>[:alpha:]</li>\n\t/// <li>[:blank:]</li>\n\t/// <li>[:cntrl:]</li>\n\t/// <li>[:digit:]</li>\n\t/// <li>[:graph:]</li>\n\t/// <li>[:lower:]</li>\n\t/// <li>[:print:]</li>\n\t/// <li>[:punct:]</li>\n\t/// <li>[:space:]</li>\n\t/// <li>[:upper:]</li>\n\t/// <li>[:word:]</li>\n\t/// <li>[:xdigit:]</li>\n\t/// </ul>\n\t/// e. g. [[:xdigit:]] </li>\n\t/// </ul>\n\t/// </summary>\n\tpublic sealed class FileNameMatcher\n\t{\n\t\tinternal static readonly IList<IHead> EmptyHeadList = new List<IHead>();\n\t\tprivate static readonly IList<AbstractHead> EmptyAbstractHeadList = new List<AbstractHead>();\n\n\t\tprivate const string CharacterClassStartPattern = \"\\\\[[.:=]\";\n\n\t\tprivate readonly IList<IHead> _headsStartValue;\n\t\tprivate List<IHead> _heads;\n\n\t\t///\t<summary>\n\t\t/// <seealso cref=\"ExtendStringToMatchByOneCharacter\"/> needs a list for the\n\t\t/// new heads, allocating a new array would be bad for the performance, as\n\t\t/// the method gets called very often.\n\t\t///\t</summary>\n\t\tprivate List<IHead> _listForLocalUseage;\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<param name=\"headsStartValue\">\n\t\t///\tMust be a list which will never be modified.\n\t\t/// </param>\n\t\tprivate FileNameMatcher(IList<IHead> headsStartValue)\n\t\t\t: this(headsStartValue, headsStartValue)\n\t\t{\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<param name=\"headsStartValue\">must be a list which will never be modified.</param>\n\t\t///\t<param name=\"heads\">a list which will be cloned and then used as current head list. </param>\n\t\tprivate FileNameMatcher(IList<IHead> headsStartValue, ICollection<IHead> heads)\n\t\t{\n\t\t\t_headsStartValue = headsStartValue;\n\t\t\t_heads = new List<IHead>(heads.Count);\n\t\t\t_heads.AddRange(heads);\n\t\t\t_listForLocalUseage = new List<IHead>(heads.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// </summary>\n\t\t///\t<param name=\"patternString\">must contain a pattern which fnmatch would accept.</param>\n\t\t/// <param name=\"invalidWildgetCharacter\">\n\t\t/// if this parameter isn't null then this character will not\n\t\t/// match at wildcards(* and ? are wildcards). \n\t\t/// </param>\n\t\t///\t<exception cref=\"InvalidPatternException\">\n\t\t/// if the patternString contains a invalid fnmatch pattern.\n\t\t/// </exception>\n\t\tpublic FileNameMatcher(string patternString, char? invalidWildgetCharacter)\n\t\t\t: this(CreateHeadsStartValues(patternString, invalidWildgetCharacter))\n\t\t{\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// A copy constructor which creates a new <seealso cref=\"FileNameMatcher\"/> with the\n\t\t/// same state and Reset point like <code>other</code>.\n\t\t/// </summary>\n\t\t/// <param name=\"other\">\n\t\t/// another <seealso cref=\"FileNameMatcher\"/> instance.\n\t\t/// </param>\n\t\tpublic FileNameMatcher(FileNameMatcher other)\n\t\t\t: this(other._headsStartValue, other._heads)\n\t\t{\n\t\t\tif (other == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"other\");\n\t\t}\n\n\t\tprivate static IList<IHead> CreateHeadsStartValues(string patternString, char? invalidWildgetCharacter)\n\t\t{\n\t\t\tIList<AbstractHead> allHeads = ParseHeads(patternString, invalidWildgetCharacter);\n\n\t\t\tIList<IHead> nextHeadsSuggestion = new List<IHead>(2) { LastHead.Instance };\n\t\t\tfor (int i = allHeads.Count - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tAbstractHead head = allHeads[i];\n\n\t\t\t\t// explanation:\n\t\t\t\t// a and * of the pattern \"a*b\"\n\t\t\t\t// need *b as newHeads\n\t\t\t\t// that's why * extends the list for it self and it's left neighbor.\n\t\t\t\tif (head.IsStar)\n\t\t\t\t{\n\t\t\t\t\tnextHeadsSuggestion.Add(head);\n\t\t\t\t\thead.setNewHeads(nextHeadsSuggestion);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\thead.setNewHeads(nextHeadsSuggestion);\n\t\t\t\t\tnextHeadsSuggestion = new List<IHead>(2) { head };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nextHeadsSuggestion;\n\t\t}\n\n\t\tprivate static int FindGroupEnd(int indexOfStartBracket, string pattern)\n\t\t{\n\t\t\tint firstValidCharClassIndex = indexOfStartBracket + 1;\n\t\t\tint firstValidEndBracketIndex = indexOfStartBracket + 2;\n\n\t\t\tif (indexOfStartBracket + 1 >= pattern.Length)\n\t\t\t{\n\t\t\t\tthrow new NoClosingBracketException(indexOfStartBracket, \"[\", \"]\", pattern);\n\t\t\t}\n\n\t\t\tif (pattern[firstValidCharClassIndex] == '!')\n\t\t\t{\n\t\t\t\tfirstValidCharClassIndex++;\n\t\t\t\tfirstValidEndBracketIndex++;\n\t\t\t}\n\n\t\t\tint groupEnd = -1;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint possibleGroupEnd = pattern.IndexOf(']', firstValidEndBracketIndex);\n\t\t\t\tif (possibleGroupEnd == -1)\n\t\t\t\t{\n\t\t\t\t\tthrow new NoClosingBracketException(indexOfStartBracket, \"[\", \"]\", pattern);\n\t\t\t\t}\n\n\t\t\t\tMatch charClassStartMatch = Regex.Match(pattern.Substring(firstValidCharClassIndex), CharacterClassStartPattern);\n\n\t\t\t\tbool foundCharClass = charClassStartMatch.Success;\n\t\t\t\tint charClassStartMatchIndex = charClassStartMatch.Index + firstValidCharClassIndex;\n\n\t\t\t\tif (foundCharClass && charClassStartMatchIndex < possibleGroupEnd)\n\t\t\t\t{\n\t\t\t\t\tstring classStart = charClassStartMatch.Groups[0].Value;\n\t\t\t\t\tstring classEnd = classStart[1] + \"]\";\n\n\t\t\t\t\tint classStartIndex = charClassStartMatchIndex;\n\t\t\t\t\tint classEndIndex = pattern.IndexOf(classEnd, classStartIndex + 2);\n\n\t\t\t\t\tif (classEndIndex == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new NoClosingBracketException(classStartIndex, classStart, classEnd, pattern);\n\t\t\t\t\t}\n\n\t\t\t\t\tfirstValidCharClassIndex = classEndIndex + 2;\n\t\t\t\t\tfirstValidEndBracketIndex = firstValidCharClassIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgroupEnd = possibleGroupEnd;\n\t\t\t\t}\n\t\t\t} while (groupEnd == -1);\n\n\t\t\treturn groupEnd;\n\t\t}\n\n\t\tprivate static IList<AbstractHead> ParseHeads(string pattern, char? invalidWildgetCharacter)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(pattern))\n\t\t\t{\n\t\t\t\treturn EmptyAbstractHeadList;\n\t\t\t}\n\n\t\t\tvar heads = new List<AbstractHead>();\n\t\t\tint currentIndex = 0;\n\n            while (currentIndex < pattern.Length)\n\t\t\t{\n\t\t\t\tint groupStart = pattern.IndexOf('[', currentIndex);\n\t\t\t\tif (groupStart == -1)\n\t\t\t\t{\n\t\t\t\t\tstring patternPart = pattern.Substring(currentIndex);\n\t\t\t\t\theads.AddRange(CreateSimpleHeads(patternPart, invalidWildgetCharacter));\n\t\t\t\t\tcurrentIndex = pattern.Length;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstring patternPart = pattern.Slice(currentIndex, groupStart);\n\t\t\t\t\theads.AddRange(CreateSimpleHeads(patternPart, invalidWildgetCharacter));\n\n                    int groupEnd = FindGroupEnd(groupStart, pattern);\n\t\t\t\t\tstring groupPart = pattern.Slice(groupStart + 1, groupEnd);\n\t\t\t\t\theads.Add(new GroupHead(groupPart, pattern));\n\t\t\t\t\tcurrentIndex = groupEnd + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn heads;\n\t\t}\n\n\t\tprivate static IList<AbstractHead> CreateSimpleHeads(string patternPart, char? invalidWildgetCharacter)\n\t\t{\n\t\t\tIList<AbstractHead> heads = new List<AbstractHead>(patternPart.Length);\n\n\t\t\tfor (int i = 0; i < patternPart.Length; i++)\n\t\t\t{\n\t\t\t\tAbstractHead head;\n\n\t\t\t\tchar c = patternPart[i];\n\t\t\t\tswitch (c)\n\t\t\t\t{\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\thead = CreateWildCardHead(invalidWildgetCharacter, true);\n\t\t\t\t\t\theads.Add(head);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '?':\n\t\t\t\t\t\thead = CreateWildCardHead(invalidWildgetCharacter, false);\n\t\t\t\t\t\theads.Add(head);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\thead = new CharacterHead(c);\n\t\t\t\t\t\theads.Add(head);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn heads;\n\t\t}\n\n\t\tprivate static AbstractHead CreateWildCardHead(char? invalidWildgetCharacter, bool star)\n\t\t{\n\t\t\tif (invalidWildgetCharacter != null)\n\t\t\t{\n\t\t\t\treturn new RestrictedWildCardHead(invalidWildgetCharacter.Value, star);\n\t\t\t}\n\n\t\t\treturn new WildCardHead(star);\n\t\t}\n\n\t\tprivate void ExtendStringToMatchByOneCharacter(char c)\n\t\t{\n\t\t\tList<IHead> newHeads = _listForLocalUseage;\n\t\t\tnewHeads.Clear();\n\t\t\tList<IHead> lastAddedHeads = null;\n\t\t\tfor (int i = 0; i < _heads.Count; i++)\n\t\t\t{\n\t\t\t\tIHead head = _heads[i];\n\t\t\t\tIList<IHead> headsToAdd = head.GetNextHeads(c);\n\n\t\t\t\t// Why the next performance optimization isn't wrong:\n\t\t\t\t// Some times two heads return the very same list.\n\t\t\t\t// We save future effort if we don't add these heads again.\n\t\t\t\t// This is the case with the heads \"a\" and \"*\" of \"a*b\" which\n\t\t\t\t// both can return the list [\"*\",\"b\"]\n\t\t\t\tif (headsToAdd != lastAddedHeads)\n\t\t\t\t{\n\t\t\t\t\tnewHeads.AddRange(headsToAdd);\n\t\t\t\t\tlastAddedHeads = new List<IHead>(headsToAdd);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_listForLocalUseage = _heads;\n\t\t\t_heads = newHeads;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<param name=\"stringToMatch\">\n\t\t/// Extends the string which is matched against the patterns of this class.\n\t\t///  </param>\n\t\tpublic void Append(string stringToMatch)\n\t\t{\n\t\t\tif (stringToMatch == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"stringToMatch\");\n\t\t\t\n\t\t\tfor (int i = 0; i < stringToMatch.Length; i++)\n\t\t\t{\n\t\t\t\tchar c = stringToMatch[i];\n\t\t\t\tExtendStringToMatchByOneCharacter(c);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Resets this matcher to it's state right After construction.\n\t\t/// </summary>\n\t\tpublic void Reset()\n\t\t{\n\t\t\t_heads.Clear();\n\t\t\t_heads.AddRange(_headsStartValue);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<returns>\n\t\t/// A <seealso cref=\"FileNameMatcher\"/> instance which uses the same pattern\n\t\t///\tlike this matcher, but has the current state of this matcher as\n\t\t///\tReset and start point.\n\t\t/// </returns>\n\t\tpublic FileNameMatcher CreateMatcherForSuffix()\n\t\t{\n\t\t\tvar copyOfHeads = new List<IHead>(_heads.Count);\n\t\t\tcopyOfHeads.AddRange(_heads);\n\t\t\treturn new FileNameMatcher(copyOfHeads);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<returns>\n\t\t/// True, if the string currently being matched does match.\n\t\t/// </returns>\n\t\tpublic bool IsMatch()\n\t\t{\n\t\t\tvar reverseList = Enumerable.Reverse(_heads);\n\n\t\t\tforeach (IHead head in reverseList)\n\t\t\t{\n\t\t\t\tif (ReferenceEquals(head, LastHead.Instance))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// </summary>\n\t\t///\t<returns>\n\t\t/// False, if the string being matched will not match when the string gets extended.\n\t\t/// </returns>\n\t\tpublic bool CanAppendMatch()\n\t\t{\n\t\t\tfor (int i = 0; i < _heads.Count; i++)\n\t\t\t{\n\t\t\t\tif (!ReferenceEquals(_heads[i], LastHead.Instance))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/FnMatch/GroupHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.FnMatch\n{\n    using System.Collections.Generic;\n\n    internal sealed class GroupHead : AbstractHead\n    {\n        private readonly List<ICharacterPattern> _characterClasses;\n\n        private static readonly Regex RegexPattern = new Regex(\"([^-][-][^-]|\\\\[[.:=].*?[.:=]\\\\])\", RegexOptions.Compiled);\n\n        private readonly bool _inverse;\n\n        internal GroupHead(string pattern, string wholePattern)\n            : base(false)\n        {\n            _characterClasses = new List<ICharacterPattern>();\n\n            _inverse = pattern.StartsWith(\"!\");\n            if (_inverse)\n            {\n                pattern = pattern.Substring(1);\n            }\n\n            Match match = RegexPattern.Match(pattern);\n\n            while (match.Success)\n            {\n                string characterClass = match.Groups[0].Value;\n\n                if (characterClass.Length == 3 && characterClass[1] == '-')\n                {\n                    char start = characterClass[0];\n                    char end = characterClass[2];\n                    _characterClasses.Add(new CharacterRange(start, end));\n                }\n                else if (characterClass.Equals(\"[:alnum:]\"))\n                {\n                    _characterClasses.Add(LetterPattern.Instance);\n                    _characterClasses.Add(DigitPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:alpha:]\"))\n                {\n                    _characterClasses.Add(LetterPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:blank:]\"))\n                {\n                    _characterClasses.Add(new OneCharacterPattern(' '));\n                    _characterClasses.Add(new OneCharacterPattern('\\t'));\n                }\n                else if (characterClass.Equals(\"[:cntrl:]\"))\n                {\n                    _characterClasses.Add(new CharacterRange('\\u0000', '\\u001F'));\n                    _characterClasses.Add(new OneCharacterPattern('\\u007F'));\n                }\n                else if (characterClass.Equals(\"[:digit:]\"))\n                {\n                    _characterClasses.Add(DigitPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:graph:]\"))\n                {\n                    _characterClasses.Add(new CharacterRange('\\u0021', '\\u007E'));\n                    _characterClasses.Add(LetterPattern.Instance);\n                    _characterClasses.Add(DigitPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:lower:]\"))\n                {\n                    _characterClasses.Add(LowerPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:print:]\"))\n                {\n                    _characterClasses.Add(new CharacterRange('\\u0020', '\\u007E'));\n                    _characterClasses.Add(LetterPattern.Instance);\n                    _characterClasses.Add(DigitPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:punct:]\"))\n                {\n                    _characterClasses.Add(PunctPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:space:]\"))\n                {\n                    _characterClasses.Add(WhitespacePattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:upper:]\"))\n                {\n                    _characterClasses.Add(UpperPattern.Instance);\n                }\n                else if (characterClass.Equals(\"[:xdigit:]\"))\n                {\n                    _characterClasses.Add(new CharacterRange('0', '9'));\n                    _characterClasses.Add(new CharacterRange('a', 'f'));\n                    _characterClasses.Add(new CharacterRange('A', 'F'));\n                }\n                else if (characterClass.Equals(\"[:word:]\"))\n                {\n                    _characterClasses.Add(new OneCharacterPattern('_'));\n                    _characterClasses.Add(LetterPattern.Instance);\n                    _characterClasses.Add(DigitPattern.Instance);\n                }\n                else\n                {\n                    string message = string.Format(\"The character class \\\"{0}\\\" is not supported.\", characterClass);\n                    throw new InvalidPatternException(message, wholePattern);\n                }\n\n                pattern = pattern.Replace(characterClass, string.Empty);\n                match = RegexPattern.Match(pattern);\n            }\n\n            // pattern contains now no ranges\n            for (int i = 0; i < pattern.Length; i++)\n            {\n                char c = pattern[i];\n                _characterClasses.Add(new OneCharacterPattern(c));\n            }\n        }\n\n        protected internal override bool matches(char c)\n        {\n            foreach (ICharacterPattern pattern in _characterClasses)\n            {\n                if (pattern.Matches(c))\n                {\n                    return !_inverse;\n                }\n            }\n            return _inverse;\n        }\n\n        private interface ICharacterPattern\n        {\n            /// <summary>\n            /// \n            /// </summary>\n            /// <param name=\"c\">The character to test</param>\n            /// <returns>Returns true if the character matches a pattern.</returns>\n            bool Matches(char c);\n        }\n\n        private sealed class CharacterRange : ICharacterPattern\n        {\n            private readonly char _start;\n            private readonly char _end;\n\n            internal CharacterRange(char start, char end)\n            {\n                _start = start;\n                _end = end;\n            }\n\n            public bool Matches(char c)\n            {\n                return _start <= c && c <= _end;\n            }\n        }\n\n        private sealed class DigitPattern : ICharacterPattern\n        {\n            internal static readonly DigitPattern Instance = new DigitPattern();\n\n            public bool Matches(char c)\n            {\n                return char.IsDigit(c);\n            }\n        }\n\n        private sealed class LetterPattern : ICharacterPattern\n        {\n            internal static readonly LetterPattern Instance = new LetterPattern();\n\n            public bool Matches(char c)\n            {\n                return char.IsLetter(c);\n            }\n        }\n\n        private sealed class LowerPattern : ICharacterPattern\n        {\n            internal static readonly LowerPattern Instance = new LowerPattern();\n\n            public bool Matches(char c)\n            {\n                return char.IsLower(c);\n            }\n        }\n\n        private sealed class UpperPattern : ICharacterPattern\n        {\n            internal static readonly UpperPattern Instance = new UpperPattern();\n\n            public bool Matches(char c)\n            {\n                return char.IsUpper(c);\n            }\n        }\n\n        private sealed class WhitespacePattern : ICharacterPattern\n        {\n            internal static readonly WhitespacePattern Instance = new WhitespacePattern();\n\n            public bool Matches(char c)\n            {\n                return char.IsWhiteSpace(c);\n            }\n        }\n\n        private sealed class OneCharacterPattern : ICharacterPattern\n        {\n            private readonly char _expectedCharacter;\n\n            internal OneCharacterPattern(char c)\n            {\n                _expectedCharacter = c;\n            }\n\n            public bool Matches(char c)\n            {\n                return _expectedCharacter == c;\n            }\n        }\n\n        private sealed class PunctPattern : ICharacterPattern\n        {\n            internal static readonly PunctPattern Instance = new PunctPattern();\n\n            private static readonly string PunctCharacters = \"-!\\\"#$%&'()*+,./:;<=>?@[\\\\]_`{|}~\";\n\n            public bool Matches(char c)\n            {\n                return PunctCharacters.IndexOf(c) != -1;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/IHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.FnMatch\n{\n    public interface IHead\n    {\n        /// <summary>\n        /// \n        /// </summary>\n        /// <param name=\"c\">the character which decides which heads are returned.</param>\n        /// <returns>a list of heads based on the input.</returns>\n        IList<IHead> GetNextHeads(char c);\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/LastHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.FnMatch\n{\n    internal sealed class LastHead : IHead\n    {\n        internal static readonly IHead Instance = new LastHead();\n\n        ///\t<summary>\n        /// Don't call this constructor, use <seealso cref=\"LastHead.Instance\"/>\n        /// </summary>\n        private LastHead()\n        {\n        }\n\n        public IList<IHead> GetNextHeads(char c)\n        {\n            return FileNameMatcher.EmptyHeadList;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/FnMatch/RestrictedWildCardHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.FnMatch\n{\n    internal sealed class RestrictedWildCardHead : AbstractHead\n    {\n        private readonly char _excludedCharacter;\n\n        internal RestrictedWildCardHead(char excludedCharacter, bool star)\n            : base(star)\n        {\n            _excludedCharacter = excludedCharacter;\n        }\n\n        protected internal override bool matches(char c)\n        {\n            return c != _excludedCharacter;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/FnMatch/WildCardHead.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.FnMatch\n{\n    internal sealed class WildCardHead : AbstractHead\n    {\n        internal WildCardHead(bool star)\n            : base(star)\n        {\n        }\n\n        protected internal override bool matches(char c)\n        {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/ForceModified.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n    public class ForceModified : TreeVisitor\n    {\n        public void StartVisitTree(Tree t)\n        {\n            t.SetModified();\n        }\n\n        public void EndVisitTree(Tree t)\n        {\n            // Nothing to do.\n        }\n\n        public void VisitFile(FileTreeEntry f)\n        {\n            f.SetModified();\n        }\n\n        public void VisitGitlink(GitLinkTreeEntry e)\n        {\n            // TODO: handle gitlinks\n        }\n\n        public void VisitSymlink(SymlinkTreeEntry s)\n        {\n            // TODO: handle symlinks. Only problem is that JGit is independent of\n            // Eclipse\n            // and Pure Java does not know what to do about symbolic links.\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/GitException.cs",
    "content": "﻿using System;\n\nnamespace GitSharp.Core\n{\n    [Serializable]\n    public class GitException : Exception\n    {\n        //\n        // For guidelines regarding the creation of new exception types, see\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp\n        // and\n        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp\n        //\n\n        public GitException() { }\n        public GitException(string message) : base(message) { }\n        public GitException(string message, Exception inner) : base(message, inner) { }\n        internal GitException(\n          System.Runtime.Serialization.SerializationInfo info,\n          System.Runtime.Serialization.StreamingContext context)\n            : base(info, context) { }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/GitIndex.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2007, Robin Rosenberg <me@lathund.dewire.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing MiscUtil.Conversion;\nusing MiscUtil.IO;\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A representation of the Git index.\n\t/// \n\t/// The index points to the objects currently checked out or in the process of\n\t/// being prepared for committing or objects involved in an unfinished merge.\n\t/// \n\t/// The abstract format is:<br/> path stage flags statdata SHA-1\n\t/// <ul>\n\t/// <li>Path is the relative path in the workdir</li>\n\t/// <li>stage is 0 (normally), but when\n\t/// merging 1 is the common ancestor version, 2 is 'our' version and 3 is 'their'\n\t/// version. A fully resolved merge only contains stage 0.</li>\n\t/// <li>flags is the object type and information of validity</li>\n\t/// <li>statdata is the size of this object and some other file system specifics,\n\t/// some of it ignored by JGit</li>\n\t/// <li>SHA-1 represents the content of the references object</li>\n\t/// </ul>\n\t/// An index can also contain a tree cache which we ignore for now. We drop the\n\t/// tree cache when writing the index.\n\t/// </summary>\n\t//[Obsolete(\"Use DirCache instead.\")]\n\tpublic class GitIndex\n\t{\n\t\t/// <summary>\n\t\t/// Stage 0 represents merged entries.\n\t\t/// </summary>\n\t\tprivate const int STAGE_0 = 0;\n\t\tprivate static bool? filemode = null; // needed for testing.\n\n\t\tprivate readonly IDictionary<byte[], Entry> _entries;\n\t\tprivate readonly FileInfo _cacheFile;\n\n\t\t// Index is modified\n\t\tprivate bool _changed;\n\t\tprivate Header _header;\n\t\tprivate long _lastCacheTime;\n\t\tprivate bool _statDirty;\n\n\t\t/// <summary>\n\t\t/// Encoding that is used for encoding / decoding filenames only\n\t\t/// </summary>\n\t\t//public Encoding FilenameEncoding\n\t\t//{\n\t\t//   get;\n\t\t//   set;\n\t\t//}\n\n\t\t///\t<summary>\n\t\t/// Construct a Git index representation.\n\t\t/// </summary>\n\t\t///\t<param name=\"db\"> </param>\n\t\tpublic GitIndex(Repository db)\n\t\t{\n\t\t\t//FilenameEncoding = Constants.CHARSET; //  defaults to UTF8 actually\n\t\t\t_entries = new SortedDictionary<byte[], Entry>(new ByteVectorComparer());\n\t\t\tRepository = db;\n\t\t\t_cacheFile = db.getIndexFile();\n\t\t}\n\n\t\tpublic Repository Repository { get; private set; }\n\n\t\t///\t<returns>\n\t\t/// True if we have modified the index in memory since reading it from disk.\n\t\t/// </returns>\n\t\tpublic bool IsChanged\n\t\t{\n\t\t\tget { return _changed || _statDirty; }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Return the members of the index sorted by the unsigned byte\n\t\t///\tvalues of the path names.\n\t\t///\t\n\t\t///\tSmall beware: Unaccounted for are unmerged entries. You may want\n\t\t///\tto abort if members with stage != 0 are found if you are doing\n\t\t///\tany updating operations. All stages will be found after one another\n\t\t///\there later. Currently only one stage per name is returned.\t\n\t\t///\t</summary>\n\t\t///\t<returns> \n\t\t/// The index entries sorted \n\t\t/// </returns>\n\t\tpublic IList<Entry> Members\n\t\t{\n\t\t\tget { return _entries.Values.ToList(); }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Reread index data from disk if the index file has been changed\n\t\t/// </summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic void RereadIfNecessary()\n\t\t{\n            _cacheFile.Refresh();\n\t\t\tif (_cacheFile.Exists && _cacheFile.lastModified() != _lastCacheTime)\n\t\t\t{\n\t\t\t\tRead();\n\t\t\t\tRepository.fireIndexChanged();\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add the content of a file to the index.\n\t\t///\t</summary>\n\t\t///\t<param name=\"wd\"> workdir </param>\n\t\t///\t<param name=\"f\"> the file </param>\n\t\t///\t<returns> a new or updated index entry for the path represented by f</returns>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic Entry add(FileSystemInfo wd, FileInfo f)\n\t\t{\n\t\t\treturn add(wd, f, null);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add the content of a file to the index.\n\t\t///\t</summary>\n\t\t///\t<param name=\"wd\">workdir</param>\n\t\t///\t<param name=\"f\">the file</param>\n\t\t/// <param name=\"content\">content of the file</param>\n\t\t///\t<returns> a new or updated index entry for the path represented by f </returns>\n\t\t/// <exception cref=\"IOException\"> </exception>\n\t\tpublic Entry add(FileSystemInfo wd, FileInfo f, byte[] content)\n\t\t{\n\t\t\tbyte[] key = MakeKey(wd, f);\n\t\t\tEntry e;\n\n\t\t\tif (!_entries.TryGetValue(key, out e))\n\t\t\t{\n\t\t\t\te = new Entry(Repository, key, f, STAGE_0, content);\n\t\t\t\t_entries[key] = e;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\te.update(f);\n\t\t\t}\n\n\t\t\treturn e;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Add the encoded filename and content of a file to the index.\n\t\t/// </summary>\n\t\t/// <param name=\"relative_filename\">relative filename with respect to the working directory</param>\n\t\t/// <param name=\"content\"></param>\n\t\t/// <returns></returns>\n\t\tpublic Entry add(byte[] relative_filename, byte[] content)\n\t\t{\n\t\t\tbyte[] key = relative_filename;\n\t\t\tEntry e;\n\n\t\t\tif (!_entries.TryGetValue(key, out e))\n\t\t\t{\n\t\t\t\te = new Entry(Repository, key, null, STAGE_0, content);\n\t\t\t\t_entries[key] = e;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\te.update(null, content);\n\t\t\t}\n\n\t\t\treturn e;\n\t\t}\n\n\t\tpublic bool Remove(string relative_file_path)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(relative_file_path))\n\t\t\t\treturn false;\n\t\t\tvar key = Core.Repository.GitInternalSlash(Constants.encode(relative_file_path));\n\t\t\treturn _entries.Remove(key);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Remove a path from the index.\n\t\t/// </summary>\n\t\t/// <param name=\"wd\"> workdir </param>\n\t\t/// <param name=\"f\"> the file whose path shall be removed. </param>\n\t\t/// <returns> true if such a path was found (and thus removed) </returns>\n\t\t/// <exception cref=\"IOException\">  </exception>\n\t\tpublic bool remove(FileSystemInfo wd, FileSystemInfo f)\n\t\t{\n\t\t\tbyte[] key = MakeKey(wd, f);\n\t\t\treturn _entries.Remove(key);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Read the cache file into memory.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic void Read()\n\t\t{\n\t\t\t_changed = false;\n\t\t\t_statDirty = false;\n\n\t\t\t_cacheFile.Refresh();\n\n\t\t\tif (!_cacheFile.Exists)\n\t\t\t{\n\t\t\t\t_header = null;\n\t\t\t\t_entries.Clear();\n\t\t\t\t_lastCacheTime = 0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tusing (var cache = new FileStream(_cacheFile.FullName, System.IO.FileMode.Open))\n\t\t\tusing (var buffer = new EndianBinaryReader(new BigEndianBitConverter(), cache))\n\t\t\t{\n\t\t\t\t_header = new Header(buffer);\n\t\t\t\t_entries.Clear();\n\n\t\t\t\tfor (int i = 0; i < _header.Entries; ++i)\n\t\t\t\t{\n\t\t\t\t\tvar entry = new Entry(Repository, buffer);\n\t\t\t\t\t_entries[Constants.encode(entry.Name)] = entry;\n\t\t\t\t}\n\n\t\t\t\t_lastCacheTime = _cacheFile.lastModified();\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Write content of index to disk.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic void write()\n\t\t{\n\t\t\tCheckWriteOk();\n\t\t\tvar tmpIndex = new FileInfo(_cacheFile.FullName + \".tmp\");\n\t\t\tvar @lock = new FileInfo(_cacheFile.FullName + \".lock\");\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (@lock.Create())\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Index file is in use\");\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var fileOutputStream = new FileStream(tmpIndex.FullName, System.IO.FileMode.CreateNew))\n\t\t\t\tusing (var writer = new EndianBinaryWriter(new BigEndianBitConverter(), fileOutputStream))\n\t\t\t\t{\n\t\t\t\t\tMessageDigest newMessageDigest = Constants.newMessageDigest();\n\t\t\t\t\tvar ms = new MemoryStream();\n\n\t\t\t\t\t_header = new Header(_entries.Values as ICollection);\n\t\t\t\t\t_header.Write(ms);\n\n\t\t\t\t\tnewMessageDigest.Update(ms.ToArray());\n\t\t\t\t\twriter.Write(ms.ToArray());\n\n\t\t\t\t\tforeach (Entry entry in _entries.Values)\n\t\t\t\t\t{\n\t\t\t\t\t\tms = new MemoryStream();\n\n\t\t\t\t\t\tentry.Write(ms);\n\t\t\t\t\t\tnewMessageDigest.Update(ms.ToArray());\n\t\t\t\t\t\twriter.Write(ms.ToArray());\n\t\t\t\t\t}\n\n\t\t\t\t\tms = new MemoryStream();\n\n\t\t\t\t\tbyte[] digestBuffer = newMessageDigest.Digest();\n\t\t\t\t\tms.Write(digestBuffer, 0, digestBuffer.Length);\n\t\t\t\t\twriter.Write(ms.ToArray(), 0, digestBuffer.Length);\n\t\t\t\t}\n\n\t\t\t\t_cacheFile.Refresh();\n\t\t\t\tif (_cacheFile.Exists)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_cacheFile.Delete();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IOException(\"Could not rename delete old index\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!tmpIndex.RenameTo(_cacheFile.FullName))\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Could not rename temporary index file to index\");\n\t\t\t\t}\n\n\t\t\t\t_changed = false;\n\t\t\t\t_statDirty = false;\n\t\t\t    _cacheFile.Refresh();\n\t\t\t\t_lastCacheTime = _cacheFile.lastModified();\n\t\t\t\tRepository.fireIndexChanged();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t@lock.Delete();\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Could not delete lock file. Should not happen\");\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\ttmpIndex = new FileInfo(_cacheFile.FullName + \".tmp\");\n\t\t\t\t\tif (tmpIndex.Exists)\n\t\t\t\t\t{\n\t\t\t\t\t\ttmpIndex.Delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Could not delete temporary index file. Should not happen\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void CheckWriteOk()\n\t\t{\n\t\t\tforeach (Entry e in _entries.Values)\n\t\t\t{\n\t\t\t\tif (e.Stage != STAGE_0)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotSupportedException(\n\t\t\t\t\t\t \"Cannot work with other stages than zero right now. Won't write corrupt index.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool FileCanExecute(FileSystemInfo f)\n\t\t{\n\t\t\treturn FS.canExecute(f);\n\t\t}\n\n\t\tprivate static bool FileSetExecute(FileInfo f, bool @value)\n\t\t{\n\t\t\treturn FS.setExecute(f, @value);\n\t\t}\n\n\t\tprivate static bool FileHasExecute()\n\t\t{\n\t\t\treturn FS.supportsExecute();\n\t\t}\n\n\t\tprivate byte[] MakeKey(FileSystemInfo wd, FileSystemInfo f)\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(f.DirectoryName()) &&\n\t\t\t\t wd.IsDirectory() && wd.Exists &&\n\t\t\t\t !f.DirectoryName().StartsWith(wd.DirectoryName()))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Path is not in working dir\");\n\t\t\t}\n\n\t\t\tstring relName = Repository.StripWorkDir(wd, f);\n\t\t\treturn Core.Repository.GitInternalSlash(Constants.encode(relName));\n\t\t}\n\n\t\tprivate static bool ConfigFilemode(Repository repository)\n\t\t{\n\t\t\t// temporary til we can actually set parameters. We need to be able\n\t\t\t// to change this for testing.\n\t\t\tif (filemode != null)\n\t\t\t{\n\t\t\t\treturn filemode.Value;\n\t\t\t}\n\n\t\t\tRepositoryConfig config = repository.Config;\n\t\t\treturn config.getBoolean(\"core\", null, \"filemode\", true);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Read a Tree recursively into the index\n\t\t/// </summary>\n\t\t/// <param name=\"t\">The tree to read</param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic void ReadTree(Tree t)\n\t\t{\n\t\t\t_entries.Clear();\n\t\t\tReadTree(string.Empty, t);\n\t\t}\n\n\t\tprivate void ReadTree(string prefix, Tree t)\n\t\t{\n\t\t\tTreeEntry[] members = t.Members;\n\t\t\tfor (int i = 0; i < members.Length; ++i)\n\t\t\t{\n\t\t\t\tTreeEntry te = members[i];\n\t\t\t\tstring name;\n\t\t\t\tif (prefix.Length > 0)\n\t\t\t\t{\n\t\t\t\t\tname = prefix + \"/\" + te.Name;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tname = te.Name;\n\t\t\t\t}\n\t\t\t\tTree tr = (te as Tree);\n\t\t\t\tif (tr != null)\n\t\t\t\t{\n\t\t\t\t\tReadTree(name, tr);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar e = new Entry(Repository, te, 0);\n\t\t\t\t\t_entries[Constants.encode(name)] = e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add tree entry to index\n\t\t/// </summary>\n\t\t///\t<param name=\"te\"> tree entry </param>\n\t\t///\t<returns> new or modified index entry </returns>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic Entry addEntry(TreeEntry te)\n\t\t{\n\t\t\tbyte[] key = Constants.encode(te.FullName);\n\t\t\tvar e = new Entry(Repository, te, 0);\n\t\t\t_entries[key] = e;\n\t\t\treturn e;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Check out content of the content represented by the index\n\t\t///\t</summary>\n\t\t///\t<param name=\"workDir\">workdir </param>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic void checkout(FileSystemInfo workDir)\n\t\t{\n\t\t\tforeach (Entry e in _entries.Values)\n\t\t\t{\n\t\t\t\tif (e.Stage != STAGE_0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcheckoutEntry(workDir, e);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check out content of the specified index entry\n\t\t/// </summary>\n\t\t/// <param name=\"workDir\">workdir</param>\n\t\t/// <param name=\"e\">index entry</param>\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic void checkoutEntry(FileSystemInfo workDir, Entry e)\n\t\t{\n\t\t\tObjectLoader ol = Repository.OpenBlob(e.ObjectId);\n\t\t\tbyte[] bytes = ol.Bytes;\n\n\t\t\tvar file = new FileInfo(Path.Combine(workDir.DirectoryName(), e.Name));\n\n\t\t\tif (file.Exists)\n\t\t\t{\n\t\t\t\tfile.Delete();\n\t\t\t}\n\n\t\t\tfile.Directory.Mkdirs();\n\n\t\t\tusing (var fs = new FileStream(file.FullName, System.IO.FileMode.CreateNew))\n\t\t\t{\n\t\t\t\tvar ms = new MemoryStream(bytes);\n\t\t\t\tms.WriteTo(fs);\n\t\t\t}\n\n\t\t\tif (ConfigFilemode(Repository) && FileHasExecute())\n\t\t\t{\n\t\t\t\tif (FileMode.ExecutableFile.Equals(e.Mode))\n\t\t\t\t{\n\t\t\t\t\tif (!FileCanExecute(file))\n\t\t\t\t\t{\n\t\t\t\t\t\tFileSetExecute(file, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (FileCanExecute(file))\n\t\t\t\t{\n\t\t\t\t\tFileSetExecute(file, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\te.Mtime = file.lastModified() * 1000000L;\n\t\t\te.Ctime = e.Mtime;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Construct and write tree out of index.\n\t\t///\t</summary>\n\t\t///\t<returns> SHA-1 of the constructed tree</returns>\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic ObjectId writeTree()\n\t\t{\n\t\t\tCheckWriteOk();\n\t\t\tvar writer = new ObjectWriter(Repository);\n\t\t\tvar current = new Tree(Repository);\n\t\t\tvar trees = new Stack<Tree>();\n\t\t\ttrees.Push(current);\n\t\t\tvar prevName = new string[0];\n\n\t\t\tforeach (Entry e in _entries.Values)\n\t\t\t{\n\t\t\t\tif (e.Stage != STAGE_0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tstring[] newName = SplitDirPath(e.Name);\n\t\t\t\tint c = LongestCommonPath(prevName, newName);\n\t\t\t\twhile (c < trees.Count - 1)\n\t\t\t\t{\n\t\t\t\t\tcurrent.Id = writer.WriteTree(current);\n\t\t\t\t\ttrees.Pop();\n\t\t\t\t\tcurrent = trees.Count == 0 ? null : trees.Peek();\n\t\t\t\t}\n\n\t\t\t\twhile (trees.Count < newName.Length)\n\t\t\t\t{\n\t\t\t\t\tif (!current.ExistsTree(newName[trees.Count - 1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrent = new Tree(current, Constants.encode(newName[trees.Count - 1]));\n\t\t\t\t\t\tcurrent.Parent.AddEntry(current);\n\t\t\t\t\t\ttrees.Push(current);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrent = (Tree)current.findTreeMember(newName[trees.Count - 1]);\n\t\t\t\t\t\ttrees.Push(current);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar ne = new FileTreeEntry(current, e.ObjectId, Constants.encode(newName[newName.Length - 1]),\n\t\t\t\t\t\t\t\t\t\t\t\t\t(e.Mode & FileMode.ExecutableFile.Bits) == FileMode.ExecutableFile.Bits);\n\t\t\t\tcurrent.AddEntry(ne);\n\t\t\t}\n\n\t\t\twhile (trees.Count != 0)\n\t\t\t{\n\t\t\t\tcurrent.Id = writer.WriteTree(current);\n\t\t\t\ttrees.Pop();\n\n\t\t\t\tif (trees.Count != 0)\n\t\t\t\t{\n\t\t\t\t\tcurrent = trees.Peek();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn current.TreeId;\n\t\t}\n\n\t\tinternal string[] SplitDirPath(string name)\n\t\t{\n\t\t\t// TODO : Maybe should we rely on a plain string.Split(). Seems to deliver the expected output.\n\t\t\tvar tmp = new string[name.Length / 2 + 1];\n\t\t\tint p0 = -1;\n\t\t\tint p1;\n\t\t\tint c = 0;\n\t\t\twhile ((p1 = name.IndexOf('/', p0 + 1)) != -1)\n\t\t\t{\n\t\t\t\ttmp[c++] = name.Slice(p0 + 1, p1);\n\t\t\t\tp0 = p1;\n\t\t\t}\n\t\t\ttmp[c++] = name.Substring(p0 + 1);\n\t\t\tvar ret = new string[c];\n\t\t\tfor (int i = 0; i < c; ++i)\n\t\t\t{\n\t\t\t\tret[i] = tmp[i];\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tinternal int LongestCommonPath(string[] a, string[] b)\n\t\t{\n\t\t\tint i;\n\n\t\t\tfor (i = 0; i < a.Length && i < b.Length; ++i)\n\t\t\t{\n\t\t\t\tif (!a[i].Equals(b[i]))\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn i;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Look up an entry with the specified path.\n\t\t/// </summary>\n\t\t/// <param name=\"path\"></param>\n\t\t/// <returns>Index entry for the path or null if not in index.</returns>\n\t\tpublic Entry GetEntry(string path)\n\t\t{\n\t\t\tbyte[] val = Repository.GitInternalSlash(Constants.encode(path));\n\t\t\treturn _entries.Where(e => e.Key.SequenceEqual(val)).FirstOrDefault().Value;\n\t\t}\n\n\t\t#region Nested Types\n\n\t\t#region Nested type: ByteVectorComparer\n\n\t\tprivate class ByteVectorComparer : IComparer<byte[]>\n\t\t{\n\t\t\t#region IComparer<byte[]> Members\n\n\t\t\tpublic int Compare(byte[] x, byte[] y)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < x.Length && i < y.Length; ++i)\n\t\t\t\t{\n\t\t\t\t\tint c = x[i] - y[i];\n\t\t\t\t\tif (c != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn c;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (x.Length < y.Length)\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\n\t\t\t\tif (x.Length > y.Length)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Nested type: Entry\n\n\t\t/// <summary>\n\t\t/// An index entry\n\t\t/// </summary>\n\t\tpublic class Entry\n\t\t{\n\t\t\tprivate readonly int _dev;\n\t\t\tprivate readonly int _gid;\n\t\t\tprivate readonly int _ino;\n\t\t\tprivate readonly byte[] _name;\n\t\t\tprivate readonly int _uid;\n\n\t\t\tprivate short _flags;\n\t\t\tprivate int _size;\n\n\t\t\tinternal Entry(Repository repository, byte[] key, FileInfo f, int stage)\n\t\t\t\t: this(repository, key, f, stage, null)\n\t\t\t{\n\t\t\t}\n\n\t\t\tinternal Entry(Repository repository, byte[] key, FileInfo f, int stage, byte[] newContent)\n\t\t\t\t: this(repository)\n\t\t\t{\n\t\t\t\tif (newContent == null && f == null)\n\t\t\t\t\tthrow new ArgumentException(\"either file or newContent must be non-null\");\n\n\t\t\t\tCtime = f.lastModified() * 1000000L;\n\t\t\t    Mtime = Ctime; // we use same here\n\t\t\t\t_dev = -1;\n\t\t\t\t_ino = -1;\n\n\t\t\t\tif (ConfigFilemode(Repository) && FileCanExecute(f))\n\t\t\t\t{\n\t\t\t\t\tMode = FileMode.ExecutableFile.Bits;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMode = FileMode.RegularFile.Bits;\n\t\t\t\t}\n\n\t\t\t\t_uid = -1;\n\t\t\t\t_gid = -1;\n\t\t\t\t_size = ((newContent == null || newContent.Length == 0) && f != null) ? (int)(f).Length : newContent.Length;\n\t\t\t\tvar writer = new ObjectWriter(Repository);\n\t\t\t\tif ((newContent == null || newContent.Length == 0) && f != null)\n\t\t\t\t{\n\t\t\t\t\tObjectId = writer.WriteBlob(f);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tObjectId = writer.WriteBlob(newContent);\n\t\t\t\t}\n\t\t\t\t_name = key;\n\t\t\t\t_flags = (short)((stage << 12) | _name.Length); // TODO: fix _flags\n\t\t\t}\n\n\t\t\tinternal Entry(Repository repository, TreeEntry f, int stage)\n\t\t\t\t: this(repository)\n\t\t\t{\n\t\t\t\tCtime = -1; // hmm\n\t\t\t\tMtime = -1;\n\t\t\t\t_dev = -1;\n\t\t\t\t_ino = -1;\n\t\t\t\tMode = f.Mode.Bits;\n\t\t\t\t_uid = -1;\n\t\t\t\t_gid = -1;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_size = (int)Repository.OpenBlob(f.Id).Size;\n\t\t\t\t}\n\t\t\t\tcatch (IOException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t_size = -1;\n\t\t\t\t}\n\t\t\t\tObjectId = f.Id;\n\t\t\t\t_name = Constants.encode(f.FullName);\n\t\t\t\t_flags = (short)((stage << 12) | _name.Length); // TODO: fix _flags\n\t\t\t}\n\n\t\t\tinternal Entry(Repository repository, EndianBinaryReader b)\n\t\t\t\t: this(repository)\n\t\t\t{\n\t\t\t\tlong startposition = b.BaseStream.Position;\n\t\t\t\tCtime = b.ReadInt32() * 1000000000L + (b.ReadInt32() % 1000000000L);\n\t\t\t\tMtime = b.ReadInt32() * 1000000000L + (b.ReadInt32() % 1000000000L);\n\t\t\t\t_dev = b.ReadInt32();\n\t\t\t\t_ino = b.ReadInt32();\n\t\t\t\tMode = b.ReadInt32();\n\t\t\t\t_uid = b.ReadInt32();\n\t\t\t\t_gid = b.ReadInt32();\n\t\t\t\t_size = b.ReadInt32();\n\t\t\t\tbyte[] sha1Bytes = b.ReadBytes(Constants.OBJECT_ID_LENGTH);\n\t\t\t\tObjectId = ObjectId.FromRaw(sha1Bytes);\n\t\t\t\t_flags = b.ReadInt16();\n\t\t\t\t_name = b.ReadBytes(_flags & 0xFFF);\n\t\t\t\tb.BaseStream.Position = startposition +\n\t\t\t\t\t\t\t\t\t\t\t\t((8 + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 20 + 2 + _name.Length + 8) & ~7);\n\t\t\t}\n\n\t\t\tprivate Entry(Repository repository)\n\t\t\t{\n\t\t\t\tRepository = repository;\n\t\t\t\tConfigFileMode = ConfigFilemode(repository);\n\t\t\t}\n\n\t\t\tpublic ObjectId ObjectId { get; private set; }\n\t\t\tpublic Repository Repository { get; private set; }\n\t\t\tpublic bool ConfigFileMode { get; private set; }\n\t\t\tpublic int Mode { get; private set; }\n\n\t\t\tpublic long Ctime { get; set; }\n\t\t\tpublic long Mtime { get; set; }\n\n\t\t\t/// <returns> path name for this entry </returns>\n\t\t\tpublic string Name\n\t\t\t{\n\t\t\t\tget { return RawParseUtils.decode(_name); }\n\t\t\t}\n\n\t\t\t///\t<returns> path name for this entry as byte array, hopefully UTF-8 encoded </returns>\n\t\t\tpublic byte[] NameUTF8\n\t\t\t{\n\t\t\t\tget { return _name; }\n\t\t\t}\n\n\t\t\t///\t<returns> the stage this entry is in </returns>\n\t\t\tpublic int Stage\n\t\t\t{\n\t\t\t\tget { return (_flags & 0x3000) >> 12; }\n\t\t\t}\n\n\t\t\t///\t<returns> size of disk object </returns>\n\t\t\tpublic int Size\n\t\t\t{\n\t\t\t\tget { return _size; }\n\t\t\t}\n\n\t\t\t///\t<summary>\n\t\t\t/// Update this index entry with stat and SHA-1 information if it looks\n\t\t\t/// like the file has been modified in the workdir.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"f\">file in work dir</param>\n\t\t\t/// <returns> true if a change occurred </returns>\n\t\t\t/// <exception cref=\"IOException\"></exception>\n\t\t\tpublic bool update(FileInfo f)\n\t\t\t{\n\t\t\t\tlong lm = f.lastModified() * 1000000L;\n\t\t\t\tbool modified = Mtime != lm;\n\t\t\t\tMtime = lm;\n\n\t\t\t\tif (_size != f.Length)\n\t\t\t\t{\n\t\t\t\t\tmodified = true;\n\t\t\t\t}\n\n\t\t\t\tif (ConfigFileMode)\n\t\t\t\t{\n\t\t\t\t\tif (FileCanExecute(f) != FileMode.ExecutableFile.Equals(Mode))\n\t\t\t\t\t{\n\t\t\t\t\t\tMode = FileMode.ExecutableFile.Bits;\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (modified)\n\t\t\t\t{\n\t\t\t\t\t_size = (int)f.Length;\n\t\t\t\t\tvar writer = new ObjectWriter(Repository);\n\t\t\t\t\tObjectId newsha1 = ObjectId = writer.WriteBlob(f);\n\n\t\t\t\t\tmodified = !newsha1.Equals(ObjectId);\n\t\t\t\t\tObjectId = newsha1;\n\t\t\t\t}\n\n\t\t\t\treturn modified;\n\t\t\t}\n\n\t\t\t///\t<summary>\n\t\t\t/// Update this index entry with stat and SHA-1 information if it looks\n\t\t\t/// like the file has been modified in the workdir.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"f\">file in work dir</param>\n\t\t\t/// <param name=\"newContent\">the new content of the file </param>\n\t\t\t/// <returns> true if a change occurred </returns>\n\t\t\t/// <exception cref=\"IOException\"></exception>\n\t\t\tpublic bool update(FileInfo f, byte[] newContent) //[henon] TODO: remove parameter f as it is useless\n\t\t\t{\n\t\t\t\tbool modified = false;\n\t\t\t\t_size = newContent.Length;\n\t\t\t\tvar writer = new ObjectWriter(Repository);\n\t\t\t\tObjectId newsha1 = ObjectId = writer.WriteBlob(newContent);\n\n\t\t\t\tif (!newsha1.Equals(ObjectId))\n\t\t\t\t{\n\t\t\t\t\tmodified = true;\n\t\t\t\t}\n\n\t\t\t\tObjectId = newsha1;\n\t\t\t\treturn modified;\n\t\t\t}\n\n\t\t\tinternal void Write(MemoryStream buf)\n\t\t\t{\n\t\t\t\tvar t = new BigEndianBitConverter();\n\n\t\t\t\tlong startposition = buf.Position;\n\n\t\t\t\tvar tmpBuffer = t.GetBytes((int)(Ctime / 1000000000L));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((int)(Ctime % 1000000000L));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((int)(Mtime / 1000000000L));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((int)(Mtime % 1000000000L));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_dev));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_ino));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((Mode));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_uid));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_gid));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_size));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\tObjectId.copyRawTo(buf);\n\n\t\t\t\ttmpBuffer = t.GetBytes((_flags));\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\tbuf.Write(_name, 0, _name.Length);\n\n\t\t\t\tlong end = startposition\n\t\t\t\t\t\t  + ((8 + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 20 + 2 + _name.Length + 8) & ~7);\n\t\t\t\tlong remain = end - buf.Position;\n\t\t\t\twhile (remain-- > 0)\n\t\t\t\t{\n\t\t\t\t\tbuf.WriteByte(0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t///\t<summary>\n\t\t\t/// Check if an entry's content is different from the cache, \n\t\t\t/// \n\t\t\t/// File status information is used and status is same we\n\t\t\t///\tconsider the file identical to the state in the working\n\t\t\t/// directory. Native git uses more stat fields than we\n\t\t\t/// have accessible in Java.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"wd\"> working directory to compare content with </param>\n\t\t\t/// <returns> true if content is most likely different. </returns>\t \n\t\t\tpublic bool IsModified(DirectoryInfo wd)\n\t\t\t{\n\t\t\t\treturn IsModified(wd, false);\n\t\t\t}\n\n\t\t\t///\t<summary>\n\t\t\t/// Check if an entry's content is different from the cache, \n\t\t\t/// \n\t\t\t/// File status information is used and status is same we\n\t\t\t///\tconsider the file identical to the state in the working\n\t\t\t/// directory. Native git uses more stat fields than we\n\t\t\t/// have accessible in Java.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"wd\"> working directory to compare content with </param>\n\t\t\t/// <param name=\"forceContentCheck\"> \n\t\t\t/// True if the actual file content should be checked if modification time differs.\n\t\t\t/// </param>\n\t\t\t/// <returns> true if content is most likely different. </returns>\n\t\t\tpublic bool IsModified(DirectoryInfo wd, bool forceContentCheck)\n\t\t\t{\n\t\t\t\tif (isAssumedValid())\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (isUpdateNeeded())\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tFileInfo file = getFile(wd);\n\t\t\t\tif (!file.Exists)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// JDK1.6 has file.canExecute\n\t\t\t\t// if (file.canExecute() != FileMode.EXECUTABLE_FILE.equals(mode))\n\t\t\t\t// return true;\n\t\t\t\tint exebits = FileMode.ExecutableFile.Bits ^ FileMode.RegularFile.Bits;\n\n\t\t\t\tif (ConfigFileMode && FileMode.ExecutableFile.Equals(Mode))\n\t\t\t\t{\n\t\t\t\t\tif (!FileCanExecute(file) && FileHasExecute())\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (FileMode.RegularFile.Equals(Mode & ~exebits))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!File.Exists(file.FullName) || ConfigFileMode && FileCanExecute(file) && FileHasExecute())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (FileMode.Symlink.Equals(Mode))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (FileMode.Tree.Equals(Mode))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!Directory.Exists(file.FullName))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.WriteLine(\"Does not handle mode \" + Mode + \" (\" + file + \")\");\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (file.Length != _size)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// Git under windows only stores seconds so we round the timestamp\n\t\t\t\t// Java gives us if it looks like the timestamp in index is seconds\n\t\t\t\t// only. Otherwise we compare the timestamp at millisecond prevision.\n\t\t\t\tlong javamtime = Mtime / 1000000L;\n\t\t\t\tlong lastm = file.lastModified();\n\n\t\t\t\tif (javamtime % 1000 == 0)\n\t\t\t\t{\n\t\t\t\t\tlastm = lastm - lastm % 1000;\n\t\t\t\t}\n\t\t\t\tif (lastm != javamtime)\n\t\t\t\t{\n                    if (!forceContentCheck)\n\t\t\t\t\treturn true;\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (Stream @is = new FileStream(file.FullName, System.IO.FileMode.Open, FileAccess.Read))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar objectWriter = new ObjectWriter(Repository);\n\t\t\t\t\t\t\t\tObjectId newId = objectWriter.ComputeBlobSha1(file.Length, @is);\n\t\t\t\t\t\t\t\tbool ret = !newId.Equals(ObjectId);\n\t\t\t\t\t\t\t\treturn ret;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (IOException e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfinally\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t@is.Close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (IOException e)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// can't happen, but if it does we ignore it\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (FileNotFoundException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// should not happen because we already checked this\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n                }\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// for testing\n\t\t\tinternal void forceRecheck()\n\t\t\t{\n\t\t\t\tMtime = -1;\n\t\t\t}\n\n\t\t\tprivate FileInfo getFile(DirectoryInfo wd)\n\t\t\t{\n\t\t\t\treturn new FileInfo(Path.Combine(wd.FullName, Name));\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn Name + \"/SHA-1(\" +\n\t\t\t\t\t\t ObjectId.Name + \")/M:\" +\n                         (Ctime / 1000000L).MillisToUtcDateTime() + \"/C:\" +\n                         (Mtime / 1000000L).MillisToUtcDateTime() + \"/d\" +\n\t\t\t\t\t\t _dev +\n\t\t\t\t\t\t \"/i\" + _ino +\n\t\t\t\t\t\t \"/m\" + Convert.ToString(Mode, 8) +\n\t\t\t\t\t\t \"/u\" + _uid +\n\t\t\t\t\t\t \"/g\" + _gid +\n\t\t\t\t\t\t \"/s\" + _size +\n\t\t\t\t\t\t \"/f\" + _flags +\n\t\t\t\t\t\t \"/@\" + Stage;\n\t\t\t}\n\n\t\t\t///\t<returns> true if this entry shall be assumed valid </returns>\n\t\t\tpublic bool isAssumedValid()\n\t\t\t{\n\t\t\t\treturn (_flags & 0x8000) != 0;\n\t\t\t}\n\n\t\t\t///\t<returns> true if this entry should be checked for changes </returns>\n\t\t\tpublic bool isUpdateNeeded()\n\t\t\t{\n\t\t\t\treturn (_flags & 0x4000) != 0;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Set whether to always assume this entry valid\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"assumeValid\"> true to ignore changes </param>\n\t\t\tpublic void setAssumeValid(bool assumeValid)\n\t\t\t{\n\t\t\t\tif (assumeValid)\n\t\t\t\t{\n\t\t\t\t\t_flags = Convert.ToInt16(Convert.ToInt32(_flags) | 0x8000);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_flags = Convert.ToInt16(Convert.ToInt32(_flags) & ~0x8000);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t///\t<summary>\n\t\t\t/// Set whether this entry must be checked\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"updateNeeded\"> </param>\n\t\t\tpublic void setUpdateNeeded(bool updateNeeded)\n\t\t\t{\n\t\t\t\tif (updateNeeded)\n\t\t\t\t{\n\t\t\t\t\t_flags |= 0x4000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_flags &= ~0x4000;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Return raw file mode bits. See <seealso cref=\"FileMode\"/>\n\t\t\t/// </summary>\n\t\t\t///\t<returns> file mode bits </returns>\n\t\t\tpublic int getModeBits()\n\t\t\t{\n\t\t\t\treturn Mode;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Nested type: Header\n\n\t\tprivate class Header\n\t\t{\n\t\t\tprivate int _signature;\n\t\t\tprivate int _version;\n\n\t\t\tinternal Header(EndianBinaryReader map)\n\t\t\t{\n\t\t\t\tRead(map);\n\t\t\t}\n\n\t\t\tinternal Header(ICollection entryset)\n\t\t\t{\n\t\t\t\t_signature = 0x44495243;\n\t\t\t\t_version = 2;\n\t\t\t\tEntries = entryset.Count;\n\t\t\t}\n\n\t\t\tinternal int Entries { get; private set; }\n\n\t\t\tprivate void Read(EndianBinaryReader buf)\n\t\t\t{\n\t\t\t\t_signature = buf.ReadInt32();\n\t\t\t\t_version = buf.ReadInt32();\n\t\t\t\tEntries = buf.ReadInt32();\n\n\t\t\t\tif (_signature != 0x44495243)\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(\"Index signature is invalid: \" + _signature);\n\t\t\t\t}\n\n\t\t\t\tif (_version != 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(\"Unknown index version (or corrupt index):\" + _version);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinternal void Write(Stream buf)\n\t\t\t{\n\t\t\t\tvar t = new BigEndianBitConverter();\n\t\t\t\tvar tmpBuffer = t.GetBytes(_signature);\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes(_version);\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\n\t\t\t\ttmpBuffer = t.GetBytes(Entries);\n\t\t\t\tbuf.Write(tmpBuffer, 0, tmpBuffer.Length);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/GitSharp.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{C46EDD61-C202-465A-93F1-ADE20A83BB59}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>GitSharp.Core</RootNamespace>\n    <AssemblyName>GitSharp.Core</AssemblyName>\n    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>http://localhost/GitSharp.Core/</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Web</InstallFrom>\n    <UpdateEnabled>true</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>true</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Debug\\GitSharp.Core.XML</DocumentationFile>\n    <NoWarn>1591</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=null\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\lib\\ICSharpCode.SharpZipLib.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Tamir.SharpSSH, Version=1.1.1.13, Culture=neutral, PublicKeyToken=null\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\lib\\Tamir.SharpSSH.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AbbreviatedObjectId.cs\" />\n    <Compile Include=\"AlternateRepositoryDatabase.cs\" />\n    <Compile Include=\"BlobBasedConfig.cs\" />\n    <Compile Include=\"ByteArrayExtensions.cs\" />\n    <Compile Include=\"ByteArrayWindow.cs\" />\n    <Compile Include=\"ByteBufferWindow.cs\" />\n    <Compile Include=\"ByteWindow.cs\" />\n    <Compile Include=\"ConsoleUserInfoProvider.cs\" />\n    <Compile Include=\"IgnoreHandler.cs\" />\n    <Compile Include=\"RepositoryListener.cs\" />\n    <Compile Include=\"CompleteAttribute.cs\" />\n    <Compile Include=\"DeltaOfsPackedObjectLoader.cs\" />\n    <Compile Include=\"DeltaPackedObjectLoader.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"DeltaRefPackedObjectLoader.cs\" />\n    <Compile Include=\"Diff\\DiffFormatter.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheBuildIterator.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheIterator.cs\" />\n    <Compile Include=\"Ensure.cs\" />\n    <Compile Include=\"Exceptions\\CancelledException.cs\" />\n    <Compile Include=\"Exceptions\\CheckoutConflictException.cs\" />\n    <Compile Include=\"Exceptions\\CompoundException.cs\" />\n    <Compile Include=\"Exceptions\\ConfigInvalidException.cs\" />\n    <Compile Include=\"Exceptions\\ExceptionExtensions.cs\" />\n    <Compile Include=\"Exceptions\\GitlinksNotSupportedException.cs\" />\n    <Compile Include=\"Exceptions\\InvalidObjectIdException.cs\" />\n    <Compile Include=\"Exceptions\\NoClosingBracketException.cs\" />\n    <Compile Include=\"Exceptions\\CorruptObjectException.cs\" />\n    <Compile Include=\"Exceptions\\EntryExistsException.cs\" />\n    <Compile Include=\"Exceptions\\FileLockedException.cs\" />\n    <Compile Include=\"Exceptions\\IncorrectObjectTypeException.cs\" />\n    <Compile Include=\"Exceptions\\InvalidPackException.cs\" />\n    <Compile Include=\"Exceptions\\InvalidPatternException.cs\" />\n    <Compile Include=\"Exceptions\\MissingObjectException.cs\" />\n    <Compile Include=\"Exceptions\\ObjectWritingException.cs\" />\n    <Compile Include=\"Exceptions\\PackMismatchException.cs\" />\n    <Compile Include=\"Exceptions\\RepositoryNotFoundException.cs\" />\n    <Compile Include=\"Exceptions\\RevisionSyntaxException.cs\" />\n    <Compile Include=\"Exceptions\\SymlinksNotSupportedException.cs\" />\n    <Compile Include=\"FileBasedConfig.cs\" />\n    <Compile Include=\"FnMatch\\AbstractHead.cs\" />\n    <Compile Include=\"FnMatch\\CharacterHead.cs\" />\n    <Compile Include=\"FnMatch\\FileNameMatcher.cs\" />\n    <Compile Include=\"FnMatch\\GroupHead.cs\" />\n    <Compile Include=\"FnMatch\\IHead.cs\" />\n    <Compile Include=\"FnMatch\\LastHead.cs\" />\n    <Compile Include=\"FnMatch\\RestrictedWildCardHead.cs\" />\n    <Compile Include=\"FnMatch\\WildCardHead.cs\" />\n    <Compile Include=\"GitlinkTreeEntry.cs\" />\n    <Compile Include=\"SubmoduleConfig.cs\" />\n    <Compile Include=\"SystemReader.cs\" />\n    <Compile Include=\"Merge\\Merger.cs\" />\n    <Compile Include=\"Merge\\MergeStrategy.cs\" />\n    <Compile Include=\"Merge\\StrategyOneSided.cs\" />\n    <Compile Include=\"Merge\\StrategySimpleTwoWayInCore.cs\" />\n    <Compile Include=\"Merge\\ThreeWayMerger.cs\" />\n    <Compile Include=\"Merge\\ThreeWayMergeStrategy.cs\" />\n    <Compile Include=\"ObjectDatabase.cs\" />\n    <Compile Include=\"ObjectDirectory.cs\" />\n    <Compile Include=\"ReflogReader.cs\" />\n    <Compile Include=\"RefRename.cs\" />\n    <Compile Include=\"RepositoryCache.cs\" />\n    <Compile Include=\"RepositoryConfig.cs\" />\n    <Compile Include=\"RevWalk\\FooterKey.cs\" />\n    <Compile Include=\"RevWalk\\FooterLine.cs\" />\n    <Compile Include=\"TransferConfig.cs\" />\n    <Compile Include=\"Transport\\BundleWriter.cs\" />\n    <Compile Include=\"Transport\\LongMap.cs\" />\n    <Compile Include=\"Transport\\DefaultSshSessionFactory.cs\" />\n    <Compile Include=\"Transport\\FetchProcess.cs\" />\n    <Compile Include=\"Transport\\OpenSshConfig.cs\" />\n    <Compile Include=\"Transport\\PushProcess.cs\" />\n    <Compile Include=\"Transport\\RefAdvertiser.cs\" />\n    <Compile Include=\"Transport\\SideBandProgressMonitor.cs\" />\n    <Compile Include=\"Transport\\SshTransport.cs\" />\n    <Compile Include=\"Transport\\SshConfigSessionFactory.cs\" />\n    <Compile Include=\"Transport\\SshSessionFactory.cs\" />\n    <Compile Include=\"Transport\\TransportAmazonS3.cs\" />\n    <Compile Include=\"Transport\\TransportBundleStream.cs\" />\n    <Compile Include=\"Transport\\TransportGitAnon.cs\" />\n    <Compile Include=\"Transport\\TransportGitSsh.cs\" />\n    <Compile Include=\"Transport\\TransportHttp.cs\" />\n    <Compile Include=\"Transport\\TransportLocal.cs\" />\n    <Compile Include=\"Transport\\TransportSftp.cs\" />\n    <Compile Include=\"Transport\\WalkEncryption.cs\" />\n    <Compile Include=\"Transport\\WalkFetchConnection.cs\" />\n    <Compile Include=\"Transport\\WalkPushConnection.cs\" />\n    <Compile Include=\"Transport\\WalkRemoteObjectDatabase.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\PathSuffixFilter.cs\" />\n    <Compile Include=\"UnpackedObjectCache.cs\" />\n    <Compile Include=\"UserConfig.cs\" />\n    <Compile Include=\"UserInfoProvider.cs\" />\n    <Compile Include=\"Util\\ArrayExtensions.cs\" />\n    <Compile Include=\"Util\\JavaHelper\\AtomicReference.cs\" />\n    <Compile Include=\"Util\\BigEndianBitConverter.cs\" />\n    <Compile Include=\"Util\\JavaHelper\\Charset.cs\" />\n    <Compile Include=\"Util\\DateTimeExtensions.cs\" />\n    <Compile Include=\"Util\\EndianBinaryReader.cs\" />\n    <Compile Include=\"Util\\EndianBinaryWriter.cs\" />\n    <Compile Include=\"Util\\EndianBitConverter.cs\" />\n    <Compile Include=\"Util\\Endianness.cs\" />\n    <Compile Include=\"Util\\Extensions.cs\" />\n    <Compile Include=\"AbstractIndexTreeVisitor.cs\" />\n    <Compile Include=\"AnyObjectId.cs\" />\n    <Compile Include=\"BinaryDelta.cs\" />\n    <Compile Include=\"Codec.cs\" />\n    <Compile Include=\"Commit.cs\" />\n    <Compile Include=\"Constants.cs\" />\n    <Compile Include=\"CoreConfig.cs\" />\n    <Compile Include=\"FileMode.cs\" />\n    <Compile Include=\"FileTreeEntry.cs\" />\n    <Compile Include=\"ForceModified.cs\" />\n    <Compile Include=\"GitException.cs\" />\n    <Compile Include=\"GitIndex.cs\" />\n    <Compile Include=\"IndexDiff.cs\" />\n    <Compile Include=\"IndexTreeVisitor.cs\" />\n    <Compile Include=\"IndexTreeWalker.cs\" />\n    <Compile Include=\"InflaterCache.cs\" />\n    <Compile Include=\"LockFile.cs\" />\n    <Compile Include=\"MutableObjectId.cs\" />\n    <Compile Include=\"NullProgressMonitor.cs\" />\n    <Compile Include=\"ObjectChecker.cs\" />\n    <Compile Include=\"ObjectId.cs\" />\n    <Compile Include=\"ObjectLoader.cs\" />\n    <Compile Include=\"ObjectType.cs\" />\n    <Compile Include=\"ObjectWriter.cs\" />\n    <Compile Include=\"OffsetCache.cs\" />\n    <Compile Include=\"PackedObjectLoader.cs\" />\n    <Compile Include=\"PackFile.cs\" />\n    <Compile Include=\"PackIndex.cs\" />\n    <Compile Include=\"PackIndexV1.cs\" />\n    <Compile Include=\"PackIndexV2.cs\" />\n    <Compile Include=\"PackIndexWriter.cs\" />\n    <Compile Include=\"PackIndexWriterV1.cs\" />\n    <Compile Include=\"PackIndexWriterV2.cs\" />\n    <Compile Include=\"PackReverseIndex.cs\" />\n    <Compile Include=\"PersonIdent.cs\" />\n    <Compile Include=\"ProgressMonitor.cs\" />\n    <Compile Include=\"Ref.cs\" />\n    <Compile Include=\"RefDatabase.cs\" />\n    <Compile Include=\"RefUpdate.cs\" />\n    <Compile Include=\"Repository.cs\" />\n    <Compile Include=\"Config.cs\" />\n    <Compile Include=\"RepositoryState.cs\" />\n    <Compile Include=\"SymlinkTreeEntry.cs\" />\n    <Compile Include=\"Tag.cs\" />\n    <Compile Include=\"TextProgressMonitor.cs\" />\n    <Compile Include=\"Transport\\PackedObjectInfo.cs\" />\n    <Compile Include=\"Tree.cs\" />\n    <Compile Include=\"TreeEntry.cs\" />\n    <Compile Include=\"Treeish.cs\" />\n    <Compile Include=\"TreeIterator.cs\" />\n    <Compile Include=\"TreeVisitor.cs\" />\n    <Compile Include=\"TreeVisitorWithCurrentDirectory.cs\" />\n    <Compile Include=\"UnpackedObjectLoader.cs\" />\n    <Compile Include=\"Util\\AtomicReferenceArray.cs\" />\n    <Compile Include=\"Util\\JavaHelper\\AtomicValue.cs\" />\n    <Compile Include=\"Util\\IO.cs\" />\n    <Compile Include=\"Util\\LittleEndianBitConverter.cs\" />\n    <Compile Include=\"Util\\Stream.cs\" />\n    <Compile Include=\"Util\\FS.cs\" />\n    <Compile Include=\"Util\\GenericComparer.cs\" />\n    <Compile Include=\"Util\\Inspect.cs\" />\n    <Compile Include=\"Util\\Int32.cs\" />\n    <Compile Include=\"Util\\MutableInteger.cs\" />\n    <Compile Include=\"Util\\StringExtension.cs\" />\n    <Compile Include=\"Util\\CheckedOutputStream.cs\" />\n    <Compile Include=\"Util\\CRC32.cs\" />\n    <Compile Include=\"Util\\MessageDigest.cs\" />\n    <Compile Include=\"Util\\StringUtils.cs\" />\n    <Compile Include=\"Util\\WeakReference.cs\" />\n    <Compile Include=\"WholePackedObjectLoader.cs\" />\n    <Compile Include=\"WindowCache.cs\" />\n    <Compile Include=\"WindowCacheConfig.cs\" />\n    <Compile Include=\"WindowCursor.cs\" />\n    <Compile Include=\"WorkDirCheckout.cs\" />\n    <Compile Include=\"WriteTree.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Util\\Hex.cs\" />\n    <Compile Include=\"Util\\NestedDictionary.cs\" />\n    <Compile Include=\"Util\\NB.cs\" />\n    <Compile Include=\"Util\\PathUtil.cs\" />\n    <Compile Include=\"Util\\RawParseUtils.cs\" />\n    <Compile Include=\"RepositoryChangedEventArgs.cs\" />\n    <Compile Include=\"RefsChangedEventArgs.cs\" />\n    <Compile Include=\"IndexChangedEventArgs.cs\" />\n    <Compile Include=\"RevWalk\\AbstractRevQueue.cs\" />\n    <Compile Include=\"RevWalk\\BlockObjQueue.cs\" />\n    <Compile Include=\"RevWalk\\BlockRevQueue.cs\" />\n    <Compile Include=\"RevWalk\\BoundaryGenerator.cs\" />\n    <Compile Include=\"RevWalk\\DateRevQueue.cs\" />\n    <Compile Include=\"RevWalk\\DelayRevQueue.cs\" />\n    <Compile Include=\"RevWalk\\EndGenerator.cs\" />\n    <Compile Include=\"RevWalk\\FIFORevQueue.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\AndRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\AuthorRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\CommitterRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\CommitTimeRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\MessageRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\NotRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\OrRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\PatternMatchRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\RevFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\RevFlagFilter.cs\" />\n    <Compile Include=\"RevWalk\\Filter\\SubStringRevFilter.cs\" />\n    <Compile Include=\"RevWalk\\FixUninterestingGenerator.cs\" />\n    <Compile Include=\"RevWalk\\Generator.cs\" />\n    <Compile Include=\"RevWalk\\LIFORevQueue.cs\" />\n    <Compile Include=\"RevWalk\\MergeBaseGenerator.cs\" />\n    <Compile Include=\"RevWalk\\ObjectWalk.cs\" />\n    <Compile Include=\"RevWalk\\PendingGenerator.cs\" />\n    <Compile Include=\"RevWalk\\RevBlob.cs\" />\n    <Compile Include=\"RevWalk\\RevCommit.cs\" />\n    <Compile Include=\"RevWalk\\RevCommitList.cs\" />\n    <Compile Include=\"RevWalk\\RevFlag.cs\" />\n    <Compile Include=\"RevWalk\\RevFlagSet.cs\" />\n    <Compile Include=\"RevWalk\\RevObject.cs\" />\n    <Compile Include=\"RevWalk\\RevObjectList.cs\" />\n    <Compile Include=\"RevWalk\\RevSort.cs\" />\n    <Compile Include=\"RevWalk\\RevTag.cs\" />\n    <Compile Include=\"RevWalk\\RevTree.cs\" />\n    <Compile Include=\"RevWalk\\RevWalk.cs\" />\n    <Compile Include=\"RevWalk\\RewriteGenerator.cs\" />\n    <Compile Include=\"RevWalk\\RewriteTreeFilter.cs\" />\n    <Compile Include=\"RevWalk\\StartGenerator.cs\" />\n    <Compile Include=\"RevWalk\\TopoSortGenerator.cs\" />\n    <Compile Include=\"DirectoryCache\\BaseDirCacheEditor.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCache.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheBuilder.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheEditor.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheEntry.cs\" />\n    <Compile Include=\"DirectoryCache\\DirCacheTree.cs\" />\n    <Compile Include=\"Diff\\Edit.cs\" />\n    <Compile Include=\"Diff\\EditList.cs\" />\n    <Compile Include=\"Diff\\RawText.cs\" />\n    <Compile Include=\"Diff\\Sequence.cs\" />\n    <Compile Include=\"Exceptions\\MissingBundlePrerequisiteException.cs\" />\n    <Compile Include=\"Exceptions\\NoRemoteRepositoryException.cs\" />\n    <Compile Include=\"Exceptions\\PackProtocolException.cs\" />\n    <Compile Include=\"Exceptions\\RevWalkException.cs\" />\n    <Compile Include=\"Exceptions\\StopWalkException.cs\" />\n    <Compile Include=\"Exceptions\\TransportException.cs\" />\n    <Compile Include=\"Exceptions\\UnmergedPathException.cs\" />\n    <Compile Include=\"ObjectIdSubclassMap.cs\" />\n    <Compile Include=\"PackLock.cs\" />\n    <Compile Include=\"PackWriter.cs\" />\n    <Compile Include=\"Patch\\BinaryHunk.cs\" />\n    <Compile Include=\"Patch\\CombinedFileHeader.cs\" />\n    <Compile Include=\"Patch\\CombinedHunkHeader.cs\" />\n    <Compile Include=\"Patch\\FileHeader.cs\" />\n    <Compile Include=\"Patch\\FormatError.cs\" />\n    <Compile Include=\"Patch\\HunkHeader.cs\" />\n    <Compile Include=\"Patch\\Patch.cs\" />\n    <Compile Include=\"RefComparator.cs\" />\n    <Compile Include=\"RefWriter.cs\" />\n    <Compile Include=\"Transport\\BaseConnection.cs\" />\n    <Compile Include=\"Transport\\BaseFetchConnection.cs\" />\n    <Compile Include=\"Transport\\BasePackConnection.cs\" />\n    <Compile Include=\"Transport\\BasePackFetchConnection.cs\" />\n    <Compile Include=\"Transport\\BasePackPushConnection.cs\" />\n    <Compile Include=\"Transport\\BundleFetchConnection.cs\" />\n    <Compile Include=\"Transport\\Daemon.cs\" />\n    <Compile Include=\"Transport\\DaemonClient.cs\" />\n    <Compile Include=\"Transport\\DaemonService.cs\" />\n    <Compile Include=\"Transport\\FetchHeadRecord.cs\" />\n    <Compile Include=\"Transport\\FetchResult.cs\" />\n    <Compile Include=\"Transport\\HttpTransport.cs\" />\n    <Compile Include=\"Transport\\IFetchConnection.cs\" />\n    <Compile Include=\"Transport\\IConnection.cs\" />\n    <Compile Include=\"Transport\\IndexPack.cs\" />\n    <Compile Include=\"Transport\\IPreReceiveHook.cs\" />\n    <Compile Include=\"Transport\\IPushConnection.cs\" />\n    <Compile Include=\"Transport\\IPackTransport.cs\" />\n    <Compile Include=\"Transport\\OperationResult.cs\" />\n    <Compile Include=\"Transport\\PacketLineIn.cs\" />\n    <Compile Include=\"Transport\\PacketLineOut.cs\" />\n    <Compile Include=\"Transport\\IPostReceiveHook.cs\" />\n    <Compile Include=\"PackOutputStream.cs\" />\n    <Compile Include=\"Transport\\PushResult.cs\" />\n    <Compile Include=\"Transport\\ReceiveCommand.cs\" />\n    <Compile Include=\"Transport\\ReceivePack.cs\" />\n    <Compile Include=\"Transport\\RefSpec.cs\" />\n    <Compile Include=\"Transport\\RemoteConfig.cs\" />\n    <Compile Include=\"Transport\\RemoteRefUpdate.cs\" />\n    <Compile Include=\"Transport\\SideBandInputStream.cs\" />\n    <Compile Include=\"Transport\\SideBandOutputStream.cs\" />\n    <Compile Include=\"Transport\\TagOpt.cs\" />\n    <Compile Include=\"Transport\\TcpTransport.cs\" />\n    <Compile Include=\"Transport\\TrackingRefUpdate.cs\" />\n    <Compile Include=\"Transport\\Transport.cs\" />\n    <Compile Include=\"Transport\\ITransportBundle.cs\" />\n    <Compile Include=\"Transport\\TransportBundleFile.cs\" />\n    <Compile Include=\"Transport\\UploadPack.cs\" />\n    <Compile Include=\"Transport\\URIish.cs\" />\n    <Compile Include=\"Transport\\IWalkTransport.cs\" />\n    <Compile Include=\"TreeWalk\\AbstractTreeIterator.cs\" />\n    <Compile Include=\"TreeWalk\\CanonicalTreeParser.cs\" />\n    <Compile Include=\"TreeWalk\\EmptyTreeIterator.cs\" />\n    <Compile Include=\"TreeWalk\\FileTreeIterator.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\AndTreeFilter.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\NotTreeFilter.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\OrTreeFilter.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\PathFilter.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\PathFilterGroup.cs\" />\n    <Compile Include=\"TreeWalk\\Filter\\TreeFilter.cs\" />\n    <Compile Include=\"TreeWalk\\NameConflictTreeWalk.cs\" />\n    <Compile Include=\"TreeWalk\\TreeWalk.cs\" />\n    <Compile Include=\"TreeWalk\\WorkingTreeIterator.cs\" />\n    <Compile Include=\"Util\\DigestOutputStream.cs\" />\n    <Compile Include=\"Util\\IListUtil.cs\" />\n    <Compile Include=\"Util\\ICharSequence.cs\" />\n    <Compile Include=\"Util\\IntList.cs\" />\n    <Compile Include=\"Util\\ListIterator.cs\" />\n    <Compile Include=\"Util\\QuotedString.cs\" />\n    <Compile Include=\"Util\\RawCharSequence.cs\" />\n    <Compile Include=\"Util\\RawSubstringPattern.cs\" />\n    <Compile Include=\"Util\\TemporaryBuffer.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"CachedObjectDirectory.cs\" />\n    <Compile Include=\"CachedObjectDatabase.cs\" />\n    <Compile Include=\"Diff\\MyersDiff.cs\" />\n    <Compile Include=\"Merge\\MergeAlgorithm.cs\" />\n    <Compile Include=\"Merge\\MergeChunk.cs\" />\n    <Compile Include=\"Merge\\MergeFormatter.cs\" />\n    <Compile Include=\"Merge\\MergeResult.cs\" />\n    <Compile Include=\"ObjectIdRef.cs\" />\n    <Compile Include=\"Util\\PipeStream.cs\" />\n    <Compile Include=\"Platform\\Linux.cs\" />\n    <Compile Include=\"Platform\\Mac.cs\" />\n    <Compile Include=\"Platform\\Platform.cs\" />\n    <Compile Include=\"Platform\\Windows.cs\" />\n    <Compile Include=\"RefDirectory.cs\" />\n    <Compile Include=\"RefDirectoryRename.cs\" />\n    <Compile Include=\"RefDirectoryUpdate.cs\" />\n    <Compile Include=\"RevPlot\\AbstractPlotRenderer.cs\" />\n    <Compile Include=\"RevPlot\\PlotCommit.cs\" />\n    <Compile Include=\"RevPlot\\PlotCommitList.cs\" />\n    <Compile Include=\"RevPlot\\PlotLane.cs\" />\n    <Compile Include=\"RevPlot\\PlotWalk.cs\" />\n    <Compile Include=\"SymbolicRef.cs\" />\n    <Compile Include=\"Util\\IO\\InterruptTimer.cs\" />\n    <Compile Include=\"Util\\IO\\TimeoutStream.cs\" />\n    <Compile Include=\"Util\\IO\\UnionInputStream.cs\" />\n    <Compile Include=\"Util\\JavaHelper\\Properties.cs\" />\n    <Compile Include=\"Transport\\RefFilter.cs\" />\n    <Compile Include=\"Util\\JavaHelper\\AtomicInteger.cs\" />\n    <Compile Include=\"Util\\LongList.cs\" />\n    <Compile Include=\"Util\\RefList.cs\" />\n    <Compile Include=\"Util\\RefMap.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>\n    </PostBuildEvent>\n  </PropertyGroup>\n  <ProjectExtensions>\n    <MonoDevelop>\n      <Properties>\n        <MonoDevelop.Autotools.MakefileInfo RelativeMakefileName=\"Makefile\" ExecuteTargetName=\"run\">\n          <BuildFilesVar Sync=\"true\" Name=\"SOURCES\" />\n          <DeployFilesVar />\n          <ResourcesVar />\n          <OthersVar />\n          <GacRefVar />\n          <AsmRefVar />\n          <ProjectRefVar />\n        </MonoDevelop.Autotools.MakefileInfo>\n      </Properties>\n    </MonoDevelop>\n    <VisualStudio />\n  </ProjectExtensions>\n</Project>\n"
  },
  {
    "path": "GitSharp.Core/GitlinkTreeEntry.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Jonas Fonseca <fonseca@diku.dk>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    public class GitLinkTreeEntry : TreeEntry\n    {\n        public GitLinkTreeEntry(Tree parent, ObjectId id, byte[] nameUTF8)\n            : base(parent, id, nameUTF8)\n        {\n        }\n\n        public override FileMode Mode\n        {\n            get { return FileMode.GitLink; }\n        }\n\n        public override void Accept(TreeVisitor tv, int flags)\n        {\n            if (tv == null)\n                throw new System.ArgumentNullException (\"tv\");\n\n            if ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !IsModified)\n            {\n                return;\n            }\n\n            tv.VisitGitlink(this);\n        }\n\n        public override string ToString()\n        {\n            StringBuilder r = new StringBuilder();\n            r.Append(ObjectId.ToString(Id));\n            r.Append(\" G \");\n            r.Append(FullName);\n            return r.ToString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/IgnoreHandler.cs",
    "content": "/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.FnMatch;\n\nnamespace GitSharp.Core\n{\n\tpublic interface IPattern\n\t{\n\t\tbool IsIgnored(string path);\n\t}\n\n\tpublic class IgnoreHandler\n\t{\n\t\tprivate readonly Repository _repo;\n\t\tprivate readonly List<IPattern> _commandLinePatterns = new List<IPattern>();\n\t\tprivate readonly List<IPattern> _excludePatterns = new List<IPattern>();\n\t\tprivate readonly Dictionary<string, List<IPattern>> _directoryPatterns = new Dictionary<string, List<IPattern>>();\n\n\t\tpublic IgnoreHandler(Repository repo)\n\t\t{\n\t\t\tif (repo == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"repo\");\n\t\t\t}\n\n\t\t\t_repo = repo;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tstring excludeFile = repo.Config.getCore().getExcludesFile();\n\t\t\t\tif (!string.IsNullOrEmpty(excludeFile))\n\t\t\t\t{\n\t\t\t\t\tReadPatternsFromFile(Path.Combine(repo.WorkingDirectory.FullName, excludeFile), _excludePatterns);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t//optional\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tReadPatternsFromFile(Path.Combine(repo.Directory.FullName, \"info/exclude\"), _excludePatterns);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t// optional\n\t\t\t}\n\t\t}\n\n\t\tprivate static List<string> GetPathDirectories(string path)\n\t\t{\n\t\t\tif (path.StartsWith(\"/\"))\n\t\t\t\tpath = path.Substring(1);\n\n\t\t\t// always check our repository directory since path is relative to this\n\t\t\tvar ret = new List<string> { \".\" };\n\n\t\t\t// this ensures top down\n\t\t\tfor (int i = 0; i < path.Length; i++)\n\t\t\t{\n\t\t\t\tchar c = path[i];\n\t\t\t\tif (c == '/')\n\t\t\t\t\tret.Add(path.Substring(0, i));\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tprivate void LoadDirectoryPatterns(IEnumerable<string> dirs)\n\t\t{\n\t\t\tforeach (string p in dirs)\n\t\t\t{\n\t\t\t\tif (_directoryPatterns.ContainsKey(p))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t_directoryPatterns.Add(p, new List<IPattern>());\n\t\t\t\tstring ignorePath = Path.Combine(_repo.WorkingDirectory.FullName, p);\n\t\t\t\tignorePath = Path.Combine(ignorePath, Constants.GITIGNORE_FILENAME);\n\t\t\t\tif (File.Exists(ignorePath))\n\t\t\t\t{\n\t\t\t\t\tReadPatternsFromFile(ignorePath, _directoryPatterns[p]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void ReadPatternsFromFile(string path, ICollection<IPattern> to)\n\t\t{\n\t\t\tif (!File.Exists(path))\n\t\t\t\tthrow new FileNotFoundException(\"File not found\", path);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var s = new FileStream(path, System.IO.FileMode.Open, FileAccess.Read))\n\t\t\t\t{\n\t\t\t\t\tvar reader = new StreamReader(s);\n\t\t\t\t\twhile (!reader.EndOfStream)\n\t\t\t\t\t\tAddPattern(reader.ReadLine(), to);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException inner)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Can't read from \" + path, inner);\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool IsIgnored(string path, IEnumerable<IPattern> patterns, bool ret)\n\t\t{\n\t\t\t// if ret is true, path was marked as ignored by a previous pattern, so only NegatedPatterns can still change this\n\t\t\tif (ret)\n\t\t\t{\n\t\t\t\treturn !patterns.Any(p => (p is NegatedPattern) && p.IsIgnored(path));\n\t\t\t}\n\n\t\t\treturn patterns.Any(p => !(p is NegatedPattern) && p.IsIgnored(path));\n\t\t}\n\n\t\tpublic void AddCommandLinePattern(string pattern)\n\t\t{\n\t\t\tAddPattern(pattern, _commandLinePatterns);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Evaluate if the given path is ignored. If not yet loaded this loads all .gitignore files on the path and respects them.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">relative path to a file in the repository</param>\n\t\t/// <returns></returns>\n\t\tpublic bool IsIgnored(string path)\n\t\t{\n\t\t\tbool ret = false;\n\t\t\tstring filename = System.IO.Path.GetFileName(path);\n\t\t\tret = IsIgnored(filename, _excludePatterns, ret);\n\n\t\t\tvar dirs = GetPathDirectories(path);\n\t\t\tLoadDirectoryPatterns(dirs);\n\n\t\t\tforeach (string p in dirs)\n\t\t\t{\n\t\t\t\tret = IsIgnored(filename, _directoryPatterns[p], ret);\n\t\t\t}\n\n\t\t\tret = IsIgnored(filename, _commandLinePatterns, ret);\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tprivate static void AddPattern(string line, ICollection<IPattern> to)\n\t\t{\n\t\t\tif (line.Length == 0)\n\t\t\t\treturn;\n\n\t\t\t// Comment\n\t\t\tif (line.StartsWith(\"#\"))\n\t\t\t\treturn;\n\n\t\t\t// Negated\n\t\t\tif (line.StartsWith(\"!\"))\n\t\t\t{\n\t\t\t\tline = line.Substring(1);\n\t\t\t\tto.Add(new NegatedPattern(new FnMatchPattern(line)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tto.Add(new FnMatchPattern(line));\n\t\t}\n\n\t\tprivate class FnMatchPattern : IPattern\n\t\t{\n\t\t\tprivate readonly FileNameMatcher _matcher;\n\n\t\t\tpublic FnMatchPattern(string line)\n\t\t\t{\n\t\t\t\t_matcher = new FileNameMatcher(line, null);\n\t\t\t}\n\n\t\t\tpublic bool IsIgnored(string path)\n\t\t\t{\n\t\t\t\t_matcher.Reset();\n\t\t\t\t_matcher.Append(path);\n\t\t\t\treturn _matcher.IsMatch();\n\t\t\t}\n\t\t}\n\n\t\tprivate class NegatedPattern : IPattern\n\t\t{\n\t\t\tprivate readonly IPattern _original;\n\n\t\t\tpublic NegatedPattern(IPattern pattern)\n\t\t\t{\n\t\t\t\t_original = pattern;\n\t\t\t}\n\n\t\t\tpublic bool IsIgnored(string path)\n\t\t\t{\n\t\t\t\treturn _original.IsIgnored(path);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/IndexChangedEventArgs.cs",
    "content": "\n/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Robin Rosenberg <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n\tpublic class IndexChangedEventArgs : RepositoryChangedEventArgs\n\t{\n\t\tpublic IndexChangedEventArgs(Repository repo)\n\t\t\t: base(repo)\n\t\t{\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"IndexChangedEventArgs[{0}]\", Repository);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/IndexDiff.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace GitSharp.Core\n{\n    [Complete]\n    public class IndexDiff\n    {\n        private readonly GitIndex _index;\n        private readonly Tree _tree;\n        private bool _anyChanges;\n\n        /// <summary>\n        /// Construct an indexdiff for diffing the workdir against the index.\n        /// </summary>\n        /// <param name=\"repository\"></param>\n        public IndexDiff(Repository repository)\n            : this(repository.MapTree(\"HEAD\"), repository.Index)\n        {\n        }\n\n        /// <summary>\n        /// Construct an indexdiff for diffing the workdir against both the index and a tree.\n        /// </summary>\n        /// <param name=\"tree\"></param>\n        /// <param name=\"index\"></param>\n        public IndexDiff(Tree tree, GitIndex index)\n        {\n            _anyChanges = false;\n            _tree = tree;\n            _index = index;\n\n            Added = new HashSet<string>();\n            Changed = new HashSet<string>();\n            Removed = new HashSet<string>();\n            Missing = new HashSet<string>();\n            Modified = new HashSet<string>();\n            Untracked = new HashSet<string>();\n            MergeConflict = new HashSet<string>();\n        }\n\n        /// <summary>\n        /// Run the diff operation. Until this is called, all lists will be empty\n        /// </summary>\n        /// <returns>true if anything is different between index, tree, and workdir</returns>\n        public bool Diff()\n        {\n            DirectoryInfo root = _index.Repository.WorkingDirectory;\n            var visitor = new AbstractIndexTreeVisitor\n                            {\n                                VisitEntry = delegate(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file)\n                                                {\n                                                    if (treeEntry == null)\n                                                    {\n                                                        Added.Add(indexEntry.Name);\n                                                        _anyChanges = true;\n                                                    }\n                                                    else if (indexEntry == null)\n                                                    {\n                                                        if (!(treeEntry is Tree))\n                                                        {\n                                                            Removed.Add(treeEntry.FullName);\n                                                        }\n                                                        _anyChanges = true;\n                                                    }\n                                                    else\n                                                    {\n                                                        if (!treeEntry.Id.Equals(indexEntry.ObjectId))\n                                                        {\n                                                            Changed.Add(indexEntry.Name);\n                                                            _anyChanges = true;\n                                                        }\n                                                    }\n\n                                                    if (indexEntry != null)\n                                                    {\n                                                        if (!file.Exists)\n                                                        {\n                                                            Missing.Add(indexEntry.Name);\n                                                            _anyChanges = true;\n                                                        }\n                                                        else\n                                                        {\n                                                            if (indexEntry.IsModified(root, true))\n                                                            {\n                                                                Modified.Add(indexEntry.Name);\n                                                                _anyChanges = true;\n                                                            }\n                                                        }\n                                                    }\n\n                                                    if (indexEntry != null)\n                                                    {\n                                                        if (indexEntry.Stage != 0)\n                                                        {\n                                                            MergeConflict.Add(indexEntry.Name);\n                                                            _anyChanges = true;\n                                                        }\n                                                    }\n                                                }\n                            };\n            new IndexTreeWalker(_index, _tree, root, visitor).Walk();\n\n            CheckUntrackedDirectory(root.FullName, string.Empty);\n\n            return _anyChanges;\n        }\n\n\n        private void CheckUntrackedDirectory(string path, string relative_path)\n        {\n            var files = Directory.GetFiles(path);\n            foreach (string file in files)\n                CheckUntrackedFile(new FileInfo(file), relative_path);\n\n            var dirs = Directory.GetDirectories(path);\n            foreach (string dir in dirs)\n            {\n                var dirname = new DirectoryInfo(dir).Name;\n                if (dirname.StartsWith(Constants.DOT_GIT_EXT))\n                    continue;\n\n                CheckUntrackedDirectory(dir, (relative_path.Length == 0 ? dirname : relative_path + \"/\" + dirname));\n            }\n        }\n\n        private void CheckUntrackedFile(FileInfo f, string relative_path)\n        {\n            var relative_name =  (relative_path.Length == 0 ? f.Name : relative_path + \"/\" + f.Name);\n            if (!_index.Members.Any(e => e.Name == relative_name))\n            {\n                Untracked.Add(relative_name);\n            }\n        }\n\n        /// <summary>\n        /// List of files added to the index, not in the tree\n        /// </summary>\n        public HashSet<string> Added { get; private set; }\n\n        /// <summary>\n        /// List of files changed from tree to index\n        /// </summary>\n        public HashSet<string> Changed { get; private set; }\n\n        /// <summary>\n        /// List of files removed from index, but in tree\n        /// </summary>\n        public HashSet<string> Removed { get; private set; }\n\n        /// <summary>\n        /// List of files in index, but not filesystem\n        /// </summary>\n        public HashSet<string> Missing { get; private set; }\n\n        /// <summary>\n        /// List of files modified on disk relative to the index\n        /// </summary>\n        public HashSet<string> Modified { get; private set; }\n\n\n        public HashSet<string> Untracked { get; private set; }\n\n        /// <summary>\n        /// List of files in index and have a merge conflict\n        /// </summary>\n        public HashSet<string> MergeConflict { get; private set; }\n\n        /// <summary>\n        /// Returns the number of files checked into the git repository\n        /// </summary>\n        public int IndexSize { get { return _index.Members.Count; } }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/IndexTreeVisitor.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Visitor interface for traversing the index and two trees in parallel.\n\t/// <para />\n\t/// When merging we deal with up to two tree nodes and a base node. Then\n\t/// we figure out what to do.\n\t///<para />\n\t/// A File argument is supplied to allow us to check for modifications in\n\t/// a work tree or update the file.\n\t///</summary>\n    public interface IndexTreeVisitor\n    {\n\t\t///\t<summary>\n\t\t/// Visit a blob, and corresponding tree and index entries.\n\t\t///\t</summary>\n\t\t///\t<param name=\"treeEntry\"></param>\n\t\t///\t<param name=\"indexEntry\"></param>\n\t\t///\t<param name=\"file\"></param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void VisitEntry(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file);\n\n\t\t///\t<summary>\n\t\t/// Visit a blob, and corresponding tree nodes and associated index entry.\n\t\t/// </summary>\n\t\t/// <param name=\"treeEntry\"></param>\n\t\t/// <param name=\"auxEntry\"></param>\n\t\t/// <param name=\"indexEntry\"></param>\n\t\t/// <param name=\"file\"></param>\n\t\t/// <exception cref=\"IOException\"></exception>\n        void VisitEntry(TreeEntry treeEntry, TreeEntry auxEntry, GitIndex.Entry indexEntry, FileInfo file);\n\n\t\t///\t<summary>\n\t\t/// Invoked after handling all child nodes of a tree, during a three way merge\n\t\t///\t</summary>\n\t\t///\t<param name=\"tree\"></param>\n\t\t///\t<param name=\"auxTree\"></param>\n\t\t///\t<param name=\"curDir\"></param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void FinishVisitTree(Tree tree, Tree auxTree, string curDir);\n\n\t\t///\t<summary>\n\t\t/// Invoked after handling all child nodes of a tree, during two way merge.\n\t\t///\t</summary>\n\t\t///\t<param name=\"tree\"></param>\n\t\t///\t<param name=\"i\"></param>\n\t\t///\t<param name=\"curDir\"></param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void FinishVisitTree(Tree tree, int i, string curDir);\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/IndexTreeWalker.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Diagnostics;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GitSharp.Core\n{\n    public class IndexTreeWalker\n    {\n        // Fields\n        private readonly IList<GitIndex.Entry> _indexMembers;\n        private readonly Tree _mainTree;\n        private readonly Tree _newTree;\n        private readonly FileSystemInfo _root;\n        private readonly bool _threeTrees;\n        private readonly IndexTreeVisitor _visitor;\n\n        // Methods\n        public IndexTreeWalker(GitIndex index, Tree mainTree, FileSystemInfo root, IndexTreeVisitor visitor)\n            : this(index, mainTree, null, root, visitor)\n        {\n        }\n\n        public IndexTreeWalker(GitIndex index, Tree mainTree, Tree newTree, FileSystemInfo root,\n                               IndexTreeVisitor visitor)\n        {\n            _mainTree = mainTree;\n            _newTree = newTree;\n            _root = root;\n            _visitor = visitor;\n            _threeTrees = newTree != null;\n            _indexMembers = index.Members;\n        }\n\n        public int IndexCounter { get; private set; }\n\n        private static int Compare(TreeEntry t, GitIndex.Entry i)\n        {\n            if ((t == null) && (i == null))\n            {\n                return 0;\n            }\n            if (t == null)\n            {\n                return 1;\n            }\n            if (i == null)\n            {\n                return -1;\n            }\n            return Tree.CompareNames(t.FullNameUTF8, i.NameUTF8, TreeEntry.LastChar(t), TreeEntry.LastChar(i));\n        }\n\n        private static int Compare(TreeEntry t1, TreeEntry t2)\n        {\n            if ((((t1 != null) && (t1.Parent == null)) && (t2 != null)) && (t2.Parent == null))\n            {\n                return 0;\n            }\n            if ((t1 != null) && (t1.Parent == null))\n            {\n                return -1;\n            }\n            if ((t2 != null) && (t2.Parent == null))\n            {\n                return 1;\n            }\n            if ((t1 == null) && (t2 == null))\n            {\n                return 0;\n            }\n            if (t1 == null)\n            {\n                return 1;\n            }\n            if (t2 == null)\n            {\n                return -1;\n            }\n            return Tree.CompareNames(t1.FullNameUTF8, t2.FullNameUTF8, TreeEntry.LastChar(t1), TreeEntry.LastChar(t2));\n        }\n\n        private static bool eq(TreeEntry t1, GitIndex.Entry e)\n        {\n            return (Compare(t1, e) == 0);\n        }\n\n        private static bool eq(TreeEntry t1, TreeEntry t2)\n        {\n            return (Compare(t1, t2) == 0);\n        }\n\n        private void FinishVisitTree(TreeEntry t1, TreeEntry t2, int curIndexPos)\n        {\n            Debug.Assert((t1 != null) || (t2 != null), \"Needs at least one entry\");\n            Debug.Assert(_root != null, \"Needs workdir\");\n\n            if ((t1 != null) && (t1.Parent == null))\n            {\n                t1 = null;\n            }\n            if ((t2 != null) && (t2.Parent == null))\n            {\n                t2 = null;\n            }\n\n            FileInfo file = null;\n            string fileName = null;\n            if (t1 != null)\n            {\n                fileName = t1.FullName;\n                file = new FileInfo(Path.Combine(_root.FullName, fileName));\n            }\n            else if (t2 != null)\n            {\n                fileName = t2.FullName;\n                file = new FileInfo(Path.Combine(_root.FullName, fileName));\n            }\n\n\t\t\tTree tr1 = (t1 as Tree);\n\t\t\tTree tr2 = (t2 as Tree);\n            if (tr1 != null || tr2 != null)\n            {\n                if (_threeTrees)\n                    _visitor.FinishVisitTree(tr1, tr2, fileName);\n                else\n                    _visitor.FinishVisitTree(tr1, IndexCounter - curIndexPos, fileName);\n            }\n            else if (t1 != null || t2 != null)\n            {\n                if (_threeTrees)\n                    _visitor.VisitEntry(t1, t2, null, file);\n                else\n                    _visitor.VisitEntry(t1, null, file);\n            }\n        }\n\n        private static bool lt(GitIndex.Entry i, TreeEntry t)\n        {\n            return (Compare(t, i) > 0);\n        }\n\n        private static bool lt(TreeEntry h, GitIndex.Entry i)\n        {\n            return (Compare(h, i) < 0);\n        }\n\n        private static bool lt(TreeEntry h, TreeEntry m)\n        {\n            return (Compare(h, m) < 0);\n        }\n\n        private void VisitEntry(TreeEntry t1, TreeEntry t2, GitIndex.Entry i)\n        {\n            Debug.Assert(((t1 != null) || (t2 != null)) || (i != null), \"Needs at least one entry\");\n            Debug.Assert(_root != null, \"Needs workdir\");\n            if ((t1 != null) && (t1.Parent == null))\n            {\n                t1 = null;\n            }\n            if ((t2 != null) && (t2.Parent == null))\n            {\n                t2 = null;\n            }\n            FileInfo file = null;\n            if (i != null)\n            {\n                file = new FileInfo(Path.Combine(_root.FullName, i.Name));\n            }\n            else if (t1 != null)\n            {\n                file = new FileInfo(Path.Combine(_root.FullName, t1.FullName));\n            }\n            else if (t2 != null)\n            {\n                file = new FileInfo(Path.Combine(_root.FullName, t2.FullName));\n            }\n            if (((t1 != null) || (t2 != null)) || (i != null))\n            {\n                if (_threeTrees)\n                {\n                    _visitor.VisitEntry(t1, t2, i, file);\n                }\n                else\n                {\n                    _visitor.VisitEntry(t1, i, file);\n                }\n            }\n        }\n\n        public virtual void Walk()\n        {\n            Walk(_mainTree, _newTree);\n        }\n\n\t\tprivate void Walk(Tree tree, Tree auxTree)\n\t\t{\n\t\t\tvar mi = new TreeIterator(tree, TreeIterator.Order.POSTORDER);\n\t\t\tvar ai = new TreeIterator(auxTree, TreeIterator.Order.POSTORDER);\n\t\t\tTreeEntry m = mi.hasNext() ? mi.next() : null;\n\t\t\tTreeEntry a = ai.hasNext() ? ai.next() : null;\n\t\t\tint curIndexPos = IndexCounter;\n\t\t\tGitIndex.Entry entry = (IndexCounter < _indexMembers.Count) ? _indexMembers[IndexCounter++] : null;\n\t\t\twhile (((m != null) || (a != null)) || (entry != null))\n\t\t\t{\n\t\t\t\tint cmpma = Compare(m, a);\n\t\t\t\tint cmpmi = Compare(m, entry);\n\t\t\t\tint cmpai = Compare(a, entry);\n\t\t\t\tTreeEntry pm = ((cmpma <= 0) && (cmpmi <= 0)) ? m : null;\n\t\t\t\tTreeEntry pa = ((cmpma >= 0) && (cmpai <= 0)) ? a : null;\n\t\t\t\tGitIndex.Entry pi = ((cmpmi >= 0) && (cmpai >= 0)) ? entry : null;\n\n\t\t\t\tif (pi != null)\n\t\t\t\t{\n\t\t\t\t\tVisitEntry(pm, pa, pi);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tFinishVisitTree(pm, pa, curIndexPos);\n\t\t\t\t}\n\n\t\t\t\tif (pm != null)\n\t\t\t\t{\n\t\t\t\t\tm = mi.hasNext() ? mi.next() : null;\n\t\t\t\t}\n\n\t\t\t\tif (pa != null)\n\t\t\t\t{\n\t\t\t\t\ta = ai.hasNext() ? ai.next() : null;\n\t\t\t\t}\n\n\t\t\t\tif (pi != null)\n\t\t\t\t{\n                    entry = (IndexCounter < _indexMembers.Count) ? _indexMembers[IndexCounter++] : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/InflaterCache.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\nusing System.Runtime.CompilerServices;\n\nnamespace GitSharp.Core\n{\n\n    public class InflaterCache\n    {\n\n        private static int SZ = 4;\n\n        private static Inflater[] inflaterCache;\n\n        private static int openInflaterCount;\n\t\t\n\t\tprivate static Object locker = new Object();\n\n        private InflaterCache()\n        {\n            inflaterCache = new Inflater[SZ];\n        }\n\n        public static InflaterCache Instance\n        {\n            get\n            {\n                if (m_instance == null)\n                    m_instance = new InflaterCache();\n                return m_instance;\n            }\n        }\n        private static InflaterCache m_instance;\n\n        /// <summary>\n\t\t/// Obtain an Inflater for decompression.\n\t\t/// <para />\n\t\t/// Inflaters obtained through this cache should be returned (if possible) by\n\t\t/// <see cref=\"release(Inflater)\"/> to avoid garbage collection and reallocation.\n        /// </summary>\n\t\t/// <returns>An available inflater. Never null.</returns>\n        public Inflater get()\n        {\n            Inflater r = getImpl();\n            return r ?? new Inflater(false);\n        }\n\n        private Inflater getImpl()\n        {\n\t\t\tlock(locker)\n\t\t\t{\n\t            if (openInflaterCount > 0)\n\t            {\n\t                Inflater r = inflaterCache[--openInflaterCount];\n\t                inflaterCache[openInflaterCount] = null;\n\t                return r;\n\t            }\n\t            return null;\n\t\t\t}\n        }\n\n        /**\n         * Release an inflater previously obtained from this cache.\n         * \n         * @param i\n         *            the inflater to return. May be null, in which case this method\n         *            does nothing.\n         */\n        public void release(Inflater i)\n        {\n            if (i != null)\n            {\n                i.Reset();\n                releaseImpl(i);\n             }\n        }\n\n        private static bool releaseImpl(Inflater i)\n        {\n\t\t\tlock(locker)\n\t\t\t{\n\t            if (openInflaterCount < SZ)\n\t            {\n\t                inflaterCache[openInflaterCount++] = i;\n\t                return false;\n\t            }\n\t            return true;\n\t\t\t}\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/LockFile.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Threading;\nusing GitSharp.Core.Util;\nusing System.Diagnostics;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Git style file locking and replacement.\n    /// <para />\n    /// To modify a ref file Git tries to use an atomic update approach: we write the\n    /// new data into a brand new file, then rename it in place over the old name.\n    /// This way we can just delete the temporary file if anything goes wrong, and\n    /// nothing has been damaged. To coordinate access from multiple processes at\n    /// once Git tries to atomically create the new temporary file under a well-known\n    /// name.\n    /// </summary>\n    public class LockFile : IDisposable\n    {\n        public static string SUFFIX = \".lock\"; //$NON-NLS-1$\n\n        public static Func<string, bool> FILTER = (name) => !name.EndsWith(SUFFIX);\n\n        private readonly FileInfo _refFile;\n        private readonly FileInfo _lockFile;\n        private FileStream _os;\n        private FileLock _fLck;\n        private bool _haveLock;\n        private readonly string _lockFilePath;\n\n\n        public long CommitLastModified { get; private set; }\n        public bool NeedStatInformation { get; set; }\n\n        /// <summary>\n        /// Create a new lock for any file.\n        /// </summary>\n        /// <param name=\"file\">the file that will be locked.</param>\n        public LockFile(FileInfo file)\n        {\n            _refFile = file;\n            _lockFile = PathUtil.CombineFilePath(_refFile.Directory, _refFile.Name + SUFFIX);\n            _lockFilePath = _lockFile.FullName;\n\n        }\n\n        /// <summary>\n        /// Try to establish the lock.\n        /// </summary>\n        /// <returns>\n        /// True if the lock is now held by the caller; false if it is held\n        /// by someone else.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// the temporary output file could not be created. The caller\n        /// does not hold the lock.\n        /// </exception>\n        public bool Lock()\n        {\n            _lockFile.Directory.Mkdirs();\n            if (_lockFile.Exists)\n            {\n                return false;\n            }\n\n            try\n            {\n                _haveLock = true;\n                _os = _lockFile.Create();\n\n                _fLck = FileLock.TryLock(_os, _lockFile);\n                if (_fLck == null)\n                {\n                    // We cannot use unlock() here as this file is not\n                    // held by us, but we thought we created it. We must\n                    // not delete it, as it belongs to some other process.\n                    _haveLock = false;\n                    try\n                    {\n                        _os.Close();\n                    }\n                    catch (Exception)\n                    {\n                        // Fail by returning haveLck = false.\n                    }\n                    _os = null;\n                }\n            }\n            catch (Exception)\n            {\n                Unlock();\n                throw;\n            }\n\n            return _haveLock;\n        }\n\n        /// <summary>\n        /// Try to establish the lock for appending.\n        /// </summary>\n        /// <returns>\n        /// True if the lock is now held by the caller; false if it is held\n        /// by someone else.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n        /// The temporary output file could not be created. The caller\n        /// does not hold the lock.\n        /// </exception>\n        public bool LockForAppend()\n        {\n            if (!Lock())\n            {\n                return false;\n            }\n\n            CopyCurrentContent();\n\n            return true;\n        }\n\n\n        /// <summary>\n        /// Copy the current file content into the temporary file.\n        /// <para />\n        /// This method saves the current file content by inserting it into the\n        /// temporary file, so that the caller can safely append rather than replace\n        /// the primary file.\n        /// <para />\n        /// This method does nothing if the current file does not exist, or exists\n        /// but is empty.\n        /// </summary>\n        /// <exception cref=\"IOException\">\n        /// The temporary file could not be written, or a read error\n        /// occurred while reading from the current file. The lock is\n        /// released before throwing the underlying IO exception to the\n        /// caller. \n        /// </exception>\n        public void CopyCurrentContent()\n        {\n            RequireLock();\n            try\n            {\n                using (FileStream fis = _refFile.OpenRead())\n                {\n                    var buf = new byte[2048];\n                    int r;\n                    while ((r = fis.Read(buf, 0, buf.Length)) >= 0)\n                        _os.Write(buf, 0, r);\n                }\n            }\n            catch (FileNotFoundException)\n            {\n                // Don't worry about a file that doesn't exist yet, it\n                // conceptually has no current content to copy.\n                //\n            }\n            catch (Exception)\n            {\n                Unlock();\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Write an ObjectId and LF to the temporary file.\n        /// </summary>\n        /// <param name=\"id\">\n        /// the id to store in the file. The id will be written in hex,\n        /// followed by a sole LF.\n        /// </param>\n        public void Write(ObjectId id)\n        {\n            RequireLock();\n            try\n            {\n                using (var b = new BinaryWriter(_os))\n                {\n                    id.CopyTo(b);\n                    b.Write('\\n');\n                    b.Flush();\n                    _fLck.Release();\n                }\n                _os = null;\n            }\n            catch (Exception)\n            {\n                Unlock();\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Write arbitrary data to the temporary file.\n        /// </summary>\n        /// <param name=\"content\">\n        /// the bytes to store in the temporary file. No additional bytes\n        /// are added, so if the file must end with an LF it must appear\n        /// at the end of the byte array.\n        /// </param>\n        public void Write(byte[] content)\n        {\n            RequireLock();\n            try\n            {\n                _os.Write(content, 0, content.Length);\n                _os.Flush();\n                _fLck.Release();\n                _os.Close();\n                _os = null;\n            }\n            catch (Exception)\n            {\n                Unlock();\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Obtain the direct output stream for this lock.\n        /// <para />\n        /// The stream may only be accessed once, and only after <see cref=\"Lock()\"/> has\n        /// been successfully invoked and returned true. Callers must close the\n        /// stream prior to calling <see cref=\"Commit()\"/> to commit the change.\n        /// </summary>\n        /// <returns>\n        /// A stream to write to the new file. The stream is unbuffered.\n        /// </returns>\n        public Stream GetOutputStream()\n        {\n            RequireLock();\n            return new LockFileOutputStream(this);\n        }\n\n        private void RequireLock()\n        {\n            if (_os == null)\n            {\n                Unlock();\n                throw new InvalidOperationException(\"Lock on \" + _refFile + \" not held.\");\n            }\n        }\n\n        /// <summary>\n        /// Request that <see cref=\"Commit\"/> remember modification time.\n        /// </summary>\n        /// <param name=\"on\">true if the commit method must remember the modification time.</param>\n        public void setNeedStatInformation(bool on)\n        {\n            NeedStatInformation = on;\n        }\n\n        /// <summary>\n        /// Wait until the lock file information differs from the old file.\n        /// <para/>\n        /// This method tests both the length and the last modification date. If both\n        /// are the same, this method sleeps until it can force the new lock file's\n        /// modification date to be later than the target file.\n        /// </summary>\n        public void waitForStatChange()\n        {\n            _refFile.Refresh();\n            _lockFile.Refresh();\n            if (_refFile.Length == _lockFile.Length)\n            {\n                long otime = _refFile.lastModified();\n                long ntime = _lockFile.lastModified();\n                while (otime == ntime)\n                {\n                    Thread.Sleep(25 /* milliseconds */);\n                    _lockFile.LastWriteTime = DateTime.Now;\n                    ntime = _lockFile.lastModified();\n                }\n            }\n        }\n\n        /// <summary>\n        /// Commit this change and release the lock.\n        /// <para/>\n        /// If this method fails (returns false) the lock is still released.\n        /// </summary>\n        /// <returns>\n        /// true if the commit was successful and the file contains the new\n        /// data; false if the commit failed and the file remains with the\n        /// old data.\n        /// </returns>\n        public bool Commit()\n        {\n            if (_os != null)\n            {\n                Unlock();\n                throw new InvalidOperationException(\"Lock on \" + _refFile + \" not closed.\");\n            }\n\n            SaveStatInformation();\n\n            if (_lockFile.RenameTo(_refFile.FullName))\n            {\n                return true;\n            }\n\n            _refFile.Refresh();\n            if (!_refFile.Exists || _refFile.DeleteFile())\n                if (_lockFile.RenameTo(_refFile.FullName))\n                    return true;\n            Unlock();\n            return false;\n        }\n\n        private void SaveStatInformation()\n        {\n            if (NeedStatInformation)\n            {\n                _lockFile.Refresh();\n                CommitLastModified = _lockFile.lastModified();\n            }\n        }\n\n        /// <summary>\n        /// Unlock this file and abort this change.\n        /// <para/>\n        /// The temporary file (if created) is deleted before returning.\n        /// </summary>\n        public void Unlock()\n        {\n            if (_os != null)\n            {\n                if (_fLck != null)\n                {\n                    try\n                    {\n                        _fLck.Release();\n                    }\n                    catch (IOException)\n                    {\n                        // Huh?\n                    }\n                    _fLck = null;\n                }\n                try\n                {\n                    _os.Close();\n                }\n                catch (IOException)\n                {\n                    // Ignore this\n                }\n                _os = null;\n            }\n\n            if (_haveLock)\n            {\n                _haveLock = false;\n                File.Delete(_lockFilePath);\n            }\n        }\n\n        public void Dispose()\n        {\n            if (_haveLock)\n            {\n                Unlock();\n            }\n        }\n\n\n        #region Nested Types\n\n        public class LockFileOutputStream : Stream\n        {\n            private readonly LockFile _lockFile;\n\n            public LockFileOutputStream(LockFile lockfile)\n            {\n                _lockFile = lockfile;\n            }\n\n            public override void Write(byte[] buffer, int offset, int count)\n            {\n                _lockFile._os.Write(buffer, offset, count);\n            }\n\n            public void write(byte[] b)\n            {\n                _lockFile._os.Write(b, 0, b.Length);\n            }\n\n            public void write(int b)\n            {\n                _lockFile._os.WriteByte((byte)b);\n            }\n\n            public override void Flush()\n            {\n                _lockFile._os.Flush();\n            }\n\n            public override void Close()\n            {\n                try\n                {\n                    _lockFile._os.Flush();\n                    _lockFile._fLck.Release();\n                    _lockFile._os.Close();\n                    _lockFile._os = null;\n                }\n                catch (Exception)\n                {\n                    _lockFile.Unlock();\n                    throw;\n                }\n            }\n\n            public override bool CanRead\n            {\n                get { return false; }\n            }\n\n            public override bool CanSeek\n            {\n                get { return false; }\n            }\n\n            public override bool CanWrite\n            {\n                get { return true; }\n            }\n\n            public override long Length\n            {\n                get { throw new NotImplementedException(); }\n            }\n\n            public override long Position\n            {\n                get\n                {\n                    throw new NotImplementedException();\n                }\n                set\n                {\n                    throw new NotImplementedException();\n                }\n            }\n\n            public override int Read(byte[] buffer, int offset, int count)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override long Seek(long offset, SeekOrigin origin)\n            {\n                throw new NotImplementedException();\n            }\n\n            public override void SetLength(long value)\n            {\n                throw new NotImplementedException();\n            }\n        }\n\n        /// <summary>\n        /// Wraps a FileStream and tracks its locking status\n        /// </summary>\n        public class FileLock : IDisposable\n        {\n            public FileStream FileStream { get; private set; }\n            public bool Locked { get; private set; }\n            public string File { get; private set; }\n\n            private FileLock(FileStream fs, string file)\n            {\n                File = file;\n                FileStream = fs;\n                FileStream.Lock(0, long.MaxValue);\n                Locked = true;\n            }\n\n            public static FileLock TryLock(FileStream fs, FileInfo file)\n            {\n                try\n                {\n                    return new FileLock(fs, file.FullName);\n                }\n                catch (IOException e)\n                {\n                    Debug.WriteLine(\"Could not lock \" + file.FullName);\n                    Debug.WriteLine(e.Message);\n                    return null;\n                }\n            }\n\n            public void Dispose()\n            {\n                Release();\n            }\n\n            public void Release()\n            {\n                if (Locked == false)\n                {\n                    return;\n                }\n                try\n                {\n                    FileStream.Unlock(0, long.MaxValue);\n#if DEBUG\n                    GC.SuppressFinalize(this); // [henon] disarm lock-release checker\n#endif\n                }\n                catch (IOException)\n                {\n                    // unlocking went wrong\n                    Console.Error.WriteLine(GetType().Name + \": tried to unlock an unlocked filelock \" + File);\n                    throw;\n                }\n                Locked = false;\n            }\n\n#if DEBUG\n            // [henon] this : a debug mode warning if the filelock has not been disposed properly\n            ~FileLock()\n            {\n                Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: \" + File);\n            }\n#endif\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Merge/MergeAlgorithm.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Merge\n{\n    /// <summary>\n    /// Provides the merge algorithm which does a three-way merge on content provided\n    /// as RawText. Makes use of {@link MyersDiff} to compute the diffs.\n    /// </summary>\n    public class MergeAlgorithm\n    {\n\n        /// <summary>\n        /// Since this class provides only static methods I add a private default\n        /// constructor to prevent instantiation.\n        /// </summary>\n        private MergeAlgorithm()\n        {\n        }\n\n        // An special edit which acts as a sentinel value by marking the end the\n        // list of edits\n        private static Edit END_EDIT = new Edit(int.MaxValue,\n            int.MaxValue);\n\n        /// <summary>\n        /// Does the three way merge between a common base and two sequences.\n        /// </summary>\n        /// <param name=\"base\">base the common base sequence</param>\n        /// <param name=\"ours\">ours the first sequence to be merged</param>\n        /// <param name=\"theirs\">theirs the second sequence to be merged</param>\n        /// <returns>the resulting content</returns>\n        public static MergeResult merge(Sequence @base, Sequence ours,\n            Sequence theirs)\n        {\n            List<Sequence> sequences = new List<Sequence>(3);\n            sequences.Add(@base);\n            sequences.Add(ours);\n            sequences.Add(theirs);\n            MergeResult result = new MergeResult(sequences);\n            EditList oursEdits = new MyersDiff(@base, ours).getEdits();\n            IteratorBase<Edit> baseToOurs = oursEdits.iterator();\n            EditList theirsEdits = new MyersDiff(@base, theirs).getEdits();\n            IteratorBase<Edit> baseToTheirs = theirsEdits.iterator();\n            int current = 0; // points to the next line (first line is 0) of base\n            // which was not handled yet\n            Edit oursEdit = nextEdit(baseToOurs);\n            Edit theirsEdit = nextEdit(baseToTheirs);\n\n            // iterate over all edits from base to ours and from base to theirs\n            // leave the loop when there are no edits more for ours or for theirs\n            // (or both)\n            while (theirsEdit != END_EDIT || oursEdit != END_EDIT)\n            {\n                if (oursEdit.EndA <= theirsEdit.BeginA)\n                {\n                    // something was changed in ours not overlapping with any change\n                    // from theirs. First add the common part in front of the edit\n                    // then the edit.\n                    if (current != oursEdit.BeginA)\n                    {\n                        result.add(0, current, oursEdit.BeginA,\n                            MergeChunk.ConflictState.NO_CONFLICT);\n                    }\n                    result.add(1, oursEdit.BeginB, oursEdit.EndB,\n                        MergeChunk.ConflictState.NO_CONFLICT);\n                    current = oursEdit.EndA;\n                    oursEdit = nextEdit(baseToOurs);\n                }\n                else if (theirsEdit.EndA <= oursEdit.BeginA)\n                {\n                    // something was changed in theirs not overlapping with any\n                    // from ours. First add the common part in front of the edit\n                    // then the edit.\n                    if (current != theirsEdit.BeginA)\n                    {\n                        result.add(0, current, theirsEdit.BeginA,\n                            MergeChunk.ConflictState.NO_CONFLICT);\n                    }\n                    result.add(2, theirsEdit.BeginB, theirsEdit.EndB,\n                        MergeChunk.ConflictState.NO_CONFLICT);\n                    current = theirsEdit.EndA;\n                    theirsEdit = nextEdit(baseToTheirs);\n                }\n                else\n                {\n                    // here we found a real overlapping modification\n\n                    // if there is a common part in front of the conflict add it\n                    if (oursEdit.BeginA != current\n                        && theirsEdit.BeginA != current)\n                    {\n                        result.add(0, current, Math.Min(oursEdit.BeginA,\n                            theirsEdit.BeginA), MergeChunk.ConflictState.NO_CONFLICT);\n                    }\n\n                    // set some initial values for the ranges in A and B which we\n                    // want to handle\n                    int oursBeginB = oursEdit.BeginB;\n                    int theirsBeginB = theirsEdit.BeginB;\n                    // harmonize the start of the ranges in A and B\n                    if (oursEdit.BeginA < theirsEdit.BeginA)\n                    {\n                        theirsBeginB -= theirsEdit.BeginA\n                            - oursEdit.BeginA;\n                    }\n                    else\n                    {\n                        oursBeginB -= oursEdit.BeginA - theirsEdit.BeginA;\n                    }\n\n                    // combine edits:\n                    // Maybe an Edit on one side corresponds to multiple Edits on\n                    // the other side. Then we have to combine the Edits of the\n                    // other side - so in the end we can merge together two single\n                    // edits.\n                    //\n                    // It is important to notice that this combining will extend the\n                    // ranges of our conflict always downwards (towards the end of\n                    // the content). The starts of the conflicting ranges in ours\n                    // and theirs are not touched here.\n                    //\n                    // This combining is an iterative process: after we have\n                    // combined some edits we have to do the check again. The\n                    // combined edits could now correspond to multiple edits on the\n                    // other side.\n                    //\n                    // Example: when this combining algorithm works on the following\n                    // edits\n                    // oursEdits=((0-5,0-5),(6-8,6-8),(10-11,10-11)) and\n                    // theirsEdits=((0-1,0-1),(2-3,2-3),(5-7,5-7))\n                    // it will merge them into\n                    // oursEdits=((0-8,0-8),(10-11,10-11)) and\n                    // theirsEdits=((0-7,0-7))\n                    //\n                    // Since the only interesting thing to us is how in ours and\n                    // theirs the end of the conflicting range is changing we let\n                    // oursEdit and theirsEdit point to the last conflicting edit\n                    Edit nextOursEdit = nextEdit(baseToOurs);\n                    Edit nextTheirsEdit = nextEdit(baseToTheirs);\n                    for (; ; )\n                    {\n                        if (oursEdit.EndA > nextTheirsEdit.BeginA)\n                        {\n                            theirsEdit = nextTheirsEdit;\n                            nextTheirsEdit = nextEdit(baseToTheirs);\n                        }\n                        else if (theirsEdit.EndA > nextOursEdit.BeginA)\n                        {\n                            oursEdit = nextOursEdit;\n                            nextOursEdit = nextEdit(baseToOurs);\n                        }\n                        else\n                        {\n                            break;\n                        }\n                    }\n\n                    // harmonize the end of the ranges in A and B\n                    int oursEndB = oursEdit.EndB;\n                    int theirsEndB = theirsEdit.EndB;\n                    if (oursEdit.EndA < theirsEdit.EndA)\n                    {\n                        oursEndB += theirsEdit.EndA - oursEdit.EndA;\n                    }\n                    else\n                    {\n                        theirsEndB += oursEdit.EndA - theirsEdit.EndA;\n                    }\n\n                    // Add the conflict\n                    result.add(1, oursBeginB, oursEndB,\n                        MergeChunk.ConflictState.FIRST_CONFLICTING_RANGE);\n                    result.add(2, theirsBeginB, theirsEndB,\n                        MergeChunk.ConflictState.NEXT_CONFLICTING_RANGE);\n\n                    current = Math.Max(oursEdit.EndA, theirsEdit.EndA);\n                    oursEdit = nextOursEdit;\n                    theirsEdit = nextTheirsEdit;\n                }\n            }\n            // maybe we have a common part behind the last edit: copy it to the\n            // result\n            if (current < @base.size())\n            {\n                result.add(0, current, @base.size(), MergeChunk.ConflictState.NO_CONFLICT);\n            }\n            return result;\n        }\n\n        /// <summary>\n        /// Helper method which returns the next Edit for an Iterator over Edits.\n        /// When there are no more edits left this method will return the constant\n        /// END_EDIT.\n        /// </summary>\n        /// <param name=\"it\">the iterator for which the next edit should be returned</param>\n        /// <returns>the next edit from the iterator or END_EDIT if there no more edits</returns>\n        private static Edit nextEdit(IteratorBase<Edit> it)\n        {\n            return (it.hasNext() ? it.next() : END_EDIT);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/MergeChunk.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Merge\n{\n    /// <summary>\n    /// One chunk from a merge result. Each chunk contains a range from a\n    /// single sequence. In case of conflicts multiple chunks are reported for one\n    /// conflict. The conflictState tells when conflicts start and end.\n    /// </summary>\n    public class MergeChunk\n    {\n\n        /// <summary>\n        /// A state telling whether a MergeChunk belongs to a conflict or not. The\n        /// first chunk of a conflict is reported with a special state to be able to\n        /// distinguish the border between two consecutive conflicts\n        /// </summary>\n        public enum ConflictState\n        {\n            /// <summary>\n            /// This chunk does not belong to a conflict\n            /// </summary>\n            NO_CONFLICT = 0,\n\n            /// <summary>\n            /// This chunk does belong to a conflict and is the first one of the conflicting chunks\n            /// </summary>\n            FIRST_CONFLICTING_RANGE = 1,\n\n            /// <summary>\n            /// This chunk does belong to a conflict but is not the first one of the conflicting chunks. It's a subsequent one.\n            /// </summary>\n            NEXT_CONFLICTING_RANGE = 2\n        }\n\n        private int sequenceIndex;\n\n        private int begin;\n\n        private int end;\n\n        private ConflictState conflictState;\n\n        /// <summary>\n        /// Creates a new empty MergeChunk\n        /// </summary>\n        /// <param name=\"sequenceIndex\">determines to which sequence this chunks belongs to. Same as in <see cref=\"MergeResult.add\"/>\n        /// </param>\n        /// <param name=\"begin\">the first element from the specified sequence which should be included in the merge result. Indexes start with 0.</param>\n        /// <param name=\"end\">\n        /// specifies the end of the range to be added. The element this index points to is the first element which not added to the\n        /// merge result. All elements between begin (including begin) and this element are added.\n        /// </param>\n        /// <param name=\"conflictState\">the state of this chunk. See <see cref=\"ConflictState\"/></param>\n        public MergeChunk(int sequenceIndex, int begin, int end,\n            ConflictState conflictState)\n        {\n            this.sequenceIndex = sequenceIndex;\n            this.begin = begin;\n            this.end = end;\n            this.conflictState = conflictState;\n        }\n\n        /// <returns>the index of the sequence to which sequence this chunks belongs to. Same as in <see cref=\"MergeResult.add\"/></returns>\n        public int getSequenceIndex()\n        {\n            return sequenceIndex;\n        }\n\n        /// <returns>the first element from the specified sequence which should be included in the merge result. Indexes start with 0.</returns>\n        public int getBegin()\n        {\n            return begin;\n        }\n\n        /// <returns>\n        /// the end of the range of this chunk. The element this index points to is the first element which not added to the merge\n        /// result. All elements between begin (including begin) and this element are added.\n        /// </returns>\n        public int getEnd()\n        {\n            return end;\n        }\n\n        /// <returns>the state of this chunk. See <see cref=\"ConflictState\"/></returns>\n        public ConflictState getConflictState()\n        {\n            return conflictState;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/MergeFormatter.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Merge\n{\n    /// <summary>\n    /// A class to convert merge results into a Git conformant textual presentation\n    /// </summary>\n    public class MergeFormatter\n    {\n        /// <summary>\n        /// Formats the results of a merge of <see cref=\"RawText\"/> objects in a Git\n        /// conformant way. This method also assumes that the <see cref=\"RawText\"/> objects\n        /// being merged are line oriented files which use LF as delimiter. This\n        /// method will also use LF to separate chunks and conflict metadata,\n        /// therefore it fits only to texts that are LF-separated lines.\n        /// </summary>\n        /// <param name=\"out\">the outputstream where to write the textual presentation</param>\n        /// <param name=\"res\">the merge result which should be presented</param>\n        /// <param name=\"seqName\">\n        /// When a conflict is reported each conflicting range will get a\n        /// name. This name is following the \"&lt;&lt;&lt;&lt;&lt;&lt;&lt; \" or \"&gt;&gt;&gt;&gt;&gt;&gt;&gt; \"\n        /// conflict markers. The names for the sequences are given in\n        /// this list\n        /// </param>\n        /// <param name=\"charsetName\">\n        /// the name of the characterSet used when writing conflict\n        /// metadata\n        /// </param>\n        public void formatMerge(BinaryWriter @out, MergeResult res,\n                List<String> seqName, string charsetName)\n        {\n            String lastConflictingName = null; // is set to non-null whenever we are\n            // in a conflict\n            bool threeWayMerge = (res.getSequences().Count == 3);\n            foreach (MergeChunk chunk in res)\n            {\n                RawText seq = (RawText)res.getSequences()[\n                        chunk.getSequenceIndex()];\n                if (lastConflictingName != null\n                        && chunk.getConflictState() != MergeChunk.ConflictState.NEXT_CONFLICTING_RANGE)\n                {\n                    // found the end of an conflict\n                    @out.Write((\">>>>>>> \" + lastConflictingName + \"\\n\").getBytes(charsetName));\n                    lastConflictingName = null;\n                }\n                if (chunk.getConflictState() == MergeChunk.ConflictState.FIRST_CONFLICTING_RANGE)\n                {\n                    // found the start of an conflict\n                    @out.Write((\"<<<<<<< \" + seqName[chunk.getSequenceIndex()] +\n                            \"\\n\").getBytes(charsetName));\n                    lastConflictingName = seqName[chunk.getSequenceIndex()];\n                }\n                else if (chunk.getConflictState() == MergeChunk.ConflictState.NEXT_CONFLICTING_RANGE)\n                {\n                    // found another conflicting chunk\n\n                    /*\n                     * In case of a non-three-way merge I'll add the name of the\n                     * conflicting chunk behind the equal signs. I also append the\n                     * name of the last conflicting chunk after the ending\n                     * greater-than signs. If somebody knows a better notation to\n                     * present non-three-way merges - feel free to correct here.\n                     */\n                    lastConflictingName = seqName[chunk.getSequenceIndex()];\n                    @out.Write((threeWayMerge ? \"=======\\n\" : \"======= \"\n                            + lastConflictingName + \"\\n\").getBytes(charsetName));\n                }\n                // the lines with conflict-metadata are written. Now write the chunk\n                for (int i = chunk.getBegin(); i < chunk.getEnd(); i++)\n                {\n                    seq.writeLine(@out.BaseStream, i);\n                    @out.Write('\\n');\n\n                }\n            }\n            // one possible leftover: if the merge result ended with a conflict we\n            // have to close the last conflict here\n            if (lastConflictingName != null)\n            {\n                @out.Write((\">>>>>>> \" + lastConflictingName + \"\\n\").getBytes(charsetName));\n            }\n        }\n\n        /// <summary>\n        /// Formats the results of a merge of exactly two <see cref=\"RawText\"/> objects in\n        /// a Git conformant way. This convenience method accepts the names for the\n        /// three sequences (base and the two merged sequences) as explicit\n        /// parameters and doesn't require the caller to specify a List\n        /// </summary>\n        /// <param name=\"out\">\n        /// the <see cref=\"BinaryWriter\"/> where to write the textual\n        /// presentation\n        /// </param>\n        /// <param name=\"res\">the merge result which should be presented</param>\n        /// <param name=\"baseName\">the name ranges from the base should get</param>\n        /// <param name=\"oursName\">the name ranges from ours should get</param>\n        /// <param name=\"theirsName\">the name ranges from theirs should get</param>\n        /// <param name=\"charsetName\">\n        /// the name of the characterSet used when writing conflict\n        /// metadata\n        /// </param>\n        public void formatMerge(BinaryWriter @out, MergeResult res, String baseName,\n                String oursName, String theirsName, string charsetName)\n        {\n            var names = new List<String>(3);\n            names.Add(baseName);\n            names.Add(oursName);\n            names.Add(theirsName);\n            formatMerge(@out, res, names, charsetName);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/MergeResult.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Merge\n{\n    /// <summary>\n    /// The result of merging a number of <see cref=\"Sequence\"/> objects. These sequences\n    /// have one common predecessor sequence. The result of a merge is a list of\n    /// MergeChunks. Each MergeChunk contains either a range (a subsequence) from\n    /// one of the merged sequences, a range from the common predecessor or a\n    /// conflicting range from one of the merged sequences. A conflict will be\n    /// reported as multiple chunks, one for each conflicting range. The first chunk\n    /// for a conflict is marked specially to distinguish the border between two\n    /// consecutive conflicts.\n    /// <para>\n    /// This class does not know anything about how to present the merge result to\n    /// the end-user. MergeFormatters have to be used to construct something human\n    /// readable.\n    /// </para>\n    /// </summary>\n    public class MergeResult\n    {\n        public IEnumerator<MergeChunk> GetEnumerator()\n        {\n            return new MergeChunkIterator(this);\n        }\n\n        private List<Sequence> _sequences;\n\n        private IntList _chunks = new IntList();\n\n        private bool _containsConflicts = false;\n\n        /// <summary>\n        /// Creates a new empty MergeResult\n        /// </summary>\n        /// <param name=\"sequences\">\n        /// contains the common predecessor sequence at position 0\n        /// followed by the merged sequences. This list should not be\n        /// modified anymore during the lifetime of this <see cref=\"MergeResult\"/>.\n        /// </param>\n        public MergeResult(List<Sequence> sequences)\n        {\n            this._sequences = sequences;\n        }\n\n        /// <summary>\n        /// Adds a new range from one of the merged sequences or from the common\n        /// predecessor. This method can add conflicting and non-conflicting ranges\n        /// controlled by the conflictState parameter\n        /// </summary>\n        /// <param name=\"srcIdx\">\n        /// determines from which sequence this range comes. An index of\n        /// x specifies the x+1 element in the list of sequences\n        /// specified to the constructor\n        /// </param>\n        /// <param name=\"begin\">\n        /// the first element from the specified sequence which should be\n        /// included in the merge result. Indexes start with 0.\n        /// </param>\n        /// <param name=\"end\">\n        /// specifies the end of the range to be added. The element this\n        /// index points to is the first element which not added to the\n        /// merge result. All elements between begin (including begin) and\n        /// this element are added.\n        /// </param>\n        /// <param name=\"conflictState\">\n        /// when set to NO_CONLICT a non-conflicting range is added.\n        /// This will end implicitly all open conflicts added before.\n        /// </param>\n        public void add(int srcIdx, int begin, int end, MergeChunk.ConflictState conflictState)\n        {\n            _chunks.add((int)conflictState);\n            _chunks.add(srcIdx);\n            _chunks.add(begin);\n            _chunks.add(end);\n            if (conflictState != MergeChunk.ConflictState.NO_CONFLICT)\n                _containsConflicts = true;\n        }\n\n        /// <summary>\n        /// Returns the common predecessor sequence and the merged sequence in one\n        /// list. The common predecessor is is the first element in the list\n        /// </summary>\n        /// <returns>\n        /// the common predecessor at position 0 followed by the merged\n        /// sequences.\n        /// </returns>\n        public List<Sequence> getSequences()\n        {\n            return _sequences;\n        }\n\n        /// <returns>an iterator over the MergeChunks. The iterator does not support the remove operation</returns>\n        public MergeChunkIterator iterator()\n        {\n            return new MergeChunkIterator(this);\n        }\n\n        /// <returns>true if this merge result contains conflicts</returns>\n        public bool containsConflicts()\n        {\n            return _containsConflicts;\n        }\n\n        public class MergeChunkIterator : IteratorBase<MergeChunk>\n        {\n            private readonly MergeResult _mergeResult;\n            int idx;\n\n            public MergeChunkIterator(MergeResult mergeResult)\n            {\n                _mergeResult = mergeResult;\n            }\n\n            public override  bool hasNext()\n            {\n                return (idx < _mergeResult._chunks.size());\n            }\n\n            protected override MergeChunk InnerNext()\n            {\n                var state = (MergeChunk.ConflictState)(_mergeResult._chunks.get(idx++));\n                int srcIdx = _mergeResult._chunks.get(idx++);\n                int begin = _mergeResult._chunks.get(idx++);\n                int end = _mergeResult._chunks.get(idx++);\n                return new MergeChunk(srcIdx, begin, end, state);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/MergeStrategy.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nnamespace GitSharp.Core.Merge\n{\n\t/// <summary>\n\t/// A method of combining two or more trees together to form an output tree.\n\t/// <para />\n\t/// Different strategies may employ different techniques for deciding which paths\n\t/// (and ObjectIds) to carry from the input trees into the final output tree.\n\t/// </summary>\n\tpublic abstract class MergeStrategy\n\t{\n\t\t/// <summary>\n\t\t/// Simple strategy that sets the output tree to the first input tree.\n\t\t/// </summary>\n\t\tpublic static readonly MergeStrategy Ours = new StrategyOneSided(\"ours\", 0);\n\n\t\t/// <summary>\n\t\t/// Simple strategy that sets the output tree to the second input tree.\n\t\t/// </summary>\n\t\tpublic static readonly MergeStrategy Theirs = new StrategyOneSided(\"theirs\", 1);\n\n\t\t/// <summary>\n\t\t/// Simple strategy to merge paths, without simultaneous edits.\n\t\t/// </summary>\n\t\tpublic static readonly ThreeWayMergeStrategy SimpleTwoWayInCore = new StrategySimpleTwoWayInCore();\n\n\t\tprivate static readonly Dictionary<String, MergeStrategy> Strategies = new Dictionary<String, MergeStrategy>();\n\t\t\n\t\tprivate static Object locker = new Object();\n\n\t\tstatic MergeStrategy()\n\t\t{\n\t\t\tRegister(Ours);\n\t\t\tRegister(Theirs);\n\t\t\tRegister(SimpleTwoWayInCore);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Register a merge strategy so it can later be obtained by name.\n\t\t///\t</summary>\n\t\t///\t<param name=\"imp\">the strategy to register.</param>\n\t\t///\t<exception cref=\"ArgumentException\">\n\t\t/// a strategy by the same name has already been registered.\n\t\t/// </exception>\n\t\tpublic static void Register(MergeStrategy imp)\n\t\t{\n\t\t\tif (imp == null)\n\t\t\t\tthrow new ArgumentNullException (\"imp\");\n\t\t\t\n\t\t\tRegister(imp.Name, imp);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Register a merge strategy so it can later be obtained by name.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">\n\t\t/// name the strategy can be looked up under.</param>\n\t\t/// <param name=\"imp\">the strategy to register.</param>\n\t\t/// <exception cref=\"ArgumentException\">\n\t\t/// a strategy by the same name has already been registered.\n\t\t/// </exception>\n\t\tpublic static void Register(string name, MergeStrategy imp)\n\t\t{\n\t\t\tlock(locker)\n\t\t\t{\n\t\t\t\tif (Strategies.ContainsKey(name))\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentException(\"Merge strategy \\\"\" + name + \"\\\" already exists as a default strategy\");\n\t\t\t\t}\n\t\n\t\t\t\tStrategies.Add(name, imp);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a strategy by name.\n\t\t///\t</summary>\n\t\t///\t<param name=\"name\">name of the strategy to locate.</param>\n\t\t/// <returns>\n\t\t/// The strategy instance; null if no strategy matches the name.\n\t\t/// </returns>\n\t\tpublic static MergeStrategy Get(string name)\n\t\t{\n\t\t\tlock(locker)\n\t\t\t{\n\t\t\t\treturn Strategies[name];\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get all registered strategies.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The registered strategy instances. No inherit order is returned;\n\t\t/// the caller may modify (and/or sort) the returned array if\n\t\t/// necessary to obtain a reasonable ordering.\n\t\t/// </returns>\n\t\tpublic static MergeStrategy[] Get()\n\t\t{\n\t\t\tlock(locker)\n\t\t\t{\n\t\t\t\treturn Strategies.Values.ToArray();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// default name of this strategy implementation.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic abstract string Name { get; }\n\n\t\t///\t<summary>\n\t\t/// Create a new merge instance.\n\t\t/// </summary>\n\t\t/// <param name=\"db\">\n\t\t/// repository database the merger will read from, and eventually\n\t\t/// write results back to.\n\t\t/// </param>\n\t\t/// <returns> the new merge instance which implements this strategy.</returns>\n\t\tpublic abstract Merger NewMerger(Repository db);\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Merge/Merger.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.TreeWalk;\n\nnamespace GitSharp.Core.Merge\n{\n\t/// <summary>\n\t/// Instance of a specific <seealso cref=\"MergeStrategy\"/> for a single <seealso cref=\"Repository\"/>.\n\t/// </summary>\n\tpublic abstract class Merger : IDisposable\n\t{\n\t\tprivate readonly Repository _db;\n\t\tprivate readonly RevWalk.RevWalk _walk;\n\t\tprivate ObjectWriter _writer;\n\t\tprivate RevObject[] _sourceObjects;\n\t\tprivate RevCommit[] _sourceCommits;\n\n\t\t/// <summary>\n\t\t/// Create a new merge instance for a repository.\n\t\t/// </summary>\n\t\t/// <param name=\"local\">\n\t\t/// the repository this merger will read and write data on. \n\t\t/// </param>\n\t\tprotected Merger(Repository local)\n\t\t{\n\t\t\t_db = local;\n\t\t\t_walk = new RevWalk.RevWalk(_db);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The repository this merger operates on.\n\t\t/// </summary>\n\t\tprotected Repository Repository\n\t\t{\n\t\t\tget { return _db; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// A <see cref=\"RevWalk\"/> for computing merge bases, or listing incoming commits.\n\t\t/// </summary>\n\t\tprotected RevWalk.RevWalk Walk\n\t\t{\n\t\t\tget { return _walk; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The original objects supplied in the merge; this can be any <see cref=\"Treeish\"/>.\n\t\t/// </summary>\n\t\tpublic RevCommit[] SourceCommits\n\t\t{\n\t\t\tget { return _sourceCommits; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// If <seealso cref=\"SourceObjects\"/>[i] is a commit, this is the commit.\n\t\t/// </summary>\n\t\tpublic RevObject[] SourceObjects\n\t\t{\n\t\t\tget { return _sourceObjects; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The trees matching every entry in <seealso cref=\"SourceObjects\"/>.\n\t\t/// </summary>\n\t\tprotected RevTree[] SourceTrees { get; private set; }\n\n\t\t/// <summary>\n\t\t/// An object writer to Create objects in <see cref=\"Repository\"/>.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tprotected ObjectWriter GetObjectWriter()\n\t\t{\n\t\t\tif (_writer == null)\n\t\t\t{\n\t\t\t\t_writer = new ObjectWriter(Repository);\n\t\t\t}\n\t\t\treturn _writer;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Merge together two or more tree-ish objects.\n\t\t/// <para />\n\t\t/// Any tree-ish may be supplied as inputs. Commits and/or tags pointing at\n\t\t/// trees or commits may be passed as input objects.\n\t\t/// </summary>\n\t\t/// <param name=\"tips\">\n\t\t/// source trees to be combined together. The merge base is not\n\t\t/// included in this set. </param>\n\t\t/// <returns>\n\t\t/// True if the merge was completed without conflicts; false if the\n\t\t/// merge strategy cannot handle this merge or there were conflicts\n\t\t/// preventing it from automatically resolving all paths.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one of the input objects is not a commit, but the strategy\n\t\t/// requires it to be a commit.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// one or more sources could not be read, or outputs could not\n\t\t/// be written to the Repository.\n\t\t/// </exception>\n\t\tpublic virtual bool Merge(AnyObjectId[] tips)\n\t\t{\n\t\t\tif (tips == null)\n\t\t\t\tthrow new ArgumentNullException (\"tips\");\n\t\t\t\n\t\t\t_sourceObjects = new RevObject[tips.Length];\n\t\t\tfor (int i = 0; i < tips.Length; i++)\n\t\t\t\t_sourceObjects[i] = _walk.parseAny(tips[i]);\n\n\t\t\t_sourceCommits = new RevCommit[_sourceObjects.Length];\n\t\t\tfor (int i = 0; i < _sourceObjects.Length; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_sourceCommits[i] = _walk.parseCommit(_sourceObjects[i]);\n\t\t\t\t}\n\t\t\t\tcatch (IncorrectObjectTypeException)\n\t\t\t\t{\n\t\t\t\t\t_sourceCommits[i] = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSourceTrees = new RevTree[_sourceObjects.Length];\n\t\t\tfor (int i = 0; i < _sourceObjects.Length; i++)\n\t\t\t\tSourceTrees[i] = _walk.parseTree(_sourceObjects[i]);\n\n\t\t\treturn MergeImpl();\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create an iterator to walk the merge base of two commits.\n\t\t/// </summary>\n\t\t/// <param name=\"aIdx\">\n\t\t/// Index of the first commit in <seealso cref=\"SourceObjects\"/>.\n\t\t/// </param>\n\t\t/// <param name=\"bIdx\">\n\t\t/// Index of the second commit in <seealso cref=\"SourceObjects\"/>.\n\t\t/// </param>\n\t\t/// <returns> the new iterator </returns>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one of the input objects is not a commit.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// objects are missing or multiple merge bases were found.\n\t\t/// </exception>\n\t\tprotected AbstractTreeIterator MergeBase(int aIdx, int bIdx)\n\t\t{\n\t\t\tif (_sourceCommits[aIdx] == null)\n\t\t\t\tthrow new IncorrectObjectTypeException(_sourceObjects[aIdx], Constants.TYPE_COMMIT);\n\n\t\t\tif (_sourceCommits[bIdx] == null)\n\t\t\t\tthrow new IncorrectObjectTypeException(_sourceObjects[bIdx], Constants.TYPE_COMMIT);\n\n\t\t\t_walk.reset();\n\t\t\t_walk.setRevFilter(RevFilter.MERGE_BASE);\n\t\t\t_walk.markStart(_sourceCommits[aIdx]);\n\t\t\t_walk.markStart(_sourceCommits[bIdx]);\n\t\t\tRevCommit base1 = _walk.next();\n\n\t\t\tif (base1 == null)\n\t\t\t{\n\t\t\t\treturn new EmptyTreeIterator();\n\t\t\t}\n\n\t\t\tRevCommit base2 = _walk.next();\n\t\t\tif (base2 != null)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Multiple merge bases for:\" + \"\\n  \"\n\t\t\t\t\t\t+ _sourceCommits[aIdx].Name + \"\\n  \"\n\t\t\t\t\t\t+ _sourceCommits[bIdx].Name + \"found:\" + \"\\n  \"\n\t\t\t\t\t\t+ base1.Name + \"\\n  \" + base2.Name);\n\t\t\t}\n\n\t\t\treturn OpenTree(base1.Tree);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Open an iterator over a tree.\n\t\t/// </summary>\n\t\t/// <param name=\"treeId\">\n\t\t/// the tree to scan; must be a tree (not a <see cref=\"Treeish\"/>).\n\t\t/// </param>\n\t\t/// <returns>An iterator for the tree.</returns>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// the input object is not a tree.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// the tree object is not found or cannot be read.\n\t\t/// </exception>\n\t\tprotected AbstractTreeIterator OpenTree(AnyObjectId treeId)\n\t\t{\n\t\t\tvar windowCursor = new WindowCursor();\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new CanonicalTreeParser(null, _db, treeId, windowCursor);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\twindowCursor.Release();\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Execute the merge.\n\t\t/// <para />\n\t\t/// This method is called from <seealso cref=\"Merge(AnyObjectId[])\"/> after the\n\t\t/// <seealso cref=\"SourceObjects\"/>, <seealso cref=\"SourceCommits\"/> and <seealso cref=\"SourceTrees\"/>\n\t\t/// have been populated.\n\t\t/// </summary>\n\t\t/// <returns> true if the merge was completed without conflicts; false if the\n\t\t/// merge strategy cannot handle this merge or there were conflicts\n\t\t/// preventing it from automatically resolving all paths. </returns>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one of the input objects is not a commit, but the strategy\n\t\t/// requires it to be a commit. </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// one or more sources could not be read, or outputs could not\n\t\t/// be written to the Repository.\n\t\t/// </exception>\n\t\tprotected abstract bool MergeImpl();\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Resulting tree, if <seealso cref=\"Merge(AnyObjectId[])\"/> returned true. \n\t\t/// </returns>\n\t\tpublic abstract ObjectId GetResultTreeId();\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_walk.Dispose();\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Merge/StrategyOneSided.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Merge\n{\n\t/// <summary>\n\t/// Trivial merge strategy to make the resulting tree exactly match an input.\n\t/// <para />\n\t/// This strategy can be used to cauterize an entire side branch of history, by\n\t/// setting the output tree to one of the inputs, and ignoring any of the paths\n\t/// of the other inputs.\n\t/// </summary>\n\tpublic class StrategyOneSided : MergeStrategy\n\t{\n\t\tprivate readonly string _strategyName;\n\t\tprivate readonly int _treeIndex;\n\n\t\t///\t<summary>\n\t\t/// Create a new merge strategy to select a specific input tree.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">name of this strategy.</param>\n\t\t/// <param name=\"index\">\n\t\t/// the position of the input tree to accept as the result.\n\t\t/// </param>\n\t\tpublic StrategyOneSided(string name, int index)\n\t\t{\n\t\t\t_strategyName = name;\n\t\t\t_treeIndex = index;\n\t\t}\n\n\t\tpublic override string Name\n\t\t{\n\t\t\tget { return _strategyName; }\n\t\t}\n\n\t\tpublic override Merger NewMerger(Repository db)\n\t\t{\n\t\t\treturn new OneSide(db, _treeIndex);\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class OneSide : Merger\n\t\t{\n\t\t\tprivate readonly int _treeIndex;\n\n\t\t\tpublic OneSide(Repository local, int index)\n\t\t\t\t: base(local)\n\t\t\t{\n\t\t\t\t_treeIndex = index;\n\t\t\t}\n\n\t\t\tprotected override bool MergeImpl()\n\t\t\t{\n\t\t\t\treturn _treeIndex < SourceTrees.Length;\n\t\t\t}\n\n\t\t\tpublic override ObjectId GetResultTreeId()\n\t\t\t{\n\t\t\t\treturn SourceTrees[_treeIndex];\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Merge/StrategySimpleTwoWayInCore.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.TreeWalk;\n\nnamespace GitSharp.Core.Merge\n{\n    /// <summary>\n    /// Merges two commits together in-memory, ignoring any working directory.\n\t/// <para />\n\t/// The strategy chooses a path from one of the two input trees if the path is\n\t/// unchanged in the other relative to their common merge base tree. This is a\n\t/// trivial 3-way merge (at the file path level only).\n\t/// <para />\n\t/// Modifications of the same file path (content and/or file mode) by both input\n\t/// trees will cause a merge conflict, as this strategy does not attempt to merge\n\t/// file contents.\n\t/// </summary>\n    public class StrategySimpleTwoWayInCore : ThreeWayMergeStrategy\n    {\n        public override string Name\n        {\n            get {return \"simple-two-way-in-core\";}\n        }\n\n        public override Merger NewMerger(Repository db)\n        {\n            return new InCoreMerger(db);\n        }\n\n    \t#region Nested Types\n\n    \tprivate class InCoreMerger : ThreeWayMerger\n    \t{\n    \t\tprivate const int Base = 0;\n    \t\tprivate const int Ours = 1;\n    \t\tprivate const int Theirs = 2;\n\n    \t\tprivate readonly NameConflictTreeWalk _tw;\n    \t\tprivate readonly DirCache _cache;\n    \t\tprivate DirCacheBuilder _builder;\n    \t\tprivate ObjectId _resultTree;\n\n    \t\tpublic InCoreMerger(Repository local)\n    \t\t\t: base(local)\n    \t\t{\n    \t\t\t_tw = new NameConflictTreeWalk(Repository);\n    \t\t\t_cache = DirCache.newInCore();\n    \t\t}\n\n    \t\tprotected override bool MergeImpl()\n    \t\t{\n    \t\t\t_tw.reset();\n    \t\t\t_tw.addTree(MergeBase());\n    \t\t\t_tw.addTree(SourceTrees[0]);\n    \t\t\t_tw.addTree(SourceTrees[1]);\n\n    \t\t\tbool hasConflict = false;\n\n    \t\t\t_builder = _cache.builder();\n    \t\t\twhile (_tw.next())\n    \t\t\t{\n    \t\t\t\tint modeO = _tw.getRawMode(Ours);\n    \t\t\t\tint modeT = _tw.getRawMode(Theirs);\n    \t\t\t\tif (modeO == modeT && _tw.idEqual(Ours, Theirs))\n    \t\t\t\t{\n    \t\t\t\t\tAdd(Ours, DirCacheEntry.STAGE_0);\n    \t\t\t\t\tcontinue;\n    \t\t\t\t}\n\n    \t\t\t\tint modeB = _tw.getRawMode(Base);\n    \t\t\t\tif (modeB == modeO && _tw.idEqual(Base, Ours))\n    \t\t\t\t\tAdd(Theirs, DirCacheEntry.STAGE_0);\n    \t\t\t\telse if (modeB == modeT && _tw.idEqual(Base, Theirs))\n    \t\t\t\t\tAdd(Ours, DirCacheEntry.STAGE_0);\n    \t\t\t\telse if (_tw.isSubtree())\n    \t\t\t\t{\n    \t\t\t\t\tif (NonTree(modeB))\n    \t\t\t\t\t{\n    \t\t\t\t\t\tAdd(Base, DirCacheEntry.STAGE_1);\n    \t\t\t\t\t\thasConflict = true;\n    \t\t\t\t\t}\n    \t\t\t\t\tif (NonTree(modeO))\n    \t\t\t\t\t{\n    \t\t\t\t\t\tAdd(Ours, DirCacheEntry.STAGE_2);\n    \t\t\t\t\t\thasConflict = true;\n    \t\t\t\t\t}\n    \t\t\t\t\tif (NonTree(modeT))\n    \t\t\t\t\t{\n    \t\t\t\t\t\tAdd(Theirs, DirCacheEntry.STAGE_3);\n    \t\t\t\t\t\thasConflict = true;\n    \t\t\t\t\t}\n    \t\t\t\t\t_tw.enterSubtree();\n    \t\t\t\t}\n    \t\t\t\telse\n    \t\t\t\t{\n    \t\t\t\t\tAdd(Base, DirCacheEntry.STAGE_1);\n    \t\t\t\t\tAdd(Ours, DirCacheEntry.STAGE_2);\n    \t\t\t\t\tAdd(Theirs, DirCacheEntry.STAGE_3);\n    \t\t\t\t\thasConflict = true;\n    \t\t\t\t}\n    \t\t\t}\n    \t\t\t_builder.finish();\n    \t\t\t_builder = null;\n\n    \t\t\tif (hasConflict)\n    \t\t\t\treturn false;\n    \t\t\ttry\n    \t\t\t{\n    \t\t\t\t_resultTree = _cache.writeTree(GetObjectWriter());\n    \t\t\t\treturn true;\n    \t\t\t}\n    \t\t\tcatch (UnmergedPathException)\n    \t\t\t{\n    \t\t\t\t_resultTree = null;\n    \t\t\t\treturn false;\n    \t\t\t}\n    \t\t}\n\n    \t\tprivate static bool NonTree(int mode)\n    \t\t{\n    \t\t\treturn mode != 0 && !FileMode.Tree.Equals(mode);\n    \t\t}\n\n    \t\tprivate void Add(int tree, int stage)\n    \t\t{\n    \t\t\tAbstractTreeIterator i = GetTree(tree);\n    \t\t\tif (i == null) return;\n\n    \t\t\tif (FileMode.Tree.Equals(_tw.getRawMode(tree)))\n    \t\t\t{\n    \t\t\t\t_builder.addTree(_tw.getRawPath(), stage, Repository, _tw.getObjectId(tree));\n    \t\t\t}\n    \t\t\telse\n    \t\t\t{\n    \t\t\t\tvar e = new DirCacheEntry(_tw.getRawPath(), stage);\n    \t\t\t\te.setObjectIdFromRaw(i.idBuffer(), i.idOffset());\n    \t\t\t\te.setFileMode(_tw.getFileMode(tree));\n    \t\t\t\t_builder.add(e);\n    \t\t\t}\n    \t\t}\n\n    \t\tprivate AbstractTreeIterator GetTree(int tree)\n    \t\t{\n    \t\t\treturn _tw.getTree<AbstractTreeIterator>(tree, typeof(AbstractTreeIterator));\n    \t\t}\n\n    \t\tpublic override ObjectId GetResultTreeId()\n    \t\t{\n    \t\t\treturn _resultTree;\n    \t\t}\n    \t}\n\n    \t#endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/ThreeWayMergeStrategy.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Merge\n{\n\t/// <summary>\n\t/// A merge strategy to merge 2 trees, using a common base ancestor tree.\n\t/// </summary>\n    public abstract class ThreeWayMergeStrategy : MergeStrategy\n    {\n        public override abstract Merger NewMerger(Repository db);\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Merge/ThreeWayMerger.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk;\n\nnamespace GitSharp.Core.Merge\n{\n\t/// <summary>\n\t/// A merge of 2 trees, using a common base ancestor tree.\n\t/// </summary>\n\tpublic abstract class ThreeWayMerger : Merger\n\t{\n\t\tprivate RevTree _baseTree;\n\n\t\t/// <summary>\n\t\t/// Create a new merge instance for a repository.\n\t\t/// </summary>\n\t\t/// <param name=\"local\">\n\t\t/// The repository this merger will Read and write data on. \n\t\t/// </param>\n\t\tprotected ThreeWayMerger(Repository local)\n\t\t\t: base(local)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the common ancestor tree.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// Common base treeish; null to automatically compute the common\n\t\t/// base from the input commits during\n\t\t/// <see cref=\"Merge(AnyObjectId, AnyObjectId)\"/>.\n\t\t/// </param>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// The object is not a <see cref=\"Treeish\"/>.\n\t\t/// </exception>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// The object does not exist.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// The object could not be read.\n\t\t/// </exception>\n\t\tpublic void SetBase(AnyObjectId id)\n\t\t{\n\t\t\t_baseTree = id != null ? Walk.parseTree(id) : null;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Merge together two <see cref=\"Treeish\"/> objects.\n\t\t/// <para />\n\t\t/// Any tree-ish may be supplied as inputs. Commits and/or tags pointing at\n\t\t/// trees or commits may be passed as input objects.\n\t\t/// </summary>\n\t\t/// <param name=\"a\">source tree to be combined together.</param>\n\t\t/// <param name=\"b\">source tree to be combined together.</param>\n\t\t/// <returns> \n\t\t/// true if the merge was completed without conflicts; false if the\n\t\t/// merge strategy cannot handle this merge or there were conflicts\n\t\t/// preventing it from automatically resolving all paths.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one of the input objects is not a commit, but the strategy\n\t\t/// requires it to be a commit.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// one or more sources could not be read, or outputs could not\n\t\t/// be written to the Repository.\n\t\t/// </exception>\n\t\tpublic bool Merge(AnyObjectId a, AnyObjectId b)\n\t\t{\n\t\t\treturn Merge(new[] { a, b });\n\t\t}\n\n\t\tpublic override bool Merge(AnyObjectId[] tips)\n\t\t{\n\t\t\tif (tips == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"tips\");\n\t\t\t\n\t\t\treturn tips.Length != 2 ? false : base.Merge(tips);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create an iterator to walk the merge base.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// An iterator over the caller-specified merge base, or the natural\n\t\t/// merge base of the two input commits.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IOException\"></exception> \n\t\tprotected AbstractTreeIterator MergeBase()\n\t\t{\n\t\t\treturn _baseTree != null ? OpenTree(_baseTree) : MergeBase(0, 1);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/MutableObjectId.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\tpublic class MutableObjectId : AnyObjectId\n\t{\n\t\tpublic MutableObjectId()\n\t\t\t: this(ObjectId.ZeroId)\n\t\t{\n\t\t}\n\n\t\tpublic MutableObjectId(AnyObjectId src)\n\t\t\t: base(src)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Make this id match <see cref=\"ObjectId.ZeroId\"/>.\n\t\t/// </summary>\n\t\tpublic void Clear()\n\t\t{\n\t\t\tW1 = 0;\n\t\t\tW2 = 0;\n\t\t\tW3 = 0;\n\t\t\tW4 = 0;\n\t\t\tW5 = 0;\n\t\t}\n\n\t\tpublic void FromRaw(byte[] bs)\n\t\t{\n\t\t\tFromRaw(bs, 0);\n\t\t}\n\n\t\tpublic void FromRaw(byte[] bs, int p)\n\t\t{\n\t\t\tW1 = NB.DecodeInt32(bs, p);\n\t\t\tW2 = NB.DecodeInt32(bs, p + 4);\n\t\t\tW3 = NB.DecodeInt32(bs, p + 8);\n\t\t\tW4 = NB.DecodeInt32(bs, p + 12);\n\t\t\tW5 = NB.DecodeInt32(bs, p + 16);\n\t\t}\n\n\t\tpublic void FromRaw(int[] ints)\n\t\t{\n\t\t\tFromRaw(ints, 0);\n\t\t}\n\n\t\tpublic void FromRaw(int[] ints, int p)\n\t\t{\n\t\t\tW1 = ints[p];\n\t\t\tW2 = ints[p + 1];\n\t\t\tW3 = ints[p + 2];\n\t\t\tW4 = ints[p + 3];\n\t\t\tW5 = ints[p + 4];\n\t\t}\n\n\t\tpublic void FromString(byte[] buf, int offset)\n\t\t{\n\t\t\tFromHexString(buf, offset);\n\t\t}\n\n\t\tpublic void FromString(string str)\n\t\t{\n            if (str.Length != Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Invalid id: \" + str, \"str\");\n\t\t\t}\n\n\t\t\tFromHexString(Constants.encodeASCII(str), 0);\n\t\t}\n\n\t\tprivate void FromHexString(byte[] bs, int p)\n\t\t{\n\t\t\ttry\n\t\t\t{\n                W1 = RawParseUtils.parseHexInt32(bs, p);\n                W2 = RawParseUtils.parseHexInt32(bs, p + 8);\n                W3 = RawParseUtils.parseHexInt32(bs, p + 16);\n                W4 = RawParseUtils.parseHexInt32(bs, p + 24);\n                W5 = RawParseUtils.parseHexInt32(bs, p + 32);\n\t\t\t}\n            catch (IndexOutOfRangeException e)\n            {\n                throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH, e);\n            }\n\t\t}\n\n\t\tpublic override ObjectId ToObjectId()\n\t\t{\n\t\t\treturn new ObjectId(this);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/NullProgressMonitor.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n    [Complete]\n    public class NullProgressMonitor : ProgressMonitor \n    {\n        public static readonly NullProgressMonitor Instance = new NullProgressMonitor();\n\n        #region ProgressMonitor Members\n\n        public override void Start(int totalTasks)\n        {\n        }\n\n        public override void BeginTask(string title, int totalWork)\n        {\n        }\n\n        public override void Update(int completed)\n        {\n        }\n\n        public override void EndTask()\n        {\n        }\n\n        public override bool IsCancelled\n        {\n            get { return false; }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/ObjectChecker.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * \n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Verifies that an object is formatted correctly.\n    /// <para />\n    /// Verifications made by this class only check that the fields of an object are\n    /// formatted correctly. The ObjectId checksum of the object is not verified, and\n    /// connectivity links between objects are also not verified. Its assumed that\n    /// the caller can provide both of these validations on its own.\n    /// <para />\n    /// Instances of this class are not thread safe, but they may be reused to\n    /// perform multiple object validations.\n    /// </summary>\n    public class ObjectChecker\n    {\n        /** Header \"tree \" */\n        public static byte[] tree = Constants.encodeASCII(\"tree \");\n\n        /** Header \"parent \" */\n        public static byte[] parent = Constants.encodeASCII(\"parent \");\n\n        /** Header \"author \" */\n        public static byte[] author = Constants.encodeASCII(\"author \");\n\n        /** Header \"committer \" */\n        public static byte[] committer = Constants.encodeASCII(\"committer \");\n\n        /** Header \"encoding \" */\n        public static byte[] encoding = Constants.encodeASCII(\"encoding \");\n\n        /** Header \"object \" */\n        public static byte[] @object = Constants.encodeASCII(\"object \");\n\n        /** Header \"type \" */\n        public static byte[] type = Constants.encodeASCII(\"type \");\n\n        /** Header \"tag \" */\n        public static byte[] tag = Constants.encodeASCII(\"tag \");\n\n        /** Header \"tagger \" */\n        public static byte[] tagger = Constants.encodeASCII(\"tagger \");\n\n\n        private MutableObjectId tempId = new MutableObjectId();\n\n        private MutableInteger ptrout = new MutableInteger();\n\n        /// <summary>\n        /// Check an object for parsing errors.\n        /// </summary>\n        /// <param name=\"objType\">\n        /// Type of the object. Must be a valid object type code in\n        /// <see cref=\"Constants\"/>.</param>\n        /// <param name=\"raw\">\n        /// The raw data which comprises the object. This should be in the\n        /// canonical format (that is the format used to generate the\n        /// <see cref=\"ObjectId\"/> of the object). The array is never modified.\n        /// </param>\n        /// <exception cref=\"CorruptObjectException\">If any error is identified.</exception>\n        public void check(int objType, byte[] raw)\n        {\n            switch (objType)\n            {\n                case Constants.OBJ_COMMIT:\n                    checkCommit(raw);\n                    break;\n\n                case Constants.OBJ_TAG:\n                    checkTag(raw);\n                    break;\n\n                case Constants.OBJ_TREE:\n                    checkTree(raw);\n                    break;\n\n                case Constants.OBJ_BLOB:\n                    checkBlob(raw);\n                    break;\n\n                default:\n                    throw new CorruptObjectException(\"Invalid object type: \" + objType);\n            }\n        }\n\n        private int id(byte[] raw, int ptr)\n        {\n            try\n            {\n                tempId.FromString(raw, ptr);\n                return ptr + Constants.OBJECT_ID_STRING_LENGTH;\n            }\n            catch (ArgumentException)\n            {\n                return -1;\n            }\n        }\n\n        private int personIdent(byte[] raw, int ptr)\n        {\n            int emailB = RawParseUtils.nextLF(raw, ptr, (byte)'<');\n            if (emailB == ptr || raw[emailB - 1] != '<')\n                return -1;\n\n            int emailE = RawParseUtils.nextLF(raw, emailB, (byte)'>');\n            if (emailE == emailB || raw[emailE - 1] != '>')\n                return -1;\n            if (emailE == raw.Length || raw[emailE] != ' ')\n                return -1;\n\n            RawParseUtils.parseBase10(raw, emailE + 1, ptrout); // when\n            ptr = ptrout.value;\n            if (emailE + 1 == ptr)\n                return -1;\n            if (ptr == raw.Length || raw[ptr] != ' ')\n                return -1;\n\n            RawParseUtils.parseBase10(raw, ptr + 1, ptrout); // tz offset\n            if (ptr + 1 == ptrout.value)\n                return -1;\n            return ptrout.value;\n        }\n\n        /// <summary>\n        /// Check a commit for errors.\n        /// </summary>\n        /// <param name=\"raw\">The commit data. The array is never modified.</param>\n        /// <exception cref=\"CorruptObjectException\">If any error was detected.</exception>\n        public void checkCommit(byte[] raw)\n        {\n            int ptr = 0;\n\n            if ((ptr = RawParseUtils.match(raw, ptr, tree)) < 0)\n                throw new CorruptObjectException(\"no tree header\");\n            if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                throw new CorruptObjectException(\"invalid tree\");\n\n            while (RawParseUtils.match(raw, ptr, parent) >= 0)\n            {\n                ptr += parent.Length;\n                if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                    throw new CorruptObjectException(\"invalid parent\");\n            }\n\n            if ((ptr = RawParseUtils.match(raw, ptr, author)) < 0)\n                throw new CorruptObjectException(\"no author\");\n            if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                throw new CorruptObjectException(\"invalid author\");\n\n            if ((ptr = RawParseUtils.match(raw, ptr, committer)) < 0)\n                throw new CorruptObjectException(\"no committer\");\n            if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                throw new CorruptObjectException(\"invalid committer\");\n        }\n\n        /// <summary>\n        /// Check an annotated tag for errors.\n        /// </summary>\n        /// <param name=\"raw\">The tag data. The array is never modified.</param>\n        /// <exception cref=\"CorruptObjectException\">If any error was detected.</exception>\n        public void checkTag(byte[] raw)\n        {\n            int ptr = 0;\n\n            if ((ptr = RawParseUtils.match(raw, ptr, @object)) < 0)\n                throw new CorruptObjectException(\"no object header\");\n            if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                throw new CorruptObjectException(\"invalid object\");\n\n            if ((ptr = RawParseUtils.match(raw, ptr, type)) < 0)\n                throw new CorruptObjectException(\"no type header\");\n            ptr = RawParseUtils.nextLF(raw, ptr);\n\n            if ((ptr = RawParseUtils.match(raw, ptr, tag)) < 0)\n                throw new CorruptObjectException(\"no tag header\");\n            ptr = RawParseUtils.nextLF(raw, ptr);\n\n            if ((ptr = RawParseUtils.match(raw, ptr, tagger)) > 0)\n            {\n                if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\\n')\n                    throw new CorruptObjectException(\"invalid tagger\");\n            }\n        }\n\n        private static int lastPathChar(int mode)\n        {\n            return FileMode.Tree.Equals(mode) ? '/' : '\\0';\n        }\n\n        private static int pathCompare(byte[] raw, int aPos, int aEnd, int aMode, int bPos, int bEnd, int bMode)\n        {\n            while (aPos < aEnd && bPos < bEnd)\n            {\n                int cmp = (raw[aPos++] & 0xff) - (raw[bPos++] & 0xff);\n                if (cmp != 0)\n                    return cmp;\n            }\n\n            if (aPos < aEnd)\n                return (raw[aPos] & 0xff) - lastPathChar(bMode);\n            if (bPos < bEnd)\n                return lastPathChar(aMode) - (raw[bPos] & 0xff);\n            return 0;\n        }\n\n        private static bool duplicateName(byte[] raw, int thisNamePos, int thisNameEnd)\n        {\n            int sz = raw.Length;\n            int nextPtr = thisNameEnd + 1 + Constants.OBJECT_ID_LENGTH;\n            for (; ; )\n            {\n                int nextMode = 0;\n                for (; ; )\n                {\n                    if (nextPtr >= sz)\n                        return false;\n                    byte c = raw[nextPtr++];\n                    if (' ' == c)\n                        break;\n                    nextMode <<= 3;\n                    nextMode += (c - (byte)'0');\n                }\n\n                int nextNamePos = nextPtr;\n                for (; ; )\n                {\n                    if (nextPtr == sz)\n                        return false;\n                    byte c = raw[nextPtr++];\n                    if (c == '\\0')\n                        break;\n                }\n                if (nextNamePos + 1 == nextPtr)\n                    return false;\n\n                int cmp = pathCompare(raw, thisNamePos, thisNameEnd, FileMode.Tree.Bits, nextNamePos, nextPtr - 1, nextMode);\n                if (cmp < 0)\n                    return false;\n                else if (cmp == 0)\n                    return true;\n\n                nextPtr += Constants.OBJECT_ID_LENGTH;\n            }\n        }\n\n        /// <summary>\n        /// Check a canonical formatted tree for errors.\n        /// </summary>\n        /// <param name=\"raw\">The raw tree data. The array is never modified.</param>\n        /// <exception cref=\"CorruptObjectException\">If any error was detected.</exception>\n        public void checkTree(byte[] raw)\n        {\n            int sz = raw.Length;\n            int ptr = 0;\n            int lastNameB = 0, lastNameE = 0, lastMode = 0;\n\n            while (ptr < sz)\n            {\n                int thisMode = 0;\n                for (; ; )\n                {\n                    if (ptr == sz)\n                        throw new CorruptObjectException(\"truncated in mode\");\n                    byte c = raw[ptr++];\n                    if (' ' == c)\n                        break;\n                    if (c < '0' || c > '7')\n                        throw new CorruptObjectException(\"invalid mode character\");\n                    if (thisMode == 0 && c == '0')\n                        throw new CorruptObjectException(\"mode starts with '0'\");\n                    thisMode <<= 3;\n                    thisMode += (c - (byte)'0');\n                }\n\n                if (FileMode.FromBits(thisMode).ObjectType == ObjectType.Bad)\n                    throw new CorruptObjectException(\"invalid mode \" + NB.DecimalToBase(thisMode, 8));\n\n                int thisNameB = ptr;\n                for (; ; )\n                {\n                    if (ptr == sz)\n                        throw new CorruptObjectException(\"truncated in name\");\n                    byte c = raw[ptr++];\n                    if (c == '\\0')\n                        break;\n                    if (c == '/')\n                        throw new CorruptObjectException(\"name contains '/'\");\n                }\n                if (thisNameB + 1 == ptr)\n                    throw new CorruptObjectException(\"zero length name\");\n                if (raw[thisNameB] == '.')\n                {\n                    int nameLen = (ptr - 1) - thisNameB;\n                    if (nameLen == 1)\n                        throw new CorruptObjectException(\"invalid name '.'\");\n                    if (nameLen == 2 && raw[thisNameB + 1] == '.')\n                        throw new CorruptObjectException(\"invalid name '..'\");\n                }\n                if (duplicateName(raw, thisNameB, ptr - 1))\n                    throw new CorruptObjectException(\"duplicate entry names\");\n\n                if (lastNameB != 0)\n                {\n                    int cmp = pathCompare(raw, lastNameB, lastNameE,\n                           lastMode, thisNameB, ptr - 1, thisMode);\n                    if (cmp > 0)\n                        throw new CorruptObjectException(\"incorrectly sorted\");\n                }\n\n                lastNameB = thisNameB;\n                lastNameE = ptr - 1;\n                lastMode = thisMode;\n\n                ptr += Constants.OBJECT_ID_LENGTH;\n                if (ptr > sz)\n                    throw new CorruptObjectException(\"truncated in object id\");\n            }\n        }\n\n        /// <summary>\n        /// Check a blob for errors.\n        /// </summary>\n        /// <param name=\"raw\">The blob data. The array is never modified.</param>\n        /// <exception cref=\"CorruptObjectException\">If any error was detected.</exception>\n        public void checkBlob(byte[] raw)\n        {\n            // We can always assume the blob is valid.\n        }\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/ObjectDatabase.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Abstraction of arbitrary object storage.\n    /// <para />\n    /// An object database stores one or more Git objects, indexed by their unique\n    /// <see cref=\"ObjectId\"/>. Optionally an object database can reference one or more\n    /// alternates; other <see cref=\"ObjectDatabase\"/> instances that are searched in\n    /// addition to the current database.\n    /// <para />\n    /// Databases are usually divided into two halves: a half that is considered to\n    /// be fast to search, and a half that is considered to be slow to search. When\n    /// alternates are present the fast half is fully searched (recursively through\n    /// all alternates) before the slow half is considered.\n    /// </summary>\n    public abstract class ObjectDatabase : IDisposable\n    {\n        /// <summary>\n        /// Constant indicating no alternate databases exist.\n        /// </summary>\n        protected static readonly ObjectDatabase[] NoAlternates = { };\n\n        private readonly AtomicReference<ObjectDatabase[]> _alternates;\n\n        /// <summary>\n        /// Initialize a new database instance for access.\n        /// </summary>\n        protected ObjectDatabase()\n        {\n            _alternates = new AtomicReference<ObjectDatabase[]>();\n        }\n\n        /// <summary>\n        /// Does this database exist yet?\n        /// </summary>\n        /// <returns>\n        /// true if this database is already created; false if the caller\n        /// should invoke <see cref=\"create\"/> to create this database location.\n        /// </returns>\n        public virtual bool exists()\n        {\n            return true;\n        }\n\n        /// <summary>\n        /// Initialize a new object database at this location.\n        /// </summary>\n        public virtual void create()\n        {\n            // Assume no action is required.\n        }\n\n        public virtual void Dispose()\n        {\n            close();\n        }\n\n        /// <summary>\n        /// Close any resources held by this database and its active alternates.\n        /// </summary>\n        public void close()\n        {\n            closeSelf();\n            closeAlternates();\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~ObjectDatabase()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed.\");\n        }\n#endif\n        /// <summary>\n        /// Close any resources held by this database only; ignoring alternates.\n        /// <para />\n        /// To fully close this database and its referenced alternates, the caller\n        /// should instead invoke <see cref=\"close()\"/>.\n        /// </summary>\n        public virtual void closeSelf()\n        {\n            // Assume no action is required.\n        }\n\n        /// <summary>\n        /// Fully close all loaded alternates and clear the alternate list.\n        /// </summary>\n        public virtual void closeAlternates()\n        {\n            ObjectDatabase[] alt = _alternates.get();\n            if (alt != null)\n            {\n                _alternates.set(null);\n                closeAlternates(alt);\n            }\n        }\n\n        /// <summary>\n        /// Does the requested object exist in this database?\n        /// <para />\n        /// Alternates (if present) are searched automatically.\n        /// </summary>\n        /// <param name=\"objectId\">identity of the object to test for existence of.</param>\n        /// <returns>\n        /// True if the specified object is stored in this database, or any\n        /// of the alternate databases.\n        /// </returns>\n        public bool hasObject(AnyObjectId objectId)\n        {\n            return hasObjectImpl1(objectId) || hasObjectImpl2(objectId.Name);\n        }\n\n        private bool hasObjectImpl1(AnyObjectId objectId)\n        {\n            if (hasObject1(objectId))\n            {\n                return true;\n            }\n            foreach (ObjectDatabase alt in getAlternates())\n            {\n                if (alt.hasObjectImpl1(objectId))\n                {\n                    return true;\n                }\n            }\n            return tryAgain1() && hasObject1(objectId);\n        }\n\n        private bool hasObjectImpl2(string objectId)\n        {\n            if (hasObject2(objectId))\n            {\n                return true;\n            }\n            foreach (ObjectDatabase alt in getAlternates())\n            {\n                if (alt.hasObjectImpl2(objectId))\n                {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        /// <summary>\n        /// Fast half of <see cref=\"hasObject(AnyObjectId)\"/>.\n        /// </summary>\n        /// <param name=\"objectId\">\n        /// Identity of the object to test for existence of.\n        /// </param>\n        /// <returns>\n        /// true if the specified object is stored in this database.\n        /// </returns>\n        public abstract bool hasObject1(AnyObjectId objectId);\n\n        /// <summary>\n        /// Slow half of <see cref=\"hasObject(AnyObjectId)\"/>.\n        /// </summary>\n        /// <param name=\"objectName\">\n        /// Identity of the object to test for existence of.\n        /// </param>\n        /// <returns>\n        /// true if the specified object is stored in this database.\n        /// </returns>\n        public virtual bool hasObject2(string objectName)\n        {\n            // Assume the search took place during hasObject1.\n            return false;\n        }\n\n        /// <summary>\n        /// Open an object from this database.\n        /// <para />\n        /// Alternates (if present) are searched automatically.\n        /// </summary>\n        /// <param name=\"curs\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"objectId\">Identity of the object to open.</param>\n        /// <returns>\n        /// A <see cref=\"ObjectLoader\"/> for accessing the data of the named\n        /// object, or null if the object does not exist.\n        /// </returns>\n        public ObjectLoader openObject(WindowCursor curs, AnyObjectId objectId)\n        {\n            if (objectId == null) return null;\n\n            ObjectLoader ldr = OpenObjectImpl1(curs, objectId);\n            if (ldr != null)\n            {\n                return ldr;\n            }\n\n            ldr = OpenObjectImpl2(curs, objectId.Name, objectId);\n            if (ldr != null)\n            {\n                return ldr;\n            }\n            return null;\n        }\n\n        private ObjectLoader OpenObjectImpl1(WindowCursor curs,\n                 AnyObjectId objectId)\n        {\n            ObjectLoader ldr = openObject1(curs, objectId);\n            if (ldr != null)\n            {\n                return ldr;\n            }\n\n            foreach (ObjectDatabase alt in getAlternates())\n            {\n                ldr = alt.OpenObjectImpl1(curs, objectId);\n                if (ldr != null)\n                {\n                    return ldr;\n                }\n            }\n\n            if (tryAgain1())\n            {\n                ldr = openObject1(curs, objectId);\n                if (ldr != null)\n                {\n                    return ldr;\n                }\n            }\n\n            return null;\n        }\n\n        private ObjectLoader OpenObjectImpl2(WindowCursor curs, string objectName, AnyObjectId objectId)\n        {\n            ObjectLoader ldr = openObject2(curs, objectName, objectId);\n            if (ldr != null)\n            {\n                return ldr;\n            }\n\n            foreach (ObjectDatabase alt in getAlternates())\n            {\n                ldr = alt.OpenObjectImpl2(curs, objectName, objectId);\n                if (ldr != null)\n                {\n                    return ldr;\n                }\n            }\n\n            return null;\n        }\n\n        /// <summary>\n        /// Fast half of <see cref=\"openObject(WindowCursor, AnyObjectId)\"/>.\n        /// </summary>\n        /// <param name=\"curs\">\n        /// temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"objectId\">identity of the object to open.</param>\n        /// <returns>\n        /// A <see cref=\"ObjectLoader\"/> for accessing the data of the named\n        /// object, or null if the object does not exist.\n        /// </returns>\n        public abstract ObjectLoader openObject1(WindowCursor curs,\n                AnyObjectId objectId);\n\n        /// <summary>\n        /// Slow half of <see cref=\"openObject(WindowCursor, AnyObjectId)\"/>.\n        /// </summary>\n        /// <param name=\"curs\">\n        /// temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"objectName\">Name of the object to open.</param>\n        /// <param name=\"objectId\">identity of the object to open.</param>\n        /// <returns>\n        /// A <see cref=\"ObjectLoader\"/> for accessing the data of the named\n        /// object, or null if the object does not exist.\n        /// </returns>\n        public virtual ObjectLoader openObject2(WindowCursor curs, string objectName,\n                AnyObjectId objectId)\n        {\n            // Assume the search took place during openObject1.\n            return null;\n        }\n\n        /// <summary>\n        /// Open the object from all packs containing it.\n        /// <para />\n        /// If any alternates are present, their packs are also considered.\n        /// </summary>\n        /// <param name=\"out\">\n        /// Result collection of loaders for this object, filled with\n        /// loaders from all packs containing specified object\n        /// </param>\n        /// <param name=\"windowCursor\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"objectId\"><see cref=\"ObjectId\"/> of object to search for.</param>\n        public virtual void OpenObjectInAllPacks(ICollection<PackedObjectLoader> @out, WindowCursor windowCursor, AnyObjectId objectId)\n        {\n            OpenObjectInAllPacksImplementation(@out, windowCursor, objectId);\n            foreach (ObjectDatabase alt in getAlternates())\n            {\n                alt.OpenObjectInAllPacksImplementation(@out, windowCursor, objectId);\n            }\n        }\n\n        /// <summary>\n        /// Open the object from all packs containing it.\n        /// <para />\n        /// If any alternates are present, their packs are also considered.\n        /// </summary>\n        /// <param name=\"out\">\n        /// Result collection of loaders for this object, filled with\n        /// loaders from all packs containing specified object.\n        /// </param>\n        /// <param name=\"windowCursor\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"objectId\"><see cref=\"ObjectId\"/> of object to search for.</param>\n        public virtual void OpenObjectInAllPacksImplementation(ICollection<PackedObjectLoader> @out, WindowCursor windowCursor, AnyObjectId objectId)\n        {\n            // Assume no pack support\n        }\n\n        /// <summary>\n        /// true if the fast-half search should be tried again.\n        /// </summary>\n        /// <returns></returns>\n        public virtual bool tryAgain1()\n        {\n            return false;\n        }\n\n        /// <summary>\n        /// Get the alternate databases known to this database.\n        /// </summary>\n        /// <returns>\n        /// The alternate list. Never null, but may be an empty array.\n        /// </returns>\n        public ObjectDatabase[] getAlternates()\n        {\n            ObjectDatabase[] r = _alternates.get();\n            if (r == null)\n            {\n                lock (_alternates)\n                {\n                    r = _alternates.get();\n                    if (r == null)\n                    {\n                        try\n                        {\n                            r = loadAlternates();\n                        }\n                        catch (IOException)\n                        {\n                            r = NoAlternates;\n                        }\n\n                        _alternates.set(r); // [henon] possible deadlock?\n                    }\n                }\n            }\n\n            return r;\n        }\n\n        /// <summary>\n        /// Load the list of alternate databases into memory.\n        /// <para />\n        /// This method is invoked by <see cref=\"getAlternates()\"/> if the alternate list\n        /// has not yet been populated, or if <see cref=\"closeAlternates()\"/> has been\n        /// called on this instance and the alternate list is needed again.\n        /// <para />\n        /// If the alternate array is empty, implementors should consider using the\n        /// constant <see cref=\"NoAlternates\"/>.\n        /// </summary>\n        /// <returns>The alternate list for this database.</returns>\n        /// <exception cref=\"Exception\">\n        /// The alternate list could not be accessed. The empty alternate\n        /// array <see cref=\"NoAlternates\"/> will be assumed by the caller.\n        /// </exception>\n        protected virtual ObjectDatabase[] loadAlternates()\n        {\n            return NoAlternates;\n        }\n\n        /// <summary>\n        /// Close the list of alternates returned by <see cref=\"loadAlternates\"/>.\n        /// </summary>\n        /// <param name=\"alt\">the alternate list, from <see cref=\"loadAlternates\"/>.</param>\n        protected void closeAlternates(ObjectDatabase[] alt)\n        {\n            foreach (ObjectDatabase d in alt)\n            {\n                d.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Create a new cached database instance over this database. This instance might\n        /// optimize queries by caching some information about database. So some modifications\n        /// done after instance creation might fail to be noticed.\n        /// </summary>\n        /// <returns>new cached database instance</returns>\n        public virtual ObjectDatabase newCachedDatabase()\n        {\n            return new CachedObjectDatabase(this);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/ObjectDirectory.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Traditional file system based <see cref=\"ObjectDatabase\"/>.\n    /// <para />\n    /// This is the classical object database representation for a Git repository,\n    /// where objects are stored loose by hashing them into directories by their\n    /// <see cref=\"ObjectId\"/>, or are stored in compressed containers known as\n    /// <see cref=\"PackFile\"/>s.\n    /// </summary>\n    public class ObjectDirectory : ObjectDatabase\n    {\n        private static readonly PackList NoPacks = new PackList(-1, -1, new PackFile[0]);\n        private readonly DirectoryInfo _objects;\n        private readonly DirectoryInfo _infoDirectory;\n        private readonly DirectoryInfo _packDirectory;\n        private readonly FileInfo _alternatesFile;\n        private readonly AtomicReference<PackList> _packList;\n\n        private DirectoryInfo[] _alternateObjectDir;\n\n        /// <summary>\n        /// Initialize a reference to an on-disk object directory.\n        /// </summary>\n        /// <param name=\"dir\">the location of the <code>objects</code> directory.</param>\n        /// <param name=\"alternateObjectDir\">a list of alternate object directories</param>\n        public ObjectDirectory(DirectoryInfo dir, DirectoryInfo[] alternateObjectDir)\n        {\n            _objects = dir;\n            _alternateObjectDir = alternateObjectDir;\n            _infoDirectory = new DirectoryInfo(_objects.FullName + \"/info\");\n            _packDirectory = new DirectoryInfo(_objects.FullName + \"/pack\");\n            _alternatesFile = new FileInfo(_infoDirectory + \"/alternates\");\n            _packList = new AtomicReference<PackList>(NoPacks);\n        }\n\n        /// <summary>\n        /// Gets the location of the <code>objects</code> directory.\n        /// </summary>\n        public DirectoryInfo getDirectory()\n        {\n            return _objects;\n        }\n\n        public override bool exists()\n        {\n            return _objects.Exists;\n        }\n\n        public override void create()\n        {\n            _objects.Mkdirs();\n            _infoDirectory.Mkdirs();\n            _packDirectory.Mkdirs();\n        }\n\n        public override void closeSelf()\n        {\n            PackList packs = _packList.get();\n            _packList.set(NoPacks);\n            foreach (PackFile p in packs.packs)\n            {\n                p.Dispose();\n            }\n\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~ObjectDirectory()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed {\" + _objects.FullName + \"}\");\n        }\n#endif\n        /// <summary>\n        /// Compute the location of a loose object file.\n        /// </summary>\n        /// <param name=\"objectId\">Identity of the loose object to map to the directory.</param>\n        /// <returns>Location of the object, if it were to exist as a loose object.</returns>\n        public FileInfo fileFor(AnyObjectId objectId)\n        {\n            if (objectId == null)\n                throw new ArgumentNullException(\"objectId\");\n\n            return fileFor(objectId.Name);\n        }\n\n        private FileInfo fileFor(string objectName)\n        {\n            string d = objectName.Slice(0, 2);\n            string f = objectName.Substring(2);\n            return new FileInfo(_objects.FullName + \"/\" + d + \"/\" + f);\n        }\n\n        /// <returns>\n        /// unmodifiable collection of all known pack files local to this\n        /// directory. Most recent packs are presented first. Packs most\n        /// likely to contain more recent objects appear before packs\n        /// containing objects referenced by commits further back in the\n        /// history of the repository.\n        /// </returns>\n        public ICollection<PackFile> getPacks()\n        {\n            PackFile[] packs = _packList.get().packs;\n            return new ReadOnlyCollection<PackFile>(packs);\n        }\n\n        /// <summary>\n        /// Add a single existing pack to the list of available pack files.\n        /// </summary>\n        /// <param name=\"pack\">Path of the pack file to open.</param>\n        /// <param name=\"idx\">Path of the corresponding index file.</param>\n        ///\t<exception cref=\"IOException\">\n        /// Index file could not be opened, read, or is not recognized as\n        /// a Git pack file index.\n        /// </exception>\n        public void openPack(FileInfo pack, FileInfo idx)\n        {\n            if (pack == null)\n                throw new ArgumentNullException(\"pack\");\n            if (idx == null)\n                throw new ArgumentNullException(\"idx\");\n\n            string p = pack.Name;\n            string i = idx.Name;\n\n            if (p.Length != 50 || !p.StartsWith(\"pack-\") || !p.EndsWith(IndexPack.PackSuffix))\n            {\n                throw new IOException(\"Not a valid pack \" + pack);\n            }\n\n            if (i.Length != 49 || !i.StartsWith(\"pack-\") || !i.EndsWith(IndexPack.IndexSuffix))\n            {\n                throw new IOException(\"Not a valid pack \" + idx);\n            }\n\n            if (!p.Slice(0, 45).Equals(i.Slice(0, 45)))\n            {\n                throw new IOException(\"Pack \" + pack + \"does not match index\");\n            }\n\n            InsertPack(new PackFile(idx, pack));\n        }\n\n        public override string ToString()\n        {\n            return \"ObjectDirectory[\" + getDirectory() + \"]\";\n        }\n\n        public override bool hasObject1(AnyObjectId objectId)\n        {\n            foreach (PackFile p in _packList.get().packs)\n            {\n                try\n                {\n                    if (p.HasObject(objectId))\n                    {\n                        return true;\n                    }\n                }\n                catch (IOException)\n                {\n                    // The hasObject call should have only touched the index,\n                    // so any failure here indicates the index is unreadable\n                    // by this process, and the pack is likewise not readable.\n                    //\n                    RemovePack(p);\n                    continue;\n                }\n            }\n\n            return false;\n        }\n\n        public override ObjectLoader openObject1(WindowCursor curs, AnyObjectId objectId)\n        {\n            PackList pList = _packList.get();\n\n            while (true)\n            {\n            SEARCH:\n                foreach (PackFile p in pList.packs)\n                {\n                    try\n                    {\n                        PackedObjectLoader ldr = p.Get(curs, objectId);\n                        if (ldr != null)\n                        {\n                            ldr.Materialize(curs);\n                            return ldr;\n                        }\n                    }\n                    catch (PackMismatchException)\n                    {\n                        // Pack was modified; refresh the entire pack list.\n                        //\n                        pList = ScanPacks(pList);\n                        goto SEARCH;\n                    }\n                    catch (IOException)\n                    {\n                        // Assume the pack is corrupted.\n                        //\n                        RemovePack(p);\n                    }\n                }\n\n                return null;\n            }\n        }\n\n        public override void OpenObjectInAllPacksImplementation(ICollection<PackedObjectLoader> @out, WindowCursor windowCursor, AnyObjectId objectId)\n        {\n            if (@out == null)\n                throw new ArgumentNullException(\"out\");\n\n            PackList pList = _packList.get();\n            while (true)\n            {\n            SEARCH:\n                foreach (PackFile p in pList.packs)\n                {\n                    try\n                    {\n                        PackedObjectLoader ldr = p.Get(windowCursor, objectId);\n                        if (ldr != null)\n                        {\n                            @out.Add(ldr);\n                        }\n                    }\n                    catch (PackMismatchException)\n                    {\n                        // Pack was modified; refresh the entire pack list.\n                        //\n                        pList = ScanPacks(pList);\n                        goto SEARCH;\n                    }\n                    catch (IOException)\n                    {\n                        // Assume the pack is corrupted.\n                        //\n                        RemovePack(p);\n                    }\n                }\n\n                break;\n            }\n        }\n\n        public override bool hasObject2(string objectName)\n        {\n            return fileFor(objectName).Exists;\n        }\n\n        public override ObjectLoader openObject2(WindowCursor curs, string objectName, AnyObjectId objectId)\n        {\n            try\n            {\n                return new UnpackedObjectLoader(fileFor(objectName), objectId);\n            }\n            catch (FileNotFoundException)\n            {\n                return null;\n            }\n            catch (DirectoryNotFoundException)\n            {\n                return null;\n            }\n        }\n\n        public override bool tryAgain1()\n        {\n            PackList old = _packList.get();\n            _packDirectory.Refresh();\n            if (old.tryAgain(_packDirectory.lastModified()))\n                return old != ScanPacks(old);\n\n            return false;\n        }\n\n        private void InsertPack(PackFile pf)\n        {\n            PackList o, n;\n            do\n            {\n                o = _packList.get();\n                PackFile[] oldList = o.packs;\n                var newList = new PackFile[1 + oldList.Length];\n                newList[0] = pf;\n                Array.Copy(oldList, 0, newList, 1, oldList.Length);\n                n = new PackList(o.lastRead, o.lastModified, newList);\n            } while (!_packList.compareAndSet(o, n));\n        }\n\n        private void RemovePack(PackFile deadPack)\n        {\n            PackList o, n;\n            do\n            {\n                o = _packList.get();\n                PackFile[] oldList = o.packs;\n                int j = indexOf(oldList, deadPack);\n                if (j < 0)\n                    break;\n                var newList = new PackFile[oldList.Length - 1];\n                Array.Copy(oldList, 0, newList, 0, j);\n                Array.Copy(oldList, j + 1, newList, j, newList.Length - j);\n                n = new PackList(o.lastRead, o.lastModified, newList);\n            } while (!_packList.compareAndSet(o, n));\n            deadPack.Dispose();\n        }\n\n        private static int indexOf(PackFile[] list, PackFile pack)\n        {\n            for (int i = 0; i < list.Length; i++)\n            {\n                if (list[i] == pack)\n                    return i;\n            }\n            return -1;\n        }\n\n        private PackList ScanPacks(PackList original)\n        {\n            lock (_packList)\n            {\n                PackList o, n;\n                do\n                {\n                    o = _packList.get();\n                    if (o != original)\n                    {\n                        // Another thread did the scan for us, while we\n                        // were blocked on the monitor above.\n                        //\n                        return o;\n                    }\n                    n = ScanPacksImpl(o);\n                    if (n == o)\n                        return n;\n                } while (!_packList.compareAndSet(o, n));\n\n                return n;\n            }\n        }\n\n        private PackList ScanPacksImpl(PackList old)\n        {\n            Dictionary<string, PackFile> forReuse = ReuseMap(old);\n            long lastRead = SystemReader.getInstance().getCurrentTime();\n            long lastModified = _packDirectory.lastModified();\n            HashSet<String> names = listPackDirectory();\n            var list = new List<PackFile>(names.Count >> 2);\n            bool foundNew = false;\n            foreach (string indexName in names)\n            {\n                // Must match \"pack-[0-9a-f]{40}.idx\" to be an index.\n                //\n                if (indexName.Length != 49 || !indexName.EndsWith(\".idx\"))\n                    continue;\n                string @base = indexName.Slice(0, indexName.Length - 4);\n                string packName = IndexPack.GetPackFileName(@base);\n\n                if (!names.Contains(packName))\n                {\n                    // Sometimes C Git's HTTP fetch transport leaves a\n                    // .idx file behind and does not download the .pack.\n                    // We have to skip over such useless indexes.\n                    //\n                    continue;\n                }\n                PackFile oldPack;\n                forReuse.TryGetValue(packName, out oldPack);\n                forReuse.Remove(packName);\n                if (oldPack != null)\n                {\n                    list.Add(oldPack);\n                    continue;\n                }\n\n                var packFile = new FileInfo(_packDirectory.FullName + \"/\" + packName);\n\n                var idxFile = new FileInfo(_packDirectory + \"/\" + indexName);\n                list.Add(new PackFile(idxFile, packFile));\n                foundNew = true;\n            }\n\n            // If we did not discover any new files, the modification time was not\n            // changed, and we did not remove any files, then the set of files is\n            // the same as the set we were given. Instead of building a new object\n            // return the same collection.\n            //\n            if (!foundNew && lastModified == old.lastModified && forReuse.isEmpty())\n                return old.updateLastRead(lastRead);\n\n            foreach (PackFile p in forReuse.Values)\n            {\n                p.Dispose();\n            }\n\n            if (list.Count == 0)\n            {\n                return new PackList(lastRead, lastModified, NoPacks.packs);\n            }\n\n            PackFile[] r = list.ToArray();\n            Array.Sort(r, PackFile.PackFileSortComparison);\n            return new PackList(lastRead, lastModified, r);\n        }\n\n        private static Dictionary<string, PackFile> ReuseMap(PackList old)\n        {\n            var forReuse = new Dictionary<string, PackFile>();\n            foreach (PackFile p in old.packs)\n            {\n                if (p.IsInvalid)\n                {\n                    // The pack instance is corrupted, and cannot be safely used\n                    // again. Do not include it in our reuse map.\n                    //\n                    p.Dispose();\n                    continue;\n                }\n\n                PackFile prior = forReuse[p.File.Name] = p;\n                if (prior != null)\n                {\n                    // This should never occur. It should be impossible for us\n                    // to have two pack files with the same name, as all of them\n                    // came out of the same directory. If it does, we promised to\n                    // close any PackFiles we did not reuse, so close the one we\n                    // just evicted out of the reuse map.\n                    //\n                    prior.Dispose();\n                }\n            }\n\n            return forReuse;\n        }\n\n        private HashSet<string> listPackDirectory()\n        {\n            {\n                var nameList = new List<string>(_packDirectory.GetFileSystemInfos().Select(x => x.Name));\n                if (nameList.Count == 0)\n                    return new HashSet<string>();\n                var nameSet = new HashSet<String>();\n                foreach (string name in nameList)\n                {\n                    if (name.StartsWith(\"pack-\"))\n                        nameSet.Add(name);\n                }\n                return nameSet;\n            }\n        }\n\n        protected override ObjectDatabase[] loadAlternates()\n        {\n            var l = new List<ObjectDatabase>(4);\n            if (_alternateObjectDir != null)\n            {\n                foreach (DirectoryInfo d in _alternateObjectDir)\n                {\n                    l.Add(openAlternate(d));\n                }\n            }\n            else\n            {\n                using (StreamReader br = Open(_alternatesFile))\n                {\n                    string line;\n                    while ((line = br.ReadLine()) != null)\n                    {\n                        l.Add(openAlternate(line));\n                    }\n                }\n            }\n\n            if (l.isEmpty())\n            {\n                return NoAlternates;\n            }\n\n            return l.ToArray();\n        }\n\n        private static StreamReader Open(FileSystemInfo f)\n        {\n            return new StreamReader(new FileStream(f.FullName, System.IO.FileMode.Open));\n        }\n\n        private ObjectDatabase openAlternate(string location)\n        {\n            var objdir = (DirectoryInfo)FS.resolve(_objects, location);\n            return openAlternate(objdir);\n        }\n\n        private ObjectDatabase openAlternate(DirectoryInfo objdir)\n        {\n            DirectoryInfo parent = objdir.Parent;\n            if (RepositoryCache.FileKey.isGitRepository(parent))\n            {\n                Repository db = RepositoryCache.open(RepositoryCache.FileKey.exact(parent));\n                return new AlternateRepositoryDatabase(db);\n            }\n            return new ObjectDirectory(objdir, null);\n        }\n\n        private class PackList\n        {\n            /// <summary>\n            /// Last wall-clock time the directory was read.\n            /// </summary>\n            private volatile LongWrapper _lastRead = new LongWrapper();\n            public long lastRead { get { return _lastRead.Value; } }\n\n            /// <summary>\n            /// Last modification time of <see cref=\"ObjectDirectory._packDirectory\"/>.\n            /// </summary>\n            public readonly long lastModified;\n\n            /// <summary>\n            /// All known packs, sorted by <see cref=\"PackFile.PackFileSortComparison\"/>.\n            /// </summary>\n            public readonly PackFile[] packs;\n\n            private bool cannotBeRacilyClean;\n\n            public PackList(long lastRead, long lastModified, PackFile[] packs)\n            {\n                this._lastRead.Value = lastRead;\n                this.lastModified = lastModified;\n                this.packs = packs;\n                this.cannotBeRacilyClean = notRacyClean(lastRead);\n            }\n\n            private bool notRacyClean(long read)\n            {\n                return read - lastModified > 2 * 60 * 1000L;\n            }\n\n            public PackList updateLastRead(long now)\n            {\n                if (notRacyClean(now))\n                    cannotBeRacilyClean = true;\n                _lastRead.Value = now;\n                return this;\n            }\n\n            public bool tryAgain(long currLastModified)\n            {\n                // Any difference indicates the directory was modified.\n                //\n                if (lastModified != currLastModified)\n                    return true;\n\n                // We have already determined the last read was far enough\n                // after the last modification that any new modifications\n                // are certain to change the last modified time.\n                //\n                if (cannotBeRacilyClean)\n                    return false;\n\n                if (notRacyClean(lastRead))\n                {\n                    // Our last read should have marked cannotBeRacilyClean,\n                    // but this thread may not have seen the change. The read\n                    // of the volatile field lastRead should have fixed that.\n                    //\n                    return false;\n                }\n\n                // We last read this directory too close to its last observed\n                // modification time. We may have missed a modification. Scan\n                // the directory again, to ensure we still see the same state.\n                //\n                return true;\n            }\n\n            private class LongWrapper\n            {\n                public LongWrapper()\n                {\n                    Value = -1;\n                }\n\n                public long Value { get; set; }\n            }\n        }\n\n        public override ObjectDatabase newCachedDatabase()\n        {\n            return new CachedObjectDirectory(this);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ObjectId.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\tpublic class ObjectId : AnyObjectId\n\t{\n\t\tprivate static readonly string ZeroIdString;\n\n\t\tstatic ObjectId()\n\t\t{\n\t\t\tZeroId = new ObjectId(0, 0, 0, 0, 0);\n\t\t\tZeroIdString = ZeroId.Name;\n\t\t}\n\n\t\tinternal ObjectId(int w1, int w2, int w3, int w4, int w5)\n\t\t\t: base(w1, w2, w3, w4, w5)\n\t\t{\n\t\t}\n\n\t\tpublic ObjectId(AnyObjectId src)\n\t\t\t: base(src)\n\t\t{\n\t\t}\n\n\t\tpublic static ObjectId ZeroId { get; private set; }\n\n\t\t///\t<summary>\n\t\t/// Test a string of characters to verify it is a hex format.\n\t\t///\t<para />\n\t\t///\tIf true the string can be parsed with <seealso cref=\"FromString(string)\"/>.\n\t\t///\t</summary>\n\t\t///\t<param name=\"id\">the string to test.</param>\n\t\t///\t<returns> true if the string can converted into an <see cref=\"ObjectId\"/>.\n\t\t/// </returns>\n\t\tpublic static bool IsId(string id)\n\t\t{\n            if (id.Length != Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n                for (int i = 0; i < Constants.OBJECT_ID_STRING_LENGTH; i++)\n                {\n                    RawParseUtils.parseHexInt4((byte)id[i]);\n                }\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Convert an ObjectId into a hex string representation.\n\t\t///\t</summary>\n\t\t///\t<param name=\"i\">The id to convert. May be null.</param>\n\t\t///\t<returns>The hex string conversion of this id's content.</returns>\n\t\tpublic static string ToString(ObjectId i)\n\t\t{\n\t\t\treturn i != null ? i.Name : ZeroIdString;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compare to object identifier byte sequences for equality.\n\t\t/// </summary>\n\t\t/// <param name=\"firstBuffer\">\n\t\t/// the first buffer to compare against. Must have at least 20\n\t\t/// bytes from position ai through the end of the buffer.\n\t\t/// </param>\n\t\t/// <param name=\"fi\">\n\t\t/// first offset within firstBuffer to begin testing.\n\t\t/// </param>\n\t\t/// <param name=\"secondBuffer\">\n\t\t/// the second buffer to compare against. Must have at least 2\n\t\t/// bytes from position bi through the end of the buffer.\n\t\t/// </param>\n\t\t/// <param name=\"si\">\n\t\t/// first offset within secondBuffer to begin testing.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// return true if the two identifiers are the same.\n\t\t/// </returns>\n\t\tpublic static bool Equals(byte[] firstBuffer, int fi, byte[] secondBuffer, int si)\n\t\t{\n\t\t\treturn firstBuffer[fi] == secondBuffer[si]\n\t\t\t\t   && firstBuffer[fi + 1] == secondBuffer[si + 1]\n\t\t\t\t   && firstBuffer[fi + 2] == secondBuffer[si + 2]\n\t\t\t\t   && firstBuffer[fi + 3] == secondBuffer[si + 3]\n\t\t\t\t   && firstBuffer[fi + 4] == secondBuffer[si + 4]\n\t\t\t\t   && firstBuffer[fi + 5] == secondBuffer[si + 5]\n\t\t\t\t   && firstBuffer[fi + 6] == secondBuffer[si + 6]\n\t\t\t\t   && firstBuffer[fi + 7] == secondBuffer[si + 7]\n\t\t\t\t   && firstBuffer[fi + 8] == secondBuffer[si + 8]\n\t\t\t\t   && firstBuffer[fi + 9] == secondBuffer[si + 9]\n\t\t\t\t   && firstBuffer[fi + 10] == secondBuffer[si + 10]\n\t\t\t\t   && firstBuffer[fi + 11] == secondBuffer[si + 11]\n\t\t\t\t   && firstBuffer[fi + 12] == secondBuffer[si + 12]\n\t\t\t\t   && firstBuffer[fi + 13] == secondBuffer[si + 13]\n\t\t\t\t   && firstBuffer[fi + 14] == secondBuffer[si + 14]\n\t\t\t\t   && firstBuffer[fi + 15] == secondBuffer[si + 15]\n\t\t\t\t   && firstBuffer[fi + 16] == secondBuffer[si + 16]\n\t\t\t\t   && firstBuffer[fi + 17] == secondBuffer[si + 17]\n\t\t\t\t   && firstBuffer[fi + 18] == secondBuffer[si + 18]\n\t\t\t\t   && firstBuffer[fi + 19] == secondBuffer[si + 19];\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Convert an ObjectId from raw binary representation.\n\t\t/// </summary>\n\t\t/// <param name=\"bs\">\n\t\t/// The raw byte buffer to read from. At least 20 bytes after <paramref name=\"offset\"/>\n\t\t/// must be available within this byte array.\n\t\t/// </param>\n\t\t///\t<param name=\"offset\">\n\t\t/// Position to read the first byte of data from.\n\t\t/// </param>\n\t\t///\t<returns>The converted object id.</returns>\n\t\tpublic static ObjectId FromString(byte[] bs, int offset)\n\t\t{\n\t\t\treturn FromHexString(bs, offset);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Convert an ObjectId from raw binary representation.\n\t\t/// </summary>\n\t\t/// <param name=\"str\">\n\t\t/// The raw byte buffer to read from. At least 20 bytes must be\n\t\t/// available within this byte array.\n\t\t/// </param>\n\t\t/// <returns> the converted object id. </returns>\n\t\tpublic static ObjectId FromString(string str)\n\t\t{\n            if (str.Length != Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t{\n                throw new ArgumentException(\"Invalid id: \" + str, \"str\");\n\t\t\t}\n\t\t\treturn FromHexString(Constants.encodeASCII(str), 0);\n\t\t}\n\n\t\tpublic static ObjectId FromHexString(byte[] bs, int p)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint a = RawParseUtils.parseHexInt32(bs, p);\n                int b = RawParseUtils.parseHexInt32(bs, p + 8);\n                int c = RawParseUtils.parseHexInt32(bs, p + 16);\n                int d = RawParseUtils.parseHexInt32(bs, p + 24);\n                int e = RawParseUtils.parseHexInt32(bs, p + 32);\n\t\t\t\treturn new ObjectId(a, b, c, d, e);\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException e)\n\t\t\t{\n                throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic override ObjectId ToObjectId()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic static ObjectId FromRaw(byte[] buffer)\n\t\t{\n\t\t\treturn FromRaw(buffer, 0);\n\t\t}\n\n\t\tpublic static ObjectId FromRaw(byte[] buffer, int offset)\n\t\t{\n\t\t\tint a = NB.DecodeInt32(buffer, offset);\n\t\t\tint b = NB.DecodeInt32(buffer, offset + 4);\n\t\t\tint c = NB.DecodeInt32(buffer, offset + 8);\n\t\t\tint d = NB.DecodeInt32(buffer, offset + 12);\n\t\t\tint e = NB.DecodeInt32(buffer, offset + 16);\n\t\t\treturn new ObjectId(a, b, c, d, e);\n\t\t}\n\n\t\tpublic static ObjectId FromRaw(int[] intbuffer)\n\t\t{\n\t\t\treturn FromRaw(intbuffer, 0);\n\t\t}\n\n\t\tpublic static ObjectId FromRaw(int[] intbuffer, int offset)\n\t\t{\n\t\t\treturn new ObjectId(intbuffer[offset], intbuffer[offset + 1], intbuffer[offset + 2], intbuffer[offset + 3],\n\t\t\t\t\t\t\t\tintbuffer[offset + 4]);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/ObjectIdRef.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Any reference whose peeled value is not yet known.\n    /// </summary>\n    public class Unpeeled : ObjectIdRef\n    {\n\n        /// <summary>\n        /// Create a new ref pairing.\n        /// </summary>\n        /// <param name=\"st\">method used to store this ref.</param>\n        /// <param name=\"name\">name of this ref.</param>\n        /// <param name=\"id\">\n        /// current value of the ref. May be null to indicate a ref that\n        /// does not exist yet.\n        /// </param>\n        public Unpeeled(Storage st, string name, ObjectId id)\n            : base(st, name, id)\n        {\n\n        }\n\n        public override ObjectId PeeledObjectId\n        {\n            get { return null; }\n        }\n\n        public override bool IsPeeled\n        {\n            get { return false; }\n        }\n    }\n\n    /// <summary>\n    /// An annotated tag whose peeled object has been cached.\n    /// </summary>\n    public class PeeledTag : ObjectIdRef\n    {\n        private readonly ObjectId _peeledObjectId;\n\n        /// <summary>\n        /// Create a new ref pairing.\n        /// </summary>\n        /// <param name=\"st\">method used to store this ref.</param>\n        /// <param name=\"name\">name of this ref.</param>\n        /// <param name=\"id\">\n        /// current value of the ref. \n        /// </param>\n        /// <param name=\"p\">the first non-tag object that tag {@code id} points to.</param>\n        public PeeledTag(Storage st, string name, ObjectId id, ObjectId p)\n            : base(st, name, id)\n        {\n\n            _peeledObjectId = p;\n        }\n\n        public override ObjectId PeeledObjectId\n        {\n            get { return _peeledObjectId; }\n        }\n\n        public override bool IsPeeled\n        {\n            get { return true; }\n        }\n    }\n\n    /// <summary>\n    /// A reference to a non-tag object coming from a cached source.\n    /// </summary>\n    public class PeeledNonTag : ObjectIdRef\n    {\n\n        /// <summary>\n        /// Create a new ref pairing.\n        /// </summary>\n        /// <param name=\"st\">method used to store this ref.</param>\n        /// <param name=\"name\">name of this ref.</param>\n        /// <param name=\"id\">\n        /// current value of the ref. May be null to indicate a ref that\n        /// does not exist yet.\n        /// </param>\n        public PeeledNonTag(Storage st, string name, ObjectId id)\n            : base(st, name, id)\n        {\n\n        }\n\n        public override ObjectId PeeledObjectId\n        {\n            get { return null; }\n        }\n\n        public override bool IsPeeled\n        {\n            get { return true; }\n        }\n    }\n\n    /// <summary>\n    /// A <see cref=\"Ref\"/> that points directly at an <see cref=\"ObjectId\"/>.\n    /// </summary>\n    public abstract class ObjectIdRef : Ref\n    {\n        private readonly string _name;\n        private readonly Storage _storage;\n        private readonly ObjectId _objectId;\n\n        /// <summary>\n        /// Create a new ref pairing.\n        /// </summary>\n        /// <param name=\"st\">method used to store this ref.</param>\n        /// <param name=\"name\">name of this ref.</param>\n        /// <param name=\"id\">\n        /// current value of the ref. May be null to indicate a ref that\n        /// does not exist yet.\n        /// </param>\n        protected ObjectIdRef(Storage st, string name, ObjectId id)\n        {\n            _name = name;\n            _storage = st;\n            _objectId = id;\n        }\n\n        public string Name\n        {\n            get { return _name; }\n        }\n\n        public bool IsSymbolic\n        {\n            get { return false; }\n        }\n\n        public Ref Leaf\n        {\n            get { return this; }\n        }\n\n        public Ref Target\n        {\n            get { return this; }\n        }\n\n        public ObjectId ObjectId\n        {\n            get { return _objectId; }\n        }\n\n        public abstract ObjectId PeeledObjectId { get; }\n\n        public abstract bool IsPeeled { get; }\n\n        public Storage StorageFormat\n        {\n            get { return _storage; }\n        }\n\n        public override string ToString()\n        {\n            var r = new StringBuilder();\n            r.Append(\"Ref[\");\n            r.Append(Name);\n            r.Append('=');\n            r.Append(ObjectId.ToString(ObjectId));\n            r.Append(']');\n            return r.ToString();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ObjectIdSubclassMap.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Fast, efficient map specifically for {@link ObjectId} subclasses.\n\t/// <para />\n\t/// This map provides an efficient translation from any ObjectId instance to a\n\t/// cached subclass of ObjectId that has the same value.\n\t/// <para />\n\t/// Raw value equality is tested when comparing two ObjectIds (or subclasses),\n\t/// not reference equality and not <code>.Equals(Object)</code> equality. This\n\t/// allows subclasses to override <code>Equals</code> to supply their own\n\t/// extended semantics.\n\t/// </summary>\n\t/// <typeparam name=\"TObject\">\n\t/// Type of subclass of ObjectId that will be stored in the map.\n\t/// </typeparam>\n\tpublic class ObjectIdSubclassMap<TObject> : HashSet<TObject>\n\t\twhere TObject : AnyObjectId\n\t{\n\t\tprivate static readonly IEqualityComparer<TObject> EqualityComparer = new AnyObjectId.AnyObjectIdEqualityComparer<TObject>();\n\n\t\tpublic ObjectIdSubclassMap()\n\t\t\t: base(EqualityComparer)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Lookup an existing mapping.\n\t\t/// </summary>\n\t\t/// <param name=\"toFind\">the object identifier to find.</param>\n\t\t/// <returns>the instance mapped to toFind, or null if no mapping exists.</returns>\n\t\tpublic TObject Get(AnyObjectId toFind)\n\t\t{\n\t\t\treturn this.SingleOrDefault(x => AnyObjectId.equals(toFind.ToObjectId(), x.ToObjectId()));\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/ObjectLoader.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Base class for a set of loaders for different representations of Git objects.\n\t/// New loaders are constructed for every object.\n\t/// </summary>\n    public abstract class ObjectLoader\n    {\n\t\t/// <summary>\n\t\t/// Git in pack object type, see <seealso cref=\"Constants\"/>.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic abstract int Type { get; protected set; }\n\n    \t/// <summary>\n    \t/// Size of object in bytes\n    \t/// </summary>\n    \t/// <returns></returns>\n\t\tpublic abstract long Size { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Obtain a copy of the bytes of this object.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"CachedBytes\"/> this method returns an array that might\n\t\t///\tbe modified by the caller.\n\t\t/// </summary>\n\t\t/// <returns>The bytes of this object.</returns>\n    \tpublic byte[] Bytes\n    \t{\n    \t\tget\n    \t\t{\n    \t\t\tbyte[] data = CachedBytes;\n    \t\t\tvar copy = new byte[data.Length];\n    \t\t\tArray.Copy(data, 0, copy, 0, data.Length);\n    \t\t\treturn copy;\n    \t\t}\n    \t}\n\n    \t/// <summary>\n    \t/// Obtain a reference to the (possibly cached) bytes of this object.\n    \t/// <para />\n    \t/// This method offers direct access to the internal caches, potentially\n    \t/// saving on data copies between the internal cache and higher level code.\n    \t/// Callers who receive this reference <b>must not</b> modify its contents.\n    \t/// Changes (if made) will affect the cache but not the repository itself.\n    \t/// </summary>\n    \t/// <returns>A copy of the cached bytes of this object.</returns>\n\t\tpublic abstract byte[] CachedBytes { get; protected set; }\n\n    \t/// <summary>\n    \t/// Raw object type from object header, as stored in storage (pack,\n    \t/// loose file). This may be different from <see cref=\"Type\"/> result\n\t\t/// for packs (see <see cref=\"Constants\"/>).\n    \t/// </summary>\n    \t/// <returns></returns>\n    \tpublic abstract int RawType { get; }\n\n    \t/// <summary>\n    \t/// Raw size of object from object header (pack, loose file).\n\t\t/// Interpretation of this value depends on <see cref=\"RawType\"/>.\n    \t/// </summary>\n    \t/// <returns></returns>\n    \tpublic abstract long RawSize { get; }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/ObjectType.cs",
    "content": "/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n\t[Serializable]\n\tpublic enum ObjectType\n\t{\n\t\t/// <summary>\n\t\t/// An unknown or invalid object type code.\n\t\t/// </summary>\n\t\tBad = -1,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: extended types.\n\t\t/// <para />\n\t\t/// This header code is reserved for future expansion. It is currently\n\t\t/// undefined/unsupported.\n\t\t/// </summary>\n\t\tExtension = 0,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: commit.\n\t\t/// <para />\n\t\t/// Indicates the associated object is a commit.\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// <seealso cref=\"Constants.TYPE_COMMIT\"/>\n\t\t/// </summary>\n\t\tCommit = 1,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: tree.\n\t\t/// <para />\n\t\t/// Indicates the associated object is a tree.\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// </summary>\n\t\t/// <seealso cref=\"Constants.TYPE_BLOB\"/>\n\t\tTree = 2,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: blob.\n\t\t/// <para />\n\t\t/// Indicates the associated object is a blob.\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// </summary>\n\t\t/// <seealso cref=\"Constants.TYPE_BLOB\"/>\n\t\tBlob = 3,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: annotated tag.\n\t\t/// <para />\n\t\t/// Indicates the associated object is an annotated tag.\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// </summary>\n\t\t/// <seealso cref=\"Constants.TYPE_TAG\"/>\n\t\tTag = 4,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: reserved for future use.\n\t\t/// </summary>\n\t\tObjectType5 = 5,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: offset delta\n\t\t/// <para />\n\t\t/// Objects stored with this type actually have a different type which must\n\t\t/// be obtained from their delta base object. Delta objects store only the\n\t\t/// changes needed to apply to the base object in order to recover the\n\t\t/// original object.\n\t\t/// <para />\n\t\t/// An offset delta uses a negative offset from the start of this object to\n\t\t/// refer to its delta base. The base object must exist in this packfile\n\t\t/// (even in the case of a thin pack).\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// </summary>\n\t\tOffsetDelta = 6,\n\n\t\t/// <summary>\n\t\t/// In-pack object type: reference delta\n\t\t/// <para />\n\t\t/// Objects stored with this type actually have a different type which must\n\t\t/// be obtained from their delta base object. Delta objects store only the\n\t\t/// changes needed to apply to the base object in order to recover the\n\t\t/// original object.\n\t\t/// <para />\n\t\t/// A reference delta uses a full object id (hash) to reference the delta\n\t\t/// base. The base object is allowed to be omitted from the packfile, but\n\t\t/// only in the case of a thin pack being transferred over the network.\n\t\t/// <para />\n\t\t/// <b>This constant is fixed and is defined by the Git packfile format.</b>\n\t\t/// </summary>\n\t\tReferenceDelta = 7,\n\n\t\tDeltaBase = 254,\n\n\t\tUnknown = 255\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/ObjectWriter.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\nusing ICSharpCode.SharpZipLib.Zip.Compression.Streams;\n\nnamespace GitSharp.Core\n{\n    public class ObjectWriter\n    {\n        // Fields\n        private static readonly byte[] HAuthor = Constants.encodeASCII(\"author\");\n        private static readonly byte[] HCommitter = Constants.encodeASCII(\"committer\");\n        private static readonly byte[] HEncoding = Constants.encodeASCII(\"encoding\");\n        private static readonly byte[] HParent = Constants.encodeASCII(\"parent\");\n        private static readonly byte[] HTree = Constants.encodeASCII(\"tree\");\n        private readonly byte[] _buf;\n        private readonly MessageDigest _md;\n        private readonly Repository _r;\n\n        ///\t<summary>\n        /// Construct an object writer for the specified repository.\n        /// </summary>\n        ///\t<param name=\"repo\"> </param>\n        public ObjectWriter(Repository repo)\n        {\n            _r = repo;\n            _buf = new byte[0x2000];\n            _md = Constants.newMessageDigest();\n        }\n\n        ///\t<summary>\n        /// Compute the SHA-1 of a blob without creating an object. This is for\n        ///\tfiguring out if we already have a blob or not.\n        ///\t</summary>\n        ///\t<param name=\"length\"> number of bytes to consume.</param>\n        ///\t<param name=\"input\"> stream for read blob data from.</param>\n        ///\t<returns>SHA-1 of a looked for blob.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId ComputeBlobSha1(long length, Stream input)\n        {\n            return WriteObject(ObjectType.Blob, length, input, false);\n        }\n\n        /// <summary>\n        /// Write a blob with the data in the specified file\n        /// </summary>\n        /// <param name=\"fileInfo\">A file containing blob data.</param>\n        ///\t<returns>SHA-1 of the blob.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteBlob(FileInfo fileInfo)\n        {\n            using (FileStream stream = fileInfo.OpenRead())\n            {\n                return WriteBlob(fileInfo.Length, stream);\n            }\n        }\n\n        ///\t<summary>\n        /// Write a blob with the specified data.\n        ///\t</summary>\n        ///\t<param name=\"b\">Bytes of the blob.</param>\n        ///\t<returns>SHA-1 of the blob.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteBlob(byte[] b)\n        {\n            return WriteBlob(b.Length, new MemoryStream(b));\n        }\n\n        ///\t<summary>\n        /// Write a blob with data from a stream\n        ///\t</summary>\n        ///\t<param name=\"len\">Number of bytes to consume from the stream.</param>\n        ///\t<param name=\"input\">Stream with blob data.</param>\n        ///\t<returns>SHA-1 of the blob.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteBlob(long len, Stream input)\n        {\n            return WriteObject(ObjectType.Blob, len, input, true);\n        }\n\n        ///\t<summary>\n        /// Write a canonical tree to the object database.\n        /// </summary>\n        /// <param name=\"buffer\">The canonical encoding of the tree object.</param>\n        ///\t<returns>SHA-1 of the tree.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteCanonicalTree(byte[] buffer)\n        {\n            return WriteTree(buffer.Length, new MemoryStream(buffer));\n        }\n\n        ///\t<summary>\n        /// Write a Commit to the object database\n        ///\t</summary>\n        ///\t<param name=\"c\">Commit to store.</param>\n        ///\t<returns>SHA-1 of the commit.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteCommit(Commit c)\n        {\n            Encoding encoding = c.Encoding ?? Constants.CHARSET;\n            var output = new MemoryStream();\n            var s = new BinaryWriter(output, encoding);\n            s.Write(HTree);\n            s.Write(' ');\n            c.TreeId.CopyTo(s);\n            s.Write('\\n');\n            ObjectId[] parentIds = c.ParentIds;\n            for (int i = 0; i < parentIds.Length; i++)\n            {\n                s.Write(HParent);\n                s.Write(' ');\n                parentIds[i].CopyTo(s);\n                s.Write('\\n');\n            }\n            s.Write(HAuthor);\n            s.Write(' ');\n            s.Write(c.Author.ToExternalString().ToCharArray());\n            s.Write('\\n');\n            s.Write(HCommitter);\n            s.Write(' ');\n            s.Write(c.Committer.ToExternalString().ToCharArray());\n            s.Write('\\n');\n\n            if (encoding != Constants.CHARSET)\n            {\n                s.Write(HEncoding);\n                s.Write(' ');\n                s.Write(Constants.encodeASCII(encoding.HeaderName.ToUpperInvariant()));\n                s.Write('\\n');\n            }\n\n            s.Write('\\n');\n            s.Write(c.Message.ToCharArray());\n\n            return WriteCommit(output.ToArray());\n        }\n\n        private ObjectId WriteCommit(byte[] b)\n        {\n            return WriteCommit(b.Length, new MemoryStream(b));\n        }\n\n        private ObjectId WriteCommit(long len, Stream input)\n        {\n            return WriteObject(ObjectType.Commit, len, input, true);\n        }\n\n        internal ObjectId WriteObject(ObjectType type, long len, Stream input, bool store)\n        {\n            FileInfo info;\n            DeflaterOutputStream stream;\n            FileStream stream2;\n            ObjectId objectId = null;\n            Deflater def = null;\n\n            if (store)\n            {\n                info = _r.ObjectsDirectory.CreateTempFile(\"noz\");\n                stream2 = info.OpenWrite();\n            }\n            else\n            {\n                info = null;\n                stream2 = null;\n            }\n\n            _md.Reset();\n            if (store)\n            {\n                def = new Deflater(_r.Config.getCore().getCompression());\n                stream = new DeflaterOutputStream(stream2, def);\n            }\n            else\n            {\n                stream = null;\n            }\n\n            try\n            {\n                int num;\n                byte[] bytes = Codec.EncodedTypeString(type);\n                _md.Update(bytes);\n                if (stream != null)\n                {\n                    stream.Write(bytes, 0, bytes.Length);\n                }\n\n                _md.Update(0x20);\n                if (stream != null)\n                {\n                    stream.WriteByte(0x20);\n                }\n\n                bytes = Constants.encodeASCII(len.ToString());\n                _md.Update(bytes);\n                if (stream != null)\n                {\n                    stream.Write(bytes, 0, bytes.Length);\n                }\n\n                _md.Update(0);\n                if (stream != null)\n                {\n                    stream.WriteByte(0);\n                }\n                while ((len > 0L) && ((num = input.Read(_buf, 0, (int)Math.Min(len, _buf.Length))) > 0))\n                {\n                    _md.Update(_buf, 0, num);\n                    if (stream != null)\n                    {\n                        stream.Write(_buf, 0, num);\n                    }\n                    len -= num;\n                }\n\n                if (len != 0L)\n                {\n                    throw new IOException(\"Input did not match supplied Length. \" + len + \" bytes are missing.\");\n                }\n\n                if (stream != null)\n                {\n                    stream.Close();\n                    if (info != null)\n                    {\n                        info.IsReadOnly = true;\n                    }\n                }\n                objectId = ObjectId.FromRaw(_md.Digest());\n            }\n            finally\n            {\n                if ((objectId == null) && (stream != null))\n                {\n                    try\n                    {\n                        stream.Close();\n                    }\n                    finally\n                    {\n                        info.DeleteFile();\n                    }\n\n                    if (def != null)\n                    {\n                        def.Finish();\n                    }\n                }\n            }\n            if (info != null)\n            {\n                if (_r.HasObject(objectId))\n                {\n                    // Object is already in the repository so remove\n                    // the temporary file.\n                    //\n                    info.DeleteFile();\n                }\n                else\n                {\n                    FileInfo info2 = _r.ToFile(objectId);\n                    if (!info.RenameTo(info2.FullName))\n                    {\n                        // Maybe the directory doesn't exist yet as the object\n                        // directories are always lazily created. Note that we\n                        // try the rename first as the directory likely does exist.\n                        //\n                        if (info2.Directory != null)\n                        {\n                            info2.Directory.Create();\n                        }\n                        if (!info.RenameTo(info2.FullName) && !_r.HasObject(objectId))\n                        {\n                            // The object failed to be renamed into its proper\n                            // location and it doesn't exist in the repository\n                            // either. We really don't know what went wrong, so\n                            // fail.\n                            //\n                            info.DeleteFile();\n                            throw new ObjectWritingException(\"Unable to create new object: \" + info2);\n                        }\n                    }\n                }\n            }\n            return objectId;\n        }\n\n        ///\t<summary>\n        /// Write an annotated Tag to the object database\n        ///\t</summary>\n        ///\t<param name=\"tag\">Tag</param>\n        ///\t<returns>SHA-1 of the tag.</returns>\n        ///\t<exception cref=\"IOException\"></exception>\n        public ObjectId WriteTag(Tag tag)\n        {\n            using (var output = new MemoryStream())\n            using (var s = new BinaryWriter(output))\n            {\n                s.Write(\"object \".ToCharArray());\n                tag.Id.CopyTo(s);\n                s.Write('\\n');\n                s.Write(\"type \".ToCharArray());\n                s.Write(tag.TagType.ToCharArray());\n                s.Write('\\n');\n                s.Write(\"tag \".ToCharArray());\n                s.Write(tag.TagName.ToCharArray());\n                s.Write('\\n');\n                s.Write(\"tagger \".ToCharArray());\n                s.Write(tag.Author.ToExternalString().ToCharArray());\n                s.Write('\\n');\n                s.Write('\\n');\n                s.Write(tag.Message.ToCharArray());\n\n                return WriteTag(output.ToArray());\n            }\n        }\n\n        private ObjectId WriteTag(byte[] b)\n        {\n            return WriteTag(b.Length, new MemoryStream(b));\n        }\n\n        private ObjectId WriteTag(long len, Stream input)\n        {\n            return WriteObject(ObjectType.Tag, len, input, true);\n        }\n\n        public ObjectId WriteTree(Tree t)\n        {\n            var output = new MemoryStream();\n            var writer = new BinaryWriter(output);\n            foreach (TreeEntry entry in t.Members)\n            {\n                ObjectId id = entry.Id;\n                if (id == null)\n                {\n                    throw new ObjectWritingException(\"object at path \\\"\" + entry.FullName +\n                                                     \"\\\" does not have an id assigned.  All object ids must be assigned prior to writing a tree.\");\n                }\n                entry.Mode.CopyTo(output);\n                writer.Write((byte)0x20);\n                writer.Write(entry.NameUTF8);\n                writer.Write((byte)0);\n                id.copyRawTo(output);\n            }\n            return WriteCanonicalTree(output.ToArray());\n        }\n\n        private ObjectId WriteTree(long len, Stream input)\n        {\n            return WriteObject(ObjectType.Tree, len, input, true);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/OffsetCache.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Least frequently used cache for objects specified by PackFile positions.\n\t/// <para />\n\t/// This cache maps a <code>(PackFile, position)</code> tuple to an object.\n\t/// <para />\n\t/// This cache is suitable for objects that are \"relative expensive\" to compute\n\t/// from the underlying PackFile, given some known position in that file.\n\t/// <para />\n\t/// Whenever a cache miss occurs, <see cref=\"load(PackFile, long)\"/> is invoked by\n\t/// exactly one thread for the given <code>(PackFile,position)</code> key tuple.\n\t/// This is ensured by an array of _locks, with the tuple hashed to a @lock instance.\n\t/// <para />\n\t/// During a miss, older entries are evicted from the cache so long as\n\t/// <see cref=\"isFull\"/> returns true.\n\t/// <para />\n\t/// Its too expensive during object access to be 100% accurate with a least\n\t/// recently used (LRU) algorithm. Strictly ordering every read is a lot of\n\t/// overhead that typically doesn't yield a corresponding benefit to the\n\t/// application.\n\t/// <para />\n\t/// This cache : a loose LRU policy by randomly picking a window\n\t/// comprised of roughly 10% of the cache, and evicting the oldest accessed entry\n\t/// within that window.\n\t/// <para />\n\t/// Entities created by the cache are held under SoftReferences, permitting the\n\t/// Java runtime's garbage collector to evict entries when heap memory gets low.\n\t/// Most JREs implement a loose least recently used algorithm for this eviction.\n\t/// <para />\n\t/// The internal hash table does not expand at runtime, instead it is fixed in\n\t/// size at cache creation time. The internal @lock table used to gate load\n\t/// invocations is also fixed in size.\n\t/// <para />\n\t/// The key tuple is passed through to methods as a pair of parameters rather\n\t/// than as a single object, thus reducing the transient memory allocations of\n\t/// callers. It is more efficient to avoid the allocation, as we can't be 100%\n\t/// sure that a JIT would be able to stack-allocate a key tuple.\n\t/// <para />\n\t/// This cache has an implementation rule such that:\n\t/// <list>\n\t/// <item><see cref=\"load(PackFile, long)\"/> is invoked by at most one thread at a time\n\t/// for a given <code>(PackFile, position)</code> tuple.\n\t/// </item><item>For every <code>load()</code> invocation there is exactly one\n\t/// <see cref=\"createRef(PackFile, long, V)\"/> invocation to wrap a SoftReference\n\t/// around the cached entity.\n\t/// </item><item>For every Reference created by <code>createRef()</code> there will be\n\t/// exactly one call to <see cref=\"clear(R)\"/> to cleanup any resources associated\n\t/// with the (now expired) cached entity.\n\t/// </item>\n\t/// </list>\n\t/// <para />\n\t/// Therefore, it is safe to perform resource accounting increments during the\n\t/// <see cref=\"load(PackFile, long)\"/> or <see cref=\"createRef(PackFile, long, V)\"/>\n\t/// methods, and matching decrements during <see cref=\"clear(R)\"/>. Implementors may\n\t/// need to override <see cref=\"createRef(PackFile, long, V)\"/> in order to embed\n\t/// additional accounting information into an implementation specific\n\t/// <typeparamref name=\"V\"/> subclass, as the cached entity may have already been\n\t/// evicted by the JRE's garbage collector.\n\t/// <para />\n\t/// To maintain higher concurrency workloads, during eviction only one thread\n\t/// performs the eviction work, while other threads can continue to insert new\n\t/// objects in parallel. This means that the cache can be temporarily over limit,\n\t/// especially if the nominated eviction thread is being starved relative to the\n\t/// other threads.\n\t/// </summary>\n\t/// <typeparam name=\"V\">Type of value stored in the cache.</typeparam>\n\t/// <typeparam name=\"R\">\n\t/// Subtype of <typeparamref name=\"R\"/> subclass used by the cache.\n\t/// </typeparam>\n\tinternal abstract class OffsetCache<V, R>\n\t\twhere R : OffsetCache<V, R>.Ref<V>\n\t\twhere V : class\n\t{\n\t\t// [ammachado] .NET Random is not thread safe\n\t\tprivate static readonly Random Rng = new Random();\n\n\t\t/// <summary>\n\t\t/// Queue that <see cref=\"createRef(PackFile, long, V)\"/> must use.\n\t\t/// </summary>\n\t\tinternal Queue queue;\n\n\t\t/// <summary>\n\t\t/// Number of entries in <see cref=\"_table\"/>.\n\t\t/// </summary>\n\t\tprivate readonly int _tableSize;\n\n\t\t/// <summary>\n\t\t/// Access clock for loose LRU.\n\t\t/// </summary>\n\t\tprivate readonly AtomicLong _clock;\n\n\t\t/// <summary>\n\t\t/// Hash bucket directory; entries are chained below.\n\t\t/// </summary>\n\t\tprivate readonly AtomicReferenceArray<Entry<V>> _table;\n\n\t\t/// <summary>\n\t\t/// Locks to prevent concurrent loads for same (PackFile, position).\n\t\t/// </summary>\n\t\tprivate readonly LockTarget[] _locks;\n\n\t\t/// <summary>\n\t\t/// Lock to elect the eviction thread after a load occurs.\n\t\t/// </summary>\n\t\tprivate readonly AutoResetEvent _evictLock;\n\n\t\t/// <summary>\n\t\t/// Number of <see cref=\"_table\"/> buckets to scan for an eviction window.\n\t\t/// </summary>\n\t\tprivate readonly int _evictBatch;\n\n\t\t/// <summary>\n\t\t/// Create a new cache with a fixed size entry table and @Lock table.\n\t\t/// </summary>\n\t\t/// <param name=\"tSize\">number of entries in the entry hash table.</param>\n\t\t/// <param name=\"lockCount\">\n\t\t/// number of entries in the <see cref=\"LockTarget\"/> table. This is the maximum\n\t\t/// concurrency rate for creation of new objects through\n\t\t/// <see cref=\"load(PackFile, long)\"/> invocations.\n\t\t/// </param>\n\t\tinternal OffsetCache(int tSize, int lockCount)\n\t\t{\n\t\t\tif (tSize < 1)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"tSize must be >= 1\");\n\t\t\t}\n\n\t\t\tif (lockCount < 1)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"lockCount must be >= 1\");\n\t\t\t}\n\n\t\t\tqueue = new Queue();\n\t\t\t_tableSize = tSize;\n\t\t\t_clock = new AtomicLong(1);\n\t\t\t_table = new AtomicReferenceArray<Entry<V>>(_tableSize);\n\t\t\t_locks = new LockTarget[lockCount];\n\n\t\t\tfor (int i = 0; i < _locks.Length; i++)\n\t\t\t{\n\t\t\t\t_locks[i] = new LockTarget();\n\t\t\t}\n\n\t\t\t_evictLock = new AutoResetEvent(true);\n\n\t\t\tvar eb = (int)(_tableSize * .1);\n\n\t\t\tif (64 < eb)\n\t\t\t{\n\t\t\t\teb = 64;\n\t\t\t}\n\t\t\telse if (eb < 4)\n\t\t\t{\n\t\t\t\teb = 4;\n\t\t\t}\n\n\t\t\tif (_tableSize < eb)\n\t\t\t{\n\t\t\t\teb = _tableSize;\n\t\t\t}\n\n\t\t\t_evictBatch = eb;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Lookup a cached object, creating and loading it if it doesn't exist.\n\t\t/// </summary>\n\t\t/// <param name=\"pack\">the pack that \"contains\" the cached object.</param>\n\t\t/// <param name=\"position\">offset within <paramref name=\"pack\"/> of the object.</param>\n\t\t/// <returns>The object reference.</returns>\n\t\t/// <exception cref=\"Exception\">\n\t\t/// The object reference was not in the cache and could not be\n\t\t/// obtained by <see cref=\"load(PackFile, long)\"/>\n\t\t/// </exception>\n\t\tinternal V getOrLoad(PackFile pack, long position)\n\t\t{\n\t\t\tint slot = this.Slot(pack, position);\n\t\t\tEntry<V> e1 = _table.get(slot);\n\t\t\tV v = Scan(e1, pack, position);\n\t\t\tif (v != null)\n\t\t\t\treturn v;\n\n\t\t\tlock (Lock(pack, position))\n\t\t\t{\n\t\t\t\tEntry<V> e2 = _table.get(slot);\n\t\t\t\tif (e2 != e1)\n\t\t\t\t{\n\t\t\t\t\tv = Scan(e2, pack, position);\n\t\t\t\t\tif (v != null)\n\t\t\t\t\t\treturn v;\n\t\t\t\t}\n\n\t\t\t\tv = load(pack, position);\n\t\t\t\tRef<V> @ref = createRef(pack, position, v);\n\t\t\t\tHit(@ref);\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tvar n = new Entry<V>(Clean(e2), @ref);\n\t\t\t\t\tif (_table.compareAndSet(slot, e2, n)) break;\n\t\t\t\t\te2 = _table.get(slot);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (_evictLock.WaitOne())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tGc();\n\t\t\t\t\tEvict();\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\t_evictLock.Set();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn v;\n\t\t}\n\n\t\tprivate V Scan(Entry<V> n, PackFile pack, long position)\n\t\t{\n\t\t\tfor (; n != null; n = n.Next)\n\t\t\t{\n\t\t\t\tRef<V> r = n.Ref;\n\t\t\t\tif (r.pack == pack && r.position == position)\n\t\t\t\t{\n\t\t\t\t\tV v = r.get();\n\t\t\t\t\tif (v != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tHit(r);\n\t\t\t\t\t\treturn v;\n\t\t\t\t\t}\n\t\t\t\t\tn.Kill();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate void Hit(Ref<V> r)\n\t\t{\n\t\t\t// We don't need to be 100% accurate here. Its sufficient that at least\n\t\t\t// one thread performs the increment. Any other concurrent access at\n\t\t\t// exactly the same time can simply use the same clock value.\n\t\t\t//\n\t\t\t// Consequently we attempt the set, but we don't try to recover should\n\t\t\t// it fail. This is why we don't use getAndIncrement() here.\n\t\t\t//\n\t\t\tlong c = _clock.get();\n\t\t\t_clock.compareAndSet(c, c + 1);\n\t\t\tr.lastAccess = c;\n\t\t}\n\n        private void Evict()\n        {\n            while (isFull())\n            {\n                int ptr = Rng.Next(_tableSize);\n                Entry<V> old = null;\n                int slot = 0;\n                for (int b = _evictBatch - 1; b >= 0; b--, ptr++)\n                {\n                    if (_tableSize <= ptr)\n                        ptr = 0;\n                    for (Entry<V> e = _table.get(ptr); e != null; e = e.Next)\n                    {\n                        if (e.Dead)\n                            continue;\n\n                        if (old == null || e.Ref.lastAccess < old.Ref.lastAccess)\n                        {\n                            old = e;\n                            slot = ptr;\n                        }\n                    }\n                }\n\n                if (old != null)\n                {\n                    old.Kill();\n                    Gc();\n                    Entry<V> e1 = _table.get(slot);\n                    _table.compareAndSet(slot, e1, Clean(e1));\n                }\n            }\n        }\n\n\t    /// <summary>\n\t\t/// Clear every entry from the cache.\n\t\t/// <para />\n\t\t/// This is a last-ditch effort to clear out the cache, such as before it\n\t\t/// gets replaced by another cache that is configured differently. This\n\t\t/// method tries to force every cached entry through <see cref=\"clear(R)\"/> to\n\t\t/// ensure that resources are correctly accounted for and cleaned up by the\n\t\t/// subclass. A concurrent reader loading entries while this method is\n\t\t/// running may cause resource accounting failures.\n\t\t/// </summary>\n\t\tinternal void removeAll()\n\t\t{\n\t\t\tfor (int s = 0; s < _tableSize; s++)\n\t\t\t{\n\t\t\t\tEntry<V> e1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\te1 = _table.get(s);\n\t\t\t\t\tfor (Entry<V> e = e1; e != null; e = e.Next)\n\t\t\t\t\t{\n\t\t\t\t\t\te.Kill();\n\t\t\t\t\t}\n\t\t\t\t} while (!_table.compareAndSet(s, e1, null));\n\t\t\t}\n\n\t\t\tGc();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Clear all entries related to a single file.\n\t\t/// <para />\n\t\t/// Typically this method is invoked during <see cref=\"PackFile.Close()\"/>, when we\n\t\t/// know the pack is never going to be useful to us again (for example, it no\n\t\t/// longer exists on disk). A concurrent reader loading an entry from this\n\t\t/// same pack may cause the pack to become stuck in the cache anyway.\n\t\t/// </summary>\n\t\t/// <param name=\"pack\">the file to purge all entries of.</param>\n\t\tinternal void removeAll(PackFile pack)\n\t\t{\n\t\t\tfor (int s = 0; s < _tableSize; s++)\n\t\t\t{\n\t\t\t\tEntry<V> e1 = _table.get(s);\n\t\t\t\tbool hasDead = false;\n\t\t\t\tfor (Entry<V> e = e1; e != null; e = e.Next)\n\t\t\t\t{\n\t\t\t\t\tif (e.Ref.pack == pack)\n\t\t\t\t\t{\n\t\t\t\t\t\te.Kill();\n\t\t\t\t\t\thasDead = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (e.Dead)\n\t\t\t\t\t\thasDead = true;\n\t\t\t\t}\n\t\t\t\tif (hasDead)\n\t\t\t\t\t_table.compareAndSet(s, e1, Clean(e1));\n\t\t\t}\n\t\t\tGc();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Materialize an object that doesn't yet exist in the cache.\n\t\t/// <para />\n\t\t/// This method is invoked by <see cref=\"getOrLoad(PackFile, long)\"/> when the\n\t\t/// specified entity does not yet exist in the cache. Internal locking\n\t\t/// ensures that at most one thread can call this method for each unique\n\t\t/// <code>(pack,position)</code>, but multiple threads can call this method\n\t\t/// concurrently for different <code>(pack,position)</code> tuples.\n\t\t/// </summary>\n\t\t/// <param name=\"pack\">The file to materialize the entry from.</param>\n\t\t/// <param name=\"position\">Offset within the file of the entry.</param>\n\t\t/// <returns> the materialized object. Must never be null.</returns>\n\t\t/// <exception cref=\"Exception\">\n\t\t/// The method was unable to materialize the object for this\n\t\t/// input pair. The usual reasons would be file corruption, file\n\t\t/// not found, out of file descriptors, etc.\n\t\t/// </exception>\n\t\tinternal abstract V load(PackFile pack, long position);\n\n\t\t/// <summary>\n\t\t/// Construct a Ref (SoftReference) around a cached entity.\n\t\t/// <para />\n\t\t/// Implementing this is only necessary if the subclass is performing\n\t\t/// resource accounting during <see cref=\"load(PackFile, long)\"/> and\n\t\t/// <see cref=\"clear(R)\"/> requires some information to update the accounting.\n\t\t/// <para />\n\t\t/// Implementors <b>MUST</b> ensure that the returned reference uses the\n\t\t/// <see cref=\"queue\">Queue</see>, otherwise <see cref=\"clear(R)\"/> will not be\n\t\t/// invoked at the proper time.\n\t\t/// </summary>\n\t\t/// <param name=\"pack\">The file to materialize the entry from.</param>\n\t\t/// <param name=\"position\">Offset within the file of the entry.</param>\n\t\t/// <param name=\"v\">\n\t\t/// The object returned by <see cref=\"load(PackFile, long)\"/>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// A weak reference subclass wrapped around <typeparamref name=\"V\"/>.\n\t\t/// </returns>\n\t\tinternal virtual R createRef(PackFile pack, long position, V v)\n\t\t{\n\t\t\treturn (R)new Ref<V>(pack, position, v, queue);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Update accounting information now that an object has left the cache.\n\t\t/// <para />\n\t\t/// This method is invoked exactly once for the combined\n\t\t/// <see cref=\"load(PackFile, long)\"/> and\n\t\t/// <see cref=\"createRef(PackFile, long, V)\"/> invocation pair that was used\n\t\t/// to construct and insert an object into the cache.\n\t\t/// </summary>\n\t\t/// <param name=\"ref\">\n\t\t/// the reference wrapped around the object. Implementations must\n\t\t/// be prepared for <code>@ref.get()</code> to return null.\n\t\t/// </param>\n\t\tinternal virtual void clear(R @ref)\n\t\t{\n\t\t\t// Do nothing by default.\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if the cache is full and requires eviction of entries.\n\t\t/// <para />\n\t\t/// By default this method returns false. Implementors may override to\n\t\t/// consult with the accounting updated by <see cref=\"load(PackFile, long)\"/>,\n\t\t/// <see cref=\"createRef(PackFile, long, V)\"/> and <see cref=\"clear(R)\"/>.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True if the cache is still over-limit and requires eviction of\n\t\t/// more entries.\n\t\t/// </returns>\n\t\tinternal virtual bool isFull()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate void Gc()\n\t\t{\n\t\t\tR r;\n\n\t\t\twhile (queue.Count > 0)\n\t\t\t{\n\t\t\t\tr = (R)queue.Dequeue();\n\t\t\t\t// Sun's Java 5 and 6 implementation have a bug where a Reference\n\t\t\t\t// can be enqueued and dequeued twice on the same reference queue\n\t\t\t\t// due to a race condition within Queue.enqueue(Reference).\n\t\t\t\t//\n\t\t\t\t// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6837858\n\t\t\t\t//\n\t\t\t\t// We CANNOT permit a Reference to come through us twice, as it will\n\t\t\t\t// skew the resource counters we maintain. Our canClear() check here\n\t\t\t\t// provides a way to skip the redundant dequeues, if any.\n\t\t\t\t//\n\t\t\t\tif (!r.canClear()) continue;\n\n\t\t\t\tclear(r);\n\n\t\t\t\tbool found = false;\n\t\t\t\tint s = Slot(r.pack, r.position);\n\t\t\t\tEntry<V> e1 = _table.get(s);\n\n\t\t\t\tfor (Entry<V> n = e1; n != null; n = n.Next)\n\t\t\t\t{\n\t\t\t\t\tif (!n.Ref.Equals(r)) continue;\n\n\t\t\t\t\t//n.Dead = true;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (found)\n\t\t\t\t{\n\t\t\t\t\t_table.compareAndSet(s, e1, Clean(e1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compute the hash code value for a <code>(PackFile,position)</code> tuple.\n\t\t/// <para />\n\t\t/// For example, <code>return packHash + (int) (position >>> 4)</code>.\n\t\t/// Implementors must override with a suitable hash (for example, a different\n\t\t/// right shift on the position).\n\t\t/// </summary>\n\t\t/// <param name=\"packHash\">hash code for the file being accessed.</param>\n\t\t/// <param name=\"position\">position within the file being accessed.</param>\n\t\t/// <returns>a reasonable hash code mixing the two values.</returns>\n\t\tinternal abstract int hash(int packHash, long position);\n\n\t\tprivate int Slot(PackFile pack, long position)\n\t\t{\n\t\t\treturn (int)((uint)hash(pack.Hash, position) >> 1) % _tableSize;\n\t\t}\n\n\t\tprivate LockTarget Lock(PackFile pack, long position)\n\t\t{\n\t\t\treturn _locks[(int)((uint)hash(pack.Hash, position) >> 1) % _locks.Length];\n\t\t}\n\n\t\tprivate static Entry<V> Clean(Entry<V> top)\n\t\t{\n\t\t\twhile (top != null && top.Dead)\n\t\t\t{\n\t\t\t\ttop.Ref.enqueue();\n\t\t\t\ttop = top.Next;\n\t\t\t}\n\t\t\tif (top == null) return null;\n\n\t\t\tEntry<V> n = Clean(top.Next);\n\t\t\treturn n == top.Next ? top : new Entry<V>(n, top.Ref);\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class Entry<T>\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Next entry in the hash table's chain list.\n\t\t\t/// </summary>\n\t\t\tpublic readonly Entry<T> Next;\n\n\t\t\t/// <summary>\n\t\t\t/// The referenced object.\n\t\t\t/// </summary>\n\t\t\tpublic readonly Ref<T> Ref;\n\n\t\t    /// <summary>\n\t\t    /// Marked true when <see cref=\"Ref\"/> returns null and the <see cref=\"Ref\"/> \n\t\t    /// is garbage collected.\n\t\t    /// <para />\n\t\t    /// A true here indicates that the @ref is no longer accessible, and that\n\t\t    /// we therefore need to eventually purge this Entry object out of the\n\t\t    /// bucket's chain.\n\t\t    /// </summary>\n\t\t    public bool Dead;\n\n\t\t\tpublic Entry(Entry<T> n, Ref<T> r)\n\t\t\t{\n\t\t\t\tNext = n;\n\t\t\t\tRef = r;\n\t\t\t}\n\n\t\t\tpublic void Kill()\n\t\t\t{\n\t\t\t    Dead = true;\n\t\t\t\tRef.enqueue();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// A <see cref=\"WeakReference\"/> wrapped around a cached object.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">Type of the cached object.</typeparam>\n\t\tinternal class Ref<T> : WeakReference\n\t\t{\n\t\t\tprivate readonly Queue _queue;\t\n\t\t\tprivate Object locker = new Object();\n\n\t\t\tpublic Ref(PackFile pack, long position, T v, Queue queue)\n\t\t\t\t: base(v)\n\t\t\t{\n\t\t\t\t_queue = queue;\n\t\t\t\tthis.pack = pack;\n\t\t\t\tthis.position = position;\n\t\t\t}\n\n\t\t\tpublic PackFile pack;\n\t\t\tpublic long position;\n\t\t\tpublic long lastAccess;\n\t\t\tprivate bool cleared;\n\n\t\t\tpublic bool enqueue()\n\t\t\t{\n\t\t\t\tif (_queue.Contains(this)) return false;\n\t\t\t\t_queue.Enqueue(this);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic bool canClear()\n\t\t\t{\n\t\t\t\tlock(locker)\n\t\t\t\t{\n\t\t\t\t\tif (cleared)\n\t                    return false;\n\t\t\t\t\tcleared = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic T get()\n\t\t\t{\n\t\t\t\treturn (T)Target;\n\t\t\t}\n\t\t}\n\n\t\tprivate class LockTarget\n\t\t{\n\t\t\t// Used only as target for locking\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PackFile.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A Git version 2 pack file representation. A pack file contains Git objects in\n\t/// delta packed format yielding high compression of lots of object where some\n\t/// objects are similar.\n\t/// </summary>\n\tpublic class PackFile : IEnumerable<PackIndex.MutableEntry>, IDisposable\n\t{\n\t\t/// <summary>\n\t\t/// Sorts PackFiles to be most recently created to least recently created.\n\t\t/// </summary>\n\t\tinternal static readonly Comparison<PackFile> PackFileSortComparison = (a, b) => b._packLastModified - a._packLastModified;\n\n\t\tprivate readonly FileInfo _idxFile;\n\t\tprivate readonly FileInfo _packFile;\n\t\tprivate readonly int _hash;\n\t\tprivate readonly int _packLastModified;\n\n\t\tprivate FileStream _fd;\n\t\tprivate int _activeWindows;\n\t\tprivate int _activeCopyRawData;\n\t\t\n\t\tprivate volatile bool _invalid;\n\t\tprivate byte[] _packChecksum;\n\t\tprivate PackIndex _loadedIdx;\n\t\tprivate PackReverseIndex _reverseIdx;\n\t\t\n\t\tprivate Object locker = new Object();\n\n\t\t/// <summary>\n\t\t/// Construct a Reader for an existing, pre-indexed packfile.\n\t\t/// </summary>\n\t\t/// <param name=\"idxFile\">path of the <code>.idx</code> file listing the contents.</param>\n\t\t/// <param name=\"packFile\">path of the <code>.pack</code> file holding the data.</param>\n\t\tpublic PackFile(FileInfo idxFile, FileInfo packFile)\n\t\t{\n\t\t\t_idxFile = idxFile;\n\t\t\t_packFile = packFile;\n\n\t\t\t// [henon] why the heck right shift by 10 ?? ... seems to have to do with the SORT comparison\n\t\t\t_packLastModified = (int)(packFile.lastModified() >> 10);\n\n\t\t\t// Multiply by 31 here so we can more directly combine with another\n\t\t\t// value in WindowCache.hash(), without doing the multiply there.\n\t\t\t//\n\t\t\t_hash = GetHashCode() * 31;\n\n\t\t\tLength = long.MaxValue;\n\t\t}\n\n\t\tprivate PackIndex LoadPackIndex()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tif (_loadedIdx == null)\n\t\t\t\t{\n\t\t\t\t\tif (_invalid)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new PackInvalidException(_packFile.FullName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tPackIndex idx = PackIndex.Open(_idxFile);\n\n\t\t\t\t\t\tif (_packChecksum == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_packChecksum = idx.PackChecksum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (_packChecksum.SequenceEqual(idx.PackChecksum))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new PackMismatchException(\"Pack checksum mismatch\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_loadedIdx = idx;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\t_invalid = true;\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn _loadedIdx;\n\t\t}\n\n\t\t/// <summary>\n\t\t///\n\t\t/// </summary>\n\t\t/// <param name=\"windowCursor\"></param>\n\t\t/// <param name=\"offset\"></param>\n\t\t/// <returns>\n\t\t/// The file object which locates this pack on disk.\n\t\t/// </returns>\n\t\tinternal PackedObjectLoader ResolveBase(WindowCursor windowCursor, long offset)\n\t\t{\n\t\t\treturn Reader(windowCursor, offset);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The <see cref=\"FileInfo\"/> object which locates this pack on disk.\n\t\t/// </summary>\n\t\tpublic FileInfo File\n\t\t{\n\t\t\tget { return _packFile; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// * Determine if an object is contained within the pack file.\n\t\t/// <para>\n\t\t/// For performance reasons only the index file is searched; the main pack\n\t\t/// content is ignored entirely.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <param name=\"id\">The object to look for. Must not be null.</param>\n\t\t/// <returns>True if the object is in this pack; false otherwise.</returns>\n\t\tpublic bool HasObject(AnyObjectId id)\n\t\t{\n\t\t\treturn LoadPackIndex().HasObject(id);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get an object from this pack.\n\t\t/// </summary>\n\t\t/// <param name=\"curs\">temporary working space associated with the calling thread.</param>\n\t\t/// <param name=\"id\">the object to obtain from the pack. Must not be null.</param>\n\t\t/// <returns>\n\t\t/// The object loader for the requested object if it is contained in\n\t\t/// this pack; null if the object was not found.\n\t\t/// </returns>\n\t\tpublic PackedObjectLoader Get(WindowCursor curs, AnyObjectId id)\n\t\t{\n\t\t\tlong offset = LoadPackIndex().FindOffset(id);\n\t\t\treturn 0 < offset ? Reader(curs, offset) : null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Close the resources utilized by this repository.\n\t\t/// </summary>\n\t\tpublic void Close()\n\t\t{\n\t\t\tUnpackedObjectCache.purge(this);\n\t\t\tWindowCache.Purge(this);\n\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\t_loadedIdx = null;\n\t\t\t\t_reverseIdx = null;\n\t\t\t}\n\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n\t\t}\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~PackFile()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: {\" + _packFile.FullName + \"}/{\" + _idxFile.FullName + \"}\");\n        }\n#endif\n\t\t#region IEnumerable Implementation\n\n\t\tpublic IEnumerator<PackIndex.MutableEntry> GetEnumerator()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn LoadPackIndex().GetEnumerator();\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\treturn new List<PackIndex.MutableEntry>().GetEnumerator();\n\t\t\t}\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\n\t\t///\t<summary>\n\t\t/// Obtain the total number of objects available in this pack. This method\n\t\t///\trelies on pack index, giving number of effectively available objects.\n\t\t/// </summary>\n\t\t///\t<returns>\n\t\t/// Number of objects in index of this pack, likewise in this pack.\n\t\t/// </returns>\n\t\t///\t<exception cref=\"IOException\">\n\t\t///\tThe index file cannot be loaded into memory.\n\t\t/// </exception>\n\t\tpublic long ObjectCount\n\t\t{\n\t\t\tget { return LoadPackIndex().ObjectCount; }\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Search for object id with the specified start offset in associated pack\n\t\t/// (reverse) index.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">start offset of object to find</param>\n\t\t/// <returns>\n\t\t/// Object id for this offset, or null if no object was found\n\t\t/// </returns>\n\t\tpublic ObjectId FindObjectForOffset(long offset)\n\t\t{\n\t\t\treturn GetReverseIdx().FindObject(offset);\n\t\t}\n\n\t\tpublic UnpackedObjectCache.Entry readCache(long position)\n\t\t{\n\t\t\treturn UnpackedObjectCache.get(this, position);\n\t\t}\n\n\t\tpublic void saveCache(long position, byte[] data, int type)\n\t\t{\n\t\t\tUnpackedObjectCache.store(this, position, data, type);\n\t\t}\n\n\t\tpublic byte[] decompress(long position, long totalSize, WindowCursor curs)\n\t\t{\n\t\t\tvar dstbuf = new byte[totalSize];\n\n\t\t\tif (curs.Inflate(this, position, dstbuf, 0) != totalSize)\n\t\t\t{\n\t\t\t\tthrow new EndOfStreamException(\"Short compressed stream at \" + position);\n\t\t\t}\n\n\t\t\treturn dstbuf;\n\t\t}\n\n\t\tinternal void CopyRawData<T>(PackedObjectLoader loader, T @out, byte[] buf, WindowCursor cursor)\n\t\t\twhere T : Stream\n\t\t{\n\t\t\tlong objectOffset = loader.ObjectOffset;\n\t\t\tlong dataOffset = loader.DataOffset;\n\t\t\tvar cnt = (int)(FindEndOffset(objectOffset) - dataOffset);\n\n\t\t\tif (LoadPackIndex().HasCRC32Support)\n\t\t\t{\n\t\t\t\tvar crc = new Crc32();\n\t\t\t\tvar headerCnt = (int)(dataOffset - objectOffset);\n\t\t\t\twhile (headerCnt > 0)\n\t\t\t\t{\n\t\t\t\t\tint toRead = Math.Min(headerCnt, buf.Length);\n\t\t\t\t\tReadFully(objectOffset, buf, 0, toRead, cursor);\n\t\t\t\t\tcrc.Update(buf, 0, toRead);\n\t\t\t\t\theaderCnt -= toRead;\n\t\t\t\t}\n\t\t\t\tvar crcOut = new CheckedOutputStream(@out, crc);\n\t\t\t\tCopyToStream(dataOffset, buf, cnt, crcOut, cursor);\n\t\t\t\tlong computed = crc.Value;\n\t\t\t\tObjectId id = FindObjectForOffset(objectOffset);\n\t\t\t\tlong expected = LoadPackIndex().FindCRC32(id);\n\t\t\t\tif (computed != expected)\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(\"object at \" + dataOffset + \" in \" + File.FullName + \" has bad zlib stream\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tcursor.InflateVerify(this, dataOffset);\n\t\t\t\t}\n\t\t\t\tcatch (Exception fe) // [henon] was DataFormatException\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(\"object at \" + dataOffset + \" in \" + File.FullName + \" has bad zlib stream\", fe);\n\t\t\t\t}\n\n\t\t\t\tCopyToStream(dataOffset, buf, cnt, @out, cursor);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool SupportsFastCopyRawData\n\t\t{\n\t\t\tget { return LoadPackIndex().HasCRC32Support; }\n\t\t}\n\n\n\t\tinternal bool IsInvalid\n\t\t{\n\t\t\tget { return _invalid; }\n\t\t}\n\n\t\tprivate void ReadFully(long position, byte[] dstbuf, int dstoff, int cnt, WindowCursor curs)\n\t\t{\n\t\t\tif (curs.Copy(this, position, dstbuf, dstoff, cnt) != cnt)\n\t\t\t{\n\t\t\t\tthrow new EndOfStreamException();\n\t\t\t}\n\t\t}\n\n\t\tprivate void CopyToStream(long position, byte[] buffer, long count, Stream stream, WindowCursor windowCursor)\n\t\t{\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tvar toRead = (int)Math.Min(count, buffer.Length);\n\t\t\t\tReadFully(position, buffer, 0, toRead, windowCursor);\n\t\t\t\tposition += toRead;\n\t\t\t\tcount -= toRead;\n\t\t\t\tstream.Write(buffer, 0, toRead);\n\t\t\t}\n\t\t}\n\n\t\tpublic void beginCopyRawData()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tif (++_activeCopyRawData == 1 && _activeWindows == 0)\n\t\t\t\t{\n\t\t\t\t\tDoOpen();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void endCopyRawData()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tif (--_activeCopyRawData == 0 && _activeWindows == 0)\n\t\t\t\t{\n\t\t\t\t\tDoClose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool beginWindowCache()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tif (++_activeWindows == 1)\n\t\t\t\t{\n\t\t\t\t\tif (_activeCopyRawData == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tDoOpen();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool endWindowCache()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tbool r = --_activeWindows == 0;\n\n\t\t\t\tif (r && _activeCopyRawData == 0)\n\t\t\t\t{\n\t\t\t\t\tDoClose();\n\t\t\t\t}\n\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\n\t\tprivate void DoOpen()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (_invalid)\n\t\t\t\t{\n\t\t\t\t\tthrow new PackInvalidException(File.FullName);\n\t\t\t\t}\n\n\t\t\t\t_fd = new FileStream(File.FullName, System.IO.FileMode.Open, FileAccess.Read);\n\t\t\t\tLength = _fd.Length;\n\t\t\t\tOnOpenPack();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tOpenFail();\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tprivate void OpenFail()\n\t\t{\n\t\t\t_activeWindows = 0;\n\t\t\t_activeCopyRawData = 0;\n\t\t\t_invalid = true;\n\t\t\tDoClose();\n\t\t}\n\n\t\tprivate void DoClose()\n\t\t{\n\t\t\tif (_fd == null) return;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_fd.Dispose();\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\t// Ignore a close event. We had it open only for reading.\n\t\t\t\t// There should not be errors related to network buffers\n\t\t\t\t// not flushed, etc.\n\t\t\t}\n\n\t\t\t_fd = null;\n\t\t}\n\n\t\tinternal ByteArrayWindow Read(long pos, int size)\n\t\t{\n\t\t\tif (Length < pos + size)\n\t\t\t{\n\t\t\t\tsize = (int)(Length - pos);\n\t\t\t}\n\n\t\t\tvar buf = new byte[size];\n\t\t\tIO.ReadFully(_fd, pos, buf, 0, size);\n\t\t\treturn new ByteArrayWindow(this, pos, buf);\n\t\t}\n\t\t\n\t\t// Note: For now we are going to remove the dependency on Winterdom.IO.FileMap, \n\t\t// since this isn't our default way of packing a file and there isn't any \n\t\t// reason to invest in developing a cross-platform replacement.  We're leaving \n\t\t// the rest of the logic in place in case we decide to invest in \n\t\t// this in the future.  This was never tested thoroughly and caused \n\t\t// tests to fail when it did run.\n\t\tinternal ByteWindow MemoryMappedByteWindow(long pos, int size)\n\t\t{\n\t\t    throw new NotImplementedException();\n\t\t}\n\n\t\tprivate void OnOpenPack()\n\t\t{\n\t\t\tPackIndex idx = LoadPackIndex();\n\t\t\tvar buf = new byte[20];\n\n\t\t\tIO.ReadFully(_fd, 0, buf, 0, 12);\n\t\t\tif (RawParseUtils.match(buf, 0, Constants.PACK_SIGNATURE) != 4)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Not a PACK file.\");\n\t\t\t}\n\n\t\t\tlong vers = NB.decodeUInt32(buf, 4);\n\t\t\tlong packCnt = NB.decodeUInt32(buf, 8);\n\t\t\tif (vers != 2 && vers != 3)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Unsupported pack version \" + vers + \".\");\n\t\t\t}\n\n\t\t\tif (packCnt != idx.ObjectCount)\n\t\t\t{\n\t\t\t\tthrow new PackMismatchException(\"Pack object count mismatch:\"\n\t\t\t\t\t+ \" pack \" + packCnt\n\t\t\t\t\t+ \" index \" + idx.ObjectCount\n\t\t\t\t\t+ \": \" + File.FullName);\n\t\t\t}\n\n\t\t\tIO.ReadFully(_fd, Length - 20, buf, 0, 20);\n\n\t\t\tif (!buf.SequenceEqual(_packChecksum))\n\t\t\t{\n\t\t\t\tthrow new PackMismatchException(\"Pack checksum mismatch:\"\n\t\t\t\t\t+ \" pack \" + ObjectId.FromRaw(buf)\n\t\t\t\t\t+ \" index \" + ObjectId.FromRaw(idx.PackChecksum)\n\t\t\t\t\t+ \": \" + File.FullName);\n\t\t\t}\n\t\t}\n\n\t\tprivate PackedObjectLoader Reader(WindowCursor curs, long objOffset)\n\t\t{\n\t\t\tlong pos = objOffset;\n\t\t\tint p = 0;\n\t\t\tbyte[] ib = curs.TempId; // Reader.ReadBytes(ObjectId.ObjectIdLength);\n\t\t\tReadFully(pos, ib, 0, 20, curs);\n\t\t\tint c = ib[p++] & 0xff;\n\t\t\tint typeCode = (c >> 4) & 7;\n\t\t\tlong dataSize = c & 15;\n\t\t\tint shift = 4;\n\t\t\twhile ((c & 0x80) != 0)\n\t\t\t{\n\t\t\t\tc = ib[p++] & 0xff;\n\t\t\t\tdataSize += (c & 0x7f) << shift;\n\t\t\t\tshift += 7;\n\t\t\t}\n\t\t\tpos += p;\n\n\t\t\tswitch (typeCode)\n\t\t\t{\n\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\treturn new WholePackedObjectLoader(this, pos, objOffset, typeCode, (int)dataSize);\n\n\t\t\t\tcase Constants.OBJ_OFS_DELTA:\n\t\t\t\t\tReadFully(pos, ib, 0, 20, curs);\n\t\t\t\t\tp = 0;\n\t\t\t\t\tc = ib[p++] & 0xff;\n\t\t\t\t\tlong ofs = c & 127;\n\n\t\t\t\t\twhile ((c & 128) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tofs += 1;\n\t\t\t\t\t\tc = ib[p++] & 0xff;\n\t\t\t\t\t\tofs <<= 7;\n\t\t\t\t\t\tofs += (c & 127);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new DeltaOfsPackedObjectLoader(this, pos + p, objOffset, (int)dataSize, objOffset - ofs);\n\n\t\t\t\tcase Constants.OBJ_REF_DELTA:\n\t\t\t\t\tReadFully(pos, ib, 0, 20, curs);\n\t\t\t\t\treturn new DeltaRefPackedObjectLoader(this, pos + ib.Length, objOffset, (int)dataSize, ObjectId.FromRaw(ib));\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new IOException(\"Unknown object type \" + typeCode + \".\");\n\t\t\t}\n\t\t}\n\n\t\tprivate long FindEndOffset(long startOffset)\n\t\t{\n\t\t\tlong maxOffset = Length - 20;\n\t\t\treturn GetReverseIdx().FindNextOffset(startOffset, maxOffset);\n\t\t}\n\n\t\tprivate PackReverseIndex GetReverseIdx()\n\t\t{\n\t\t\tlock (locker)\n\t\t\t{\n\t\t\t\tif (_reverseIdx == null)\n\t\t\t\t{\n\t\t\t\t\t_reverseIdx = new PackReverseIndex(LoadPackIndex());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn _reverseIdx;\n\t\t}\n\n\t\tpublic long Length { get; private set; }\n\n\t\tinternal int Hash\n\t\t{\n\t\t\tget { return _hash; }\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n            Close();\n\n            if (_fd == null)\n            {\n                return;\n            }\n\n\t\t    _fd.Dispose();}\n\t\t}\n\t\t\n\t}\n"
  },
  {
    "path": "GitSharp.Core/PackIndex.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Access path to locate objects by <see cref=\"ObjectId\"/> in a <see cref=\"PackFile\"/>.\n\t/// <para />\n\t/// Indexes are strictly redundant information in that we can rebuild all of the\n\t/// data held in the index file from the on disk representation of the pack file\n\t/// itself, but it is faster to access for random requests because data is stored\n\t/// by ObjectId.\n\t/// </summary>\n\tpublic abstract class PackIndex : IEnumerable<PackIndex.MutableEntry>\n\t{\n\t\t/// <summary>\n\t\t/// Footer checksum applied on the bottom of the pack file.\n\t\t/// </summary>\n\t\tpublic byte[] PackChecksum { get; protected set; }\n\n\t\tprivate static bool IsTOC(byte[] h)\n\t\t{\n\t\t\tbyte[] toc = PackIndexWriter.TOC;\n\t\t\tfor (int i = 0; i < toc.Length; i++)\n\t\t\t{\n\t\t\t\tif (h[i] != toc[i])\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if an object is contained within the pack file.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// The object to look for. Must not be null.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// True if the object is listed in this index; false otherwise.\n\t\t/// </returns>\n\t\tpublic bool HasObject(AnyObjectId id)\n\t\t{\n\t\t\treturn FindOffset(id) != -1;\n\t\t}\n\n\t\t#region IEnumerable<MutableEntry> Members\n\n\t\tpublic abstract IEnumerator<MutableEntry> GetEnumerator();\n\n\t\t#endregion\n\n\t\t#region IEnumerable Members\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\n\n\t\t/**\n\t * Obtain the total number of objects described by this index.\n\t * \n\t * @return number of objects in this index, and likewise in the associated\n\t *         pack that this index was generated from.\n\t */\n\t\tpublic abstract long ObjectCount { get; internal set; }\n\n\t\t/**\n\t\t * Obtain the total number of objects needing 64 bit offsets.\n\t\t *\n\t\t * @return number of objects in this index using a 64 bit offset; that is an\n\t\t *         object positioned after the 2 GB position within the file.\n\t\t */\n\t\tpublic abstract long Offset64Count { get; }\n\n\t\t/**\n\t\t * Get ObjectId for the n-th object entry returned by {@link #iterator()}.\n\t\t * <para />\n\t\t * This method is a constant-time replacement for the following loop:\n\t\t *\n\t\t * <pre>\n\t\t * Iterator&lt;MutableEntry&gt; eItr = index.iterator();\n\t\t * int curPosition = 0;\n\t\t * while (eItr.hasNext() &amp;&amp; curPosition++ &lt; nthPosition)\n\t\t * \teItr.next();\n\t\t * ObjectId result = eItr.next().ToObjectId();\n\t\t * </pre>\n\t\t *\n\t\t * @param nthPosition\n\t\t *            position within the traversal of {@link #iterator()} that the\n\t\t *            caller needs the object for. The first returned\n\t\t *            {@link MutableEntry} is 0, the second is 1, etc.\n\t\t * @return the ObjectId for the corresponding entry.\n\t\t */\n\t\tpublic abstract ObjectId GetObjectId(long nthPosition);\n\n\t\t/**\n\t\t * Get ObjectId for the n-th object entry returned by {@link #iterator()}.\n\t\t * <para />\n\t\t * This method is a constant-time replacement for the following loop:\n\t\t *\n\t\t * <pre>\n\t\t * Iterator&lt;MutableEntry&gt; eItr = index.iterator();\n\t\t * int curPosition = 0;\n\t\t * while (eItr.hasNext() &amp;&amp; curPosition++ &lt; nthPosition)\n\t\t * \teItr.next();\n\t\t * ObjectId result = eItr.next().ToObjectId();\n\t\t * </pre>\n\t\t *\n\t\t * @param nthPosition\n\t\t *            unsigned 32 bit position within the traversal of\n\t\t *            {@link #iterator()} that the caller needs the object for. The\n\t\t *            first returned {@link MutableEntry} is 0, the second is 1,\n\t\t *            etc. Positions past 2**31-1 are negative, but still valid.\n\t\t * @return the ObjectId for the corresponding entry.\n\t\t */\n\t\tpublic ObjectId GetObjectId(int nthPosition)\n\t\t{\n\t\t\tif (nthPosition >= 0)\n\t\t\t\treturn GetObjectId((long)nthPosition);\n\t\t\tint u31 = nthPosition.UnsignedRightShift(1);\n\t\t\tint one = nthPosition & 1;\n\t\t\treturn GetObjectId((((long)u31) << 1) | (uint)one);\n\t\t}\n\n\t\t/**\n\t\t * Locate the file offset position for the requested object.\n\t\t * \n\t\t * @param objId\n\t\t *            name of the object to locate within the pack.\n\t\t * @return offset of the object's header and compressed content; -1 if the\n\t\t *         object does not exist in this index and is thus not stored in the\n\t\t *         associated pack.\n\t\t */\n\t\tpublic abstract long FindOffset(AnyObjectId objId);\n\n\t\t/// <summary>\n\t\t/// Retrieve stored CRC32 checksum of the requested object raw-data\n\t\t/// (including header).\n\t\t/// </summary>\n\t\t/// <param name=\"objId\">id of object to look for</param>\n\t\t/// <returns>\n\t\t/// CRC32 checksum of specified object (at 32 less significant bits).\n\t\t/// </returns>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// When requested ObjectId was not found in this index\n\t\t/// </exception>\n\t\t/// <exception cref=\"InvalidOperationException\">\n\t\t/// when this index doesn't support CRC32 checksum\n\t\t/// </exception>\n\t\tpublic abstract long FindCRC32(AnyObjectId objId);\n\n\n\t\t/// <summary>\n\t\t/// Check whether this index supports (has) CRC32 checksums for objects.\n\t\t/// </summary>\n\t\tpublic abstract bool HasCRC32Support { get; }\n\n\t    public class MutableEntry\n\t    {\n\t        private readonly Func<MutableObjectId, MutableObjectId> _idBufferBuilder;\n\t        private MutableObjectId _idBuffer;\n\n\t        public MutableObjectId idBuffer\n\t        {\n\t            get\n\t            {\n\t                if (_idBuffer == null)\n\t                {\n\t                    _idBuffer = _idBufferBuilder(new MutableObjectId());\n\t                }\n\t                return _idBuffer;\n\t            }\n\t        }\n\n\t        public MutableEntry(Func<MutableObjectId, MutableObjectId> idBufferBuilder)\n\t        {\n\t            _idBufferBuilder = idBufferBuilder;\n\t        }\n\n\t        public MutableEntry(MutableObjectId idBuffer)\n\t        {\n\t            _idBuffer = idBuffer;\n\t        }\n\n            /// <summary>\n            /// Returns offset for this index object entry\n            /// </summary>\n\t        public long Offset { get; set; }\n\n            /// <summary>\n            /// Returns hex string describing the object id of this entry\n            /// </summary>\n\t        public String Name\n\t        {\n\t            get { return idBuffer.Name; }\n\t        }\n\n\t        public ObjectId ToObjectId()\n\t        {\n\t            return idBuffer.ToObjectId();\n\t        }\n\n            /// <summary>\n            /// Returns mutable copy of this mutable entry.\n            /// </summary>\n            /// <returns>\n            /// Copy of this mutable entry\n            /// </returns>\n\t        public MutableEntry CloneEntry()\n\t        {\n\t            var r = new MutableEntry(new MutableObjectId(idBuffer.ToObjectId()));\n\t            r.Offset = Offset;\n\n\t            return r;\n\t        }\n\n\t        public override string ToString()\n\t        {\n\t            return idBuffer.ToString();\n\t        }\n\t    }\n\n        /// <summary>\n        /// Provide iterator that gives access to index entries. Note, that iterator\n        /// returns reference to mutable object, the same reference in each call -\n        /// for performance reason. If client needs immutable objects, it must copy\n        /// returned object on its own.\n        /// <para />\n        /// Iterator returns objects in SHA-1 lexicographical order.\n        /// </summary>\n\t    internal abstract class EntriesIterator : IEnumerator<MutableEntry>\n\t    {\n\t        private MutableEntry _current;\n\t        private readonly PackIndex _packIndex;\n\n\t        protected EntriesIterator(PackIndex packIndex)\n\t        {\n\t            _packIndex = packIndex;\n\t        }\n\n\t        protected long ReturnedNumber;\n\n\t        protected abstract MutableObjectId IdBufferBuilder(MutableObjectId idBuffer);\n\n\t        private MutableEntry InitEntry()\n\t        {\n\t            return new MutableEntry(IdBufferBuilder);\n\t        }\n\n\t        public bool hasNext()\n\t        {\n\t            return ReturnedNumber < _packIndex.ObjectCount;\n\t        }\n\n\t        protected abstract MutableEntry InnerNext(MutableEntry entry);\n\n\t        public MutableEntry next()\n\t        {\n\t            _current = InnerNext(InitEntry());\n\t            return _current;\n\t        }\n\n\t        public bool MoveNext()\n\t        {\n\t            if (!hasNext())\n\t            {\n\t                return false;\n\t            }\n\n\t            next();\n\t            return true;\n\t        }\n\n\t        public void Reset()\n\t        {\n\t            throw new NotSupportedException();\n\t        }\n\n\t        public MutableEntry Current\n\t        {\n\t            get { return _current; }\n\t        }\n\n\t        object IEnumerator.Current\n\t        {\n\t            get { return Current; }\n\t        }\n\n\t        public void Dispose()\n\t        {\n\t        }\n\t    }\n\n\n        /// <summary>\n        /// Open an existing pack <code>.idx</code> file for reading..\n        /// <para/>\n        /// The format of the file will be automatically detected and a proper access\n        /// implementation for that format will be constructed and returned to the\n        /// caller. The file may or may not be held open by the returned instance.\n        /// </summary>\n        /// <param name=\"idxFile\">existing pack .idx to read.</param>\n        /// <returns></returns>\n        public static PackIndex Open(FileInfo idxFile)\n        {\n            try\n            {\n                using (FileStream fs = idxFile.OpenRead())\n                {\n                    byte[] hdr = new byte[8];\n                    IO.ReadFully(fs, hdr, 0, hdr.Length);\n\n                    if (IsTOC(hdr))\n                    {\n                        int v = NB.DecodeInt32(hdr, 4);\n                        switch (v)\n                        {\n                            case 2:\n                                return new PackIndexV2(fs);\n                            default:\n                                throw new IOException(\"Unsupported pack index version \" + v);\n                        }\n                    }\n                    return new PackIndexV1(fs, hdr);\n                }\n            }\n            catch (IOException)\n            {\n                throw new IOException(\"Unable to read pack index: \" + idxFile.FullName);\n            }\n        }\n\n\n\n\n\n            \n\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PackIndexV1.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t[Complete]\n\tpublic class PackIndexV1 : PackIndex\n\t{\n\t\tprivate const int IdxHdrLen = 256 * 4;\n\t\tprivate readonly long[] _idxHeader;\n\t\tprivate readonly byte[][] _idxdata;\n\n\t\tpublic PackIndexV1(Stream fd, byte[] hdr)\n\t\t{\n\t\t\tbyte[] fanoutTable = new byte[IdxHdrLen];\n\t\t\tArray.Copy(hdr, 0, fanoutTable, 0, hdr.Length);\n\t\t\tIO.ReadFully(fd, fanoutTable, hdr.Length, IdxHdrLen - hdr.Length);\n\n\t\t\t_idxHeader = new long[256];\n\t\t\tfor (int k = 0; k < _idxHeader.Length; k++)\n\t\t\t\t_idxHeader[k] = NB.decodeUInt32(fanoutTable, k * 4);\n\n\t\t\t_idxdata = new byte[_idxHeader.Length][];\n\t\t\tfor (int k = 0; k < _idxHeader.Length; k++)\n\t\t\t{\n\t\t\t\tuint n;\n\t\t\t\tif (k == 0)\n\t\t\t\t\tn = (uint)(_idxHeader[k]);\n\t\t\t\telse\n\t\t\t\t\tn = (uint)(_idxHeader[k] - _idxHeader[k - 1]);\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\t_idxdata[k] = new byte[n * (Constants.OBJECT_ID_LENGTH + 4)];\n\t\t\t\t\tIO.ReadFully(fd, _idxdata[k], 0, _idxdata[k].Length);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tObjectCount = _idxHeader[255];\n\t\t\tPackChecksum = new byte[20];\n\t\t\tIO.ReadFully(fd, PackChecksum, 0, PackChecksum.Length);\n\n\n\n\t\t\t/*var fanoutTable = new byte[IDX_HDR_LEN];\n\t\t\tArray.Copy(hdr, 0, fanoutTable, 0, hdr.Length);\n\t\t\tNB.ReadFully(fd, fanoutTable, hdr.Length, IDX_HDR_LEN - hdr.Length);\n\n\t\t\tidxHeader = new long[256]; // really unsigned 32-bit...\n\t\t\tfor (int k = 0; k < idxHeader.Length; k++)\n\t\t\t\tidxHeader[k] = NB.DecodeUInt32(fanoutTable, k * 4);\n\t\t\tidxdata = new byte[idxHeader.Length][];\n\t\t\tfor (int k = 0; k < idxHeader.Length; k++)\n\t\t\t{\n\t\t\t\t_idxHeader[k] = NB.DecodeUInt32(fanoutTable, k * 4);\n\t\t\t}\n\n\t\t\t_idxdata = new byte[_idxHeader.Length][];\n\t\t\tfor (int k = 0; k < _idxHeader.Length; k++)\n\t\t\t{\n\t\t\t\tint n;\n\t\t\t\tif (k == 0)\n\t\t\t\t{\n\t\t\t\t\tn = (int)(_idxHeader[k]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tn = (int)(_idxHeader[k] - _idxHeader[k - 1]);\n\t\t\t\t}\n\n\t\t\t\tif (n <= 0) continue;\n\n\t\t\t\t_idxdata[k] = new byte[n * (AnyObjectId.ObjectIdLength + 4)];\n\t\t\t\tNB.ReadFully(fd, _idxdata[k], 0, _idxdata[k].Length);\n\t\t\t}\n\n\t\t\tObjectCount = _idxHeader[255];\n\n\t\t\t_packChecksum = new byte[20];\n\t\t\tNB.ReadFully(fd, _packChecksum, 0, _packChecksum.Length);\n\t\t\t * */\n\t\t}\n\n\t\tpublic override IEnumerator<MutableEntry> GetEnumerator()\n\t\t{\n\t\t\treturn new IndexV1Enumerator(this);\n\t\t}\n\n\t\tpublic override long ObjectCount { get; internal set; }\n\n\t\tpublic override long Offset64Count\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tlong n64 = 0;\n\t\t\t\tforeach (MutableEntry e in this)\n\t\t\t\t{\n\t\t\t\t\tif (e.Offset >= int.MaxValue)\n\t\t\t\t\t\tn64++;\n\t\t\t\t}\n\t\t\t\treturn n64;\n\t\t\t}\n\t\t}\n\n\t\tpublic override ObjectId GetObjectId(long nthPosition)\n\t\t{\n\t\t\tint levelOne = Array.BinarySearch(_idxHeader, nthPosition + 1);\n\t\t\tlong lbase;\n\t\t\tif (levelOne >= 0)\n\t\t\t{\n\t\t\t\t// If we hit the bucket exactly the item is in the bucket, or\n\t\t\t\t// any bucket before it which has the same object count.\n\t\t\t\t//\n\t\t\t\tlbase = _idxHeader[levelOne];\n\t\t\t\twhile (levelOne > 0 && lbase == _idxHeader[levelOne - 1])\n\t\t\t\t{\n\t\t\t\t\tlevelOne--;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The item is in the bucket we would insert it into.\n\t\t\t\t//\n\t\t\t\tlevelOne = -(levelOne + 1);\n\t\t\t}\n\n\t\t\tlbase = levelOne > 0 ? _idxHeader[levelOne - 1] : 0;\n\t\t\tvar p = (int)(nthPosition - lbase);\n            int dataIdx = ((4 + Constants.OBJECT_ID_LENGTH) * p) + 4;\n\t\t\treturn ObjectId.FromRaw(_idxdata[levelOne], dataIdx);\n\t\t}\n\n\t\tpublic override long FindOffset(AnyObjectId objId)\n\t\t{\n\t\t\tint levelOne = objId.GetFirstByte();\n\t\t\tbyte[] data = _idxdata[levelOne];\n\t\t\tif (data == null)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n            int high = data.Length / (4 + Constants.OBJECT_ID_LENGTH);\n\t\t\tint low = 0;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint mid = (low + high) / 2;\n                int pos = ((4 + Constants.OBJECT_ID_LENGTH) * mid) + 4;\n\t\t\t\tint cmp = objId.CompareTo(data, pos);\n\t\t\t\tif (cmp < 0)\n\t\t\t\t{\n\t\t\t\t\thigh = mid;\n\t\t\t\t}\n\t\t\t\telse if (cmp == 0)\n\t\t\t\t{\n\t\t\t\t\tuint b0 = data[pos - 4] & (uint)0xff;\n\t\t\t\t\tuint b1 = data[pos - 3] & (uint)0xff;\n\t\t\t\t\tuint b2 = data[pos - 2] & (uint)0xff;\n\t\t\t\t\tuint b3 = data[pos - 1] & (uint)0xff;\n\t\t\t\t\treturn (((long)b0) << 24) | (b1 << 16) | (b2 << 8) | (b3);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tlow = mid + 1;\n\t\t\t} while (low < high);\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic override long FindCRC32(AnyObjectId objId)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic override bool HasCRC32Support\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t#region Nested Types\n\n        private class IndexV1Enumerator : EntriesIterator\n        {\n            private readonly PackIndexV1 _index;\n            private int _levelOne;\n            private int _levelTwo;\n\n            public IndexV1Enumerator(PackIndexV1 index)\n                : base(index)\n            {\n                _index = index;\n            }\n\n            protected override MutableObjectId IdBufferBuilder(MutableObjectId idBuffer)\n            {\n                idBuffer.FromRaw(_index._idxdata[_levelOne], _levelTwo - Constants.OBJECT_ID_LENGTH);\n                return idBuffer;\n            }\n\n            protected override MutableEntry InnerNext(MutableEntry entry)\n            {\n                for (; _levelOne < _index._idxdata.Length; _levelOne++)\n                {\n                    if (_index._idxdata[_levelOne] == null)\n                    {\n                        continue;\n                    }\n\n                    if (_levelTwo < _index._idxdata[_levelOne].Length)\n                    {\n                        entry.Offset = NB.DecodeUInt32(_index._idxdata[_levelOne], _levelTwo);\n                        _levelTwo += Constants.OBJECT_ID_LENGTH + 4;\n                        ReturnedNumber++;\n                        return entry;\n                    }\n\n                    _levelTwo = 0;\n                }\n                throw new IndexOutOfRangeException();\n            }\n        }\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PackIndexV2.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Support for the pack index v2 format.\n\t/// </summary>\n\tpublic class PackIndexV2 : PackIndex\n\t{\n\t\tprivate const long IS_O64 = 1L << 31;\n\t\tprivate const int FANOUT = 256;\n\t\tprivate static readonly int[] NoInts = { };\n\t\tprivate static readonly byte[] NoBytes = { };\n\t\tprivate readonly long[] _fanoutTable;\n\n\t\t/** 256 arrays of contiguous object names. */\n\t\tprivate readonly int[][] _names;\n\n\t\t/** 256 arrays of the 32 bit offset data, matching {@link #names}. */\n\t\tprivate readonly byte[][] _offset32;\n\n\t\t/** 256 arrays of the CRC-32 of objects, matching {@link #names}. */\n\t\tprivate readonly byte[][] _crc32;\n\n\t\t/** 64 bit offset table. */\n\t\tprivate readonly byte[] _offset64;\n\n\t\tpublic PackIndexV2(Stream fd)\n\t\t{\n\t\t\tvar fanoutRaw = new byte[4 * FANOUT];\n\t\t\tIO.ReadFully(fd, fanoutRaw, 0, fanoutRaw.Length);\n\t\t\t_fanoutTable = new long[FANOUT];\n\t\t\tfor (int k = 0; k < FANOUT; k++)\n\t\t\t{\n\t\t\t\t_fanoutTable[k] = NB.DecodeUInt32(fanoutRaw, k * 4);\n\t\t\t}\n\t\t\tObjectCount = _fanoutTable[FANOUT - 1];\n\n\t\t\t_names = new int[FANOUT][];\n\t\t\t_offset32 = new byte[FANOUT][];\n\t\t\t_crc32 = new byte[FANOUT][];\n\n\t\t\t// object name table. The size we can permit per fan-out bucket\n\t\t\t// is limited to Java's 2 GB per byte array limitation. That is\n\t\t\t// no more than 107,374,182 objects per fan-out.\n\t\t\t//\n\t\t\tfor (int k = 0; k < FANOUT; k++)\n\t\t\t{\n\t\t\t\tlong bucketCnt;\n\t\t\t\tif (k == 0)\n\t\t\t\t{\n\t\t\t\t\tbucketCnt = _fanoutTable[k];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbucketCnt = _fanoutTable[k] - _fanoutTable[k - 1];\n\t\t\t\t}\n\n\t\t\t\tif (bucketCnt == 0)\n\t\t\t\t{\n\t\t\t\t\t_names[k] = NoInts;\n\t\t\t\t\t_offset32[k] = NoBytes;\n\t\t\t\t\t_crc32[k] = NoBytes;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n                long nameLen = bucketCnt * Constants.OBJECT_ID_LENGTH;\n\t\t\t\tif (nameLen > int.MaxValue)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Index file is too large\");\n\t\t\t\t}\n\n\t\t\t\tvar intNameLen = (int)nameLen;\n\t\t\t\tvar raw = new byte[intNameLen];\n\t\t\t\tvar bin = new int[intNameLen >> 2];\n\t\t\t\tIO.ReadFully(fd, raw, 0, raw.Length);\n\t\t\t\tfor (int i = 0; i < bin.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tbin[i] = NB.DecodeInt32(raw, i << 2);\n\t\t\t\t}\n\n\t\t\t\t_names[k] = bin;\n\t\t\t\t_offset32[k] = new byte[(int)(bucketCnt * 4)];\n\t\t\t\t_crc32[k] = new byte[(int)(bucketCnt * 4)];\n\t\t\t}\n\n\t\t\t// CRC32 table.\n\t\t\tfor (int k = 0; k < FANOUT; k++)\n\t\t\t{\n\t\t\t\tIO.ReadFully(fd, _crc32[k], 0, _crc32[k].Length);\n\t\t\t}\n\n\t\t\t// 32 bit offset table. Any entries with the most significant bit\n\t\t\t// set require a 64 bit offset entry in another table.\n\t\t\t//\n\t\t\tint o64cnt = 0;\n\t\t\tfor (int k = 0; k < FANOUT; k++)\n\t\t\t{\n\t\t\t\tbyte[] ofs = _offset32[k];\n\t\t\t\tIO.ReadFully(fd, ofs, 0, ofs.Length);\n\t\t\t\tfor (int p = 0; p < ofs.Length; p += 4)\n\t\t\t\t{\n                    if (NB.ConvertUnsignedByteToSigned(ofs[p]) < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\to64cnt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 64 bit offset table. Most objects should not require an entry.\n\t\t\t//\n\t\t\tif (o64cnt > 0)\n\t\t\t{\n\t\t\t\t_offset64 = new byte[o64cnt * 8];\n\t\t\t\tIO.ReadFully(fd, _offset64, 0, _offset64.Length);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_offset64 = NoBytes;\n\t\t\t}\n\n\t\t\tPackChecksum = new byte[20];\n\t\t\tIO.ReadFully(fd, PackChecksum, 0, PackChecksum.Length);\n\t\t}\n\n\t\tpublic override IEnumerator<MutableEntry> GetEnumerator()\n\t\t{\n\t\t\treturn new EntriesEnumeratorV2(this);\n\t\t}\n\n\t\tpublic override long ObjectCount { get; internal set; }\n\n\t\tpublic override long Offset64Count\n\t\t{\n\t\t\tget  { return _offset64.Length / 8; }\n\t\t}\n\n\t\tpublic override ObjectId GetObjectId(long nthPosition)\n\t\t{\n\t\t\tint levelOne = Array.BinarySearch(_fanoutTable, nthPosition + 1);\n\t\t\tlong lbase;\n\t\t\tif (levelOne >= 0)\n\t\t\t{\n\t\t\t\t// If we hit the bucket exactly the item is in the bucket, or\n\t\t\t\t// any bucket before it which has the same object count.\n\t\t\t\t//\n\t\t\t\tlbase = _fanoutTable[levelOne];\n\t\t\t\twhile (levelOne > 0 && lbase == _fanoutTable[levelOne - 1])\n\t\t\t\t{\n\t\t\t\t\tlevelOne--;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The item is in the bucket we would insert it into.\n\t\t\t\t//\n\t\t\t\tlevelOne = -(levelOne + 1);\n\t\t\t}\n\n\t\t\tlbase = levelOne > 0 ? _fanoutTable[levelOne - 1] : 0;\n\t\t\tvar p = (int)(nthPosition - lbase);\n\t\t\tint p4 = p << 2;\n\t\t\treturn ObjectId.FromRaw(_names[levelOne], p4 + p); // p * 5\n\t\t}\n\n\t\tpublic override long FindOffset(AnyObjectId objId)\n\t\t{\n\t\t\tint levelOne = objId.GetFirstByte();\n\t\t\tint levelTwo = BinarySearchLevelTwo(objId, levelOne);\n\t\t\tif (levelTwo == -1)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tlong p = NB.DecodeUInt32(_offset32[levelOne], levelTwo << 2);\n\t\t\tif ((p & IS_O64) != 0)\n\t\t\t{\n\t\t\t\treturn NB.DecodeUInt64(_offset64, (8 * (int)(p & ~IS_O64)));\n\t\t\t}\n\n\t\t\treturn p;\n\t\t}\n\n\t\tpublic override long FindCRC32(AnyObjectId objId)\n\t\t{\n\t\t\tint levelOne = objId.GetFirstByte();\n\t\t\tint levelTwo = BinarySearchLevelTwo(objId, levelOne);\n\t\t\tif (levelTwo == -1)\n\t\t\t{\n\t\t\t\tthrow new MissingObjectException(objId.Copy(), ObjectType.Unknown);\n\t\t\t}\n\n\t\t\treturn NB.DecodeUInt32(_crc32[levelOne], levelTwo << 2);\n\t\t}\n\n\t\tpublic override bool HasCRC32Support\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tprivate int BinarySearchLevelTwo(AnyObjectId objId, int levelOne)\n\t\t{\n\t\t\tint[] data = _names[levelOne];\n\t\t\tvar high = (int)((uint)(_offset32[levelOne].Length) >> 2);\n\t\t\tif (high == 0)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tint low = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar mid = (int)((uint)(low + high) >> 1);\n\t\t\t\tint mid4 = mid << 2;\n\n\t\t\t\tint cmp = objId.CompareTo(data, mid4 + mid);\n\t\t\t\tif (cmp < 0)\n\t\t\t\t{\n\t\t\t\t\thigh = mid;\n\t\t\t\t}\n\t\t\t\telse if (cmp == 0)\n\t\t\t\t{\n\t\t\t\t\treturn mid;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t}\n\n\t\t\t} while (low < high);\n\t\t\treturn -1;\n\t\t}\n\n\t\t#region Nested Types\n\n        private class EntriesEnumeratorV2 : EntriesIterator\n        {\n            private readonly PackIndexV2 _index;\n            private int _levelOne;\n            private int _levelTwo;\n\n            public EntriesEnumeratorV2(PackIndexV2 index)\n                : base(index)\n            {\n                _index = index;\n            }\n\n            protected override MutableObjectId IdBufferBuilder(MutableObjectId idBuffer)\n            {\n                idBuffer.FromRaw(_index._names[_levelOne], _levelTwo - Constants.OBJECT_ID_LENGTH / 4);\n                return idBuffer;\n            }\n\n            protected override MutableEntry InnerNext(MutableEntry entry)\n            {\n                for (; _levelOne < _index._names.Length; _levelOne++)\n                {\n                    if (_levelTwo < _index._names[_levelOne].Length)\n                    {\n                        int idx = _levelTwo / (Constants.OBJECT_ID_LENGTH / 4) * 4;\n                        long offset = NB.DecodeUInt32(_index._offset32[_levelOne], idx);\n                        if ((offset & IS_O64) != 0)\n                        {\n                            idx = (8 * (int)(offset & ~IS_O64));\n                            offset = NB.DecodeUInt64(_index._offset64, idx);\n                        }\n                        entry.Offset = offset;\n\n                        _levelTwo += Constants.OBJECT_ID_LENGTH / 4;\n                        ReturnedNumber++;\n                        return entry;\n                    }\n                    _levelTwo = 0;\n                }\n\n                throw new IndexOutOfRangeException();\n            }\n        }\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PackIndexWriter.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Security.Cryptography;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public abstract class PackIndexWriter\n    {\n        internal static byte[] TOC = { 255, (byte)'t', (byte)'O', (byte)'c' };\n\n\t\t/// <summary>\n\t\t/// Create a new writer for the oldest (most widely understood) format.\n\t\t/// <para />\n\t\t/// This method selects an index format that can accurate describe the\n\t\t/// supplied objects and that will be the most compatible format with older\n\t\t/// Git implementations.\n\t\t/// <para />\n\t\t/// Index version 1 is widely recognized by all Git implementations, but\n\t\t/// index version 2 (and later) is not as well recognized as it was\n\t\t/// introduced more than a year later. Index version 1 can only be used if\n\t\t/// the resulting pack file is under 4 gigabytes in size; packs larger than\n\t\t/// that limit must use index version 2.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\"></typeparam>\n\t\t/// <param name=\"dst\">\n\t\t/// The stream the index data will be written to. If not already\n\t\t/// buffered it will be automatically wrapped in a buffered\n\t\t/// stream. Callers are always responsible for closing the stream.\n\t\t/// </param>\n\t\t/// <param name=\"objs\">\n\t\t/// The objects the caller needs to store in the index. Entries\n\t\t/// will be examined until a format can be conclusively selected.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// A new writer to output an index file of the requested format to\n\t\t/// the supplied stream.\n\t\t/// </returns>\n\t\t/// <exception cref=\"ArgumentException\">\n\t\t/// No recognized pack index version can support the supplied\n\t\t/// objects. This is likely a bug in the implementation.\n\t\t/// </exception>\n        public static PackIndexWriter CreateOldestPossible<T>(Stream dst, List<T> objs) \n\t\t\twhere T : PackedObjectInfo\n        {\n            int version = 1;\n        \tbool breakLoop = false;\n\n            foreach (T oe in objs)\n            {\n                switch (version)\n                {\n                    case 1:\n                        if (PackIndexWriterV1.CanStore(oe)) continue;\n                        version = 2;\n                \t\tbreak;\n\n                    case 2:\n                \t\tbreakLoop = true;\n                \t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (breakLoop)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n            }\n\n            return CreateVersion(dst, version);\n        }\n\n\t\t/// <summary>\n\t\t/// Create a new writer instance for a specific index format version.\n\t\t/// </summary>\n\t\t/// <param name=\"dst\">\n\t\t/// The stream the index data will be written to. If not already\n\t\t/// buffered it will be automatically wrapped in a buffered\n\t\t/// stream. Callers are always responsible for closing the stream.\n\t\t/// </param>\n\t\t/// <param name=\"version\">\n\t\t/// Index format version number required by the caller. Exactly\n\t\t/// this formatted version will be written.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// A new writer to output an index file of the requested format to\n\t\t/// the supplied stream.\n\t\t/// </returns>\n\t\t/// <exception cref=\"ArgumentException\">\n\t\t/// The version requested is not supported by this\n\t\t/// implementation.\n\t\t/// </exception>\n        public static PackIndexWriter CreateVersion(Stream dst, int version)\n        {\n            switch (version)\n            {\n                case 1:\n                    return new PackIndexWriterV1(dst);\n                case 2:\n                    return new PackIndexWriterV2(dst);\n                default:\n                    throw new ArgumentException(\"Unsupported pack index version \" + version);\n            }\n        }\n\n\t\t// The index data stream we are responsible for creating.\n        internal readonly BinaryWriter _stream;\n\n\t\t// A temporary buffer for use during IO to out.\n        internal byte[] tmp = new byte[4 + Constants.OBJECT_ID_LENGTH];\n\n\t\t// The entries this writer must pack.\n        internal List<PackedObjectInfo> entries;\n\n\t\t// SHA-1 checksum for the entire pack data.\n        internal byte[] packChecksum;\n\n\t\t/// <summary>\n\t\t/// Create a new writer instance.\n\t\t/// </summary>\n\t\t/// <param name=\"stream\">\n\t\t/// The stream this instance outputs to. If not already buffered\n\t\t/// it will be automatically wrapped in a buffered stream.\n\t\t/// </param>\n        internal PackIndexWriter(Stream stream)\n        {\n            _stream = new BinaryWriter(stream);\n        }\n        \n\t\t/// <summary>\n\t\t///  Write all object entries to the index stream.\n\t\t///  <para />\n\t\t///  After writing the stream passed to the factory is flushed but remains\n\t\t///  open. Callers are always responsible for closing the output stream.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\"></typeparam>\n\t\t/// <param name=\"toStore\">\n\t\t/// Sorted list of objects to store in the index. The caller must\n\t\t/// have previously sorted the list using <see cref=\"PackedObjectInfo\"/>'s\n\t\t/// native {@link Comparable} implementation.\n\t\t/// </param>\n\t\t/// <param name=\"packDataChecksum\">\n\t\t/// Checksum signature of the entire pack data content. This is\n\t\t/// traditionally the last 20 bytes of the pack file's own stream.\n\t\t/// </param>\n\t\tpublic void Write<T>(List<T> toStore, byte[] packDataChecksum) \n\t\t\twhere T : PackedObjectInfo\n        {\n            entries = new List<PackedObjectInfo>();\n            foreach (T e in toStore) entries.Add(e);\n            packChecksum = packDataChecksum;\n            WriteInternal();\n            _stream.Flush();\n        }\n\n\t\t/// <summary>\n\t\t///  Writes the index file to out.\n\t\t///  <para />\n\t\t///  Implementations should go something like:\n\t\t/// <example>\n\t\t/// WriteFanOutTable();\n\t\t/// foreach (PackedObjectInfo po in entries)\n\t\t/// {\n\t\t///\t\tWriteOneEntry(po);\n\t\t/// }\n\t\t/// WriteChecksumFooter();\n\t\t/// </example>\n\t\t/// <para />\n\t\t/// Where the logic for <code>writeOneEntry</code> is specific to the index\n\t\t/// format in use. Additional headers/footers may be used if necessary and\n\t\t/// the entries collection may be iterated over more than once if\n\t\t/// necessary. Implementors therefore have complete control over the data.\n\t\t/// </summary>\n        internal abstract void WriteInternal();\n\n\t\t/// <summary>\n\t\t/// Output the version 2 (and later) TOC header, with version number.\n\t\t/// <para />\n\t\t/// Post version 1 all index files start with a TOC header that makes the\n\t\t/// file an invalid version 1 file, and then includes the version number.\n\t\t/// This header is necessary to recognize a version 1 from a version 2\n\t\t/// formatted index.\n\t\t/// </summary>\n\t\t/// <param name=\"version\">Version number of this index format being written.</param>\n        internal void WriteTOC(int version)\n        {\n            _stream.Write(TOC);\n            NB.encodeInt32(tmp, 0, version);\n            _stream.Write(tmp, 0 , 4);\n        }\n\n\t\t/// <summary>\n\t\t/// utput the standard 256 entry first-level fan-out table.\n\t\t/// <para />\n\t\t/// The fan-out table is 4 KB in size, holding 256 32-bit unsigned integer\n\t\t/// counts. Each count represents the number of objects within this index\n\t\t/// whose <see cref=\"AnyObjectId.GetFirstByte()\"/> matches the count's position in the\n\t\t/// fan-out table.\n\t\t/// </summary>\n\t    internal void WriteFanOutTable() \n        {\n\t\t    int[] fanout = new int[256];\n\t\t    foreach (PackedObjectInfo po in entries)\n\t\t\t    fanout[po.GetFirstByte() & 0xff]++;\n\t\t    \n            for (int i = 1; i < 256; i++)\n\t\t\t    fanout[i] += fanout[i - 1];\n\n            foreach (int n in fanout)\n            {\n                NB.encodeInt32(tmp, 0, n);\n                _stream.Write(tmp, 0, 4);\n            }\n\n        }\n\n\t\t/// <summary>\n\t\t/// Output the standard two-checksum index footer.\n\t\t/// <para />\n\t\t/// The standard footer contains two checksums (20 byte SHA-1 values):\n\t\t/// <ol>\n\t\t/// <li>Pack data checksum - taken from the last 20 bytes of the pack file.</li>\n\t\t/// <li>Index data checksum - checksum of all index bytes written, including\n\t\t/// the pack data checksum above.</li>\n\t\t/// </ol>\n\t\t/// </summary>\n\t    internal void WriteChecksumFooter() {\n\t\t    _stream.Write(packChecksum);\n            using (var sha = new SHA1CryptoServiceProvider())\n\t\t\t{\n\t\t\tvar hash = sha.ComputeHash(_stream.BaseStream);\n#warning this should be tested better\n\t\t\t\t_stream.Write(hash);\n\t\t\t}\n\t    }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/PackIndexWriterV1.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public class PackIndexWriterV1 : PackIndexWriter\n    {\n        public static bool CanStore(PackedObjectInfo objectInfo)\n        {\n            // We are limited to 4 GB per pack as offset is 32 bit unsigned int.\n            //\n            return objectInfo.Offset.UnsignedRightShift(1) < int.MaxValue;\n        }\n        \n        public PackIndexWriterV1(Stream output)\n            : base(output)\n        {\n        }\n\n        internal override void WriteInternal()\n        {\n            WriteFanOutTable();\n\n            foreach (PackedObjectInfo oe in entries)\n            {\n                if (!CanStore(oe))\n                {\n                \tthrow new IOException(\"Pack too large for index version 1\");\n                }\n\n                NB.encodeInt32(tmp, 0, (int)oe.Offset);\n                oe.copyRawTo(tmp, 4);\n                _stream.Write(tmp, 0, tmp.Length);\n            }\n\n            WriteChecksumFooter();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/PackIndexWriterV2.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public class PackIndexWriterV2 : PackIndexWriter\n    {\n        public PackIndexWriterV2(Stream output)\n            : base(output)\n        {\n        }\n\n        internal override void WriteInternal()\n        {\n            WriteTOC(2);\n            WriteFanOutTable();\n            WriteObjectNames();\n            WriteCRCs();\n            WriteOffset32();\n            WriteOffset64();\n            WriteChecksumFooter();\n        }\n\n        private void WriteObjectNames()\n        {\n            foreach (PackedObjectInfo oe in entries)\n            {\n                oe.copyRawTo(_stream.BaseStream);\n            }\n        }\n\n        private void WriteCRCs()\n        {\n            foreach (PackedObjectInfo oe in entries)\n            {\n                NB.encodeInt32(tmp, 0, oe.CRC);\n            \t_stream.BaseStream.Write(tmp, 0, 4);\n            }\n        }\n\n        private void WriteOffset32()\n        {\n            int o64 = 0;\n            foreach (PackedObjectInfo oe in entries)\n            {\n                long o = oe.Offset;\n                if (o < int.MaxValue)\n                {\n                    NB.encodeInt32(tmp, 0, (int)o);\n                }\n                else\n                {\n                    NB.encodeInt32(tmp, 0, (1 << 31) | o64++);\n                }\n                _stream.BaseStream.Write(tmp, 0, 4);\n            }\n        }\n\n        private void WriteOffset64()\n        {\n            foreach (PackedObjectInfo oe in entries)\n            {\n                long o = oe.Offset;\n                if (o > int.MaxValue)\n                {\n                    NB.encodeInt64(tmp, 0, o);\n                \t_stream.BaseStream.Write(tmp, 0, 8);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/PackLock.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n\t/// Keeps track of a <see cref=\"PackFile\"/> associated <code>.keep</code> file.\n    /// </summary>\n    public class PackLock\n    {\n        private readonly FileInfo _keepFile;\n\n        /// <summary>\n        /// Create a new lock for a pack file.\n        /// </summary>\n        /// <param name=\"packFile\">\n\t\t/// Location of the <code>pack-*.pack</code> file.\n        /// </param>\n        public PackLock(FileInfo packFile)\n        {\n            string n = packFile.Name;\n            string p = packFile.DirectoryName + Path.DirectorySeparatorChar + n.Slice(0, n.Length - 5) + \".keep\";\n            _keepFile = new FileInfo(p);\n        }\n\n        /// <summary>\n        /// Create the <code>pack-*.keep</code> file, with the given message.\n        /// </summary>\n        /// <param name=\"msg\">message to store in the file.</param>\n        /// <returns>\n        /// true if the keep file was successfully written; false otherwise.\n        /// </returns>\n        /// <exception cref=\"IOException\">\n\t\t/// The keep file could not be written.\n        /// </exception>\n        public bool Lock(string msg)\n        {\n            if (msg == null) \n\t\t\t\treturn false;\n\t\t\t\n            if (!msg.EndsWith(\"\\n\")) msg += \"\\n\";\n            using(LockFile lf = new LockFile(_keepFile))\n\t\t\t{\n\t            if (!lf.Lock()) \n\t\t\t\t\treturn false;\n\t            lf.Write(Constants.encode(msg));\n\t            return lf.Commit();\n\t\t\t}\n        }\n\n        /// <summary>\n\t\t/// Remove the <code>.keep</code> file that holds this pack in place.\n        /// </summary>\n        public void Unlock()\n        {\n            _keepFile.Delete();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/PackOutputStream.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public class PackOutputStream : Stream\n    {\n        private readonly Stream _stream;\n        private readonly Crc32 _crc;\n        private readonly MessageDigest _md;\n        private long _count;\n\n        public PackOutputStream(Stream stream)\n        {\n\t\t\t_crc = new Crc32();\n\t\t\t_md = Constants.newMessageDigest();\n            _stream = stream;\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            _stream.Write(buffer, offset, count);\n            _crc.Update(buffer, offset, count);\n            _md.Update(buffer, offset, count);\n            _count += count;\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override void SetLength(long value)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override int Read(byte[] buffer, int offset, int count)\n        {\n            throw new System.NotImplementedException();\n        }\n\n        public override bool CanRead\n        {\n            get { return false; }\n        }\n\n        public override bool CanWrite\n        {\n            get { return true; }\n        }\n\n        public override bool CanSeek\n        {\n            get { return false; }\n        }\n\n        public override long Position\n        {\n            get { throw new System.NotImplementedException(); }\n            set { throw new System.NotImplementedException(); }\n        }\n\n        public override void Flush()\n        {\n            _stream.Flush();    \n        }\n\n        public override long Length\n        {\n            get { return _count; }\n        }\n\n        public int getCRC32()\n        {\n            // [caytchen] TODO: REVISIT: C# seperates signed/unsigned, all ported code doesn't seem to resemble this CRC-wise\n            return (int)_crc.Value;\n        }\n\n        public void resetCRC32()\n        {\n            _crc.Reset();\n        }\n\n        public byte[] getDigest()\n        {\n            return _md.Digest();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/PackReverseIndex.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Reverse index for forward pack index. Provides operations based on offset\n\t/// instead of object id. Such offset-based reverse lookups are performed in\n\t/// O(log n) time.\n\t/// </summary>\n\t/// <seealso cref=\"PackIndex\"/>\n\t/// /// <seealso cref=\"PackFile\"/>\n\tpublic class PackReverseIndex\n\t{\n\t\t// Index we were created from, and that has our ObjectId data.\n\t\tprivate readonly PackIndex _index;\n\n\t\t// (offset31, truly) Offsets accommodating in 31 bits.\n\t\tprivate readonly int[] _offsets32;\n\n\t\t// Offsets not accommodating in 31 bits.\n\t\tprivate readonly long[] _offsets64;\n\n\t\t// Position of the corresponding offsets32 in index.\n\t\tprivate readonly int[] _nth32;\n\n\t\t// Position of the corresponding offsets64 in index.\n\t\tprivate readonly int[] _nth64;\n\n\t\t/// <summary>\n\t\t/// Create reverse index from straight/forward pack index, by indexing all\n\t\t/// its entries.\n\t\t/// </summary>\n\t\t/// <param name=\"packIndex\">\n\t\t/// Forward index - entries to (reverse) index.\n\t\t/// </param>\n\t\tpublic PackReverseIndex(PackIndex packIndex)\n\t\t{\n\t\t\t_index = packIndex;\n\n\t\t\tlong cnt = _index.ObjectCount;\n\t\t\tlong n64 = _index.Offset64Count;\n\t\t\tlong n32 = cnt - n64;\n\t\t\tif (n32 > int.MaxValue || n64 > int.MaxValue || cnt > 0xffffffffL)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Huge indexes are not supported, yet\");\n\t\t\t}\n\n\t\t\t_offsets32 = new int[(int)n32];\n\t\t\t_offsets64 = new long[(int)n64];\n\t\t\t_nth32 = new int[_offsets32.Length];\n\t\t\t_nth64 = new int[_offsets64.Length];\n\n\t\t\tint i32 = 0;\n\t\t\tint i64 = 0;\n\n\t\t\tforeach (PackIndex.MutableEntry me in _index)\n\t\t\t{\n\t\t\t\tlong o = me.Offset;\n\t\t\t\tif (o < int.MaxValue)\n\t\t\t\t{\n\t\t\t\t\t_offsets32[i32++] = (int)o;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_offsets64[i64++] = o;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tArray.Sort(_offsets32);\n\t\t\tArray.Sort(_offsets64);\n\n\t\t\tint nth = 0;\n\t\t\tforeach (PackIndex.MutableEntry me in _index)\n\t\t\t{\n\t\t\t\tlong o = me.Offset;\n\t\t\t\tif (o < int.MaxValue)\n\t\t\t\t{\n\t\t\t\t\t_nth32[Array.BinarySearch(_offsets32, (int)o)] = nth++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_nth64[Array.BinarySearch(_offsets64, o)] = nth++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Search for object id with the specified start offset in this pack\n\t\t/// (reverse) index.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">start offset of object to find.</param>\n\t\t/// <returns>\n\t\t/// <see cref=\"ObjectId\"/> for this offset, or null if no object was found.\n\t\t/// </returns>\n\t\tpublic ObjectId FindObject(long offset)\n\t\t{\n\t\t\tif (offset <= int.MaxValue)\n\t\t\t{\n\t\t\t\tint i32 = Array.BinarySearch(_offsets32, (int)offset);\n\t\t\t\tif (i32 < 0) return null;\n\t\t\t\treturn _index.GetObjectId(_nth32[i32]);\n\t\t\t}\n\n\t\t\tint i64 = Array.BinarySearch(_offsets64, offset);\n\t\t\tif (i64 < 0) return null;\n\t\t\treturn _index.GetObjectId(_nth64[i64]);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Search for the next offset to the specified offset in this pack (reverse)\n\t\t/// index.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">\n\t\t/// start offset of previous object (must be valid-existing offset).\n\t\t/// </param>\n\t\t/// <param name=\"maxOffset\">\n\t\t/// maximum offset in a pack (returned when there is no next offset).\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// offset of the next object in a pack or maxOffset if provided\n\t\t/// offset was the last one.\n\t\t/// </returns>\n\t\t/// <exception cref=\"CorruptObjectException\">\n\t\t/// When there is no object with the provided offset.\n\t\t/// </exception>\n\t\tpublic long FindNextOffset(long offset, long maxOffset)\n\t\t{\n\t\t\tif (offset <= int.MaxValue)\n\t\t\t{\n\t\t\t\tint i32 = Array.BinarySearch(_offsets32, (int)offset);\n\t\t\t\tif (i32 < 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(\"Can't find object in (reverse) pack index for the specified offset \" + offset);\n\t\t\t\t}\n\n\t\t\t\tif (i32 + 1 == _offsets32.Length)\n\t\t\t\t{\n\t\t\t\t\tif (_offsets64.Length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn _offsets64[0];\n\t\t\t\t\t}\n\t\t\t\t\treturn maxOffset;\n\t\t\t\t}\n\t\t\t\treturn _offsets32[i32 + 1];\n\t\t\t}\n\n\t\t\tint i64 = Array.BinarySearch(_offsets64, offset);\n\t\t\tif (i64 < 0)\n\t\t\t{\n\t\t\t\tthrow new CorruptObjectException(\"Can't find object in (reverse) pack index for the specified offset \" + offset);\n\t\t\t}\n\n\t\t\tif (i64 + 1 == _offsets64.Length)\n\t\t\t{\n\t\t\t\treturn maxOffset;\n\t\t\t}\n\n\t\t\treturn _offsets64[i64 + 1];\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/PackWriter.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n\tpublic class PackWriter : IDisposable\n\t{\n\t\tpublic const string COUNTING_OBJECTS_PROGRESS = \"Counting objects\";\n\t\tpublic const string SEARCHING_REUSE_PROGRESS = \"Compressing objects\";\n\t\tpublic const string WRITING_OBJECTS_PROGRESS = \"Writing objects\";\n\t\tpublic const bool DEFAULT_REUSE_DELTAS = true;\n\t\tpublic const bool DEFAULT_REUSE_OBJECTS = true;\n\t\tpublic const bool DEFAULT_DELTA_BASE_AS_OFFSET = false;\n\t\tpublic const int DEFAULT_MAX_DELTA_DEPTH = 50;\n\n\t\tprivate const int PackVersionGenerated = 2;\n\t\t\n\t\tprivate static List<ObjectToPack>[] CreateObjectsLists()\n\t\t{\n\t\t\tvar ret = new List<ObjectToPack>[Constants.OBJ_TAG + 1];\n\t\t\tret[0] = new List<ObjectToPack>();\n\t\t\tret[Constants.OBJ_COMMIT] = new List<ObjectToPack>();\n\t\t\tret[Constants.OBJ_TREE] = new List<ObjectToPack>();\n\t\t\tret[Constants.OBJ_BLOB] = new List<ObjectToPack>();\n\t\t\tret[Constants.OBJ_TAG] = new List<ObjectToPack>();\n\t\t\treturn ret;\n\t\t}\n\n\t\tprivate readonly List<ObjectToPack>[] _objectsLists;\n\t\tprivate readonly ObjectIdSubclassMap<ObjectToPack> _objectsMap;\n\t\tprivate readonly ObjectIdSubclassMap<ObjectId> _edgeObjects;\n\t\tprivate readonly byte[] _buf;\n\t\tprivate readonly WindowCursor _windowCursor;\n\t\tprivate readonly Repository _db;\n\t\tprivate PackOutputStream _pos;\n\t\tprivate readonly Deflater _deflater;\n\t\tprivate readonly ProgressMonitor _initMonitor;\n\t\tprivate readonly ProgressMonitor _writeMonitor;\n\t\tprivate List<ObjectToPack> _sortedByName;\n\t\tprivate byte[] _packChecksum;\n\t\tprivate int _outputVersion;\n\n\t\tpublic PackWriter(Repository repo, ProgressMonitor monitor)\n\t\t\t: this(repo, monitor, monitor)\n\t\t{\n\t\t}\n\n\t\tpublic PackWriter(Repository repo, ProgressMonitor imonitor, ProgressMonitor wmonitor)\n\t\t{\n\t\t\t_objectsLists = CreateObjectsLists();\n\t\t\t_objectsMap = new ObjectIdSubclassMap<ObjectToPack>();\n\t\t\t_edgeObjects = new ObjectIdSubclassMap<ObjectId>();\n\t\t\t_buf = new byte[16384]; // 16 KB\n\t\t\t_windowCursor = new WindowCursor();\n\n\t\t\tIgnoreMissingUninteresting = true;\n\t\t\tMaxDeltaDepth = DEFAULT_MAX_DELTA_DEPTH;\n\t\t\tDeltaBaseAsOffset = DEFAULT_DELTA_BASE_AS_OFFSET;\n\t\t\tReuseObjects = DEFAULT_REUSE_OBJECTS;\n\t\t\tReuseDeltas = DEFAULT_REUSE_DELTAS;\n\t\t\t_db = repo;\n\t\t\t_initMonitor = imonitor;\n\t\t\t_writeMonitor = wmonitor;\n\t\t\t_deflater = new Deflater(_db.Config.getCore().getCompression());\n\t\t\t_outputVersion = repo.Config.getCore().getPackIndexVersion();\n\t\t}\n\n\t\tpublic bool ReuseDeltas { get; set; }\n\t\tpublic bool ReuseObjects { get; set; }\n\t\tpublic bool DeltaBaseAsOffset { get; set; }\n\t\tpublic int MaxDeltaDepth { get; set; }\n\t\tpublic bool Thin { get; set; }\n\t\tpublic bool IgnoreMissingUninteresting { get; set; }\n\n\t\tpublic void setIndexVersion(int version)\n\t\t{\n\t\t\t_outputVersion = version;\n\t\t}\n\n\t\tpublic int getObjectsNumber()\n\t\t{\n\t\t\treturn _objectsMap.Count;\n\t\t}\n\n\t\tpublic void preparePack(IEnumerable<RevObject> objectsSource)\n\t\t{\n\t\t\tforeach (RevObject obj in objectsSource)\n\t\t\t{\n\t\t\t\taddObject(obj);\n\t\t\t}\n\t\t}\n\n\t\tpublic void preparePack<T>(IEnumerable<T> interestingObjects, IEnumerable<T> uninterestingObjects)\n\t\t\twhere T : ObjectId\n\t\t{\n\t\t\tusing (ObjectWalk walker = SetUpWalker(interestingObjects, uninterestingObjects))\n\t\t\t{\n\t\t\tFindObjectsToPack(walker);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool willInclude(AnyObjectId id)\n\t\t{\n\t\t\treturn _objectsMap.Get(id) != null;\n\t\t}\n\n\t\tpublic ObjectId computeName()\n\t\t{\n\t\t\tMessageDigest md = Constants.newMessageDigest();\n\t\t\tforeach (ObjectToPack otp in sortByName())\n\t\t\t{\n\t\t\t\totp.copyRawTo(_buf, 0);\n\t\t\t\tmd.Update(_buf, 0, Constants.OBJECT_ID_LENGTH);\n\t\t\t}\n\t\t\treturn ObjectId.FromRaw(md.Digest());\n\t\t}\n\n\t\tpublic void writeIndex(Stream indexStream)\n\t\t{\n\t\t\tList<ObjectToPack> list = sortByName();\n\n\t\t\tPackIndexWriter iw = _outputVersion <= 0 ?\n\t\t\t\tPackIndexWriter.CreateOldestPossible(indexStream, list) :\n\t\t\t\tPackIndexWriter.CreateVersion(indexStream, _outputVersion);\n\n\t\t\tiw.Write(list, _packChecksum);\n\t\t}\n\n\t\tprivate List<ObjectToPack> sortByName()\n\t\t{\n\t\t\tif (_sortedByName == null)\n\t\t\t{\n\t\t\t\t_sortedByName = new List<ObjectToPack>(_objectsMap.Count);\n\n\t\t\t\tforeach (List<ObjectToPack> list in _objectsLists)\n\t\t\t\t{\n\t\t\t\t\tforeach (ObjectToPack otp in list)\n\t\t\t\t\t{\n\t\t\t\t\t\t_sortedByName.Add(otp);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t_sortedByName.Sort();\n\t\t\t}\n\n\t\t\treturn _sortedByName;\n\t\t}\n\n\t\tpublic void writePack(Stream packStream)\n\t\t{\n\t\t\tif (ReuseDeltas || ReuseObjects)\n\t\t\t{\n\t\t\t\tSearchForReuse();\n\t\t\t}\n\n\t\t\tif (!(packStream is BufferedStream))\n\t\t\t{\n\t\t\t\tpackStream = new BufferedStream(packStream);\n\t\t\t}\n\n\t\t\t_pos = new PackOutputStream(packStream);\n\n\t\t\t_writeMonitor.BeginTask(WRITING_OBJECTS_PROGRESS, getObjectsNumber());\n\t\t\tWriteHeader();\n\t\t\tWriteObjects();\n\t\t\tWriteChecksum();\n\n\t\t\t_pos.Flush();\n\t\t\t_windowCursor.Release();\n\t\t\t_writeMonitor.EndTask();\n\t\t}\n\n\t\tprivate void SearchForReuse()\n\t\t{\n\t\t\t_initMonitor.BeginTask(SEARCHING_REUSE_PROGRESS, getObjectsNumber());\n\t\t\tvar reuseLoaders = new List<PackedObjectLoader>();\n\t\t\tforeach (List<ObjectToPack> list in _objectsLists)\n\t\t\t{\n\t\t\t\tforeach (ObjectToPack otp in list)\n\t\t\t\t{\n\t\t\t\t\tif (_initMonitor.IsCancelled)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IOException(\"Packing cancelled during objects writing.\");\n\t\t\t\t\t}\n\t\t\t\t\treuseLoaders.Clear();\n\t\t\t\t\tSearchForReuse(reuseLoaders, otp);\n\t\t\t\t\t_initMonitor.Update(1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_initMonitor.EndTask();\n\t\t}\n\n\t\tprivate void SearchForReuse(ICollection<PackedObjectLoader> reuseLoaders, ObjectToPack otp)\n\t\t{\n\t\t\t_db.OpenObjectInAllPacks(otp, reuseLoaders, _windowCursor);\n\n\t\t\tif (ReuseDeltas)\n\t\t\t{\n\t\t\t\tSelectDeltaReuseForObject(otp, reuseLoaders);\n\t\t\t}\n\n\t\t\tif (ReuseObjects && !otp.HasReuseLoader)\n\t\t\t{\n\t\t\t\tSelectObjectReuseForObject(otp, reuseLoaders);\n\t\t\t}\n\t\t}\n\n\t\tprivate void SelectDeltaReuseForObject(ObjectToPack otp, IEnumerable<PackedObjectLoader> loaders)\n\t\t{\n\t\t\tPackedObjectLoader bestLoader = null;\n\t\t\tObjectId bestBase = null;\n\n\t\t\tforeach (PackedObjectLoader loader in loaders)\n\t\t\t{\n\t\t\t\tObjectId idBase = loader.DeltaBase;\n\t\t\t\tif (idBase == null) continue;\n\t\t\t\tObjectToPack otpBase = _objectsMap.Get(idBase);\n\n\t\t\t\tif ((otpBase != null || (Thin && _edgeObjects.Get(idBase) != null)) && IsBetterDeltaReuseLoader(bestLoader, loader))\n\t\t\t\t{\n\t\t\t\t\tbestLoader = loader;\n\t\t\t\t\tbestBase = (otpBase ?? idBase);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (bestLoader == null) return;\n\n\t\t\totp.SetReuseLoader(bestLoader);\n\t\t\totp.DeltaBaseId = bestBase;\n\t\t}\n\n\t\tprivate static bool IsBetterDeltaReuseLoader(PackedObjectLoader currentLoader, PackedObjectLoader loader)\n\t\t{\n\t\t\tif (currentLoader == null) return true;\n\n\t\t\tif (loader.RawSize < currentLoader.RawSize) return true;\n\n\t\t\treturn loader.RawSize == currentLoader.RawSize &&\n\t\t\t\tloader.SupportsFastCopyRawData &&\n\t\t\t\t!currentLoader.SupportsFastCopyRawData;\n\t\t}\n\n\t\tprivate static void SelectObjectReuseForObject(ObjectToPack otp, IEnumerable<PackedObjectLoader> loaders)\n\t\t{\n\t\t\tforeach (PackedObjectLoader loader in loaders)\n\t\t\t{\n\t\t\t\tif (!(loader is WholePackedObjectLoader)) continue;\n\n\t\t\t\totp.SetReuseLoader(loader);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tprivate void WriteHeader()\n\t\t{\n\t\t\tArray.Copy(Constants.PACK_SIGNATURE, 0, _buf, 0, 4);\n\t\t\tNB.encodeInt32(_buf, 4, PackVersionGenerated);\n\t\t\tNB.encodeInt32(_buf, 8, getObjectsNumber());\n\t\t\t_pos.Write(_buf, 0, 12);\n\t\t}\n\n\t\tprivate void WriteObjects()\n\t\t{\n\t\t\tforeach (List<ObjectToPack> list in _objectsLists)\n\t\t\t{\n\t\t\t\tforeach (ObjectToPack otp in list)\n\t\t\t\t{\n\t\t\t\t\tif (_writeMonitor.IsCancelled)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IOException(\"Packing cancelled during objects writing\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!otp.IsWritten)\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteObject(otp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void WriteObject(ObjectToPack otp)\n\t\t{\n\t\t\totp.MarkWantWrite();\n\t\t\tif (otp.IsDeltaRepresentation)\n\t\t\t{\n\t\t\t\tObjectToPack deltaBase = otp.DeltaBase;\n\t\t\t\tDebug.Assert(deltaBase != null || Thin);\n\t\t\t\tif (deltaBase != null && !deltaBase.IsWritten)\n\t\t\t\t{\n\t\t\t\t\tif (deltaBase.WantWrite)\n\t\t\t\t\t{\n\t\t\t\t\t\totp.ClearDeltaBase();\n\t\t\t\t\t\totp.DisposeLoader();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteObject(deltaBase);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tDebug.Assert(!otp.IsWritten);\n\n\t\t\t_pos.resetCRC32();\n\t\t\totp.Offset = _pos.Length;\n\n\t\t\tPackedObjectLoader reuse = Open(otp);\n\t\t\tif (reuse != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (otp.IsDeltaRepresentation)\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteDeltaObjectReuse(otp, reuse);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteObjectHeader(otp.Type, reuse.Size);\n\t\t\t\t\t\treuse.CopyRawData(_pos, _buf, _windowCursor);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\treuse.endCopyRawData();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (otp.IsDeltaRepresentation)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"creating deltas is not implemented\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tWriteWholeObjectDeflate(otp);\n\t\t\t}\n\n\t\t\totp.CRC = _pos.getCRC32();\n\t\t\t_writeMonitor.Update(1);\n\t\t}\n\n\t\tprivate PackedObjectLoader Open(ObjectToPack otp)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tPackedObjectLoader reuse = otp.UseLoader();\n\t\t\t\tif (reuse == null) return null;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treuse.beginCopyRawData();\n\t\t\t\t\treturn reuse;\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t\totp.ClearDeltaBase();\n\t\t\t\t\tSearchForReuse(new List<PackedObjectLoader>(), otp);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void WriteWholeObjectDeflate(ObjectToPack otp)\n\t\t{\n\t\t\tObjectLoader loader = _db.OpenObject(_windowCursor, otp);\n\t\t\tbyte[] data = loader.CachedBytes;\n\t\t\tWriteObjectHeader(otp.Type, data.Length);\n\t\t\t_deflater.Reset();\n\t\t\t_deflater.SetInput(data, 0, data.Length);\n\t\t\t_deflater.Finish();\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint n = _deflater.Deflate(_buf, 0, _buf.Length);\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\t_pos.Write(_buf, 0, n);\n\t\t\t\t}\n\t\t\t} while (!_deflater.IsFinished);\n\t\t}\n\n\t\tprivate void WriteDeltaObjectReuse(ObjectToPack otp, PackedObjectLoader reuse)\n\t\t{\n\t\t\tif (DeltaBaseAsOffset && otp.DeltaBase != null)\n\t\t\t{\n\t\t\t\tWriteObjectHeader(Constants.OBJ_OFS_DELTA, reuse.RawSize);\n\n\t\t\t\tObjectToPack deltaBase = otp.DeltaBase;\n\t\t\t\tlong offsetDiff = otp.Offset - deltaBase.Offset;\n\t\t\t\tint localPos = _buf.Length - 1;\n\t\t\t\t_buf[localPos] = (byte)(offsetDiff & 0x7F);\n\t\t\t\twhile ((offsetDiff >>= 7) > 0)\n\t\t\t\t{\n\t\t\t\t\t_buf[--localPos] = (byte)(0x80 | (--offsetDiff & 0x7F));\n\t\t\t\t}\n\n\t\t\t\t_pos.Write(_buf, localPos, _buf.Length - localPos);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tWriteObjectHeader(Constants.OBJ_REF_DELTA, reuse.RawSize);\n\t\t\t\totp.DeltaBaseId.copyRawTo(_buf, 0);\n\t\t\t\t_pos.Write(_buf, 0, Constants.OBJECT_ID_LENGTH);\n\t\t\t}\n\n\t\t\treuse.CopyRawData(_pos, _buf, _windowCursor);\n\t\t}\n\n\t\tprivate void WriteObjectHeader(int objectType, long dataLength)\n\t\t{\n\t\t\tvar nextLength = (long)(((ulong)dataLength) >> 4);\n\t\t\tint size = 0;\n\t\t\t_buf[size++] = (byte)((nextLength > 0 ? (byte)0x80 : (byte)0x00) | (byte)(objectType << 4) | (byte)(dataLength & 0x0F));\n\t\t\tdataLength = nextLength;\n\n\t\t\twhile (dataLength > 0)\n\t\t\t{\n\t\t\t\tnextLength = (long)(((ulong)nextLength) >> 7);\n\t\t\t\t_buf[size++] = (byte)((nextLength > 0 ? (byte)0x80 : (byte)0x00) | (byte)(dataLength & 0x7F));\n\t\t\t\tdataLength = nextLength;\n\t\t\t}\n\t\t\t_pos.Write(_buf, 0, size);\n\t\t}\n\n\t\tprivate void WriteChecksum()\n\t\t{\n\t\t\t_packChecksum = _pos.getDigest();\n\t\t\t_pos.Write(_packChecksum, 0, _packChecksum.Length);\n\t\t}\n\n\t\tprivate ObjectWalk SetUpWalker<T>(IEnumerable<T> interestingObjects, IEnumerable<T> uninterestingObjects)\n\t\t\twhere T : ObjectId\n\t\t{\n\t\t\tvar walker = new ObjectWalk(_db);\n\t\t\twalker.sort(RevSort.Strategy.TOPO);\n\t\t\twalker.sort(RevSort.Strategy.COMMIT_TIME_DESC, true);\n\n\t\t\tif (Thin)\n\t\t\t{\n\t\t\t\twalker.sort(RevSort.Strategy.BOUNDARY, true);\n\t\t\t}\n\n\t\t\tforeach (T id in interestingObjects)\n\t\t\t{\n\t\t\t\tRevObject o = walker.parseAny(id);\n\t\t\t\twalker.markStart(o);\n\t\t\t}\n\n\t\t\tif (uninterestingObjects != null)\n\t\t\t{\n\t\t\t\tforeach (T id in uninterestingObjects)\n\t\t\t\t{\n\t\t\t\t\tRevObject o;\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\to = walker.parseAny(id);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (MissingObjectException)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (IgnoreMissingUninteresting) continue;\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n\n\t\t\t\t\twalker.markUninteresting(o);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn walker;\n\t\t}\n\n\t\tprivate void FindObjectsToPack(ObjectWalk walker)\n\t\t{\n\t\t\t_initMonitor.BeginTask(COUNTING_OBJECTS_PROGRESS, ProgressMonitor.UNKNOWN);\n\t\t\tRevObject o;\n\n\t\t\twhile ((o = walker.next()) != null)\n\t\t\t{\n\t\t\t\taddObject(o);\n\t\t\t\t_initMonitor.Update(1);\n\t\t\t}\n\n\t\t\twhile ((o = walker.nextObject()) != null)\n\t\t\t{\n\t\t\t\taddObject(o);\n\t\t\t\t_initMonitor.Update(1);\n\t\t\t}\n\t\t\t_initMonitor.EndTask();\n\t\t}\n\n\t\tpublic void addObject(RevObject robject)\n\t\t{\n\t\t\tif (robject.has(RevFlag.UNINTERESTING))\n\t\t\t{\n\t\t\t\t_edgeObjects.Add(robject);\n\t\t\t\tThin = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar otp = new ObjectToPack(robject, robject.Type);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_objectsLists[robject.Type].Add(otp);\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\tthrow new IncorrectObjectTypeException(robject, \"COMMIT nor TREE nor BLOB nor TAG\");\n\t\t\t}\n\t\t\t_objectsMap.Add(otp);\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_pos.Dispose();\n\t\t}\n\t\t\n\n\t\t#region Nested Types\n\n\t\tclass ObjectToPack : PackedObjectInfo\n\t\t{\n\t\t\tprivate PackedObjectLoader _reuseLoader;\n\t\t\tprivate int _flags;\n\n\t\t\tpublic ObjectToPack(AnyObjectId src, int type)\n\t\t\t\t: base(src)\n\t\t\t{\n\t\t\t\t_flags |= type << 1;\n\t\t\t}\n\n\t\t\tpublic ObjectId DeltaBaseId { get; set; }\n\n\t\t\tpublic ObjectToPack DeltaBase\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\tif (DeltaBaseId is ObjectToPack) return (ObjectToPack)DeltaBaseId;\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsDeltaRepresentation\n\t\t\t{\n\t\t\t\tget { return DeltaBaseId != null; }\n\t\t\t}\n\n\t\t\tpublic bool IsWritten\n\t\t\t{\n\t\t\t\tget { return Offset != 0; }\n\t\t\t}\n\n\t\t\tpublic bool HasReuseLoader\n\t\t\t{\n\t\t\t\tget { return _reuseLoader != null; }\n\t\t\t}\n\n\t\t\tpublic int Type\n\t\t\t{\n\t\t\t\tget { return (_flags >> 1) & 0x7; }\n\t\t\t}\n\n\t\t\tpublic bool WantWrite\n\t\t\t{\n\t\t\t\tget { return (_flags & 1) == 1; }\n\t\t\t}\n\n\t\t\tpublic void DisposeLoader()\n\t\t\t{\n\t\t\t\t_reuseLoader = null;\n\t\t\t}\n\n\t\t\tpublic void ClearDeltaBase()\n\t\t\t{\n\t\t\t\tDeltaBaseId = null;\n\t\t\t}\n\n\t\t\tpublic PackedObjectLoader UseLoader()\n\t\t\t{\n\t\t\t\tPackedObjectLoader r = _reuseLoader;\n\t\t\t\t_reuseLoader = null;\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\tpublic void SetReuseLoader(PackedObjectLoader reuseLoader)\n\t\t\t{\n\t\t\t\t_reuseLoader = reuseLoader;\n\t\t\t}\n\n\t\t\tpublic void MarkWantWrite()\n\t\t\t{\n\t\t\t\t_flags |= 1;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PackedObjectLoader.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Base class for a set of object loader classes for packed objects.\n\t/// </summary>\n\tpublic abstract class PackedObjectLoader : ObjectLoader, IDisposable\n\t{\n\t\tprivate readonly PackFile _packFile;\n\t\tprivate readonly long _dataOffset;\n\t\tprivate readonly long _objectOffset;\n\n\t\tprotected PackedObjectLoader(PackFile packFile, long dataOffset, long objectOffset)\n\t\t{\n\t\t\t_packFile = packFile;\n\t\t\t_dataOffset = dataOffset;\n\t\t\t_objectOffset = objectOffset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Force this object to be loaded into memory and pinned in this loader.\n\t\t/// <para />\n\t\t/// Once materialized, subsequent get operations for the following methods\n\t\t/// will always succeed without raising an exception, as all information is\n\t\t/// pinned in memory by this loader instance.\n\t\t/// <ul>\n\t\t/// <li>{@link Type}</li>\n\t\t/// <li>{@link Size}</li>\n\t\t/// <li>{@link #getBytes()}, {@link #getCachedBytes}</li>\n\t\t/// <li>{@link #getRawSize()}</li>\n\t\t/// <li>{@link #getRawType()}</li>\n\t\t/// </ul>\n\t\t/// </summary>\n\t\t/// <param name=\"curs\">temporary thread storage during data access.</param>\n\t\tpublic abstract void Materialize(WindowCursor curs);\n\n\t\tpublic override int Type { get; protected set; }\n\n\t\tpublic override long Size { get; protected set; }\n\n\t\tpublic override byte[] CachedBytes { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Gets the offset of object header within pack file\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic long ObjectOffset\n\t\t{\n\t\t\tget { return _objectOffset; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the offset of object data within pack file\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic long DataOffset\n\t\t{\n\t\t\tget { return _dataOffset; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets if this loader is capable of fast raw-data copying basing on\n\t\t/// compressed data checksum; false if raw-data copying needs\n\t\t/// uncompressing and compressing data\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic bool SupportsFastCopyRawData\n\t\t{\n\t\t\tget { return _packFile.SupportsFastCopyRawData; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the id of delta base object for this object representation. \n\t\t/// It returns null if object is not stored as delta.\n\t\t/// </summary>\n\t\tpublic abstract ObjectId DeltaBase { get; }\n\n\t\tprotected PackFile PackFile\n\t\t{\n\t\t\tget { return _packFile; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Peg the pack file open to support data copying.\n\t\t/// <para />\n\t\t/// Applications trying to copy raw pack data should ensure the pack stays\n\t\t/// open and available throughout the entire copy. To do that use:\n\t\t/// <example>\n\t\t/// loader.beginCopyRawData();\n\t\t/// try \n\t\t/// {\n\t\t///\t\tloader.CopyRawData(out, tmpbuf, curs);\n\t\t///\t}\n\t\t/// finally\n\t\t/// {\n\t\t///\t\tloader.endCopyRawData();\n\t\t///\t}\n\t\t///\t</example>\n\t\t/// </summary>\n\t\t/// <exception cref=\"Exception\">\n\t\t/// This loader contains stale information and cannot be used.\n\t\t/// The most likely cause is the underlying pack file has been\n\t\t/// deleted, and the object has moved to another pack file.\n\t\t/// </exception>\n\t\tpublic void beginCopyRawData()\n\t\t{\n\t\t\t_packFile.beginCopyRawData();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Release resources after <see cref=\"beginCopyRawData\"/>.\n\t\t/// </summary>\n\t\tpublic void endCopyRawData()\n\t\t{\n\t\t\t_packFile.endCopyRawData();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copy raw object representation from storage to provided output stream.\n\t\t/// <para />\n\t\t/// Copied data doesn't include object header. User must provide temporary\n\t\t/// buffer used during copying by underlying I/O layer.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\"></typeparam>\n\t\t/// <param name=\"out\">\n\t\t/// Output stream when data is copied. No buffering is guaranteed.\n\t\t/// </param>\n\t\t/// <param name=\"buf\">\n\t\t/// Temporary buffer used during copying. Recommended size is at\n\t\t/// least few kB.\n\t\t/// </param>\n\t\t/// <param name=\"curs\">temporary thread storage during data access.</param>\n\t\t/// <exception cref=\"Exception\">\n\t\t/// When the object cannot be read.\n\t\t/// </exception>\n\t\t/// <seealso cref=\"beginCopyRawData\"/>\n\t\tpublic void CopyRawData<T>(T @out, byte[] buf, WindowCursor curs)\n\t\t\twhere T : Stream\n\t\t{\n\t\t\t_packFile.CopyRawData(this, @out, buf, curs);\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_packFile.Dispose();\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Patch/BinaryHunk.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n    /** Part of a \"GIT binary patch\" to describe the pre-image or post-image */\n\t[Serializable]\n\tpublic class BinaryHunk\n    {\n\t    private static readonly byte[] LITERAL = Constants.encodeASCII(\"literal \");\n\n\t    private static readonly byte[] DELTA = Constants.encodeASCII(\"delta \");\n\n\t    /** Type of information stored in a binary hunk. */\n\t\t[Serializable]\n\t    public enum Type\n        {\n\t\t    /** The full content is stored, deflated. */\n\t\t    LITERAL_DEFLATED,\n\n\t\t    /** A Git pack-style delta is stored, deflated. */\n\t\t    DELTA_DEFLATED\n\t    }\n\n\t    private readonly FileHeader file;\n\n\t    /** Offset within {@link #file}.buf to the \"literal\" or \"delta \" line. */\n\t    public readonly int startOffset;\n\n\t    /** Position 1 past the end of this hunk within {@link #file}'s buf. */\n\t    public int endOffset;\n\n\t    /** Type of the data meaning. */\n\t    private Type type;\n\n\t    /** Inflated length of the data. */\n\t    private int length;\n\n\t    public BinaryHunk(FileHeader fh, int offset)\n        {\n\t\t    file = fh;\n\t\t    startOffset = offset;\n\t    }\n\n\t    /** @return header for the file this hunk applies to */\n\t    public FileHeader getFileHeader()\n        {\n\t\t    return file;\n\t    }\n\n\t    /** @return the byte array holding this hunk's patch script. */\n\t    public byte[] getBuffer()\n        {\n\t\t\treturn file.Buffer;\n\t    }\n\n\t    /** @return offset the start of this hunk in {@link #getBuffer()}. */\n\t    public int getStartOffset()\n        {\n\t\t    return startOffset;\n\t    }\n\n\t    /** @return offset one past the end of the hunk in {@link #getBuffer()}. */\n\t    public int getEndOffset()\n        {\n\t\t    return endOffset;\n\t    }\n\n\t    /** @return type of this binary hunk */\n\t    public Type getType() {\n\t\t    return type;\n\t    }\n\n\t    /** @return inflated size of this hunk's data */\n\t    public int getSize()\n        {\n\t\t    return length;\n\t    }\n\n\t    public int parseHunk(int ptr, int end)\n        {\n\t\t\tbyte[] buf = file.Buffer;\n\n\t\t    if (RawParseUtils.match(buf, ptr, LITERAL) >= 0) {\n\t\t\t    type = Type.LITERAL_DEFLATED;\n\t\t\t    length = RawParseUtils.parseBase10(buf, ptr + LITERAL.Length, null);\n\n\t\t    } else if (RawParseUtils.match(buf, ptr, DELTA) >= 0) {\n\t\t\t    type = Type.DELTA_DEFLATED;\n\t\t\t    length = RawParseUtils.parseBase10(buf, ptr + DELTA.Length, null);\n\n\t\t    } else {\n\t\t\t    // Not a valid binary hunk. Signal to the caller that\n\t\t\t    // we cannot parse any further and that this line should\n\t\t\t    // be treated otherwise.\n\t\t\t    //\n\t\t\t    return -1;\n\t\t    }\n\t\t    ptr = RawParseUtils.nextLF(buf, ptr);\n\n\t\t    // Skip until the first blank line; that is the end of the binary\n\t\t    // encoded information in this hunk. To save time we don't do a\n\t\t    // validation of the binary data at this point.\n\t\t    //\n\t\t    while (ptr < end) {\n\t\t\t    bool empty = buf[ptr] == '\\n';\n\t\t\t    ptr = RawParseUtils.nextLF(buf, ptr);\n\t\t\t    if (empty)\n\t\t\t\t    break;\n\t\t    }\n\n\t\t    return ptr;\n\t    }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Patch/CombinedFileHeader.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n    /**\n     * A file in the Git \"diff --cc\" or \"diff --combined\" format.\n     * <para />\n     * A combined diff shows an n-way comparison between two or more ancestors and\n     * the final revision. Its primary function is to perform code reviews on a\n     * merge which introduces changes not in any ancestor.\n     */\n    public class CombinedFileHeader : FileHeader\n    {\n        private static readonly byte[] Mode = Constants.encodeASCII(\"mode \");\n\n        private AbbreviatedObjectId[] _oldIds;\n        private FileMode[] _oldModes;\n\n        public CombinedFileHeader(byte[] b, int offset)\n            : base(b, offset)\n        {\n        }\n\n        /// <summary>\n\t\t/// Number of ancestor revisions mentioned in this diff.\n        /// </summary>\n    \tpublic override int ParentCount\n    \t{\n    \t\tget { return _oldIds.Length; }\n    \t}\n\n    \t/// <summary>\n    \t/// Get the file mode of the first parent.\n    \t///  </summary>\n    \tpublic override FileMode GetOldMode()\n    \t{\n    \t\treturn getOldMode(0);\n    \t}\n\n    \t/**\n         * Get the file mode of the nth ancestor\n         *\n         * @param nthParent\n         *            the ancestor to get the mode of\n         * @return the mode of the requested ancestor.\n         */\n        public FileMode getOldMode(int nthParent)\n        {\n            return _oldModes[nthParent];\n        }\n\n        /** @return get the object id of the first parent. */\n        public override AbbreviatedObjectId getOldId()\n        {\n            return getOldId(0);\n        }\n\n        /**\n         * Get the ObjectId of the nth ancestor\n         *\n         * @param nthParent\n         *            the ancestor to get the object id of\n         * @return the id of the requested ancestor.\n         */\n        public AbbreviatedObjectId getOldId(int nthParent)\n        {\n            return _oldIds[nthParent];\n        }\n\n        public override string getScriptText(Encoding oldCharset, Encoding newCharset)\n        {\n            var cs = new Encoding[ParentCount + 1];\n            for (int i = 0; i < cs.Length; i++)\n            {\n            \tcs[i] = oldCharset;\n            }\n            cs[ParentCount] = newCharset;\n            return getScriptText(cs);\n        }\n        \n        public override int parseGitHeaders(int ptr, int end)\n        {\n            while (ptr < end)\n            {\n                int eol = RawParseUtils.nextLF(Buffer, ptr);\n\t\t\t\tif (isHunkHdr(Buffer, ptr, end) >= 1)\n                {\n                    // First hunk header; break out and parse them later.\n                    break;\n                }\n\n\t\t\t\tif (RawParseUtils.match(Buffer, ptr, OLD_NAME) >= 0)\n                {\n                    ParseOldName(ptr, eol);\n\n                }\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NEW_NAME) >= 0)\n                {\n                    ParseNewName(ptr, eol);\n\n                }\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, Index) >= 0)\n                {\n                    ParseIndexLine(ptr + Index.Length, eol);\n\n                }\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, Mode) >= 0)\n                {\n                    parseModeLine(ptr + Mode.Length, eol);\n\n                }\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NewFileMode) >= 0)\n                {\n                    ParseNewFileMode(ptr, eol);\n\n                }\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, DeletedFileMode) >= 0)\n                {\n                    parseDeletedFileMode(ptr + DeletedFileMode.Length, eol);\n\n                }\n                else\n                {\n                    // Probably an empty patch (stat dirty).\n                    break;\n                }\n\n                ptr = eol;\n            }\n            return ptr;\n        }\n\n    \tprotected override void ParseIndexLine(int ptr, int end)\n        {\n            // \"index $asha1,$bsha1..$csha1\"\n            //\n            var ids = new List<AbbreviatedObjectId>();\n            while (ptr < end)\n            {\n\t\t\t\tint comma = RawParseUtils.nextLF(Buffer, ptr, (byte)',');\n                if (end <= comma) break;\n\t\t\t\tids.Add(AbbreviatedObjectId.FromString(Buffer, ptr, comma - 1));\n                ptr = comma;\n            }\n\n            _oldIds = new AbbreviatedObjectId[ids.Count + 1];\n            ids.CopyTo(_oldIds);\n\t\t\tint dot2 = RawParseUtils.nextLF(Buffer, ptr, (byte)'.');\n\t\t\t_oldIds[_oldIds.Length - 1] = AbbreviatedObjectId.FromString(Buffer, ptr, dot2 - 1);\n\t\t\tNewId = AbbreviatedObjectId.FromString(Buffer, dot2 + 1, end - 1);\n            _oldModes = new FileMode[_oldIds.Length];\n        }\n\n    \tprotected override void ParseNewFileMode(int ptr, int eol)\n        {\n            for (int i = 0; i < _oldModes.Length; i++)\n            {\n            \t_oldModes[i] = FileMode.Missing;\n            }\n            base.ParseNewFileMode(ptr, eol);\n        }\n\n        public override HunkHeader newHunkHeader(int offset)\n        {\n            return new CombinedHunkHeader(this, offset);\n        }\n\n        private void parseModeLine(int ptr, int eol)\n        {\n            // \"mode $amode,$bmode..$cmode\"\n            //\n            int n = 0;\n            while (ptr < eol)\n            {\n\t\t\t\tint comma = RawParseUtils.nextLF(Buffer, ptr, (byte)',');\n                if (eol <= comma)\n                    break;\n                _oldModes[n++] = ParseFileMode(ptr, comma);\n                ptr = comma;\n            }\n\n\t\t\tint dot2 = RawParseUtils.nextLF(Buffer, ptr, (byte)'.');\n            _oldModes[n] = ParseFileMode(ptr, dot2);\n            NewMode = ParseFileMode(dot2 + 1, eol);\n        }\n\n        private void parseDeletedFileMode(int ptr, int eol)\n        {\n            // \"deleted file mode $amode,$bmode\"\n            //\n            ChangeType = ChangeTypeEnum.DELETE;\n            int n = 0;\n            while (ptr < eol)\n            {\n\t\t\t\tint comma = RawParseUtils.nextLF(Buffer, ptr, (byte)',');\n                if (eol <= comma)\n                    break;\n                _oldModes[n++] = ParseFileMode(ptr, comma);\n                ptr = comma;\n            }\n\n            _oldModes[n] = ParseFileMode(ptr, eol);\n            NewMode = FileMode.Missing;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Patch/CombinedHunkHeader.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n\t/// <summary>\n\t/// Hunk header for a hunk appearing in a \"diff --cc\" style patch.\n\t/// </summary>\n\tpublic class CombinedHunkHeader : HunkHeader\n\t{\n\t\tprivate readonly List<CombinedOldImage> _old;\n\n\t\tpublic CombinedHunkHeader(FileHeader fh, int offset)\n\t\t\t: base(fh, offset, null)\n\t\t{\n\t\t\tint size = fh.ParentCount;\n\t\t\t_old = new List<CombinedOldImage>(size);\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\t_old.Add(new CombinedOldImage(fh, i));\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the <see cref=\"OldImage\"/> data related to the nth ancestor\n\t\t/// </summary>\n\t\t/// <param name=\"nthParent\">The ancestor to get the old image data of</param>\n\t\t/// <returns>The image data of the requested ancestor.</returns>\n\t\tinternal OldImage GetOldImage(int nthParent)\n\t\t{\n\t\t\treturn _old[nthParent];\n\t\t}\n\n        internal override OldImage OldImage\n        {\n            get\n            {\n                return GetOldImage(0);\n            }\n        }\n\n\t\tpublic override void parseHeader()\n\t\t{\n\t\t\t// Parse \"@@@ -55,12 -163,13 +163,15 @@@ protected boolean\"\n\t\t\t//\n\t\t\tbyte[] buf = File.Buffer;\n\t\t\tvar ptr = new MutableInteger\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = RawParseUtils.nextLF(buf, StartOffset, (byte)' ')\n\t\t\t\t\t\t};\n\n\t\t\t_old.ForEach(coi =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcoi.StartLine = -1 * RawParseUtils.parseBase10(Buffer, ptr.value, ptr);\n\t\t\t\t\t\t\t\tcoi.LineCount = buf[ptr.value] == ',' ?\n\t\t\t\t\t\t\t\t\tRawParseUtils.parseBase10(buf, ptr.value + 1, ptr) : 1;\n\t\t\t\t\t\t\t});\n\n\t\t\tNewStartLine = RawParseUtils.parseBase10(buf, ptr.value + 1, ptr);\n\t\t\tNewLineCount = buf[ptr.value] == ',' ? RawParseUtils.parseBase10(buf, ptr.value + 1, ptr) : 1;\n\t\t}\n\n\t\tpublic override int parseBody(Patch script, int end)\n\t\t{\n\t\t\tbyte[] buf = File.Buffer;\n\t\t\tint c = RawParseUtils.nextLF(buf, StartOffset);\n\n\t\t\t_old.ForEach(coi =>\n\t\t\t             \t{\n\t\t\t             \t\tcoi.LinesAdded = 0;\n\t\t\t             \t\tcoi.LinesDeleted = 0;\n\t\t\t             \t\tcoi.LinesContext = 0;\n\t\t\t             \t});\n\n\t\t\tLinesContext = 0;\n\t\t\tint nAdded = 0;\n\n\t\t\tfor (int eol; c < end; c = eol)\n\t\t\t{\n\t\t\t\teol = RawParseUtils.nextLF(buf, c);\n\n\t\t\t\tif (eol - c < _old.Count + 1)\n\t\t\t\t{\n\t\t\t\t\t// Line isn't long enough to mention the state of each\n\t\t\t\t\t// ancestor. It must be the end of the hunk.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbool break_scan = false;\n\t\t\t\tswitch (buf[c])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Line can't possibly be part of this hunk; the first\n\t\t\t\t\t\t// ancestor information isn't recognizable.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tbreak_scan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (break_scan)\n\t\t\t\t\tbreak;\n\n\t\t\t\tint localcontext = 0;\n\t\t\t\tfor (int ancestor = 0; ancestor < _old.Count; ancestor++)\n\t\t\t\t{\n\t\t\t\t\tswitch (buf[c + ancestor])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\t\t\tlocalcontext++;\n\t\t\t\t\t\t\t_old[ancestor].LinesContext++;\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\t\t_old[ancestor].LinesDeleted++;\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\t\t_old[ancestor].LinesAdded++;\n\t\t\t\t\t\t\tnAdded++;\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak_scan = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (break_scan)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (break_scan)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (localcontext == _old.Count)\n\t\t\t\t{\n\t\t\t\t\tLinesContext++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int ancestor = 0; ancestor < _old.Count; ancestor++)\n\t\t\t{\n\t\t\t\tCombinedOldImage o = _old[ancestor];\n\t\t\t\tint cmp = o.LinesContext + o.LinesDeleted;\n\t\t\t\tif (cmp < o.LineCount)\n\t\t\t\t{\n\t\t\t\t\tint missingCnt = o.LineCount - cmp;\n\t\t\t\t\tscript.error(buf, StartOffset, \"Truncated hunk, at least \"\n\t\t\t\t\t\t\t+ missingCnt + \" lines is missing for ancestor \"\n\t\t\t\t\t\t\t+ (ancestor + 1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (LinesContext + nAdded < NewLineCount)\n\t\t\t{\n\t\t\t\tint missingCount = NewLineCount - (LinesContext + nAdded);\n\t\t\t\tscript.error(buf, StartOffset, \"Truncated hunk, at least \"\n\t\t\t\t\t\t+ missingCount + \" new lines is missing\");\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic void extractFileLines(Stream[] outStream)\n\t\t{\n\t\t\tbyte[] buf = File.Buffer;\n\t\t\tint ptr = StartOffset;\n\t\t\tint eol = RawParseUtils.nextLF(buf, ptr);\n\t\t\tif (EndOffset <= eol)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Treat the hunk header as though it were from the ancestor,\n\t\t\t// as it may have a function header appearing After it which\n\t\t\t// was copied out of the ancestor file.\n\t\t\t//\n\t\t\toutStream[0].Write(buf, ptr, eol - ptr);\n\n\t\t\t//SCAN: \n\t\t\tfor (ptr = eol; ptr < EndOffset; ptr = eol)\n\t\t\t{\n\t\t\t\teol = RawParseUtils.nextLF(buf, ptr);\n\n\t\t\t\tif (eol - ptr < _old.Count + 1)\n\t\t\t\t{\n\t\t\t\t\t// Line isn't long enough to mention the state of each\n\t\t\t\t\t// ancestor. It must be the end of the hunk.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbool breakScan = false;\n\t\t\t\tswitch (buf[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Line can't possibly be part of this hunk; the first\n\t\t\t\t\t\t// ancestor information isn't recognizable.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (breakScan)\n\t\t\t\t\tbreak;\n\n\t\t\t\tint delcnt = 0;\n\t\t\t\tfor (int ancestor = 0; ancestor < _old.Count; ancestor++)\n\t\t\t\t{\n\t\t\t\t\tswitch (buf[ptr + ancestor])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\t\tdelcnt++;\n\t\t\t\t\t\t\toutStream[ancestor].Write(buf, ptr, eol - ptr);\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\t\t\toutStream[ancestor].Write(buf, ptr, eol - ptr);\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (breakScan)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (breakScan)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (delcnt < _old.Count)\n\t\t\t\t{\n\t\t\t\t\t// This line appears in the new file if it wasn't deleted\n\t\t\t\t\t// relative to all ancestors.\n\t\t\t\t\t//\n\t\t\t\t\toutStream[_old.Count].Write(buf, ptr, eol - ptr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void extractFileLines(StringBuilder sb, string[] text, int[] offsets)\n\t\t{\n\t\t\tbyte[] buf = File.Buffer;\n\t\t\tint ptr = StartOffset;\n\t\t\tint eol = RawParseUtils.nextLF(buf, ptr);\n\n\t\t\tif (EndOffset <= eol)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcopyLine(sb, text, offsets, 0);\n\n\t\t\tfor (ptr = eol; ptr < EndOffset; ptr = eol)\n\t\t\t{\n\t\t\t\teol = RawParseUtils.nextLF(buf, ptr);\n\n\t\t\t\tif (eol - ptr < _old.Count + 1)\n\t\t\t\t{\n\t\t\t\t\t// Line isn't long enough to mention the state of each\n\t\t\t\t\t// ancestor. It must be the end of the hunk.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbool breakScan = false;\n\t\t\t\tswitch (buf[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Line can't possibly be part of this hunk; the first\n\t\t\t\t\t\t// ancestor information isn't recognizable.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (breakScan)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbool copied = false;\n\t\t\t\tfor (int ancestor = 0; ancestor < _old.Count; ancestor++)\n\t\t\t\t{\n\t\t\t\t\tswitch (buf[ptr + ancestor])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\t\tif (copied)\n\t\t\t\t\t\t\t\tskipLine(text, offsets, ancestor);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcopyLine(sb, text, offsets, ancestor);\n\t\t\t\t\t\t\t\tcopied = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (breakScan)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (breakScan)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!copied)\n\t\t\t\t{\n\t\t\t\t\t// If none of the ancestors caused the copy then this line\n\t\t\t\t\t// must be new across the board, so it only appears in the\n\t\t\t\t\t// text of the new file.\n\t\t\t\t\t//\n\t\t\t\t\tcopyLine(sb, text, offsets, _old.Count);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Patch/FileHeader.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n\t/// <summary>\n\t/// Patch header describing an action for a single file path.\n\t/// </summary>\n\t[Serializable]\n\tpublic class FileHeader\n\t{\n\t\t// Magical file name used for file adds or deletes.\n\t\tpublic const string DEV_NULL = \"/dev/null\";\n\n\t\tprivate static readonly byte[] OldModeString = Constants.encodeASCII(\"old mode \");\n\n\t\tprivate static readonly byte[] NewModeString = Constants.encodeASCII(\"new mode \");\n\n\t\tprotected static readonly byte[] DeletedFileMode = Constants.encodeASCII(\"deleted file mode \");\n\n\t\tprotected static readonly byte[] NewFileMode = Constants.encodeASCII(\"new file mode \");\n\n\t\tprivate static readonly byte[] CopyFrom = Constants.encodeASCII(\"copy from \");\n\n\t\tprivate static readonly byte[] CopyTo = Constants.encodeASCII(\"copy to \");\n\n\t\tprivate static readonly byte[] RenameOld = Constants.encodeASCII(\"rename old \");\n\n\t\tprivate static readonly byte[] RenameNew = Constants.encodeASCII(\"rename new \");\n\n\t\tprivate static readonly byte[] RenameFrom = Constants.encodeASCII(\"rename from \");\n\n\t\tprivate static readonly byte[] RenameTo = Constants.encodeASCII(\"rename to \");\n\n\t\tprivate static readonly byte[] SimilarityIndex = Constants.encodeASCII(\"similarity index \");\n\n\t\tprivate static readonly byte[] DissimilarityIndex = Constants.encodeASCII(\"dissimilarity index \");\n\n\t\tprotected static readonly byte[] Index = Constants.encodeASCII(\"index \");\n\n\t\tpublic static readonly byte[] OLD_NAME = Constants.encodeASCII(\"--- \");\n\n\t\tpublic static readonly byte[] NEW_NAME = Constants.encodeASCII(\"+++ \");\n\n\t\t/// <summary>\n\t\t/// General type of change a single file-level patch describes.\n\t\t/// </summary>\n\t\t[Serializable]\n\t\tpublic enum ChangeTypeEnum\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Add a new file to the project\n\t\t\t/// </summary>\n\t\t\tADD,\n\n\t\t\t/// <summary>\n\t\t\t/// Modify an existing file in the project (content and/or mode)\n\t\t\t/// </summary>\n\t\t\tMODIFY,\n\n\t\t\t/// <summary>\n\t\t\t/// Delete an existing file from the project\n\t\t\t/// </summary>\n\t\t\tDELETE,\n\n\t\t\t/// <summary>\n\t\t\t/// Rename an existing file to a new location\n\t\t\t/// </summary>\n\t\t\tRENAME,\n\n\t\t\t/// <summary>\n\t\t\t/// Copy an existing file to a new location, keeping the original\n\t\t\t/// </summary>\n\t\t\tCOPY\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Type of patch used by this file.\n\t\t/// </summary>\n\t\t[Serializable]\n\t\tpublic enum PatchTypeEnum\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// A traditional unified diff style patch of a text file.\n\t\t\t/// </summary>\n\t\t\tUNIFIED,\n\n\t\t\t/// <summary>\n\t\t\t/// An empty patch with a message \"Binary files ... differ\"\n\t\t\t/// </summary>\n\t\t\tBINARY,\n\n\t\t\t/// <summary>\n\t\t\t/// A Git binary patch, holding pre and post image deltas\n\t\t\t/// </summary>\n\t\t\tGIT_BINARY\n\t\t}\n\n\t\t// File name of the old (pre-image).\n\t\tprivate string oldName;\n\n\t\t// File name of the new (post-image).\n\t\tprivate string newName;\n\n\t\t// Old mode of the file, if described by the patch, else null.\n\t\tprivate FileMode _oldMode;\n\n\t\t// New mode of the file, if described by the patch, else null.\n\t\tprivate FileMode _newMode;\n\n\t\t// Similarity score if ChangeType is a copy or rename.\n\t\tprivate int _score;\n\n\t\t// ObjectId listed on the index line for the old (pre-image)\n\t\tprivate AbbreviatedObjectId oldId;\n\n\t\t// The hunks of this file\n\t\tprivate List<HunkHeader> _hunks;\n\n\t\tpublic FileHeader(byte[] b, int offset)\n\t\t{\n\t\t\tBuffer = b;\n\t\t\tStartOffset = offset;\n\t\t\tChangeType = ChangeTypeEnum.MODIFY; // unless otherwise designated\n\t\t\tPatchType = PatchTypeEnum.UNIFIED;\n\t\t}\n\n\t\tpublic virtual int ParentCount\n\t\t{\n\t\t\tget { return 1; }\n\t\t}\n\n\t\tprotected AbbreviatedObjectId NewId { private get; set; }\n\n\t\t/// <summary>\n\t\t/// The byte array holding this file's patch script.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic byte[] Buffer { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Offset the start of this file's script in <see cref=\"Buffer\"/>\n\t\t/// </summary>\n\t\tpublic int StartOffset { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Offset one past the end of the file script.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic int EndOffset { get; set; }\n\n\t\tpublic BinaryHunk ForwardBinaryHunk { get; set; }\n\n\t\tpublic BinaryHunk ReverseBinaryHunk { get; set; }\n\n\t\tpublic ChangeTypeEnum ChangeType { get; set; }\n\n\t\tpublic PatchTypeEnum PatchType { get; set; }\n\n\t\t/// <summary>\n\t\t/// Convert the patch script for this file into a string.\n\t\t/// <para />\n\t\t/// The default character encoding <see cref=\"Constants.CHARSET\"/> is assumed for\n\t\t/// both the old and new files.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The patch script, as a Unicode string.\n\t\t/// </returns>\n\t\tpublic string getScriptText()\n\t\t{\n\t\t\treturn getScriptText(null, null);\n\t\t}\n\n\t\t/// <summary>\n\t\t///Convert the patch script for this file into a string.\n\t\t/// </summary>\n\t\t/// <param name=\"oldCharset\">hint character set to decode the old lines with.</param>\n\t\t/// <param name=\"newCharset\">hint character set to decode the new lines with.</param>\n\t\t/// <returns>the patch script, as a Unicode string.</returns>\n\t\tpublic virtual string getScriptText(Encoding oldCharset, Encoding newCharset)\n\t\t{\n\t\t\treturn getScriptText(new[] { oldCharset, newCharset });\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert the patch script for this file into a string.\n\t\t/// </summary>\n\t\t/// <param name=\"charsetGuess\">\n\t\t/// optional array to suggest the character set to use when\n\t\t/// decoding each file's line. If supplied the array must have a\n\t\t/// length of <code><see cref=\"ParentCount\"/> + 1</code>\n\t\t/// representing the old revision character sets and the new\n\t\t/// revision character set.\n\t\t/// </param>\n\t\t/// <returns>the patch script, as a Unicode string.</returns>\n\t\tpublic string getScriptText(Encoding[] charsetGuess)\n\t\t{\n\t\t\tif (Hunks.Count == 0)\n\t\t\t{\n\t\t\t\t// If we have no hunks then we can safely assume the entire\n\t\t\t\t// patch is a binary style patch, or a meta-data only style\n\t\t\t\t// patch. Either way the encoding of the headers should be\n\t\t\t\t// strictly 7-bit US-ASCII and the body is either 7-bit ASCII\n\t\t\t\t// (due to the base 85 encoding used for a BinaryHunk) or is\n\t\t\t\t// arbitrary noise we have chosen to ignore and not understand\n\t\t\t\t// (e.g. the message \"Binary files ... differ\").\n\t\t\t\t//\n\t\t\t\treturn RawParseUtils.extractBinaryString(Buffer, StartOffset, EndOffset);\n\t\t\t}\n\n\t\t\tif (charsetGuess != null && charsetGuess.Length != ParentCount + 1)\n\t\t\t\tthrow new ArgumentException(\"Expected \"\n\t\t\t\t\t\t+ (ParentCount + 1) + \" character encoding guesses\");\n\n\t\t\tif (TrySimpleConversion(charsetGuess))\n\t\t\t{\n\t\t\t\tEncoding cs = (charsetGuess != null ? charsetGuess[0] : null) ?? Constants.CHARSET;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn RawParseUtils.decodeNoFallback(cs, Buffer, StartOffset, EndOffset);\n\t\t\t\t}\n\t\t\t\tcatch (EncoderFallbackException)\n\t\t\t\t{\n\t\t\t\t\t// Try the much slower, more-memory intensive version which\n\t\t\t\t\t// can handle a character set conversion patch.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar r = new StringBuilder(EndOffset - StartOffset);\n\n\t\t\t// Always treat the headers as US-ASCII; Git file names are encoded\n\t\t\t// in a C style escape if any character has the high-bit set.\n\t\t\t//\n\t\t\tint hdrEnd = Hunks[0].StartOffset;\n\t\t\tfor (int ptr = StartOffset; ptr < hdrEnd; )\n\t\t\t{\n\t\t\t\tint eol = Math.Min(hdrEnd, RawParseUtils.nextLF(Buffer, ptr));\n\t\t\t\tr.Append(RawParseUtils.extractBinaryString(Buffer, ptr, eol));\n\t\t\t\tptr = eol;\n\t\t\t}\n\n\t\t\tstring[] files = ExtractFileLines(charsetGuess);\n\t\t\tvar offsets = new int[files.Length];\n\t\t\tforeach (HunkHeader h in Hunks)\n\t\t\t{\n\t\t\t\th.extractFileLines(r, files, offsets);\n\t\t\t}\n\n\t\t\treturn r.ToString();\n\t\t}\n\n\t\tprivate static bool TrySimpleConversion(Encoding[] charsetGuess)\n\t\t{\n\t\t\tif (charsetGuess == null) return true;\n\n\t\t\tfor (int i = 1; i < charsetGuess.Length; i++)\n\t\t\t{\n\t\t\t\tif (charsetGuess[i] != charsetGuess[0]) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate string[] ExtractFileLines(Encoding[] csGuess)\n\t\t{\n\t\t\tvar tmp = new TemporaryBuffer[ParentCount + 1];\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < tmp.Length; i++)\n\t\t\t\t{\n\t\t\t\t\ttmp[i] = new LocalFileBuffer();\n\t\t\t\t}\n\n\t\t\t\tforeach (HunkHeader h in Hunks)\n\t\t\t\t{\n\t\t\t\t\th.extractFileLines(tmp);\n\t\t\t\t}\n\n\t\t\t\tvar r = new String[tmp.Length];\n\t\t\t\tfor (int i = 0; i < tmp.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tEncoding cs = (csGuess != null ? csGuess[i] : null) ?? Constants.CHARSET;\n\t\t\t\t\tr[i] = RawParseUtils.decode(cs, tmp[i].ToArray());\n\t\t\t\t}\n\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tcatch (IOException ioe)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Cannot convert script to text\", ioe);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tforeach (TemporaryBuffer b in tmp)\n\t\t\t\t{\n\t\t\t\t\tif (b != null)\n\t\t\t\t\t\tb.destroy();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the old name associated with this file.\n\t\t/// <para />\n\t\t/// The meaning of the old name can differ depending on the semantic meaning\n\t\t/// of this patch:\n\t\t/// <ul>\n\t\t/// <li><i>file add</i>: always <code>/dev/null</code></li>\n\t\t/// <li><i>file modify</i>: always <see cref=\"NewName\"/></li>\n\t\t/// <li><i>file delete</i>: always the file being deleted</li>\n\t\t/// <li><i>file copy</i>: source file the copy originates from</li>\n\t\t/// <li><i>file rename</i>: source file the rename originates from</li>\n\t\t/// </ul>\n\t\t/// </summary>\n\t\t/// <returns>Old name for this file.</returns>\n\t\tpublic string OldName\n\t\t{\n\t\t\tget { return oldName; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the new name associated with this file.\n\t\t/// <para />\n\t\t/// The meaning of the new name can differ depending on the semantic meaning\n\t\t/// of this patch:\n\t\t/// <ul>\n\t\t/// <li><i>file add</i>: always the file being created</li>\n\t\t/// <li><i>file modify</i>: always <see cref=\"OldName\"/></li>\n\t\t/// <li><i>file delete</i>: always <code>/dev/null</code></li>\n\t\t/// <li><i>file copy</i>: destination file the copy ends up at</li>\n\t\t/// <li><i>file rename</i>: destination file the rename ends up at</li>\n\t\t/// </ul>\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic string NewName\n\t\t{\n\t\t\tget { return newName; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The old file mode, if described in the patch\n\t\t/// </summary>\n\t\tpublic virtual FileMode GetOldMode()\n\t\t{\n\t\t\treturn _oldMode;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The new file mode, if described in the patch\n\t\t/// </summary>\n\t\tpublic FileMode NewMode\n\t\t{\n\t\t\tget { return _newMode; }\n\t\t\tprotected set { _newMode = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The type of change this patch makes on <see cref=\"NewName\"/>\n\t\t/// </summary>\n\t\tpublic ChangeTypeEnum getChangeType()\n\t\t{\n\t\t\treturn ChangeType;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns similarity score between <see cref=\"OldName\"/> and\n\t\t/// <see cref=\"NewName\"/> if <see cref=\"getChangeType()\"/> is\n\t\t/// <see cref=\"ChangeTypeEnum.COPY\"/> or <see cref=\"ChangeTypeEnum.RENAME\"/>.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic int getScore()\n\t\t{\n\t\t\treturn _score;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the old object id from the <code>index</code>.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The object id; null if there is no index line\n\t\t/// </returns>\n\t\tpublic virtual AbbreviatedObjectId getOldId()\n\t\t{\n\t\t\treturn oldId;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the new object id from the <code>index</code>.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The object id; null if there is no index line\n\t\t/// </returns>\n\t\tpublic AbbreviatedObjectId getNewId()\n\t\t{\n\t\t\treturn NewId;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Style of patch used to modify this file\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic PatchTypeEnum getPatchType()\n\t\t{\n\t\t\treturn PatchType;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// True if this patch modifies metadata about a file\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic bool hasMetaDataChanges()\n\t\t{\n\t\t\treturn ChangeType != ChangeTypeEnum.MODIFY || _newMode != _oldMode;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the hunks altering this file; in order of appearance in patch\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic List<HunkHeader> Hunks\n\t\t{\n\t\t\tget { return _hunks ?? (_hunks = new List<HunkHeader>()); }\n\t\t}\n\n\t\tpublic void addHunk(HunkHeader h)\n\t\t{\n\t\t\tif (h.File != this)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Hunk belongs to another file\");\n\t\t\t}\n\n\t\t\tHunks.Add(h);\n\t\t}\n\n\t\tpublic virtual HunkHeader newHunkHeader(int offset)\n\t\t{\n\t\t\treturn new HunkHeader(this, offset);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// If a <see cref=\"PatchTypeEnum.GIT_BINARY\"/>, the new-image delta/literal\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic BinaryHunk getForwardBinaryHunk()\n\t\t{\n\t\t\treturn ForwardBinaryHunk;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// If a <see cref=\"PatchTypeEnum.GIT_BINARY\"/>, the old-image delta/literal\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic BinaryHunk getReverseBinaryHunk()\n\t\t{\n\t\t\treturn ReverseBinaryHunk;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a list describing the content edits performed on this file.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic EditList ToEditList()\n\t\t{\n\t\t\tvar r = new EditList();\n\t\t\t_hunks.ForEach(hunk => r.AddRange(hunk.ToEditList()));\n\t\t\treturn r;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse a \"diff --git\" or \"diff --cc\" line.\n\t\t/// </summary>\n\t\t/// <param name=\"ptr\">\n\t\t/// first character After the \"diff --git \" or \"diff --cc \" part.\n\t\t/// </param>\n\t\t/// <param name=\"end\">\n\t\t/// one past the last position to parse.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// first character After the LF at the end of the line; -1 on error.\n\t\t/// </returns>\n\t\tpublic int parseGitFileName(int ptr, int end)\n\t\t{\n\t\t\tint eol = RawParseUtils.nextLF(Buffer, ptr);\n\t\t\tint bol = ptr;\n\t\t\tif (eol >= end)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// buffer[ptr..eol] looks like \"a/foo b/foo\\n\". After the first\n\t\t\t// A regex to match this is \"^[^/]+/(.*?) [^/+]+/\\1\\n$\". There\n\t\t\t// is only one way to split the line such that text to the left\n\t\t\t// of the space matches the text to the right, excluding the part\n\t\t\t// before the first slash.\n\t\t\t//\n\t\t\tint aStart = RawParseUtils.nextLF(Buffer, ptr, (byte)'/');\n\t\t\tif (aStart >= eol)\n\t\t\t\treturn eol;\n\n\t\t\twhile (ptr < eol)\n\t\t\t{\n\t\t\t\tint sp = RawParseUtils.nextLF(Buffer, ptr, (byte)' ');\n\t\t\t\tif (sp >= eol)\n\t\t\t\t{\n\t\t\t\t\t// We can't split the header, it isn't valid.\n\t\t\t\t\t// This may be OK if this is a rename patch.\n\t\t\t\t\t//\n\t\t\t\t\treturn eol;\n\t\t\t\t}\n\t\t\t\tint bStart = RawParseUtils.nextLF(Buffer, sp, (byte)'/');\n\t\t\t\tif (bStart >= eol)\n\t\t\t\t\treturn eol;\n\n\t\t\t\t// If buffer[aStart..sp - 1] = buffer[bStart..eol - 1]\n\t\t\t\t// we have a valid split.\n\t\t\t\t//\n\t\t\t\tif (Eq(aStart, sp - 1, bStart, eol - 1))\n\t\t\t\t{\n\t\t\t\t\tif (Buffer[bol] == '\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t// We're a double quoted name. The region better end\n\t\t\t\t\t\t// in a double quote too, and we need to decode the\n\t\t\t\t\t\t// characters before reading the name.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (Buffer[sp - 2] != '\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn eol;\n\t\t\t\t\t\t}\n\t\t\t\t\t\toldName = QuotedString.GitPathStyle.GIT_PATH.dequote(Buffer, bol, sp - 1);\n\t\t\t\t\t\toldName = P1(oldName);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toldName = RawParseUtils.decode(Constants.CHARSET, Buffer, aStart, sp - 1);\n\t\t\t\t\t}\n\t\t\t\t\tnewName = oldName;\n\t\t\t\t\treturn eol;\n\t\t\t\t}\n\n\t\t\t\t// This split wasn't correct. Move past the space and try\n\t\t\t\t// another split as the space must be part of the file name.\n\t\t\t\t//\n\t\t\t\tptr = sp;\n\t\t\t}\n\n\t\t\treturn eol;\n\t\t}\n\n\t\tpublic virtual int parseGitHeaders(int ptr, int end)\n\t\t{\n\t\t\twhile (ptr < end)\n\t\t\t{\n\t\t\t\tint eol = RawParseUtils.nextLF(Buffer, ptr);\n\t\t\t\tif (isHunkHdr(Buffer, ptr, eol) >= 1)\n\t\t\t\t{\n\t\t\t\t\t// First hunk header; break out and parse them later.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (RawParseUtils.match(Buffer, ptr, OLD_NAME) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseOldName(ptr, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NEW_NAME) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseNewName(ptr, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, OldModeString) >= 0)\n\t\t\t\t{\n\t\t\t\t\t_oldMode = ParseFileMode(ptr + OldModeString.Length, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NewModeString) >= 0)\n\t\t\t\t{\n\t\t\t\t\t_newMode = ParseFileMode(ptr + NewModeString.Length, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, DeletedFileMode) >= 0)\n\t\t\t\t{\n\t\t\t\t\t_oldMode = ParseFileMode(ptr + DeletedFileMode.Length, eol);\n\t\t\t\t\t_newMode = FileMode.Missing;\n\t\t\t\t\tChangeType = ChangeTypeEnum.DELETE;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NewFileMode) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseNewFileMode(ptr, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, CopyFrom) >= 0)\n\t\t\t\t{\n\t\t\t\t\toldName = ParseName(oldName, ptr + CopyFrom.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.COPY;\n\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, CopyTo) >= 0)\n\t\t\t\t{\n\t\t\t\t\tnewName = ParseName(newName, ptr + CopyTo.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.COPY;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, RenameOld) >= 0)\n\t\t\t\t{\n\t\t\t\t\toldName = ParseName(oldName, ptr + RenameOld.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.RENAME;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, RenameNew) >= 0)\n\t\t\t\t{\n\t\t\t\t\tnewName = ParseName(newName, ptr + RenameNew.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.RENAME;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, RenameFrom) >= 0)\n\t\t\t\t{\n\t\t\t\t\toldName = ParseName(oldName, ptr + RenameFrom.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.RENAME;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, RenameTo) >= 0)\n\t\t\t\t{\n\t\t\t\t\tnewName = ParseName(newName, ptr + RenameTo.Length, eol);\n\t\t\t\t\tChangeType = ChangeTypeEnum.RENAME;\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, SimilarityIndex) >= 0)\n\t\t\t\t{\n\t\t\t\t\t_score = RawParseUtils.parseBase10(Buffer, ptr + SimilarityIndex.Length, null);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, DissimilarityIndex) >= 0)\n\t\t\t\t{\n\t\t\t\t\t_score = RawParseUtils.parseBase10(Buffer, ptr + DissimilarityIndex.Length, null);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, Index) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseIndexLine(ptr + Index.Length, eol);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Probably an empty patch (stat dirty).\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tptr = eol;\n\t\t\t}\n\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprotected void ParseOldName(int ptr, int eol)\n\t\t{\n\t\t\toldName = P1(ParseName(oldName, ptr + OLD_NAME.Length, eol));\n\t\t\tif (oldName == DEV_NULL)\n\t\t\t{\n\t\t\t\tChangeType = ChangeTypeEnum.ADD;\n\t\t\t}\n\t\t}\n\n\t\tprotected void ParseNewName(int ptr, int eol)\n\t\t{\n\t\t\tnewName = P1(ParseName(newName, ptr + NEW_NAME.Length, eol));\n\t\t\tif (newName == DEV_NULL)\n\t\t\t{\n\t\t\t\tChangeType = ChangeTypeEnum.DELETE;\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void ParseNewFileMode(int ptr, int eol)\n\t\t{\n\t\t\t_oldMode = FileMode.Missing;\n\t\t\t_newMode = ParseFileMode(ptr + NewFileMode.Length, eol);\n\t\t\tChangeType = ChangeTypeEnum.ADD;\n\t\t}\n\n\t\tpublic int parseTraditionalHeaders(int ptr, int end)\n\t\t{\n\t\t\twhile (ptr < end)\n\t\t\t{\n\t\t\t\tint eol = RawParseUtils.nextLF(Buffer, ptr);\n\t\t\t\tif (isHunkHdr(Buffer, ptr, eol) >= 1)\n\t\t\t\t{\n\t\t\t\t\t// First hunk header; break out and parse them later.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (RawParseUtils.match(Buffer, ptr, OLD_NAME) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseOldName(ptr, eol);\n\t\t\t\t}\n\t\t\t\telse if (RawParseUtils.match(Buffer, ptr, NEW_NAME) >= 0)\n\t\t\t\t{\n\t\t\t\t\tParseNewName(ptr, eol);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Possibly an empty patch.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tptr = eol;\n\t\t\t}\n\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprivate string ParseName(String expect, int ptr, int end)\n\t\t{\n\t\t\tif (ptr == end)\n\t\t\t{\n\t\t\t\treturn expect;\n\t\t\t}\n\n\t\t\tstring r;\n\t\t\tif (Buffer[ptr] == '\"')\n\t\t\t{\n\t\t\t\t// New style GNU diff format\n\t\t\t\t//\n\t\t\t\tr = QuotedString.GitPathStyle.GIT_PATH.dequote(Buffer, ptr, end - 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Older style GNU diff format, an optional tab ends the name.\n\t\t\t\t//\n\t\t\t\tint tab = end;\n\t\t\t\twhile (ptr < tab && Buffer[tab - 1] != '\\t')\n\t\t\t\t{\n\t\t\t\t\ttab--;\n\t\t\t\t}\n\n\t\t\t\tif (ptr == tab)\n\t\t\t\t{\n\t\t\t\t\ttab = end;\n\t\t\t\t}\n\n\t\t\t\tr = RawParseUtils.decode(Constants.CHARSET, Buffer, ptr, tab - 1);\n\t\t\t}\n\n\t\t\tif (r.Equals(DEV_NULL))\n\t\t\t{\n\t\t\t\tr = DEV_NULL;\n\t\t\t}\n\n\t\t\treturn r;\n\t\t}\n\n\t\tprivate static string P1(string r)\n\t\t{\n\t\t\tint s = r.IndexOf('/');\n\t\t\treturn s > 0 ? r.Substring(s + 1) : r;\n\t\t}\n\n\t\tprotected FileMode ParseFileMode(int ptr, int end)\n\t\t{\n\t\t\tint tmp = 0;\n\t\t\twhile (ptr < end - 1)\n\t\t\t{\n\t\t\t\ttmp <<= 3;\n\t\t\t\ttmp += Buffer[ptr++] - '0';\n\t\t\t}\n\t\t\treturn FileMode.FromBits(tmp);\n\t\t}\n\n\t\tprotected virtual void ParseIndexLine(int ptr, int end)\n\t\t{\n\t\t\t// \"index $asha1..$bsha1[ $mode]\" where $asha1 and $bsha1\n\t\t\t// can be unique abbreviations\n\t\t\t//\n\t\t\tint dot2 = RawParseUtils.nextLF(Buffer, ptr, (byte)'.');\n\t\t\tint mode = RawParseUtils.nextLF(Buffer, dot2, (byte)' ');\n\n\t\t\toldId = AbbreviatedObjectId.FromString(Buffer, ptr, dot2 - 1);\n\t\t\tNewId = AbbreviatedObjectId.FromString(Buffer, dot2 + 1, mode - 1);\n\n\t\t\tif (mode < end)\n\t\t\t{\n\t\t\t\t_newMode = _oldMode = ParseFileMode(mode, end);\n\t\t\t}\n\t\t}\n\n\t\tprivate bool Eq(int aPtr, int aEnd, int bPtr, int bEnd)\n\t\t{\n\t\t\tif (aEnd - aPtr != bEnd - bPtr)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\twhile (aPtr < aEnd)\n\t\t\t{\n\t\t\t\tif (Buffer[aPtr++] != Buffer[bPtr++])\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if this is a patch hunk header.\n\t\t/// </summary>\n\t\t/// <param name=\"buf\">the buffer to scan</param>\n\t\t/// <param name=\"start\">first position in the buffer to evaluate</param>\n\t\t/// <param name=\"end\">\n\t\t/// last position to consider; usually the end of the buffer \n\t\t/// (<code>buf.length</code>) or the first position on the next\n\t\t/// line. This is only used to avoid very long runs of '@' from\n\t\t/// killing the scan loop.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// the number of \"ancestor revisions\" in the hunk header. A\n\t\t/// traditional two-way diff (\"@@ -...\") returns 1; a combined diff\n\t\t/// for a 3 way-merge returns 3. If this is not a hunk header, 0 is\n\t\t/// returned instead.\n\t\t/// </returns>\n\t\tpublic static int isHunkHdr(byte[] buf, int start, int end)\n\t\t{\n\t\t\tint ptr = start;\n\t\t\twhile ((ptr < end) && (buf[ptr] == '@'))\n\t\t\t{\n\t\t\t\tptr++;\n\t\t\t}\n\n\t\t\tif ((ptr - start) < 2)\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tif ((ptr == end) || (buf[ptr++] != ' '))\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tif ((ptr == end) || (buf[ptr++] != '-'))\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\treturn (ptr - 3) - start;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Patch/FormatError.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n\t/// <summary>\n\t/// An error in a patch script.\n\t/// </summary>\n\t[Serializable]\n\tpublic class FormatError\n\t{\n\t\t#region Severity enum\n\n\t\t/// <summary>\n\t\t/// Classification of an error.\n\t\t/// </summary>\n\t\t[Serializable]\n\t\tpublic enum Severity\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// The error is unexpected, but can be worked around.\n\t\t\t/// </summary>\n\t\t\tWARNING,\n\n\t\t\t/// <summary>\n\t\t\t/// The error indicates the script is severely flawed.\n\t\t\t/// </summary>\n\t\t\tERROR\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate readonly byte[] _buf;\n\t\tprivate readonly string _message;\n\t\tprivate readonly int _offset;\n\t\tprivate readonly Severity _severity;\n\n\t\tpublic FormatError(byte[] buffer, int ptr, Severity sev, string msg)\n\t\t{\n\t\t\t_buf = buffer;\n\t\t\t_offset = ptr;\n\t\t\t_severity = sev;\n\t\t\t_message = msg;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The severity of the error.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Severity getSeverity()\n\t\t{\n\t\t\treturn _severity;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// A message describing the error.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic string getMessage()\n\t\t{\n\t\t\treturn _message;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The byte buffer holding the patch script.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic byte[] getBuffer()\n\t\t{\n\t\t\treturn _buf;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Byte offset within <see cref=\"getBuffer()\"/> where the error is\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic int getOffset()\n\t\t{\n\t\t\treturn _offset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Line of the patch script the error appears on.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic string getLineText()\n\t\t{\n\t\t\tint eol = RawParseUtils.nextLF(_buf, _offset);\n\t\t\treturn RawParseUtils.decode(Constants.CHARSET, _buf, _offset, eol);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar r = new StringBuilder();\n\t\t\tr.Append(Enum.GetName(typeof(Severity), getSeverity()));\n\t\t\tr.Append(\": at offset \");\n\t\t\tr.Append(getOffset());\n\t\t\tr.Append(\": \");\n\t\t\tr.Append(getMessage());\n\t\t\tr.Append(\"\\n\");\n\t\t\tr.Append(\"  in \");\n\t\t\tr.Append(getLineText());\n\t\t\treturn r.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Patch/HunkHeader.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n\t/// <summary>\n\t/// Hunk header describing the layout of a single block of lines.\n\t/// </summary>\n\tpublic class HunkHeader\n\t{\n\t\tprivate readonly FileHeader _file;\n\t\tprivate readonly OldImage _oldImage;\n\t\tprivate readonly int _startOffset;\n\n\t\tpublic HunkHeader(FileHeader fh, int offset)\n\t\t\t: this(fh, offset, new OldImage(fh))\n\t\t{\n\t\t}\n\n\t\tinternal HunkHeader(FileHeader fh, int offset, OldImage oi)\n\t\t{\n\t\t\t_file = fh;\n\t\t\t_startOffset = offset;\n\t\t\t_oldImage = oi;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Header for the file this hunk applies to.\n\t\t/// </summary>\n\t\tpublic virtual FileHeader File\n\t\t{\n\t\t\tget { return _file; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The byte array holding this hunk's patch script.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic byte[] Buffer\n\t\t{\n\t\t\tget { return _file.Buffer; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Offset within <seealso cref=\"FileHeader.Buffer\"/> to the \"@@ -\" line.\n\t\t/// </summary>\n\t\tpublic int StartOffset\n\t\t{\n\t\t\tget { return _startOffset; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Position 1 past the end of this hunk within <see cref=\"File\"/>'s buffer.\n\t\t/// </summary>\n\t\tpublic int EndOffset { get; set; }\n\n\t\tinternal virtual OldImage OldImage\n\t\t{\n\t\t\tget { return _oldImage; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// First line number in the post-image file where the hunk starts.\n\t\t/// </summary>\n\t\tpublic int NewStartLine { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Total number of post-image lines this hunk covers (context + inserted)\n\t\t/// </summary>\n\t\tpublic int NewLineCount { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Total number of lines of context appearing in this hunk.\n\t\t/// </summary>\n\t\tpublic int LinesContext { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Returns a list describing the content edits performed within the hunk.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic EditList ToEditList()\n\t\t{\n\t\t\tvar r = new EditList();\n\t\t\tbyte[] buf = _file.Buffer;\n\t\t\tint c = RawParseUtils.nextLF(buf, _startOffset);\n\t\t\tint oLine = _oldImage.StartLine;\n\t\t\tint nLine = NewStartLine;\n\t\t\tEdit inEdit = null;\n\n\t\t\tfor (; c < EndOffset; c = RawParseUtils.nextLF(buf, c))\n\t\t\t{\n\t\t\t\tbool breakScan;\n\n\t\t\t\tswitch (buf[c])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'\\n':\n\t\t\t\t\t\tinEdit = null;\n\t\t\t\t\t\toLine++;\n\t\t\t\t\t\tnLine++;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\tif (inEdit == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinEdit = new Edit(oLine - 1, nLine - 1);\n\t\t\t\t\t\t\tr.Add(inEdit);\n\t\t\t\t\t\t}\n\t\t\t\t\t\toLine++;\n\t\t\t\t\t\tinEdit.ExtendA();\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tif (inEdit == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinEdit = new Edit(oLine - 1, nLine - 1);\n\t\t\t\t\t\t\tr.Add(inEdit);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnLine++;\n\t\t\t\t\t\tinEdit.ExtendB();\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'\\\\': // Matches \"\\ No newline at end of file\"\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (breakScan)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn r;\n\t\t}\n\n\t\tpublic virtual void parseHeader()\n\t\t{\n\t\t\t// Parse \"@@ -236,9 +236,9 @@ protected boolean\"\n\t\t\t//\n\t\t\tbyte[] buf = _file.Buffer;\n\t\t\tvar ptr = new MutableInteger\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = RawParseUtils.nextLF(buf, _startOffset, (byte)' ')\n\t\t\t\t\t\t};\n\n\t\t\t_oldImage.StartLine = -1 * RawParseUtils.parseBase10(buf, ptr.value, ptr);\n\n\t\t\t_oldImage.LineCount = buf[ptr.value] == ',' ? RawParseUtils.parseBase10(buf, ptr.value + 1, ptr) : 1;\n\t\t\tNewStartLine = RawParseUtils.parseBase10(buf, ptr.value + 1, ptr);\n\t\t\tNewLineCount = buf[ptr.value] == ',' ? RawParseUtils.parseBase10(buf, ptr.value + 1, ptr) : 1;\n\t\t}\n\n\t\tpublic virtual int parseBody(Patch script, int end)\n\t\t{\n\t\t\tbyte[] buf = _file.Buffer;\n\t\t\tint c = RawParseUtils.nextLF(buf, _startOffset), last = c;\n\n\t\t\t_oldImage.LinesDeleted = 0;\n\t\t\t_oldImage.LinesAdded = 0;\n\n\t\t\tfor (; c < end; last = c, c = RawParseUtils.nextLF(buf, c))\n\t\t\t{\n\t\t\t\tbool breakScan;\n\t\t\t\tswitch (buf[c])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'\\n':\n\t\t\t\t\t\tLinesContext++;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\t_oldImage.LinesDeleted++;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\t_oldImage.LinesAdded++;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcase (byte)'\\\\': // Matches \"\\ No newline at end of file\"\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreakScan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (breakScan)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (last < end && LinesContext + _oldImage.LinesDeleted - 1 == _oldImage.LineCount\n\t\t\t\t&& LinesContext + _oldImage.LinesAdded == NewLineCount\n\t\t\t\t&& RawParseUtils.match(buf, last, Patch.SigFooter) >= 0)\n\t\t\t{\n\t\t\t\t// This is an extremely common occurrence of \"corruption\".\n\t\t\t\t// Users add footers with their signatures After this mark,\n\t\t\t\t// and git diff adds the git executable version number.\n\t\t\t\t// Let it slide; the hunk otherwise looked sound.\n\t\t\t\t//\n\t\t\t\t_oldImage.LinesDeleted--;\n\t\t\t\treturn last;\n\t\t\t}\n\n\t\t\tif (LinesContext + _oldImage.LinesDeleted < _oldImage.LineCount)\n\t\t\t{\n\t\t\t\tint missingCount = _oldImage.LineCount - (LinesContext + _oldImage.LinesDeleted);\n\t\t\t\tscript.error(buf, _startOffset, \"Truncated hunk, at least \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ missingCount + \" old lines is missing\");\n\t\t\t}\n\t\t\telse if (LinesContext + _oldImage.LinesAdded < NewLineCount)\n\t\t\t{\n\t\t\t\tint missingCount = NewLineCount - (LinesContext + _oldImage.LinesAdded);\n\t\t\t\tscript.error(buf, _startOffset, \"Truncated hunk, at least \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ missingCount + \" new lines is missing\");\n\t\t\t}\n\t\t\telse if (LinesContext + _oldImage.LinesDeleted > _oldImage.LineCount\n\t\t\t\t\t || LinesContext + _oldImage.LinesAdded > NewLineCount)\n\t\t\t{\n\t\t\t\tstring oldcnt = _oldImage.LineCount + \":\" + NewLineCount;\n\t\t\t\tstring newcnt = (LinesContext + _oldImage.LinesDeleted) + \":\"\n\t\t\t\t\t\t\t\t+ (LinesContext + _oldImage.LinesAdded);\n\t\t\t\tscript.warn(buf, _startOffset, \"Hunk header \" + oldcnt\n\t\t\t\t\t\t\t\t\t\t\t   + \" does not match body line count of \" + newcnt);\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic void extractFileLines(TemporaryBuffer[] outStream)\n\t\t{\n\t\t\tbyte[] buf = _file.Buffer;\n\t\t\tint ptr = _startOffset;\n\t\t\tint eol = RawParseUtils.nextLF(buf, ptr);\n\t\t\tif (EndOffset <= eol)\n\t\t\t\treturn;\n\n\t\t\t// Treat the hunk header as though it were from the ancestor,\n\t\t\t// as it may have a function header appearing After it which\n\t\t\t// was copied out of the ancestor file.\n\t\t\t//\n\t\t\toutStream[0].write(buf, ptr, eol - ptr);\n\n\t\t\tbool break_scan = false;\n\t\t\tfor (ptr = eol; ptr < EndOffset; ptr = eol)\n\t\t\t{\n\t\t\t\teol = RawParseUtils.nextLF(buf, ptr);\n\t\t\t\tswitch (buf[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'\\n':\n\t\t\t\t\tcase (byte)'\\\\':\n\t\t\t\t\t\toutStream[0].write(buf, ptr, eol - ptr);\n\t\t\t\t\t\toutStream[1].write(buf, ptr, eol - ptr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\toutStream[0].write(buf, ptr, eol - ptr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\toutStream[1].write(buf, ptr, eol - ptr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak_scan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (break_scan)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void extractFileLines(StringBuilder sb, string[] text, int[] offsets)\n\t\t{\n\t\t\tbyte[] buf = _file.Buffer;\n\t\t\tint ptr = _startOffset;\n\t\t\tint eol = RawParseUtils.nextLF(buf, ptr);\n\t\t\tif (EndOffset <= eol)\n\t\t\t\treturn;\n\t\t\tcopyLine(sb, text, offsets, 0);\n\n\t\t\tbool break_scan = false;\n\t\t\tfor (ptr = eol; ptr < EndOffset; ptr = eol)\n\t\t\t{\n\t\t\t\teol = RawParseUtils.nextLF(buf, ptr);\n\t\t\t\tswitch (buf[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)' ':\n\t\t\t\t\tcase (byte)'\\n':\n\t\t\t\t\tcase (byte)'\\\\':\n\t\t\t\t\t\tcopyLine(sb, text, offsets, 0);\n\t\t\t\t\t\tskipLine(text, offsets, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\tcopyLine(sb, text, offsets, 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tcopyLine(sb, text, offsets, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak_scan = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (break_scan)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void copyLine(StringBuilder sb, string[] text, int[] offsets, int fileIdx)\n\t\t{\n\t\t\tstring s = text[fileIdx];\n\t\t\tint start = offsets[fileIdx];\n\t\t\tint end = s.IndexOf('\\n', start);\n\t\t\tif (end < 0)\n\t\t\t{\n\t\t\t\tend = s.Length;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tend++;\n\t\t\t}\n\t\t\tsb.Append(s, start, end - start);\n\t\t\toffsets[fileIdx] = end;\n\t\t}\n\n\t\tpublic void skipLine(string[] text, int[] offsets, int fileIdx)\n\t\t{\n\t\t\tstring s = text[fileIdx];\n\t\t\tint end = s.IndexOf('\\n', offsets[fileIdx]);\n\t\t\toffsets[fileIdx] = end < 0 ? s.Length : end + 1;\n\t\t}\n\t}\n\n\t#region Nested Types\n\n\t/// <summary>\n\t/// Details about an old image of the file.\n\t/// </summary>\n\tinternal class OldImage\n\t{\n\t\tprivate readonly FileHeader _fh;\n\t\tprivate readonly AbbreviatedObjectId _id;\n\n\t\tpublic OldImage(FileHeader fh)\n\t\t\t: this(fh, fh.getOldId())\n\t\t{\n\t\t}\n\n\t\tpublic OldImage(FileHeader fh, AbbreviatedObjectId id)\n\t\t{\n\t\t\t_fh = fh;\n\t\t\t_id = id;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the <see cref=\"AbbreviatedObjectId\"/> of the pre-image file.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic virtual AbbreviatedObjectId Id\n\t\t{\n\t\t\tget { return _id; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the <see cref=\"FileHeader\"/> of this hunk.\n\t\t/// </summary>\n\t\tpublic virtual FileHeader Fh\n\t\t{\n\t\t\tget { return _fh; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return the first line number the hunk starts on in this file.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic int StartLine { get; set; }\n\n\t\t/// <summary>\n\t\t/// rReturn the total number of lines this hunk covers in this file.\n\t\t/// </summary>\n\t\tpublic int LineCount { get; set; }\n\n\t\t/// <summary>\n\t\t/// Returns the number of lines deleted by the post-image from this file.\n\t\t/// </summary>\n\t\tpublic int LinesDeleted { get; set; }\n\n\t\t/// <summary>\n\t\t/// Returns the number of lines added by the post-image not in this file.\n\t\t/// </summary>\n\t\tpublic int LinesAdded { get; set; }\n\n\t\tpublic virtual int LinesContext\n\t\t{\n\t\t\tget { throw new NotImplementedException(); }\n\t\t\tset { throw new NotImplementedException(); }\n\t\t}\n\t}\n\n\tinternal class CombinedOldImage : OldImage\n\t{\n\t\tprivate readonly int _imagePos;\n\n\t\tpublic CombinedOldImage(FileHeader fh, int imagePos)\n\t\t\t: base(fh, ((CombinedFileHeader)fh).getOldId(imagePos))\n\t\t{\n\t\t\t_imagePos = imagePos;\n\t\t}\n\n\t\tpublic override int LinesContext\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int ImagePos\n\t\t{\n\t\t\tget { return _imagePos; }\n\t\t}\n\t}\n\n\t#endregion\n}"
  },
  {
    "path": "GitSharp.Core/Patch/Patch.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Patch\n{\n\t/// <summary>\n\t/// A parsed collection of <seealso cref=\"FileHeader\"/>s from a unified diff patch file.\n\t/// </summary>\n\t[Serializable]\n\tpublic class Patch\n\t{\n\t\tprivate static readonly byte[] DiffGit = Constants.encodeASCII(\"diff --git \");\n\t\tprivate static readonly byte[] DiffCc = Constants.encodeASCII(\"diff --cc \");\n\t\tprivate static readonly byte[] DiffCombined = Constants.encodeASCII(\"diff --combined \");\n\t\tprivate static readonly byte[][] BinHeaders = new[] { Constants.encodeASCII(\"Binary files \"), Constants.encodeASCII(\"Files \") };\n\t\tprivate static readonly byte[] BinTrailer = Constants.encodeASCII(\" differ\\n\");\n\t\tprivate static readonly byte[] GitBinary = Constants.encodeASCII(\"GIT binary patch\\n\");\n\n\t\tpublic static readonly byte[] SigFooter = Constants.encodeASCII(\"-- \\n\");\n\n\t\t// The files, in the order they were parsed out of the input.\n\t\tprivate readonly List<FileHeader> _files;\n\n\t\t// Formatting errors, if any were identified.\n\t\tprivate readonly List<FormatError> _errors;\n\n\t\t/// <summary>\n\t\t/// Create an empty patch.\n\t\t/// </summary>\n\t\tpublic Patch()\n\t\t{\n\t\t\t_files = new List<FileHeader>();\n\t\t\t_errors = new List<FormatError>(0);\n\t\t}\n\n\t\t/**\n\t\t * Add a single file to this patch.\n\t\t * <para />\n\t\t * Typically files should be added by parsing the text through one of this\n\t\t * class's parse methods.\n\t\t *\n\t\t * @param fh\n\t\t *            the header of the file.\n\t\t */\n\t\tpublic void addFile(FileHeader fh)\n\t\t{\n\t\t\t_files.Add(fh);\n\t\t}\n\n\t\t/** @return list of files described in the patch, in occurrence order. */\n\t\tpublic List<FileHeader> getFiles()\n\t\t{\n\t\t\treturn _files;\n\t\t}\n\n\t\t/**\n\t\t * Add a formatting error to this patch script.\n\t\t *\n\t\t * @param err\n\t\t *            the error description.\n\t\t */\n\t\tpublic void addError(FormatError err)\n\t\t{\n\t\t\t_errors.Add(err);\n\t\t}\n\n\t\t/** @return collection of formatting errors, if any. */\n\t\tpublic List<FormatError> getErrors()\n\t\t{\n\t\t\treturn _errors;\n\t\t}\n\n\t\t/**\n\t\t * Parse a patch received from an InputStream.\n\t\t * <para />\n\t\t * Multiple parse calls on the same instance will concatenate the patch\n\t\t * data, but each parse input must start with a valid file header (don't\n\t\t * split a single file across parse calls).\n\t\t *\n\t\t * @param is\n\t\t *            the stream to Read the patch data from. The stream is Read\n\t\t *            until EOF is reached.\n\t\t * @throws IOException\n\t\t *             there was an error reading from the input stream.\n\t\t */\n\t\tpublic void parse(Stream iStream)\n\t\t{\n\t\t\tbyte[] buf = ReadFully(iStream);\n\t\t\tparse(buf, 0, buf.Length);\n\t\t}\n\n\t\tprivate static byte[] ReadFully(Stream stream)\n\t\t{\n\t\t\tvar b = new LocalFileBuffer();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tb.copy(stream);\n\t\t\t\tb.close();\n\t\t\t\treturn b.ToArray();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tb.destroy();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Parse a patch stored in a byte[].\n\t\t * <para />\n\t\t * Multiple parse calls on the same instance will concatenate the patch\n\t\t * data, but each parse input must start with a valid file header (don't\n\t\t * split a single file across parse calls).\n\t\t *\n\t\t * @param buf\n\t\t *            the buffer to parse.\n\t\t * @param ptr\n\t\t *            starting position to parse from.\n\t\t * @param end\n\t\t *            1 past the last position to end parsing. The total length to\n\t\t *            be parsed is <code>end - ptr</code>.\n\t\t */\n\t\tpublic void parse(byte[] buf, int ptr, int end)\n\t\t{\n\t\t\twhile (ptr < end)\n\t\t\t{\n\t\t\t\tptr = ParseFile(buf, ptr, end);\n\t\t\t}\n\t\t}\n\n\t\tpublic void warn(byte[] buf, int ptr, string msg)\n\t\t{\n\t\t\taddError(new FormatError(buf, ptr, FormatError.Severity.WARNING, msg));\n\t\t}\n\n\t\tpublic void error(byte[] buf, int ptr, string msg)\n\t\t{\n\t\t\taddError(new FormatError(buf, ptr, FormatError.Severity.ERROR, msg));\n\t\t}\n\n\t\tprivate int ParseFile(byte[] buf, int c, int end)\n\t\t{\n\t\t\twhile (c < end)\n\t\t\t{\n\t\t\t\tif (FileHeader.isHunkHdr(buf, c, end) >= 1)\n\t\t\t\t{\n\t\t\t\t\t// If we find a disconnected hunk header we might\n\t\t\t\t\t// have missed a file header previously. The hunk\n\t\t\t\t\t// isn't valid without knowing where it comes from.\n\t\t\t\t\t//\n\t\t\t\t\terror(buf, c, \"Hunk disconnected from file\");\n\t\t\t\t\tc = RawParseUtils.nextLF(buf, c);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Valid git style patch?\n\t\t\t\t//\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffGit) >= 0)\n\t\t\t\t{\n\t\t\t\t\treturn ParseDiffGit(buf, c, end);\n\t\t\t\t}\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffCc) >= 0)\n\t\t\t\t{\n\t\t\t\t\treturn ParseDiffCombined(DiffCc, buf, c, end);\n\t\t\t\t}\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffCombined) >= 0)\n\t\t\t\t{\n\t\t\t\t\treturn ParseDiffCombined(DiffCombined, buf, c, end);\n\t\t\t\t}\n\n\t\t\t\t// Junk between files? Leading junk? Traditional\n\t\t\t\t// (non-git generated) patch?\n\t\t\t\t//\n\t\t\t\tint n = RawParseUtils.nextLF(buf, c);\n\t\t\t\tif (n >= end)\n\t\t\t\t{\n\t\t\t\t\t// Patches cannot be only one line long. This must be\n\t\t\t\t\t// trailing junk that we should ignore.\n\t\t\t\t\t//\n\t\t\t\t\treturn end;\n\t\t\t\t}\n\n\t\t\t\tif (n - c < 6)\n\t\t\t\t{\n\t\t\t\t\t// A valid header must be at least 6 bytes on the\n\t\t\t\t\t// first line, e.g. \"--- a/b\\n\".\n\t\t\t\t\t//\n\t\t\t\t\tc = n;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (RawParseUtils.match(buf, c, FileHeader.OLD_NAME) >= 0 &&\n\t\t\t\t\tRawParseUtils.match(buf, n, FileHeader.NEW_NAME) >= 0)\n\t\t\t\t{\n\t\t\t\t\t// Probably a traditional patch. Ensure we have at least\n\t\t\t\t\t// a \"@@ -0,0\" smelling line next. We only check the \"@@ -\".\n\t\t\t\t\t//\n\t\t\t\t\tint f = RawParseUtils.nextLF(buf, n);\n\t\t\t\t\tif (f >= end)\n\t\t\t\t\t\treturn end;\n\t\t\t\t\tif (FileHeader.isHunkHdr(buf, f, end) == 1)\n\t\t\t\t\t\treturn ParseTraditionalPatch(buf, c, end);\n\t\t\t\t}\n\n\t\t\t\tc = n;\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\tprivate int ParseDiffGit(byte[] buf, int start, int end)\n\t\t{\n\t\t\tvar fileHeader = new FileHeader(buf, start);\n\t\t\tint ptr = fileHeader.parseGitFileName(start + DiffGit.Length, end);\n\t\t\tif (ptr < 0)\n\t\t\t{\n\t\t\t\treturn SkipFile(buf, start);\n\t\t\t}\n\n\t\t\tptr = fileHeader.parseGitHeaders(ptr, end);\n\t\t\tptr = ParseHunks(fileHeader, ptr, end);\n\t\t\tfileHeader.EndOffset = ptr;\n\t\t\taddFile(fileHeader);\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprivate int ParseDiffCombined(ICollection<byte> hdr, byte[] buf, int start, int end)\n\t\t{\n\t\t\tvar fh = new CombinedFileHeader(buf, start);\n\t\t\tint ptr = fh.parseGitFileName(start + hdr.Count, end);\n\t\t\tif (ptr < 0)\n\t\t\t{\n\t\t\t\treturn SkipFile(buf, start);\n\t\t\t}\n\n\t\t\tptr = fh.parseGitHeaders(ptr, end);\n\t\t\tptr = ParseHunks(fh, ptr, end);\n\t\t\tfh.EndOffset = ptr;\n\t\t\taddFile(fh);\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprivate int ParseTraditionalPatch(byte[] buf, int start, int end)\n\t\t{\n\t\t\tvar fh = new FileHeader(buf, start);\n\t\t\tint ptr = fh.parseTraditionalHeaders(start, end);\n\t\t\tptr = ParseHunks(fh, ptr, end);\n\t\t\tfh.EndOffset = ptr;\n\t\t\taddFile(fh);\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprivate static int SkipFile(byte[] buf, int ptr)\n\t\t{\n\t\t\tptr = RawParseUtils.nextLF(buf, ptr);\n\t\t\tif (RawParseUtils.match(buf, ptr, FileHeader.OLD_NAME) >= 0)\n\t\t\t{\n\t\t\t\tptr = RawParseUtils.nextLF(buf, ptr);\n\t\t\t}\n\t\t\treturn ptr;\n\t\t}\n\n\t\tprivate int ParseHunks(FileHeader fh, int c, int end)\n\t\t{\n\t\t\tbyte[] buf = fh.Buffer;\n\t\t\twhile (c < end)\n\t\t\t{\n\t\t\t\t// If we see a file header at this point, we have all of the\n\t\t\t\t// hunks for our current file. We should stop and report back\n\t\t\t\t// with this position so it can be parsed again later.\n\t\t\t\t//\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffGit) >= 0)\n\t\t\t\t\tbreak;\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffCc) >= 0)\n\t\t\t\t\tbreak;\n\t\t\t\tif (RawParseUtils.match(buf, c, DiffCombined) >= 0)\n\t\t\t\t\tbreak;\n\t\t\t\tif (RawParseUtils.match(buf, c, FileHeader.OLD_NAME) >= 0)\n\t\t\t\t\tbreak;\n\t\t\t\tif (RawParseUtils.match(buf, c, FileHeader.NEW_NAME) >= 0)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (FileHeader.isHunkHdr(buf, c, end) == fh.ParentCount)\n\t\t\t\t{\n\t\t\t\t\tHunkHeader h = fh.newHunkHeader(c);\n\t\t\t\t\th.parseHeader();\n\t\t\t\t\tc = h.parseBody(this, end);\n\t\t\t\t\th.EndOffset = c;\n\t\t\t\t\tfh.addHunk(h);\n\t\t\t\t\tif (c < end)\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch (buf[c])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase (byte)'@':\n\t\t\t\t\t\t\tcase (byte)'d':\n\t\t\t\t\t\t\tcase (byte)'\\n':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (RawParseUtils.match(buf, c, SigFooter) < 0)\n\t\t\t\t\t\t\t\t\twarn(buf, c, \"Unexpected hunk trailer\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tint eol = RawParseUtils.nextLF(buf, c);\n\t\t\t\tif (fh.Hunks.isEmpty() && RawParseUtils.match(buf, c, GitBinary) >= 0)\n\t\t\t\t{\n\t\t\t\t\tfh.PatchType = FileHeader.PatchTypeEnum.GIT_BINARY;\n\t\t\t\t\treturn ParseGitBinary(fh, eol, end);\n\t\t\t\t}\n\n\t\t\t\tif (fh.Hunks.isEmpty() && BinTrailer.Length < eol - c\n\t\t\t\t\t\t&& RawParseUtils.match(buf, eol - BinTrailer.Length, BinTrailer) >= 0\n\t\t\t\t\t\t&& MatchAny(buf, c, BinHeaders))\n\t\t\t\t{\n\t\t\t\t\t// The patch is a binary file diff, with no deltas.\n\t\t\t\t\t//\n\t\t\t\t\tfh.PatchType = FileHeader.PatchTypeEnum.BINARY;\n\t\t\t\t\treturn eol;\n\t\t\t\t}\n\n\t\t\t\t// Skip this line and move to the next. Its probably garbage\n\t\t\t\t// After the last hunk of a file.\n\t\t\t\t//\n\t\t\t\tc = eol;\n\t\t\t}\n\n\t\t\tif (fh.Hunks.isEmpty()\n\t\t\t\t\t&& fh.getPatchType() == FileHeader.PatchTypeEnum.UNIFIED\n\t\t\t\t\t&& !fh.hasMetaDataChanges())\n\t\t\t{\n\t\t\t\t// Hmm, an empty patch? If there is no metadata here we\n\t\t\t\t// really have a binary patch that we didn't notice above.\n\t\t\t\t//\n\t\t\t\tfh.PatchType = FileHeader.PatchTypeEnum.BINARY;\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tprivate int ParseGitBinary(FileHeader fh, int c, int end)\n\t\t{\n\t\t\tvar postImage = new BinaryHunk(fh, c);\n\t\t\tint nEnd = postImage.parseHunk(c, end);\n\t\t\tif (nEnd < 0)\n\t\t\t{\n\t\t\t\t// Not a binary hunk.\n\t\t\t\t//\n\t\t\t\terror(fh.Buffer, c, \"Missing forward-image in GIT binary patch\");\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\tc = nEnd;\n\t\t\tpostImage.endOffset = c;\n\t\t\tfh.ForwardBinaryHunk = postImage;\n\n\t\t\tvar preImage = new BinaryHunk(fh, c);\n\t\t\tint oEnd = preImage.parseHunk(c, end);\n\t\t\tif (oEnd >= 0)\n\t\t\t{\n\t\t\t\tc = oEnd;\n\t\t\t\tpreImage.endOffset = c;\n\t\t\t\tfh.ReverseBinaryHunk = preImage;\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tprivate static bool MatchAny(byte[] buf, int c, IEnumerable<byte[]> srcs)\n\t\t{\n\t\t\tforeach (byte[] s in srcs)\n\t\t\t{\n\t\t\t\tif (RawParseUtils.match(buf, c, s) >= 0)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/PersonIdent.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Globalization;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public class PersonIdent\n    {\n        public string Name { get; private set; }\n        public string EmailAddress { get; private set; }\n\n        /// <summary>\n        /// Elapsed milliseconds since Epoch (1970.1.1 00:00:00 GMT)\n        /// </summary>\n        public long When { get; private set; }\n        private readonly int tzOffset; // offset in minutes to UTC\n\n        /// <summary>\n        /// Creates new PersonIdent from config info in repository, with current time.\n        /// This new PersonIdent gets the info from the default committer as available\n        /// from the configuration.\n        /// </summary>\n        /// <param name=\"repo\"></param>\n        public PersonIdent(Repository repo)\n        {\n            RepositoryConfig config = repo.Config;\n            Name = config.getCommitterName();\n            EmailAddress = config.getCommitterEmail();\n            When = SystemReader.getInstance().getCurrentTime();\n            tzOffset = SystemReader.getInstance().getTimezone(When);\n        }\n\n        /// <summary>\n        /// Copy a <seealso cref=\"PersonIdent\"/>.\n        /// </summary>\n        /// <param name=\"pi\">Original <seealso cref=\"PersonIdent\"/>.</param>\n        public PersonIdent(PersonIdent pi)\n            : this(pi.Name, pi.EmailAddress)\n        {\n        }\n\n        /// <summary>\n        /// Construct a new <seealso cref=\"PersonIdent\"/> with current time.\n        /// </summary>\n        /// <param name=\"name\"> </param>\n        /// <param name=\"emailAddress\"></param>\n        public PersonIdent(string name, string emailAddress)\n        {\n            Name = name;\n            EmailAddress = emailAddress;\n            When = SystemReader.getInstance().getCurrentTime();\n            tzOffset = SystemReader.getInstance().getTimezone(When);\n        }\n\n        /// <summary>\n        /// Copy a PersonIdent, but alter the clone's time stamp\n        /// </summary>\n        /// <param name=\"pi\">Original <seealso cref=\"PersonIdent\"/>.</param>\n        /// <param name=\"when\">Local date time in milliseconds (since Epoch).</param>\n        /// <param name=\"tz\">Time zone offset in minutes.</param>\n        public PersonIdent(PersonIdent pi, DateTime when, int tz)\n            : this(pi.Name, pi.EmailAddress, when, tz)\n        {\n        }\n\n        /// <summary>\n        /// Copy a <seealso cref=\"PersonIdent\"/>, but alter the clone's time stamp\n        /// </summary>\n        /// <param name=\"pi\">Original <seealso cref=\"PersonIdent\"/>.</param>\n        /// <param name=\"when\">Local date time in milliseconds (since Epoch).</param>\n        public PersonIdent(PersonIdent pi, DateTime when)\n            : this(pi.Name, pi.EmailAddress, when.ToMillisecondsSinceEpoch(), pi.tzOffset)\n        {\n        }\n\n        /// <summary>\n        /// Construct a PersonIdent from simple data\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"emailAddress\"></param>\n        /// <param name=\"when\">Local date time in milliseconds (since Epoch).</param>\n        /// <param name=\"tz\">Time zone offset in minutes.</param>\n        public PersonIdent(string name, string emailAddress, DateTime when, int tz)\n            : this(name, emailAddress, when.ToMillisecondsSinceEpoch(), tz)\n        {\n        }\n\n        /// <summary>\n        /// Construct a <seealso cref=\"PersonIdent\"/>\n        /// </summary>\n        /// <param name=\"name\"></param>\n        /// <param name=\"emailAddress\"> </param>\n        /// <param name=\"when\">Local date time in milliseconds (since Epoch).</param>\n        /// <param name=\"tz\">Time zone offset in minutes.</param>\n        public PersonIdent(string name, string emailAddress, long when, int tz)\n        {\n            Name = name;\n            EmailAddress = emailAddress;\n            When = when;\n            tzOffset = tz;\n        }\n\n        /// <summary>\n        /// Copy a PersonIdent, but alter the clone's time stamp\n        /// </summary>\n        /// <param name=\"pi\">Original <seealso cref=\"PersonIdent\"/>.</param>\n        /// <param name=\"when\">Local date time in milliseconds (since Epoch).</param>\n        /// <param name=\"tz\">Time zone offset in minutes.</param>\n        public PersonIdent(PersonIdent pi, long when, int tz)\n            : this(pi.Name, pi.EmailAddress, when, tz)\n        {\n        }\n\n        /// <summary>\n        /// Construct a PersonIdent from a string with full name, email, time time\n        /// zone string. The input string must be valid.\n        /// </summary>\n        /// <param name=\"str\">A Git internal format author/committer string.</param>\n        public PersonIdent(string str)\n        {\n            int lt = str.IndexOf('<');\n            if (lt == -1)\n            {\n                throw new ArgumentException(\"Malformed PersonIdent string\"\n                        + \" (no < was found): \" + str);\n            }\n\n            int gt = str.IndexOf('>', lt);\n            if (gt == -1)\n            {\n                throw new ArgumentException(\"Malformed PersonIdent string\"\n                        + \" (no > was found): \" + str);\n            }\n\n            int sp = str.IndexOf(' ', gt + 2);\n            if (sp == -1)\n            {\n                When = 0;\n                tzOffset = -1;\n            }\n            else\n            {\n                string tzHoursStr = str.Slice(sp + 1, sp + 4).Trim();\n                int tzHours = tzHoursStr[0] == '+' ? int.Parse(tzHoursStr.Substring(1)) : int.Parse(tzHoursStr);\n\n                int tzMins = int.Parse(str.Substring(sp + 4).Trim());\n                When = long.Parse(str.Slice(gt + 1, sp).Trim()) * 1000;\n                tzOffset = tzHours * 60 + tzMins;\n            }\n\n            Name = str.Slice(0, lt).Trim();\n            EmailAddress = str.Slice(lt + 1, gt).Trim();\n        }\n\n        /// <summary>\n        /// TimeZone offset in minutes\n        /// </summary>\n        public int TimeZoneOffset\n        {\n            get\n            {\n                return tzOffset;\n            }\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return EmailAddress.GetHashCode() ^ (int)When;\n            }\n        }\n\n        public override bool Equals(object obj)\n        {\n            var p = obj as PersonIdent;\n            if (p == null)\n                return false;\n\n            return Name == p.Name\n                && EmailAddress == p.EmailAddress\n                && When == p.When;\n        }\n\n        /// <summary>\n        /// Format for Git storage.\n        /// </summary>\n        /// <returns>A string in the git author format.</returns>\n        public string ToExternalString()\n        {\n            var r = new StringBuilder();\n\n            r.Append(Name);\n            r.Append(\" <\");\n            r.Append(EmailAddress);\n            r.Append(\"> \");\n            r.Append(When / 1000);\n            r.Append(' ');\n            appendTimezone(r);\n\n            return r.ToString();\n        }\n\n        private void appendTimezone(StringBuilder r)\n        {\n            int offset = tzOffset;\n            char sign;\n\n            if (offset < 0)\n            {\n                sign = '-';\n                offset *= -1;\n            }\n            else\n            {\n                sign = '+';\n            }\n\n            int offsetHours = offset / 60;\n            int offsetMins = offset % 60;\n\n            r.AppendFormat(CultureInfo.InvariantCulture, \"{0}{1:D2}{2:D2}\", sign, offsetHours, offsetMins);\n        }\n\n        public override string ToString()\n        {\n            var r = new StringBuilder();\n\n            r.Append(\"PersonIdent[\");\n            r.Append(Name);\n            r.Append(\", \");\n            r.Append(EmailAddress);\n            r.Append(\", \");\n            r.Append(When.MillisToDateTimeOffset(tzOffset).ToIsoDateFormat());\n            r.Append(\"]\");\n\n            return r.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Platform/Linux.cs",
    "content": "/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyrigth (C) 2010, Henon <meinrad.recheis@gmail.com>\n * Copyrigth (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\n\nnamespace GitSharp.Core\n{\n\n\tpublic class Linux : Platform\n\t{\n\t\t\n\t\tpublic override bool IsSymlinkSupported\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool IsHardlinkSupported\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool CreateSymlink(string symlinkFilename, string existingFilename, bool isSymlinkDirectory)\n\t\t{\n\t\t\t//Execute command\n\t\t\tProcessStartInfo info = new ProcessStartInfo();\n\t\t\tinfo.FileName = \"ln\";\n\t\t\tinfo.Arguments = (isSymlinkDirectory ? \"-d \" : \"\") +\"-s \" + existingFilename+\" \"+symlinkFilename;\n\t\t\tinfo.UseShellExecute = false;\n\t\t\tinfo.RedirectStandardOutput = true;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\tProcess.Start(info);\n\t\t\t\t} \n\t\t\t\tcatch (Exception) \n\t\t\t\t{\n\t\t\t\t\treturn false; \n\t\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool CreateHardlink(string hardlinkFilename, string existingFilename)\n\t\t{\n\t\t\tProcessStartInfo info = new ProcessStartInfo();\n\t\t\tinfo.FileName = \"ln\";\n\t\t\tinfo.Arguments = existingFilename+\" \"+hardlinkFilename;\n\t\t\tinfo.UseShellExecute = false;\n\t\t\tinfo.RedirectStandardOutput = true;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\tProcess.Start(info);\n\t\t\t\t} \n\t\t\t\tcatch (Exception) \n\t\t\t\t{\n\t\t\t\t\treturn false; \n\t\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n        public override Process GetTextPager(string corePagerConfig)\n        {\n            var pager = new Process ();\n            var pagerVar = System.Environment.GetEnvironmentVariable (\"GIT_PAGER\");\n            if (pagerVar == null)\n                pagerVar = corePagerConfig;\n            if ((pagerVar == null) || (pagerVar.Length == 0))\n                pagerVar = \"less\";\n            var tokens = pagerVar.Split();\n            pager.StartInfo.FileName = tokens[0];\n            pager.StartInfo.UseShellExecute = false;\n            pager.StartInfo.RedirectStandardInput = true;\n            if (tokens.Length > 1)\n                pager.StartInfo.Arguments = pagerVar.Substring(tokens[0].Length);\n\n            // Apply LESS environment behavior\n            var lessVar = System.Environment.GetEnvironmentVariable (\"LESS\");\n            if (lessVar == null)\n                lessVar = \"FRSX\";\n            pager.StartInfo.EnvironmentVariables[\"LESS\"] = lessVar;\n\n            return pager;\n        }\n\n\t\tpublic Linux()\n\t\t{\n\t\t\tSystem.IO.DirectoryInfo di = new System.IO.DirectoryInfo(\"/etc\");\n\t\t\tSystem.IO.FileInfo[] release = di.GetFiles(\"*-release\");\n\t\t\tSystem.IO.FileInfo[] debian = di.GetFiles(\"debian_version\");\n\t\t\tSystem.IO.FileInfo[] slackware = di.GetFiles(\"slackware-version\");\n\t\t\t\n\t\t\tClassName = null;\n\t\t\tPlatformType = \"Linux\";\n\t\t\tPlatformSubType = \"\";\n\t\t\tEdition = \"\";\n\t\t\tVersion = \"\";\n\t\t\tVersionFile  = \"\";\n\t\t\t\n\t\t\tif (release.Length > 0)\n\t\t\t{\n\t\t\t\tstring str = release[0].ToString();\n\t\t\t\tstring platformType = str.Substring(5,str.Length-13);\n\t\t\t\tVersionFile = str;\n\t\t\t\t\n\t\t\t\tswitch (platformType)\n\t\t\t\t{\n\t\t\t\t\tcase \"arch\":\n\t\t\t\t\t\tGetArchPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"fedora\":\n\t\t\t\t\t\tGetFedoraPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"gentoo\":\n\t\t\t\t\t\tGetGentooPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"mandriva\":\n\t\t\t\t\t\tGetMandrivaPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"redhat\": \t//RedHat variants\n\t\t\t\t\t\tGetRedHatPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"suse\":\n\t\t\t\t\t\tGetSusePlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"lsb\": \t//Ubuntu variants\n\t\t\t\t\t\tGetUbuntuPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tGetDefaultLinuxPlatform( this, null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (slackware.Length > 0)\n\t\t\t{\n\t\t\t\tVersionFile = \"/etc/\" + slackware[0].ToString();\n\t\t\t\tGetSlackwarePlatform( this, null);\n\t\t\t}\n\t\t\telse if (debian.Length > 0)\n\t\t\t{\n\t\t\t\tVersionFile = \"/etc/\" + debian[0].ToString();\n\t\t\t\tGetDebianPlatform( this, null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tGetDefaultLinuxPlatform( this, null);\n\t\t\t}\n\t\t\t\n\t\t\tif (ClassName == null)\n\t\t\t\tthrow new ArgumentNullException(\"ClassName was not defined. Please report this bug.\");\n\t\t\t\n\t\t}\n\t\t\n\t\tpublic static void GetArchPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t// Arch is not versioned. It is a single rolling version.\n\t\t\t// The existance of the arch-release file determines arch\n\t\t\t// is being used. The actual file is blank.\n\t\t\tobj.ClassName = \"Linux.Arch\";\n\t\t\tobj.PlatformSubType = \"Arch\";\n\t\t\tobj.Edition = \"\";\n\t\t\tobj.Version = \"Current\";\n\t\t}\n\t\t\n\t\tpublic static void GetDefaultLinuxPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\tobj.ClassName = \"Linux.Default\";\n\t\t\tobj.PlatformSubType = \"Generic\";\n\t\t\tobj.Edition = \"\";\n\t\t\tobj.Version = \"\";\n\t\t}\n\t\t\n\t\tpublic static void GetDebianPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list available at: http://www.debian.org/releases/\n\t\t\t//There is no accurate way to determine the version information\n\t\t\t//in Debian. The community mixes the versions regularly and \n\t\t\t//argues that programs should not rely on this information, \n\t\t\t//instead using the dependencies to determine if a program will\n\t\t\t//work. Unfortunately, this viewpoint does little for generic\n\t\t\t//informational purposes, version based bug reporting, etc. They\n\t\t\t//have not standardized this process, even for the \n\t\t\t//lsb_release package. The information provided in \n\t\t\t// /etc/debian_version is often incorrect and should not be used.\n\t\t\tobj.ClassName = \"Linux.Debian\";\n\t\t\tobj.PlatformSubType = \"Debian\";\n\t\t\tobj.Edition = \"\";\n\t\t\tobj.Version = \"\";\n\t\t}\n\t\t\n\t\tpublic static void GetFedoraPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list available at http://fedoraproject.org/wiki/Releases\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tFedora release 8 (Werewolf)\n\t\t\t//\t\tFedora Core release 6 (Zod)\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\n\t\t\tint pt = lines[0].IndexOf(\"release\");\n\t\t\tint pt2 = lines[0].IndexOf(\"(\");\n\t\t\tint pt3 = lines[0].IndexOf(\")\");\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.Fedora\";\n\t\t\tobj.PlatformSubType = lines[0].Substring(0,pt-1).Trim();\n\t\t\tobj.Version = lines[0].Substring(pt+8, pt2-1).Trim();\n\t\t\tobj.Edition = lines[0].Substring(pt2+1,pt3-1).Trim();\n\t\t\t\n\t\t}\n\t\t\n\t\tpublic static void GetGentooPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list available at http://gentest.neysx.org/proj/en/releng/#doc_chap6\n\t\t\t//Versioning is primarily based on date.\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tGentoo Base System release 1.12.11.1\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(obj.VersionFile);\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.Gentoo\";\n\t\t\tobj.PlatformSubType = \"Gentoo\";\n\t\t\tobj.Edition = \"\";\n\t\t\tobj.Version = lines[0].Split().Last();\n\t\t}\n\t\t\n\t\tpublic static void GetMandrivaPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Formerly known as Mandrake Linux\n\t\t\t//Version list is available at http://en.wikipedia.org/wiki/Mandriva_Linux\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tMandriva Linux release 2010.0 (Official) for i586\n\t\t\t\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.Mandriva\";\n\t\t\tobj.PlatformSubType = \"Mandriva\";\n\t\t\tobj.Edition = \"\";\n\t\t\tint pt = lines[0].IndexOf(\"release\");\n\t\t\tint pt2 = lines[0].IndexOf(\"(\");\n\t\t\tobj.Version = lines[0].Substring(pt+8, pt2-1).Trim();\n\t\t\t\n\t\t\tswitch (obj.Version)\n\t\t\t{\n\t\t\t\tcase \"2010.0\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2010\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2009.1\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2009 Spring\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2009.0\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2009\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2008.1\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2008 Spring\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2008.0\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2008\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2007.1\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2007 Spring\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2007\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2007\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2006.0\":\n\t\t\t\t\tobj.Edition = \"Mandriva Linux 2006\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"10.2\":\n\t\t\t\t\tobj.Edition = \"Limited Edition 2005\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"10.1\":\n\t\t\t\t\tobj.Edition = \"Community and Official\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"10.0\":\n\t\t\t\t\tobj.Edition = \"Community and Official\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"9.2\":\n\t\t\t\t\tobj.Edition = \"FiveStar\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"9.1\":\n\t\t\t\t\tobj.Edition = \"Bamboo\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"9.0\":\n\t\t\t\t\tobj.Edition = \"Dolphin\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"8.2\":\n\t\t\t\t\tobj.Edition = \"Bluebird\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"8.1\":\n\t\t\t\t\tobj.Edition = \"Vitamin\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"8.0\":\n\t\t\t\t\tobj.Edition = \"Traktopel\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"7.2\":\n\t\t\t\t\tobj.Edition = \"Odyssey\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"7.1\":\n\t\t\t\t\tobj.Edition = \"Helium\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"7.0\":\n\t\t\t\t\tobj.Edition = \"Air\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"6.1\":\n\t\t\t\t\tobj.Edition = \"Helios\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"6.0\":\n\t\t\t\t\tobj.Edition = \"Venus\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"5.3\":\n\t\t\t\t\tobj.Edition = \"Festen\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"5.2\":\n\t\t\t\t\tobj.Edition = \"Leeloo\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"5.1\":\n\t\t\t\t\tobj.Edition = \"Venice\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tobj.Edition = \"Unknown\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static void GetRedHatPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list is available at ...\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tRed Hat Enterprise Linux Server release 5 (Tikanga)\n\t\t\t//\t\tRed Hat Enterprise Linux AS release 4 (Nahant Update 3)\n\t\t\t//\t\tRed Hat Advanced Server Linux AS release 2.1 (Pensacola)\n\t\t\t//\t\tRed Hat Enterprise Linux ES release 3 (Taroon Update 4)\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\t\t\t\n\t\t\tint pt = lines[0].IndexOf(\"release\");\n\t\t\tint pt2 = lines[0].IndexOf(\"(\");\n\t\t\tint pt3 = lines[0].IndexOf(\")\");\n\t\t\tint pt4 = lines[0].IndexOf(\"Linux\");\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.RedHat\";\n\t\t\tobj.PlatformSubType = lines[0].Substring(0, pt4-1);\n\t\t\tobj.Edition = lines[0].Substring(pt2+1, pt3-1-pt2);\n\t\t\tobj.Version = lines[0].Substring(pt+8, pt2 - 1 - pt + 8).Trim();\n\t\t\t\n\t\t}\n\t\t\n\t\tpublic static void GetSlackwarePlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list is available at ...\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tSlackware 13.0.0.0.0\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.Slackware\";\n\t\t\tobj.PlatformSubType = \"Slackware\";\n\t\t\tobj.Edition = \"\";\n\t\t\tint pt = lines[0].IndexOf(\" \");\n\t\t\tobj.Version = lines[0].Substring(pt+1, lines[0].Length - 1);\n\t\t}\n\n\t\tpublic static void GetSusePlatform(Linux obj)\n\t\t{\n\t\t\tGetSusePlatform( obj, null);\n\t\t}\n\t\t\n\t\tpublic static void GetSusePlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list is available at http://en.wikipedia.org/wiki/SUSE_Linux\n\t\t\t//Unique version variations for parsing include (multi-line):\n\t\t\t//\t\tSUSE LINUX 10.0 (X86-64) OSS\n\t\t\t//\t\tVERSION = 10.0\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent != null)\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\telse\n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\t\t\t\n\t\t\tint pt = lines[1].IndexOf(\" \");\n\t\t\tobj.Version = lines[0].Substring(pt+1, lines[0].Length - 1);\n\t\t\tobj.ClassName = \"Linux.Suse\";\n\t\t\tobj.PlatformSubType = \"Suse\";\n\t\t\tobj.Edition = \"\";\n\t\t\tobj.Version = lines[1].Substring(11, lines[1].Length - 11);\n\t\t}\n\t\t\n\t\tpublic static void GetUbuntuPlatform(Linux obj)\n\t\t{\n\t\t\tGetUbuntuPlatform( obj, null);\n\t\t}\n\t\t\n\t\tpublic static void GetUbuntuPlatform(Linux obj, string unitTestContent)\n\t\t{\n\t\t\t//Version list is available at http://en.wikipedia.org/wiki/Ubuntu_(Linux_distribution)\n\t\t\t//Unique version variations for parsing include (multi-line):\n\t\t\t//\t\tDISTRIB_ID=Ubuntu\n\t\t\t//\t\tDISTRIB_RELEASE = 9.04\n\t\t\t//\t\tDISTRIB_CODENAME=jaunty\n\t\t\t//\t\tDISTRIB_DESCRIPTION = Ubuntu 9.04\n\t\t\t//Because Ubuntu can identify variants, we'll use the DISTRIB_ID \n\t\t\t//to identify the variant (such as KUbuntu, XUbuntu) instead of \n\t\t\t//a static string setting.\n\n\t\t\tList<string> lines;\n\t\t\tif (unitTestContent == null) \n\t\t\t\tlines = ParseFile(\"/etc/\" + obj.VersionFile);\n\t\t\telse\n\t\t\t\tlines = ParseString(unitTestContent);\n\t\t\t\n\t\t\tobj.ClassName = \"Linux.Ubuntu\";\n\t\t\tint pt = lines[0].IndexOf(\"=\");\n\t\t\tobj.PlatformSubType = lines[0].Substring(pt+1).Trim();\n\t\t\tint pt1 = lines[2].IndexOf(\"=\");\n\t\t\tobj.Edition = lines[2].Substring(pt1+1).Trim();\n\t\t\tint pt2 = lines[1].IndexOf(\"=\");\n\t\t\tobj.Version = lines[1].Substring(pt2+1).Trim();\n\t\t}\n\t\t\n\t\tprivate static List<string> ParseFile(string f)\n\t\t{\n\t\t\tList<string> lines = new List<string>();\n\n\t\t\tusing (StreamReader r = new StreamReader(f))\n\t\t\t{\n\n\t\t\t\tstring line;\n            \twhile ((line = r.ReadLine()) != null)\n            \t{\n            \t\tlines.Add(line.Trim());\n    \t        }\n        \t}\n\t\t\t\n\t\t\treturn lines;\n\t\t}\n\t\t\n\t\tprivate static List<string> ParseString(string str)\n\t\t{\n\t\t\tstring[] stringArray = str.Split('\\n');\n\t\t\treturn new List<string>(stringArray);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Platform/Mac.cs",
    "content": "/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyrigth (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Diagnostics;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\tpublic class Mac : Platform\n\t{\n\t\tpublic override bool IsSymlinkSupported\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool IsHardlinkSupported\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool CreateSymlink(string symlinkFilename, string existingFilename, bool isSymlinkDirectory)\n\t\t{\n\t\t\tProcessStartInfo info = new ProcessStartInfo();\n\t\t\tinfo.FileName = \"ln\";\n\t\t\tinfo.Arguments = (isSymlinkDirectory ? \"-d \" : \"\") +\"-s \" + existingFilename+\" \"+symlinkFilename;\n\t\t\tinfo.UseShellExecute = false;\n\t\t\tinfo.RedirectStandardOutput = true;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\tProcess.Start(info);\n\t\t\t\t} \n\t\t\t\tcatch (Exception) \n\t\t\t\t{\n\t\t\t\t\treturn false; \n\t\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool CreateHardlink(string hardlinkFilename, string existingFilename)\n\t\t{\n\t\t\tProcessStartInfo info = new ProcessStartInfo();\n\t\t\tinfo.FileName = \"ln\";\n\t\t\tinfo.Arguments = existingFilename+\" \"+hardlinkFilename;\n\t\t\tinfo.UseShellExecute = false;\n\t\t\tinfo.RedirectStandardOutput = true;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\tProcess.Start(info);\n\t\t\t\t} \n\t\t\t\tcatch (Exception) \n\t\t\t\t{\n\t\t\t\t\treturn false; \n\t\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Process GetTextPager(string corePagerConfig)\n\t\t{\n\t\t\t// TODO: instantiate \"more\" or \"less\"\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic Mac()\n\t\t{\n\t\t\t//Version list available at http://fedoraproject.org/wiki/Releases\n\t\t\t//Unique version variations for parsing include:\n\t\t\t//\t\tDarwin 9.8.0 Power Macintosh\n\t\t\t\n\t\t\tProcessStartInfo info = new ProcessStartInfo();\n\t\t\tinfo.FileName = \"uname\";\n\t\t\tinfo.Arguments = \"-mrs\";\n\t\t\tinfo.UseShellExecute = false;\n\t\t\tinfo.RedirectStandardOutput = true;\n\t\t\t\n\t\t\tusing (Process process = Process.Start(info))\n\t\t\t{\n\t\t\t\tusing (StreamReader reader = process.StandardOutput)\n\t\t\t\t{\n\t\t\t\t\tstring result = reader.ReadToEnd();\n\t\t\t\t\t\n\t\t\t\t\tint pt = result.IndexOf(\" \");\n\t\t\t\t\tint pt2 = result.IndexOf(\" \",pt+1);\n\t\t\t\t\tint pt3 = pt2+1; \n\t\t\t\t\t\n\t\t\t\t\tClassName = \"Macintosh.Macosx\";\n\t\t\t\t\tPlatformSubType = \"\";\n\t\t\t\t\tVersion = result.Substring(pt2, pt3).Trim();\n\t\t\t\t\tEdition = result.Substring(0,pt).Trim();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Platform/Platform.cs",
    "content": "/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyrigth (C) 2010, Henon <meinrad.recheis@gmail.com>\n * Copyrigth (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Diagnostics;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Base class for a singleton object that provides capabilities that\n\t/// require a different implementation per platform. \n\t/// </summary>\n\tpublic abstract class Platform\n\t{\n\t\t/// <summary>\n\t\t/// Extension of System.PlatformID to add plaforms. \n\t\t/// </summary>\n\t\tenum GitPlatformID\n\t\t{\n\t\t\tWin32S = PlatformID.Win32S,\n\t\t\tWin32Windows = PlatformID.Win32Windows,\n\t\t\tWin32NT = PlatformID.Win32NT,\n\t\t\tWinCE = PlatformID.WinCE,\n\t\t\tUnix = PlatformID.Unix,\n\t\t\tXbox,\n\t\t\tMacOSX,\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Enumeration of the known concrete implementation families. \n\t\t/// </summary>\n\t\tpublic enum PlatformId\n\t\t{\n\t\t\tWindows = 1,\n\t\t\tLinux = 2,\n\t\t\tMac = 3\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Access to the singleton object.  Will create the object on first get. \n\t\t/// </summary>\n\t\tpublic static Platform Instance\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_instance == null)\n\t\t\t\t{\n\t\t\t\t\tSystem.OperatingSystem os = Environment.OSVersion;\n\t\t\t\t\tGitPlatformID pid = (GitPlatformID)os.Platform;\n\t\t\n\t\t\t\t\tswitch (pid)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase GitPlatformID.Unix:\n\t\t\t\t\t\t\t_instance = new Linux();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase GitPlatformID.MacOSX:\n\t\t\t\t\t\t\t_instance = new Mac();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase GitPlatformID.Win32NT:\n\t\t\t\t\t\tcase GitPlatformID.Win32S:\n\t\t\t\t\t\tcase GitPlatformID.Win32Windows:\n\t\t\t\t\t\tcase GitPlatformID.WinCE:\n\t\t\t\t\t\t\t_instance = new Win32();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new NotSupportedException(\"Platform could not be detected!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn _instance;\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract bool IsHardlinkSupported { get; }\n\n\t\tpublic abstract bool IsSymlinkSupported { get; }\n\n\t\tpublic abstract bool CreateSymlink(string symlinkFilename, string existingFilename, bool isSymlinkDirectory);\n\n\t\tpublic abstract bool CreateHardlink(string hardlinkFilename, string exisitingFilename);\n\n\n\t\tpublic abstract Process GetTextPager(string corePagerConfig);\n\n\t\tprotected Platform()\n\t\t{\n\t\t}\n\n\t\tpublic string ClassName { get; protected set; }\n\n\t\tpublic PlatformId Id { get; protected set; }\n\n\t\tpublic string PlatformType { get; protected set; }\n\n\t\tpublic string PlatformSubType { get; protected set; }\n\n\t\tpublic string Edition { get; protected set; }\n\n\t\tpublic string Version { get; protected set; }\n\n\t\tpublic string VersionFile { get; protected set; }\n\n\t\tpublic string ProductName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn PlatformType + \" \" + PlatformSubType + \" \" + Edition + \"(\" + Version + \")\";\n\t\t\t}\n\t\t}\n\n\t\tprivate static Platform _instance;\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Platform/Windows.cs",
    "content": "/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyrigth (C) 2010, Henon <meinrad.recheis@gmail.com>\n * Copyrigth (C) 2010, Andrew Cooper <andymancooper@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core;\nusing System.Runtime.InteropServices;\n\nnamespace GitSharp.Core\n{\n\n\tpublic class Win32 : Platform\n\t{\n\t\t\n\t\t[DllImport(\"kernel32.dll\")]\n\t\tprivate static extern bool GetVersionEx([In,Out] Win32VersionInfo osvi);\n\t\t\n\t\t[DllImport(\"Kernel32.dll\")]\n\t\tprivate static extern bool GetProductInfo(int dwOSMajorVersion,\n\t\t                                           int dwOSMinorVersion, int dwSpMajorVersion,\n\t\t                                           int dwSpMinorVersion, out uint dwOSEdition);\n\t\t\n\t\t[DllImport(\"kernel32.dll\")]\n\t\tprivate static extern void GetSystemInfo(ref Win32SystemInfo sysInfo);\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tprivate static extern int GetSystemMetrics(int nIndex);\n\t\t\n\t\tprivate static void GetProductInfo(Win32ProductInfo info)\n\t\t{\n\t\t\tGetProductInfo(info.dwOSMajorVersion, info.dwOSMinorVersion,\n\t\t\t               info.dwSpMajorVersion, info.dwSpMinorVersion,\n\t\t\t               out info.dwOSEdition);\n\t\t}\n\t\t\n\t\t[DllImport(\"kernel32.dll\", EntryPoint=\"CreateSymbolicLinkW\", CharSet=CharSet.Unicode)]\n\t\tprivate static extern int CreateSymbolicLink([In] string lpSymlinkFileName, [In] string lpExistingFileName, int dwFlags);\n\t\t\n\t\t[DllImport(\"kernel32.dll\", EntryPoint=\"CreateHardLinkW\", CharSet=CharSet.Unicode)]\n\t\tprivate static extern int CreateHardLink([In] string lpHardlinkFileName, [In] string lpExistingFileName, SecurityAttributes attribs);\n\t\t\n\t\tpublic override bool IsSymlinkSupported\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tSystem.OperatingSystem os = Environment.OSVersion;\n\t\t\t\tif (os.Version.Major >= 6)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsHardlinkSupported\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tSystem.OperatingSystem os = Environment.OSVersion;\n\t\t\t\tif (os.Version.Major >= 6)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool CreateSymlink(string symlinkFilename, string exisitingFilename, bool isSymlinkDirectory)\n\t\t{\n\t\t\tif (IsSymlinkSupported)\n\t\t\t{\n\t\t\t\tint success;\n\t\t\t\t\n\t\t\t\tif (isSymlinkDirectory)\n\t\t\t\t\tsuccess = CreateSymbolicLink(symlinkFilename, exisitingFilename, 1);\n\t\t\t\telse\n\t\t\t\t\tsuccess = CreateSymbolicLink(symlinkFilename, exisitingFilename, 0);\n\t\t\t\t\n\t\t\t\tif (success == 0)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override bool CreateHardlink(string hardlinkFilename, string exisitingFilename)\n\t\t{\n\t\t\tif (IsHardlinkSupported)\n\t\t\t{\n\t\t\t\tSecurityAttributes attribs = null;\n\t\t\t\tint success = CreateHardLink(hardlinkFilename, exisitingFilename, attribs);\n\t\t\t\tif (success == 0)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Process GetTextPager(string corePagerConfig)\n\t\t{\n\t\t\tvar pager = new Process();\n\t\t\tvar pagerVar = System.Environment.GetEnvironmentVariable(\"GIT_PAGER\");\n\t\t\tif (pagerVar == null)\n\t\t\t\tpagerVar = corePagerConfig;\n\t\t\tif (pagerVar == null)\n                pagerVar = System.IO.Path.Combine(System.Environment.SystemDirectory,\"more.com\");\n            var tokens = pagerVar.Split();\n            pager.StartInfo.FileName = tokens[0];\n            pager.StartInfo.UseShellExecute = false;\n            pager.StartInfo.RedirectStandardInput = true;\n            if (tokens.Length > 1)\n                pager.StartInfo.Arguments = pagerVar.Substring(tokens[0].Length);\n\t\t\treturn pager;\n\t\t}\n\n\t\tpublic Win32()\n\t\t{\n\t\t\tWin32VersionInfo osvi = new Win32VersionInfo();\n\t\t\tosvi.dwOSVersionInfoSize = Marshal.SizeOf(osvi);\n\t\t\tGetVersionEx(osvi);\n\t\t\t\n\t\t\tWin32SystemInfo sysInfo = new Win32SystemInfo();\n\t\t\tGetSystemInfo(ref sysInfo);\n\t\t\tClassName = null;\n\t\t\tPlatformType = \"Windows\";\n\t\t\t\n\t\t\tSystem.OperatingSystem os = Environment.OSVersion;\n\t\t\tVersion = os.Version.Major + \".\"+os.Version.Minor;\n\t\t\tswitch (os.Platform)\n\t\t\t{\n\t\t\t\tcase PlatformID.Win32Windows:\n\t\t\t\t\tswitch (os.Version.Major)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tswitch (os.Version.Minor)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\tif (osvi.szCSDVersion == \"B\" ||\n\t\t\t\t\t\t\t\t\t    osvi.szCSDVersion == \"C\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v95\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"95\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"OSR2\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v95\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"95\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 10:\n\t\t\t\t\t\t\t\t\tif (osvi.szCSDVersion == \"A\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v98\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"98\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"SE\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v98\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"98\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 90:\n\t\t\t\t\t\t\t\t\tClassName = \"Windows.ME\";\n\t\t\t\t\t\t\t\t\tPlatformSubType = \"ME\";\n\t\t\t\t\t\t\t\t\tEdition = \"\";\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase PlatformID.Win32NT:\n\t\t\t\t\tswitch (os.Version.Major)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tClassName = \"Windows.NT\";\n\t\t\t\t\t\t\tPlatformSubType = \"NT\";\n\t\t\t\t\t\t\tEdition = \"3.51\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tswitch (osvi.wProductType)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\tClassName = \"Windows.NT\";\n\t\t\t\t\t\t\t\t\tPlatformSubType = \"NT\";\n\t\t\t\t\t\t\t\t\tEdition = \"4.0 Workstation\";\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\tif (osvi.wSuiteMask == SuiteVersion.Enterprise)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.NT\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"NT\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"4.0 Server Enterprise\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.NT\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"NT\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"4.0 Server Standard\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tswitch (os.Version.Minor)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\tswitch (osvi.wSuiteMask)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase SuiteVersion.DataCenter:\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2000\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2000\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Data Center\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase SuiteVersion.Enterprise:\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2000\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2000\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Advanced\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2000\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2000\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Standard\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\tif (osvi.wSuiteMask == SuiteVersion.Personal)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.XP\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"XP\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"Professional\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.XP\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"XP\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"Home\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\tif ((osvi.wProductType == NTVersion.Workstation) &&\n\t\t\t\t\t\t\t\t\t    (sysInfo.processorArchitecture == ProcessorArchitecture.AMD64))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.XP\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"XP\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"Professional x64\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if ((osvi.wProductType == NTVersion.Server) &&\n\t\t\t\t\t\t\t\t\t         (GetSystemMetrics(SystemMetrics.ServerR2) == 0) &&\n\t\t\t\t\t\t\t\t\t         (osvi.wSuiteMask == SuiteVersion.Enterprise))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Server\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"2003 Enterprise\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if ((osvi.wProductType == NTVersion.Server) &&\n\t\t\t\t\t\t\t\t\t         GetSystemMetrics(SystemMetrics.ServerR2) != 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Server\";\n\t\t\t\t\t\t\t\t\t\tEdition = \"2003 R2\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tswitch (osvi.wSuiteMask)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcase SuiteVersion.DataCenter:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"2003 Data Center\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase SuiteVersion.Blade:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"2003 Web Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase SuiteVersion.WHServer:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2003\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2003\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"2003 Standard\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tWin32ProductInfo ospi = new Win32ProductInfo();\n\t\t\t\t\t\t\tospi.dwOSProductInfoSize = Marshal.SizeOf(ospi);\n\t\t\t\t\t\t\tospi.dwOSMajorVersion = os.Version.Major;\n\t\t\t\t\t\t\tospi.dwOSMinorVersion = os.Version.Minor;\n\t\t\t\t\t\t\tospi.dwSpMajorVersion = 0;\n\t\t\t\t\t\t\tospi.dwSpMinorVersion = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGetProductInfo(ospi);\n\t\t\t\t\t\t\tVersion = Version+\".\"+ospi.dwOSEdition;\n\t\t\t\t\t\t\tswitch (os.Version.Minor)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\tif (osvi.wProductType == NTVersion.Workstation)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// Vista Detection\n\t\t\t\t\t\t\t\t\t\tswitch (ospi.dwOSEdition)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Undefined:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Undefined\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"is not defined!\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Ultimate: //    1\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Ultimate Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomeBasic: // 2\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Basic Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomePremium: // 3\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Premium Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Enterprise: // 4\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomeBasicN: // 5\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Basic N Edition (EU Only)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Business: // 6\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Business Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Starter:// B\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Starter Edition\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.BusinessN: // 10\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Business N Edition (EU Only)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomePremiumN: // 1A\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Premium N Edition (EU Only)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseN: // 1B\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise N Edition (EU Only)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.UltimateN: // 1C\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Ultimate N Edition (EU Only)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Unlicensed: // 0xABCDABCD\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Unlicensed\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Unlicensed\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Unknown\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"Vista\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"is not defined!\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tswitch (ospi.dwOSEdition)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//Windows 2008 Detection\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Undefined:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Undefined\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"is not defined!\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StandardServer: // 7\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Standard Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.DataCenterServer://8\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Data Center Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.SmallBusinessServer://9\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Small Business Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseServer:// A\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.DataCenterServerCore: // C\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Data Center Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StandardServerCore: // D\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Standard Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseServerCore: // E\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseServerIA64: // F\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Server IA64\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.WebServer: // 11\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Web Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.ClusterServer: // 12\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Cluster Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomeServer: // 13\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageExpressServer: // 14\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Express Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageStandardServer: // 15\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Standard Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageWorkgroupServer: // 16\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Workgroup Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageEnterpriseServer: // 17\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Enterprise Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.ServerForSmallBusiness: // 18\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Server for Small Businesses\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.SmallBusinessServerPremium: // 19\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Small Business Server Premium\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.WebServerCore: // 1D\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Web Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.MediumBusinessServerManagement: // 1E\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Medium Business Server Management\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.MediumBusinessServerSecurity: // 1F\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Medium Business Server Security\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.MediumBusinessServerMessaging: // 20\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Medium Business Server Messaging\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.SmallBusinessServerPrime: // 21\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Small Business Server Prime\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HomePremiumServer: // 22\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Premium Server\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.ServerForSmallBusinessV: // 23\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Server for Small Business (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StandardServerV: // 24\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Standard Server (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.DataCenterServerV: // 25\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Data Center Server (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseServerV: // 26\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Server (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.DataCenterServerCoreV: // 27\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Data Center Server Core (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StandardServerCoreV: // 28\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Standard Server Core (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.EnterpriseServerCoreV: // 29\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Server Core (Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.HyperV: // 2A\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"(Hyper-V)\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageExpressServerCore: // 2B\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Express Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageStandardServerCore: // 2C\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Standard Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageWorkgroupServerCore: // 2D\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Workgroup Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.StorageEnterpriseServerCore: // 2E\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Storage Enterprise Server Core\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase ProductType.Unlicensed: // 0xABCDABCD\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Unlicensed\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"Unlicensed\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Unknown\";\n\t\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"2008\";\n\t\t\t\t\t\t\t\t\t\t\t\tEdition = \"is unknown!\";\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\tswitch (ospi.dwOSEdition)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase ProductType.Undefined:\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.Undefined\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"is undefined\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.Ultimate: //    1\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Ultimate Edition\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.HomeBasic: // 2\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Basic Edition\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.HomePremium: // 3\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Premium Edition\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.Enterprise: // 4\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Enterprise Edition\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.HomeBasicN: // 5\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Home Basic N Edition (EU only)\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.Business: // 6\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Business Edition\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase ProductType.BusinessN: // 10\n\t\t\t\t\t\t\t\t\t\t\tClassName = \"Windows.v7\";\n\t\t\t\t\t\t\t\t\t\t\tPlatformSubType = \"7\";\n\t\t\t\t\t\t\t\t\t\t\tEdition = \"Business N Edition (EU only)\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} //End os.Version.Minor\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t} // End os.Version.Major\n\t\t\t\t\tbreak;\n\t\t\t} // End os.Platform\n\t\t\t\n\t\t\tif (ClassName == null)\n\t\t\t\tthrow new ArgumentNullException(\"ClassName was not defined. Please report this bug.\");\n\t\t}\n\t}\n\n\t\n\t\n\t//The following enums are located in WinNT.h\n\tinternal static class NTVersion\n\t{\n\t\tpublic const byte Workstation         = 1;\n\t\tpublic const byte DomainController     = 2;\n\t\tpublic const byte Server             = 3;\n\t}\n\n\t// VER_SUITE_\n\tinternal static class SuiteVersion\n\t{\n\t\tpublic const ushort Standard                    = 0x00000000;\n\t\tpublic const ushort SmallBusiness             = 0x00000001;\n\t\tpublic const ushort Enterprise                 = 0x00000002;\n\t\tpublic const ushort BackOffice                 = 0x00000004;\n\t\tpublic const ushort Communications             = 0x00000008;\n\t\tpublic const ushort Terminal                     = 0x00000010;\n\t\tpublic const ushort SmallBusinessRestricted     = 0x00000020;\n\t\tpublic const ushort EmbeddedNT                 = 0x00000040;\n\t\tpublic const ushort DataCenter                 = 0x00000080;\n\t\tpublic const ushort SingleUserTS                 = 0x00000100;\n\t\tpublic const ushort Personal                     = 0x00000200;\n\t\tpublic const ushort Blade                     = 0x00000400;\n\t\tpublic const ushort EmbeddedRestricted         = 0x00000800;\n\t\tpublic const ushort SecurityAppliance         = 0x00001000;\n\t\tpublic const ushort StorageServer             = 0x00002000;\n\t\tpublic const ushort ComputeServer             = 0x00004000;\n\t\tpublic const ushort WHServer                     = 0x00008000;\n\t}\n\n\t//PRODUCT_\n\tinternal static class ProductType\n\t{\n\t\tpublic const uint Undefined                         = 0x00000000;\n\t\tpublic const uint Ultimate                         = 0x00000001;\n\t\tpublic const uint HomeBasic                         = 0x00000002;\n\t\tpublic const uint HomePremium                     = 0x00000003;\n\t\tpublic const uint Enterprise                         = 0x00000004;\n\t\tpublic const uint HomeBasicN                         = 0x00000005;\n\t\tpublic const uint Business                         = 0x00000006;\n\t\tpublic const uint StandardServer                     = 0x00000007;\n\t\tpublic const uint DataCenterServer                 = 0x00000008;\n\t\tpublic const uint SmallBusinessServer             = 0x00000009;\n\t\tpublic const uint EnterpriseServer                 = 0x0000000A;\n\t\tpublic const uint Starter                         = 0x0000000B;\n\t\tpublic const uint DataCenterServerCore             = 0x0000000C;\n\t\tpublic const uint StandardServerCore                 = 0x0000000D;\n\t\tpublic const uint EnterpriseServerCore             = 0x0000000E;\n\t\tpublic const uint EnterpriseServerIA64             = 0x0000000F;\n\t\tpublic const uint BusinessN                         = 0x00000010;\n\t\tpublic const uint WebServer                         = 0x00000011;\n\t\tpublic const uint ClusterServer                     = 0x00000012;\n\t\tpublic const uint HomeServer                         = 0x00000013;\n\t\tpublic const uint StorageExpressServer             = 0x00000014;\n\t\tpublic const uint StorageStandardServer             = 0x00000015;\n\t\tpublic const uint StorageWorkgroupServer             = 0x00000016;\n\t\tpublic const uint StorageEnterpriseServer         = 0x00000017;\n\t\tpublic const uint ServerForSmallBusiness             = 0x00000018;\n\t\tpublic const uint SmallBusinessServerPremium         = 0x00000019;\n\t\tpublic const uint HomePremiumN                     = 0x0000001A;\n\t\tpublic const uint EnterpriseN                     = 0x0000001B;\n\t\tpublic const uint UltimateN                         = 0x0000001C;\n\t\tpublic const uint WebServerCore                     = 0x0000001D;\n\t\tpublic const uint MediumBusinessServerManagement    = 0x0000001E;\n\t\tpublic const uint MediumBusinessServerSecurity     = 0x0000001F;\n\t\tpublic const uint MediumBusinessServerMessaging     = 0x00000020;\n\t\tpublic const uint SmallBusinessServerPrime         = 0x00000021;\n\t\tpublic const uint HomePremiumServer                 = 0x00000022;\n\t\tpublic const uint ServerForSmallBusinessV         = 0x00000023;\n\t\tpublic const uint StandardServerV                 = 0x00000024;\n\t\tpublic const uint DataCenterServerV                 = 0x00000025;\n\t\tpublic const uint EnterpriseServerV                 = 0x00000026;\n\t\tpublic const uint DataCenterServerCoreV             = 0x00000027;\n\t\tpublic const uint StandardServerCoreV             = 0x00000028;\n\t\tpublic const uint EnterpriseServerCoreV             = 0x00000029;\n\t\tpublic const uint HyperV                             = 0x0000002A;\n\t\tpublic const uint StorageExpressServerCore         = 0x0000002B;\n\t\tpublic const uint StorageStandardServerCore         = 0x0000002C;\n\t\tpublic const uint StorageWorkgroupServerCore         = 0x0000002D;\n\t\tpublic const uint StorageEnterpriseServerCore     = 0x0000002E;\n\t\tpublic const uint Unlicensed                        = 0xABCDABCD;\n\t}\n\n\t//PROCESSOR_ARCHITECTURE\n\tinternal static class ProcessorArchitecture\n\t{\n\t\tpublic const ushort Intel         = 0;\n\t\tpublic const ushort IA64             = 6;\n\t\tpublic const ushort AMD64         = 9;\n\t\tpublic const ushort Unknown         = 0xFFFF;\n\t}\n\n\tinternal static class SystemMetrics\n\t{\n\t\t///The build number if the system is Windows Server 2003 R2; otherwise, 0.\n\t\tpublic const int ServerR2 = 89;\n\t}\n\t\n\t[StructLayout(LayoutKind.Sequential)]\n\tinternal class SecurityAttributes\n\t{\n    \tpublic int nLength;\n    \tpublic IntPtr lpSecurityDescriptor;\n    \tpublic int bInheritHandle;\n\t}\n\t\n\t[StructLayout(LayoutKind.Sequential)]\n\tinternal class Win32ProductInfo\n\t{\n\t\tpublic int dwOSProductInfoSize;\n    \tpublic int dwOSMajorVersion;\n    \tpublic int dwOSMinorVersion;\n    \tpublic int dwSpMajorVersion;\n    \tpublic int dwSpMinorVersion;\n    \tpublic uint dwOSEdition;\n\t}\n\t\n#pragma warning disable 169\n\t[StructLayout(LayoutKind.Sequential)]\n\tinternal struct Win32SystemInfo\n\t{\n    \tpublic ushort processorArchitecture;\n    \tushort reserved;\n    \tpublic uint pageSize;\n    \tpublic IntPtr minimumApplicationAddress;\n    \tpublic IntPtr maximumApplicationAddress;\n    \tpublic IntPtr activeProcessorMask;\n    \tpublic uint numberOfProcessors;\n    \tpublic uint processorType;\n    \tpublic uint allocationGranularity;\n    \tpublic ushort processorLevel;\n    \tpublic ushort processorRevision;\n    }\n#pragma warning restore 169\n\t\n\t[StructLayout(LayoutKind.Sequential)]\n\tinternal class Win32VersionInfo\n\t{\n   \t\tpublic int dwOSVersionInfoSize;\n   \t\tpublic int dwMajorVersion;\n   \t\tpublic int dwMinorVersion;\n   \t\tpublic int dwBuildNumber;\n   \t\tpublic int dwPlatformId;\n   \t\t[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]\n   \t\tpublic string szCSDVersion;\n   \t\tpublic short wServicePackMajor;  \n   \t\tpublic short wServicePackMinor;  \n   \t\tpublic ushort wSuiteMask;\n   \t\tpublic byte wProductType;  \n   \t\tpublic byte wReserved;\n\t}\t\n}"
  },
  {
    "path": "GitSharp.Core/ProgressMonitor.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n    [Complete]\n    public abstract class ProgressMonitor\n    {\n        public const int UNKNOWN = -1;\n\n        public abstract void Start(int totalTasks);\n        public abstract void BeginTask(string title, int totalWork);\n        public abstract void Update(int completed);\n        public abstract void EndTask();\n\n        public abstract bool IsCancelled{ get; } \n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"GitSharp.Core\")]\n[assembly: AssemblyDescription(\"\")]\n\n[assembly: InternalsVisibleTo(\"GitSharp\")]\n[assembly: InternalsVisibleTo(\"GitSharp.Tests\")]\n"
  },
  {
    "path": "GitSharp.Core/Ref.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n\n    public static class RefExtensions\n    {\n        public static string getName(this Ref @ref)\n        {\n            return @ref.Name;\n        }\n\n        public static bool isSymbolic(this Ref @ref)\n        {\n            return @ref.IsSymbolic;\n        }\n\n        public static Ref getLeaf(this Ref @ref)\n        {\n            return @ref.Leaf;\n        }\n\n        public static Ref getTarget(this Ref @ref)\n        {\n            return @ref.Target;\n        }\n\n        public static ObjectId getObjectId(this Ref @ref)\n        {\n            return @ref.ObjectId;\n        }\n\n        public static ObjectId getPeeledObjectId(this Ref @ref)\n        {\n            return @ref.PeeledObjectId;\n        }\n\n        public static bool isPeeled(this Ref @ref)\n        {\n            return @ref.IsPeeled;\n        }\n\n        public static Storage getStorage(this Ref @ref)\n        {\n            return @ref.StorageFormat;\n        }\n    }\n\n\n    /// <summary>\n    /// Pairing of a name and the <seealso cref=\"ObjectId\"/> it currently has.\n    /// <para />\n    /// A ref in Git is (more or less) a variable that holds a single object\n    /// identifier. The object identifier can be any valid Git object (blob, tree,\n    /// commit, annotated tag, ...).\n    /// <para />\n    /// The ref name has the attributes of the ref that was asked for as well as the\n    /// ref it was resolved to for symbolic refs plus the object id it points to and\n    /// (for tags) the peeled target object id, i.e. the tag resolved recursively\n    /// until a non-tag object is referenced.\n    /// </summary>\n    public interface Ref\n    {\n        /// <summary>\n        /// What this ref is called within the repository.\n        /// </summary>\n        /// <returns>name of this ref.</returns>\n        string Name { get; }\n\n        /// <summary>\n        /// Test if this reference is a symbolic reference.\n        /// <para/>\n        /// A symbolic reference does not have its own {@link ObjectId} value, but\n        /// instead points to another {@code Ref} in the same database and always\n        /// uses that other reference's value as its own.\n        /// </summary>\n        /// <returns>\n        /// true if this is a symbolic reference; false if this reference\n        /// contains its own ObjectId.\n        /// </returns>\n        bool IsSymbolic { get; }\n\n        /// <summary>\n        /// Traverse target references until {@link #isSymbolic()} is false.\n        /// <para/>\n        /// If {@link #isSymbolic()} is false, returns {@code this}.\n        /// <para/>\n        /// If {@link #isSymbolic()} is true, this method recursively traverses\n        /// {@link #getTarget()} until {@link #isSymbolic()} returns false.\n        /// <para/>\n        /// This method is effectively\n        /// \n        /// <pre>\n        /// return isSymbolic() ? getTarget().getLeaf() : this;\n        /// </pre>\n        /// </summary>\n        /// <returns>the reference that actually stores the ObjectId value.</returns>\n        Ref Leaf { get; }\n\n        /// <summary>\n        /// Get the reference this reference points to, or {@code this}.\n        /// <para/>\n        /// If {@link #isSymbolic()} is true this method returns the reference it\n        /// directly names, which might not be the leaf reference, but could be\n        /// another symbolic reference.\n        /// <para/>\n        /// If this is a leaf level reference that contains its own ObjectId,this\n        /// method returns {@code this}.\n        /// </summary>\n        /// <returns>the target reference, or {@code this}.</returns>\n        Ref Target { get; }\n\n        /// <summary>\n        /// Cached value of this ref.\n        /// </summary>\n        /// <returns>the value of this ref at the last time we read it.</returns>\n        ObjectId ObjectId { get; }\n\n        /// <summary>\n        /// Cached value of <code>ref^{}</code> (the ref peeled to commit).\n        /// </summary>\n        /// <returns>\n        /// if this ref is an annotated tag the id of the commit (or tree or\n        /// blob) that the annotated tag refers to; null if this ref does not\n        /// refer to an annotated tag.\n        /// </returns>\n        ObjectId PeeledObjectId { get; }\n\n        /// <returns>whether the Ref represents a peeled tag</returns>\n        bool IsPeeled { get; }\n\n        /// <summary>\n        /// How was this ref obtained?\n        /// <para/>\n        /// The current storage model of a Ref may influence how the ref must be\n        /// updated or deleted from the repository.\n        /// </summary>\n        /// <returns>type of ref.</returns>\n        Storage StorageFormat { get; }\n\n   }\n\n    /// <summary>\n    /// Location where a <see cref=\"Ref\"/> is Stored.\n    /// </summary>\n    public sealed class Storage\n    {\n        /// <summary>\n        /// The ref does not exist yet, updating it may create it.\n        /// <para />\n        /// Creation is likely to choose <see cref=\"Loose\"/> storage.\n        /// </summary>\n        public static readonly Storage New = new Storage(\"New\", true, false);\n\n        /// <summary>\n        /// The ref is Stored in a file by itself.\n        /// <para />\n        /// Updating this ref affects only this ref.\n        /// </summary>\n        public static readonly Storage Loose = new Storage(\"Loose\", true, false);\n\n        /// <summary>\n        /// The ref is stored in the <code>packed-refs</code> file, with others.\n        /// <para />\n        /// Updating this ref requires rewriting the file, with perhaps many\n        /// other refs being included at the same time.\n        /// </summary>\n        public static readonly Storage Packed = new Storage(\"Packed\", false, true);\n\n        /// <summary>\n        /// The ref is both <see cref=\"Loose\"/> and <see cref=\"Packed\"/>.\n        /// <para />\n        /// Updating this ref requires only updating the loose file, but deletion\n        /// requires updating both the loose file and the packed refs file.\n        /// </summary>\n        public static readonly Storage LoosePacked = new Storage(\"LoosePacked\", true, true);\n\n        /// <summary>\n        /// The ref came from a network advertisement and storage is unknown.\n        /// <para />\n        /// This ref cannot be updated without Git-aware support on the remote\n        /// side, as Git-aware code consolidate the remote refs and reported them\n        /// to this process.\n        /// </summary>\n        public static readonly Storage Network = new Storage(\"Network\", false, false);\n\n        public bool IsLoose { get; private set; }\n        public bool IsPacked { get; private set; }\n        public string Name { get; private set; }\n\n        private Storage(string name, bool loose, bool packed)\n        {\n            Name = name;\n            IsLoose = loose;\n            IsPacked = packed;\n        }\n    }\n \n}"
  },
  {
    "path": "GitSharp.Core/RefComparator.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Charles O'Farrell <charleso@charleso.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Util for sorting (or comparing) Ref instances by name.\n    /// <para />\n    /// Useful for command line tools or writing out refs to file.\n    /// </summary>\n    public class RefComparator : IComparer<Ref>\n    {\n        /// <summary>\n        /// Singleton instance of RefComparator\n        /// </summary>\n        public static RefComparator INSTANCE = new RefComparator();\n\n        public int Compare(Ref o1, Ref o2)\n        {\n            return compareTo(o1, o2);\n        }\n\n        /// <summary>\n        /// Sorts the collection of refs, returning a new collection.\n        /// </summary>\n        /// <param name=\"refs\">collection to be sorted</param>\n        /// <returns>sorted collection of refs</returns>\n        public static IEnumerable<Ref> Sort(IEnumerable<Ref> refs)\n        {\n            var r = new List<Ref>(refs);\n            r.Sort(INSTANCE);\n            return r;\n        }\n\n        /// <summary>\n        /// Compare a reference to a name.\n        /// </summary>\n        /// <param name=\"o1\">the reference instance.</param>\n        /// <param name=\"o2\">the name to compare to.</param>\n        /// <returns>standard Comparator result</returns>\n        public static int compareTo(Ref o1, String o2)\n        {\n            return o1.Name.compareTo(o2);\n        }\n\n        /// <summary>\n        /// Compare two references by name.\n        /// </summary>\n        /// <param name=\"o1\">the reference instance.</param>\n        /// <param name=\"o2\">the other reference instance.</param>\n        /// <returns>standard Comparator result</returns>\n        public static int compareTo(Ref o1, Ref o2)\n        {\n            return o1.Name.compareTo(o2.Name);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/RefDatabase.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Abstraction of name to <see cref=\"ObjectId\"/> mapping.\n    /// <para/>\n    /// A reference database stores a mapping of reference names to <see cref=\"ObjectId\"/>.\n    /// Every <see cref=\"Repository\"/> has a single reference database, mapping names to\n    /// the tips of the object graph contained by the <see cref=\"ObjectDatabase\"/>.\n    /// </summary>\n    public abstract class RefDatabase : IDisposable\n    {\n        /// <summary>\n        /// Order of prefixes to search when using non-absolute references.\n        /// <para/>\n        /// The implementation's <see cref=\"getRef\"/> method must take this search\n        /// space into consideration when locating a reference by name. The first\n        /// entry in the path is always {@code \"\"}, ensuring that absolute references\n        /// are resolved without further mangling.\n        /// </summary>\n        protected static string[] SEARCH_PATH = { \"\", //$NON-NLS-1$\n                                                  Constants.R_REFS, //\n                                                  Constants.R_TAGS, //\n                                                  Constants.R_HEADS, //\n                                                  Constants.R_REMOTES //\n                                                };\n\n\n        /// <summary>\n        /// Maximum number of times a <see cref=\"SymbolicRef\"/> can be traversed.\n        /// <para/>\n        /// If the reference is nested deeper than this depth, the implementation\n        /// should either fail, or at least claim the reference does not exist.\n        /// </summary>\n        protected static int MAX_SYMBOLIC_REF_DEPTH = 5;\n\n        /// <summary>\n        /// Magic value for <see cref=\"getRefs\"/> to return all references.\n        /// </summary>\n        public static string ALL = \"\";//$NON-NLS-1$\n\n        /// <summary>\n        /// Initialize a new reference database at this location.\n        /// </summary>\n        public abstract void create();\n\n        /// <summary>\n        /// Close any resources held by this database.\n        /// </summary>\n        public abstract void close();\n\n        /// <summary>\n        /// Determine if a proposed reference name overlaps with an existing one.\n        /// <para/>\n        /// Reference names use '/' as a component separator, and may be stored in a\n        /// hierarchical storage such as a directory on the local filesystem.\n        /// <para/>\n        /// If the reference \"refs/heads/foo\" exists then \"refs/heads/foo/bar\" must\n        /// not exist, as a reference cannot have a value and also be a container for\n        /// other references at the same time.\n        /// <para/>\n        /// If the reference \"refs/heads/foo/bar\" exists than the reference\n        /// \"refs/heads/foo\" cannot exist, for the same reason.\n        /// </summary>\n        /// <param name=\"name\">proposed name.</param>\n        /// <returns>\n        /// true if the name overlaps with an existing reference; false if\n        /// using this name right now would be safe.\n        /// </returns>\n        public abstract bool isNameConflicting(string name);\n\n        /// <summary>\n        /// Create a new update command to create, modify or delete a reference.\n        /// </summary>\n        /// <param name=\"name\">the name of the reference.</param>\n        /// <param name=\"detach\">\n        /// if {@code true} and {@code name} is currently a\n        /// <see cref=\"SymbolicRef\"/>, the update will replace it with an\n        /// <see cref=\"ObjectIdRef\"/>. Otherwise, the update will recursively\n        /// traverse <see cref=\"SymbolicRef\"/>s and operate on the leaf\n        /// <see cref=\"ObjectIdRef\"/>.\n        /// </param>\n        /// <returns>a new update for the requested name; never null.</returns>\n        public abstract RefUpdate newUpdate(string name, bool detach);\n\n        /// <summary>\n        /// Create a new update command to rename a reference.\n        /// </summary>\n        /// <param name=\"fromName\">name of reference to rename from</param>\n        /// <param name=\"toName\">name of reference to rename to</param>\n        /// <returns>an update command that knows how to rename a branch to another.</returns>\n        public abstract RefRename newRename(string fromName, string toName);\n\n        /// <summary>\n        /// Read a single reference.\n        /// <para/>\n        /// Aside from taking advantage of <see cref=\"SEARCH_PATH\"/>, this method may be\n        /// able to more quickly resolve a single reference name than obtaining the\n        /// complete namespace by {@code getRefs(ALL).get(name)}.\n        /// </summary>\n        /// <param name=\"name\">\n        /// the name of the reference. May be a short name which must be\n        /// searched for using the standard {@link #SEARCH_PATH}.\n        /// </param>\n        /// <returns>the reference (if it exists); else {@code null}.</returns>\n        public abstract Ref getRef(string name);\n\n        /// <summary>\n        /// Get a section of the reference namespace.\n        /// </summary>\n        /// <param name=\"prefix\">\n        /// prefix to search the namespace with; must end with {@code /}.\n        /// If the empty string (<see cref=\"ALL\"/>), obtain a complete snapshot\n        /// of all references.\n        /// </param>\n        /// <returns>\n        /// modifiable map that is a complete snapshot of the current\n        /// reference namespace, with {@code prefix} removed from the start\n        /// of each key. The map can be an unsorted map.\n        /// </returns>\n        public abstract IDictionary<string, Ref> getRefs(string prefix);\n\n        /// <summary>\n        /// Peel a possibly unpeeled reference by traversing the annotated tags.\n        /// <para/>\n        /// If the reference cannot be peeled (as it does not refer to an annotated\n        /// tag) the peeled id stays null, but <see cref=\"Ref.IsPeeled\"/> will be true.\n        /// <para/>\n        /// Implementors should check <see cref=\"Ref.IsPeeled\"/> before performing any\n        /// additional work effort.\n        /// </summary>\n        /// <param name=\"ref\">The reference to peel</param>\n        /// <returns>\n        /// {@code ref} if {@code ref.isPeeled()} is true; otherwise a new\n        /// Ref object representing the same data as Ref, but isPeeled() will\n        /// be true and getPeeledObjectId() will contain the peeled object\n        /// (or null).\n        /// </returns>\n        public abstract Ref peel(Ref @ref);\n\n        public virtual void Dispose()\n        {\n            close();\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/RefDirectory.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing File = System.IO.File;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Traditional file system based {@link RefDatabase}.\n    /// <para/>\n    /// This is the classical reference database representation for a Git repository.\n    /// References are stored in two formats: loose, and packed.\n    /// <para/>\n    /// Loose references are stored as individual files within the {@code refs/}\n    /// directory. The file name matches the reference name and the file contents is\n    /// the current {@link ObjectId} in string form.\n    /// <para/>\n    /// Packed references are stored in a single text file named {@code packed-refs}.\n    /// In the packed format, each reference is stored on its own line. This file\n    /// reduces the number of files needed for large reference spaces, reducing the\n    /// overall size of a Git repository on disk.\n    /// </summary>\n    public class RefDirectory : RefDatabase\n    {\n        /// <summary>\n        /// Magic string denoting the start of a symbolic reference file.\n        /// </summary>\n        public static string SYMREF = \"ref: \"; //$NON-NLS-1$\n\n        /// <summary>\n        /// Magic string denoting the header of a packed-refs file.\n        /// </summary>\n        public static string PACKED_REFS_HEADER = \"# pack-refs with:\"; //$NON-NLS-1$\n\n        /// <summary>\n        /// If in the header, denotes the file has peeled data.\n        /// </summary>\n        public static string PACKED_REFS_PEELED = \" peeled\"; //$NON-NLS-1$\n\n        private readonly Repository parent;\n\n        private readonly DirectoryInfo gitDir;\n\n        private readonly DirectoryInfo refsDir;\n\n        private readonly DirectoryInfo logsDir;\n\n        private readonly DirectoryInfo logsRefsDir;\n\n        private readonly FileInfo packedRefsFile;\n\n        /// <summary>\n        /// Immutable sorted list of loose references.\n        /// <para/>\n        /// Symbolic references in this collection are stored unresolved, that is\n        /// their target appears to be a new reference with no ObjectId. These are\n        /// converted into resolved references during a get operation, ensuring the\n        /// live value is always returned.\n        /// </summary>\n        private readonly AtomicReference<RefList<LooseRef>> looseRefs = new AtomicReference<RefList<LooseRef>>();\n\n        /// <summary>\n        /// Immutable sorted list of packed references.\n        /// </summary>\n        private readonly AtomicReference<PackedRefList> packedRefs = new AtomicReference<PackedRefList>();\n\n        /// <summary>\n        /// Number of modifications made to this database.\n        /// <para/>\n        /// This counter is incremented when a change is made, or detected from the\n        /// filesystem during a read operation.\n        /// </summary>\n        private readonly AtomicInteger modCnt = new AtomicInteger();\n\n        /// <summary>\n        /// Last <see cref=\"modCnt\"/> that we sent to listeners.\n        /// <para/>\n        /// This value is compared to <see cref=\"modCnt\"/>, and a notification is sent to\n        /// the listeners only when it differs.\n        /// </summary>\n        private readonly AtomicInteger lastNotifiedModCnt = new AtomicInteger();\n\n        public RefDirectory(Repository db)\n        {\n            parent = db;\n            gitDir = db.Directory;\n            refsDir = PathUtil.CombineDirectoryPath(gitDir, Constants.R_REFS);\n            logsDir = PathUtil.CombineDirectoryPath(gitDir, Constants.LOGS);\n            logsRefsDir = PathUtil.CombineDirectoryPath(gitDir, Constants.LOGS + Path.DirectorySeparatorChar + Constants.R_REFS);\n            packedRefsFile = PathUtil.CombineFilePath(gitDir, Constants.PACKED_REFS);\n\n            looseRefs.set(RefList<LooseRef>.emptyList());\n            packedRefs.set(PackedRefList.NO_PACKED_REFS);\n        }\n\n        public Repository getRepository()\n        {\n            return parent;\n        }\n\n        public override void create()\n        {\n            refsDir.Mkdirs();\n            logsDir.Mkdirs();\n            logsRefsDir.Mkdirs();\n\n            PathUtil.CombineDirectoryPath(refsDir, Constants.R_HEADS.Substring(Constants.R_REFS.Length)).Mkdirs();\n            PathUtil.CombineDirectoryPath(refsDir, Constants.R_TAGS.Substring(Constants.R_REFS.Length)).Mkdirs();\n            PathUtil.CombineDirectoryPath(logsRefsDir, Constants.R_HEADS.Substring(Constants.R_REFS.Length)).Mkdirs();\n        }\n\n\n        public override void close()\n        {\n            // We have no resources to close.\n        }\n\n        public void rescan()\n        {\n            looseRefs.set(RefList<LooseRef>.emptyList());\n            packedRefs.set(PackedRefList.NO_PACKED_REFS);\n        }\n\n\n        public override bool isNameConflicting(string name)\n        {\n            RefList<Ref> packed = getPackedRefs();\n            RefList<LooseRef> loose = getLooseRefs();\n\n            // Cannot be nested within an existing reference.\n            int lastSlash = name.LastIndexOf('/');\n            while (0 < lastSlash)\n            {\n                string needle = name.Slice(0, lastSlash);\n                if (loose.contains(needle) || packed.contains(needle))\n                    return true;\n                lastSlash = name.LastIndexOf('/', lastSlash - 1);\n            }\n\n            // Cannot be the container of an existing reference.\n            string prefix = name + '/';\n            int idx;\n\n            idx = -(packed.find(prefix) + 1);\n            if (idx < packed.size() && packed.get(idx).getName().StartsWith(prefix))\n                return true;\n\n            idx = -(loose.find(prefix) + 1);\n            if (idx < loose.size() && loose.get(idx).getName().StartsWith(prefix))\n                return true;\n\n            return false;\n        }\n\n        private RefList<LooseRef> getLooseRefs()\n        {\n            RefList<LooseRef> oldLoose = looseRefs.get();\n\n            var scan = new LooseScanner(oldLoose, this);\n            scan.scan(ALL);\n\n            RefList<LooseRef> loose;\n            if (scan.newLoose != null)\n            {\n                loose = scan.newLoose.toRefList();\n                if (looseRefs.compareAndSet(oldLoose, loose))\n                    modCnt.incrementAndGet();\n            }\n            else\n                loose = oldLoose;\n            return loose;\n        }\n\n\n        public override Ref getRef(string needle)\n        {\n            RefList<Ref> packed = getPackedRefs();\n            Ref @ref = null;\n            foreach (string prefix in SEARCH_PATH)\n            {\n                @ref = readRef(prefix + needle, packed);\n                if (@ref != null)\n                {\n                    @ref = resolve(@ref, 0, null, null, packed);\n                    break;\n                }\n            }\n            fireRefsChanged();\n            return @ref;\n        }\n\n\n        public override IDictionary<string, Ref> getRefs(string prefix)\n        {\n            RefList<Ref> packed = getPackedRefs();\n            RefList<LooseRef> oldLoose = looseRefs.get();\n\n            var scan = new LooseScanner(oldLoose, this);\n            scan.scan(prefix);\n\n            RefList<LooseRef> loose;\n            if (scan.newLoose != null)\n            {\n                loose = scan.newLoose.toRefList();\n                if (looseRefs.compareAndSet(oldLoose, loose))\n                    modCnt.incrementAndGet();\n            }\n            else\n                loose = oldLoose;\n            fireRefsChanged();\n\n            RefList<Ref>.Builder<Ref> symbolic = scan.symbolic;\n            for (int idx = 0; idx < symbolic.size(); )\n            {\n                Ref @ref = symbolic.get(idx);\n                @ref = resolve(@ref, 0, prefix, loose, packed);\n                if (@ref != null && @ref.getObjectId() != null)\n                {\n                    symbolic.set(idx, @ref);\n                    idx++;\n                }\n                else\n                {\n                    // A broken symbolic reference, we have to drop it from the\n                    // collections the client is about to receive. Should be a\n                    // rare occurrence so pay a copy penalty.\n                    loose = loose.remove(idx);\n                    symbolic.remove(idx);\n                }\n            }\n\n            return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList());\n        }\n\n        private RefList<Ref> upcast<TRef>(RefList<TRef> loose) where TRef : Ref\n        {\n            var list = new List<Ref>(loose.asList());\n            return new RefList<Ref>(list.ToArray(), list.Count);\n        }\n\n        private class LooseScanner\n        {\n            private readonly RefDirectory _refDirectory;\n            private readonly RefList<LooseRef> curLoose;\n\n            private int curIdx;\n\n            public readonly RefList<Ref>.Builder<Ref> symbolic = new RefList<Ref>.Builder<Ref>(4);\n\n            public RefList<LooseRef>.Builder<LooseRef> newLoose;\n\n            public LooseScanner(RefList<LooseRef> curLoose, RefDirectory refDirectory)\n            {\n                this.curLoose = curLoose;\n                _refDirectory = refDirectory;\n            }\n\n            public void scan(string prefix)\n            {\n                if (ALL.Equals(prefix))\n                {\n                    scanOne(Constants.HEAD);\n                    scanTree(Constants.R_REFS, _refDirectory.refsDir);\n\n                    // If any entries remain, they are deleted, drop them.\n                    if (newLoose == null && curIdx < curLoose.size())\n                        newLoose = curLoose.copy(curIdx);\n\n                }\n                else if (prefix.StartsWith(Constants.R_REFS) && prefix.EndsWith(\"/\"))\n                {\n                    curIdx = -(curLoose.find(prefix) + 1);\n                    DirectoryInfo dir = PathUtil.CombineDirectoryPath(_refDirectory.refsDir, prefix.Substring(Constants.R_REFS.Length));\n                    scanTree(prefix, dir);\n\n                    // Skip over entries still within the prefix; these have\n                    // been removed from the directory.\n                    while (curIdx < curLoose.size())\n                    {\n                        if (!curLoose.get(curIdx).getName().StartsWith(prefix))\n                            break;\n                        if (newLoose == null)\n                            newLoose = curLoose.copy(curIdx);\n                        curIdx++;\n                    }\n\n                    // Keep any entries outside of the prefix space, we\n                    // do not know anything about their status.\n                    if (newLoose != null)\n                    {\n                        while (curIdx < curLoose.size())\n                            newLoose.add(curLoose.get(curIdx++));\n                    }\n                }\n            }\n\n            private void scanTree(string prefix, DirectoryInfo dir)\n            {\n                FileSystemInfo[] entries = dir.GetFileSystemInfos();\n                var entries2 = entries.Where(fsi => LockFile.FILTER(fsi.Name));\n                var entries3 = entries2.ToList();\n\n                entries = entries3.ToArray();\n\n                if (entries != null && 0 < entries.Length)\n                {\n                    //                    Array.Sort(entries);\n                    foreach (FileSystemInfo e in entries)\n                    {\n                        if (e.IsDirectory())\n                            scanTree(prefix + e.Name + '/', (DirectoryInfo)e);\n                        else\n                            scanOne(prefix + e.Name);\n                    }\n                }\n            }\n\n            private void scanOne(string name)\n            {\n                LooseRef cur;\n\n                if (curIdx < curLoose.size())\n                {\n                    do\n                    {\n                        cur = curLoose.get(curIdx);\n                        int cmp = RefComparator.compareTo(cur, name);\n                        if (cmp < 0)\n                        {\n                            // Reference is not loose anymore, its been deleted.\n                            // Skip the name in the new result list.\n                            if (newLoose == null)\n                                newLoose = curLoose.copy(curIdx);\n                            curIdx++;\n                            cur = null;\n                            continue;\n                        }\n\n                        if (cmp > 0) // Newly discovered loose reference.\n                            cur = null;\n                        break;\n                    } while (curIdx < curLoose.size());\n                }\n                else\n                    cur = null; // Newly discovered loose reference.\n\n                LooseRef n;\n                try\n                {\n                    n = _refDirectory.scanRef(cur, name);\n                }\n                catch (IOException)\n                {\n                    n = null;\n                }\n\n                if (n != null)\n                {\n                    if (cur != n && newLoose == null)\n                        newLoose = curLoose.copy(curIdx);\n                    if (newLoose != null)\n                        newLoose.add(n);\n                    if (n.isSymbolic())\n                        symbolic.add(n);\n                }\n                else if (cur != null)\n                {\n                    // Tragically, this file is no longer a loose reference.\n                    // Kill our cached entry of it.\n                    if (newLoose == null)\n                        newLoose = curLoose.copy(curIdx);\n                }\n\n                if (cur != null)\n                    curIdx++;\n            }\n        }\n\n        public override Ref peel(Ref @ref)\n        {\n            Ref leaf = @ref.getLeaf();\n            if (leaf.isPeeled() || leaf.getObjectId() == null)\n                return @ref;\n\n            RevWalk.RevWalk rw = new RevWalk.RevWalk(getRepository());\n            RevObject obj = rw.parseAny(leaf.getObjectId());\n            ObjectIdRef newLeaf;\n            if (obj is RevTag)\n            {\n                do\n                {\n                    obj = rw.parseAny(((RevTag)obj).getObject());\n                } while (obj is RevTag);\n\n                newLeaf = new PeeledTag(leaf.getStorage(), leaf\n                                                               .getName(), leaf.getObjectId(), obj.Copy());\n            }\n            else\n            {\n                newLeaf = new PeeledNonTag(leaf.getStorage(), leaf\n                                                                  .getName(), leaf.getObjectId());\n            }\n\n            // Try to remember this peeling in the cache, so we don't have to do\n            // it again in the future, but only if the reference is unchanged.\n            if (leaf.getStorage().IsLoose)\n            {\n                RefList<LooseRef> curList = looseRefs.get();\n                int idx = curList.find(leaf.getName());\n                if (0 <= idx && curList.get(idx) == leaf)\n                {\n                    LooseRef asPeeled = ((LooseRef)leaf).peel(newLeaf);\n                    RefList<LooseRef> newList = curList.set(idx, asPeeled);\n                    looseRefs.compareAndSet(curList, newList);\n                }\n            }\n\n            return recreate(@ref, newLeaf);\n        }\n\n        private static Ref recreate(Ref old, ObjectIdRef leaf)\n        {\n            if (old.isSymbolic())\n            {\n                Ref dst = recreate(old.getTarget(), leaf);\n                return new SymbolicRef(old.getName(), dst);\n            }\n            return leaf;\n        }\n\n        public void storedSymbolicRef(RefDirectoryUpdate u, long modified, string target)\n        {\n            putLooseRef(newSymbolicRef(modified, u.getRef().getName(), target));\n            fireRefsChanged();\n        }\n\n        public override RefUpdate newUpdate(string name, bool detach)\n        {\n            RefList<Ref> packed = getPackedRefs();\n            Ref @ref = readRef(name, packed);\n            if (@ref != null)\n                @ref = resolve(@ref, 0, null, null, packed);\n            if (@ref == null)\n                @ref = new Unpeeled(Storage.New, name, null);\n            else if (detach && @ref.isSymbolic())\n                @ref = new Unpeeled(Storage.Loose, name, @ref.getObjectId());\n            return new RefDirectoryUpdate(this, @ref);\n        }\n\n        public override RefRename newRename(string fromName, string toName)\n        {\n            RefUpdate from = newUpdate(fromName, false);\n            RefUpdate to = newUpdate(toName, false);\n            return new RefDirectoryRename((RefDirectoryUpdate)from, (RefDirectoryUpdate)to);\n        }\n\n        public void stored(RefDirectoryUpdate update, long modified)\n        {\n            ObjectId target = update.getNewObjectId().Copy();\n            Ref leaf = update.getRef().getLeaf();\n            putLooseRef(new LooseUnpeeled(modified, leaf.getName(), target));\n        }\n\n        private void putLooseRef(LooseRef @ref)\n        {\n            RefList<LooseRef> cList, nList;\n            do\n            {\n                cList = looseRefs.get();\n                nList = cList.put(@ref);\n            } while (!looseRefs.compareAndSet(cList, nList));\n            modCnt.incrementAndGet();\n            fireRefsChanged();\n        }\n\n        public void delete(RefDirectoryUpdate update)\n        {\n            Ref dst = update.getRef().getLeaf();\n            string name = dst.getName();\n\n            // Write the packed-refs file using an atomic update. We might\n            // wind up reading it twice, before and after the lock, to ensure\n            // we don't miss an edit made externally.\n            PackedRefList packed = getPackedRefs();\n            if (packed.contains(name))\n            {\n                var lck = new LockFile(packedRefsFile);\n                if (!lck.Lock())\n                    throw new IOException(\"Cannot lock \" + packedRefsFile);\n                try\n                {\n                    PackedRefList cur = readPackedRefs(0, 0);\n                    int idx = cur.find(name);\n                    if (0 <= idx)\n                        commitPackedRefs(lck, cur.remove(idx), packed);\n                }\n                finally\n                {\n                    lck.Unlock();\n                }\n            }\n\n            RefList<LooseRef> curLoose, newLoose;\n            do\n            {\n                curLoose = looseRefs.get();\n                int idx = curLoose.find(name);\n                if (idx < 0)\n                    break;\n                newLoose = curLoose.remove(idx);\n            } while (!looseRefs.compareAndSet(curLoose, newLoose));\n\n            int levels = levelsIn(name) - 2;\n            delete(logFor(name), levels);\n            if (dst.getStorage().IsLoose)\n            {\n                update.unlock();\n                delete(fileFor(name), levels);\n            }\n\n            modCnt.incrementAndGet();\n            fireRefsChanged();\n        }\n\n        public void log(RefUpdate update, string msg, bool deref)\n        {\n            ObjectId oldId = update.getOldObjectId();\n            ObjectId newId = update.getNewObjectId();\n            Ref @ref = update.getRef();\n\n            PersonIdent ident = update.getRefLogIdent();\n            if (ident == null)\n                ident = new PersonIdent(parent);\n            else\n                ident = new PersonIdent(ident);\n\n            var r = new StringBuilder();\n            r.Append(ObjectId.ToString(oldId));\n            r.Append(' ');\n            r.Append(ObjectId.ToString(newId));\n            r.Append(' ');\n            r.Append(ident.ToExternalString());\n            r.Append('\\t');\n            r.Append(msg);\n            r.Append('\\n');\n            byte[] rec = Constants.encode(r.ToString());\n\n            if (deref && @ref.isSymbolic())\n            {\n                log(@ref.getName(), rec);\n                log(@ref.getLeaf().getName(), rec);\n            }\n            else\n            {\n                log(@ref.getName(), rec);\n            }\n        }\n\n        private void log(string refName, byte[] rec)\n        {\n            FileInfo log = logFor(refName);\n            bool write;\n            if (isLogAllRefUpdates() && shouldAutoCreateLog(refName))\n                write = true;\n            else if (log.IsFile())\n                write = true;\n            else\n                write = false;\n\n            if (write)\n            {\n                DirectoryInfo dir = log.Directory;\n                if (!dir.Mkdirs() && !dir.IsDirectory())\n                {\n                    throw new IOException(\"Cannot create directory \" + dir);\n                }\n\n                using (var sw = File.Open(log.FullName, System.IO.FileMode.Append))\n                using (var @out = new BinaryWriter(sw))\n                {\n                    @out.Write(rec);\n                }\n            }\n        }\n\n        private bool isLogAllRefUpdates()\n        {\n            return parent.Config.getCore().isLogAllRefUpdates();\n        }\n\n        private bool shouldAutoCreateLog(string refName)\n        {\n            return refName.Equals(Constants.HEAD) //\n                   || refName.StartsWith(Constants.R_HEADS) //\n                   || refName.StartsWith(Constants.R_REMOTES);\n        }\n\n        private Ref resolve(Ref @ref, int depth, string prefix,\n                            RefList<LooseRef> loose, RefList<Ref> packed)\n        {\n            if (@ref.isSymbolic())\n            {\n                Ref dst = @ref.getTarget();\n\n                if (MAX_SYMBOLIC_REF_DEPTH <= depth)\n                    return null; // claim it doesn't exist\n\n                // If the cached value can be assumed to be current due to a\n                // recent scan of the loose directory, use it.\n                if (loose != null && dst.getName().StartsWith(prefix))\n                {\n                    int idx;\n                    if (0 <= (idx = loose.find(dst.getName())))\n                        dst = loose.get(idx);\n                    else if (0 <= (idx = packed.find(dst.getName())))\n                        dst = packed.get(idx);\n                    else\n                        return @ref;\n                }\n                else\n                {\n                    dst = readRef(dst.getName(), packed);\n                    if (dst == null)\n                        return @ref;\n                }\n\n                dst = resolve(dst, depth + 1, prefix, loose, packed);\n                if (dst == null)\n                    return null;\n                return new SymbolicRef(@ref.getName(), dst);\n            }\n            return @ref;\n        }\n\n        private PackedRefList getPackedRefs()\n        {\n            long size = 0;\n            if (File.Exists(packedRefsFile.FullName))\n            {\n                size = packedRefsFile.Length;\n            }\n\n            long mtime = size != 0 ? packedRefsFile.lastModified() : 0;\n\n            PackedRefList curList = packedRefs.get();\n            if (size == curList.lastSize && mtime == curList.lastModified)\n                return curList;\n\n            PackedRefList newList = readPackedRefs(size, mtime);\n            if (packedRefs.compareAndSet(curList, newList))\n                modCnt.incrementAndGet();\n            return newList;\n        }\n\n        private PackedRefList readPackedRefs(long size, long mtime)\n        {\n            if (!File.Exists(packedRefsFile.FullName))\n            {\n                // Ignore it and leave the new list empty.\n                return PackedRefList.NO_PACKED_REFS;\n            }\n\n            using (var br = new StreamReader(packedRefsFile.FullName, Constants.CHARSET))\n            {\n                return new PackedRefList(parsePackedRefs(br), size, mtime);\n            }\n        }\n\n        private static RefList<Ref> parsePackedRefs(TextReader br)\n        {\n            var all = new RefList<Ref>.Builder<Ref>();\n            Ref last = null;\n            bool peeled = false;\n            bool needSort = false;\n\n            string p;\n            while ((p = br.ReadLine()) != null)\n            {\n                if (p[0] == '#')\n                {\n                    if (p.StartsWith(PACKED_REFS_HEADER))\n                    {\n                        p = p.Substring(PACKED_REFS_HEADER.Length);\n                        peeled = p.Contains(PACKED_REFS_PEELED);\n                    }\n                    continue;\n                }\n\n                if (p[0] == '^')\n                {\n                    if (last == null)\n                        throw new IOException(\"Peeled line before ref.\");\n\n                    ObjectId id = ObjectId.FromString(p.Substring(1));\n                    last = new PeeledTag(Storage.Packed, last.getName(), last\n                                                                             .getObjectId(), id);\n                    all.set(all.size() - 1, last);\n                    continue;\n                }\n\n                int sp = p.IndexOf(' ');\n                ObjectId id2 = ObjectId.FromString(p.Slice(0, sp));\n                string name = copy(p, sp + 1, p.Length);\n                ObjectIdRef cur;\n                if (peeled)\n                    cur = new PeeledNonTag(Storage.Packed, name, id2);\n                else\n                    cur = new Unpeeled(Storage.Packed, name, id2);\n                if (last != null && RefComparator.compareTo(last, cur) > 0)\n                    needSort = true;\n                all.add(cur);\n                last = cur;\n            }\n\n            if (needSort)\n                all.sort();\n            return all.toRefList();\n        }\n\n        private static string copy(string src, int off, int end)\n        {\n            // Don't use substring since it could leave a reference to the much\n            // larger existing string. Force construction of a full new object.\n            return new StringBuilder(end - off).Append(src, off, end - off).ToString();\n        }\n\n        private void commitPackedRefs(LockFile lck, RefList<Ref> refs, PackedRefList oldPackedList)\n        {\n            new PackedRefsWriter(lck, refs, oldPackedList, packedRefs).writePackedRefs();\n        }\n\n        private class PackedRefsWriter : RefWriter\n        {\n            private readonly LockFile _lck;\n            private readonly RefList<Ref> _refs;\n            private readonly PackedRefList _oldPackedList;\n            private readonly AtomicReference<PackedRefList> _packedRefs;\n\n            public PackedRefsWriter(LockFile lck, RefList<Ref> refs, PackedRefList oldPackedList, AtomicReference<PackedRefList> packedRefs)\n                : base(refs)\n            {\n                _lck = lck;\n                _refs = refs;\n                _oldPackedList = oldPackedList;\n                _packedRefs = packedRefs;\n            }\n\n            protected override void writeFile(string name, byte[] content)\n            {\n                _lck.setNeedStatInformation(true);\n                try\n                {\n                    _lck.Write(content);\n                }\n                catch (IOException ioe)\n                {\n                    throw new ObjectWritingException(\"Unable to write \" + name,\n                                                     ioe);\n                }\n                try\n                {\n                    _lck.waitForStatChange();\n                }\n                catch (ThreadAbortException)\n                {\n                    _lck.Unlock();\n                    throw new ObjectWritingException(\"Interrupted writing \"\n                                                     + name);\n                }\n                if (!_lck.Commit())\n                    throw new ObjectWritingException(\"Unable to write \" + name);\n\n                _packedRefs.compareAndSet(_oldPackedList, new PackedRefList(_refs,\n                                                                            content.Length, _lck.CommitLastModified));\n            }\n        }\n        private Ref readRef(string name, RefList<Ref> packed)\n        {\n            RefList<LooseRef> curList = looseRefs.get();\n            int idx = curList.find(name);\n            if (0 <= idx)\n            {\n                LooseRef o = curList.get(idx);\n                LooseRef n = scanRef(o, name);\n                if (n == null)\n                {\n                    if (looseRefs.compareAndSet(curList, curList.remove(idx)))\n                        modCnt.incrementAndGet();\n                    return packed.get(name);\n                }\n\n                if (o == n)\n                    return n;\n                if (looseRefs.compareAndSet(curList, curList.set(idx, n)))\n                    modCnt.incrementAndGet();\n                return n;\n            }\n\n            LooseRef n2 = scanRef(null, name);\n            if (n2 == null)\n                return packed.get(name);\n            if (looseRefs.compareAndSet(curList, curList.add(idx, n2)))\n                modCnt.incrementAndGet();\n            return n2;\n        }\n\n        private LooseRef scanRef(LooseRef @ref, string name)\n        {\n            FileInfo path = fileFor(name);\n            long modified = 0;\n\n            modified = path.lastModified();\n\n            if (@ref != null)\n            {\n                if (@ref.getLastModified() == modified)\n                    return @ref;\n                name = @ref.getName();\n            }\n            else if (modified == 0)\n                return null;\n\n            byte[] buf;\n            try\n            {\n                buf = IO.ReadFully(path, 4096);\n            }\n            catch (FileNotFoundException)\n            {\n                return null; // doesn't exist; not a reference.\n            }\n            catch (DirectoryNotFoundException)\n            {\n                return null; // doesn't exist; not a reference.\n            }\n\n            int n = buf.Length;\n            if (n == 0)\n                return null; // empty file; not a reference.\n\n            if (isSymRef(buf, n))\n            {\n                // trim trailing whitespace\n                while (0 < n && Char.IsWhiteSpace((char)buf[n - 1]))\n                    n--;\n                if (n < 6)\n                {\n                    string content = RawParseUtils.decode(buf, 0, n);\n                    throw new IOException(\"Not a ref: \" + name + \": \" + content);\n                }\n                string target = RawParseUtils.decode(buf, 5, n);\n                return newSymbolicRef(modified, name, target);\n            }\n\n            if (n < Constants.OBJECT_ID_STRING_LENGTH)\n                return null; // impossibly short object identifier; not a reference.\n\n            ObjectId id;\n            try\n            {\n                id = ObjectId.FromString(buf, 0);\n            }\n            catch (ArgumentException)\n            {\n                while (0 < n && Char.IsWhiteSpace((char)buf[n - 1]))\n                    n--;\n                string content = RawParseUtils.decode(buf, 0, n);\n                throw new IOException(\"Not a ref: \" + name + \": \" + content);\n            }\n            return new LooseUnpeeled(modified, name, id);\n        }\n\n        private static bool isSymRef(byte[] buf, int n)\n        {\n            if (n < 6)\n                return false;\n            return buf[0] == 'r' //\n                   && buf[1] == 'e' //\n                   && buf[2] == 'f' //\n                   && buf[3] == ':' //\n                   && buf[4] == ' ';\n        }\n\n        /* If the parent should fire listeners, fires them. */\n        private void fireRefsChanged()\n        {\n            int last = lastNotifiedModCnt.get();\n            int curr = modCnt.get();\n            if (last != curr && lastNotifiedModCnt.compareAndSet(last, curr))\n                parent.fireRefsChanged();\n        }\n\n        /// <summary>\n        /// Create a reference update to write a temporary reference.\n        /// </summary>\n        /// <returns>an update for a new temporary reference.</returns>\n        public RefDirectoryUpdate newTemporaryUpdate()\n        {\n            FileInfo tmp = PathUtil.CombineFilePath(refsDir, \"renamed_\" + Guid.NewGuid() + \"_ref\");\n            string name = Constants.R_REFS + tmp.Name;\n            Ref @ref = new Unpeeled(Storage.New, name, null);\n            return new RefDirectoryUpdate(this, @ref);\n        }\n\n        /// <summary>\n        /// Locate the file on disk for a single reference name.\n        /// </summary>\n        /// <param name=\"name\">\n        /// name of the ref, relative to the Git repository top level\n        /// directory (so typically starts with refs/).\n        /// </param>\n        /// <returns>the loose file location.</returns>\n        public FileInfo fileFor(string name)\n        {\n            if (name.StartsWith(Constants.R_REFS))\n            {\n                name = name.Substring(Constants.R_REFS.Length);\n                return PathUtil.CombineFilePath(refsDir, name);\n            }\n            return PathUtil.CombineFilePath(gitDir, name);\n        }\n\n        /// <summary>\n        /// Locate the log file on disk for a single reference name.\n        /// </summary>\n        /// <param name=\"name\">\n        /// name of the ref, relative to the Git repository top level\n        /// directory (so typically starts with refs/).\n        /// </param>\n        /// <returns>the log file location.</returns>\n        public FileInfo logFor(string name)\n        {\n            if (name.StartsWith(Constants.R_REFS))\n            {\n                name = name.Substring(Constants.R_REFS.Length);\n                return PathUtil.CombineFilePath(logsRefsDir, name);\n            }\n            return PathUtil.CombineFilePath(logsDir, name);\n        }\n\n        public static int levelsIn(string name)\n        {\n            int count = 0;\n            for (int p = name.IndexOf('/'); p >= 0; p = name.IndexOf('/', p + 1))\n                count++;\n            return count;\n        }\n\n        public static void delete(FileInfo file, int depth)\n        {\n            if (!file.DeleteFile() && file.IsFile())\n                throw new IOException(\"File cannot be deleted: \" + file);\n\n            DirectoryInfo dir = file.Directory;\n            for (int i = 0; i < depth; ++i)\n            {\n                try\n                {\n                    dir.Delete();\n                }\n                catch (IOException)\n                {\n                    break;   // ignore problem here\n                }\n\n                dir = dir.Parent;\n            }\n        }\n\n        private class PackedRefList : RefList<Ref>\n        {\n            public static PackedRefList NO_PACKED_REFS = new PackedRefList(RefList<Ref>\n                                                                               .emptyList(), 0, 0);\n\n            /* Last length of the packed-refs file when we read it. */\n            public readonly long lastSize;\n\n            /* Last modified time of the packed-refs file when we read it. */\n            public readonly long lastModified;\n\n            public PackedRefList(RefList<Ref> src, long size, long mtime)\n                : base(src)\n            {\n                lastSize = size;\n                lastModified = mtime;\n            }\n        }\n\n        private static LooseSymbolicRef newSymbolicRef(long lastModified,\n                                                       string name, string target)\n        {\n            Ref dst = new Unpeeled(Storage.New, target, null);\n            return new LooseSymbolicRef(lastModified, name, dst);\n        }\n\n        private interface LooseRef : Ref\n        {\n            long getLastModified();\n\n            LooseRef peel(ObjectIdRef newLeaf);\n        }\n\n        private class LoosePeeledTag : PeeledTag, LooseRef\n        {\n            private readonly long _lastModified;\n\n            public LoosePeeledTag(long mtime, string refName, ObjectId id, ObjectId p)\n                : base(Storage.Loose, refName, id, p)\n            {\n                _lastModified = mtime;\n            }\n\n            public long getLastModified()\n            {\n                return _lastModified;\n            }\n\n            public LooseRef peel(ObjectIdRef newLeaf)\n            {\n                return this;\n            }\n        }\n\n        private class LooseNonTag : PeeledNonTag\n                                     , LooseRef\n        {\n            private readonly long _lastModified;\n\n            public LooseNonTag(long mtime, string refName, ObjectId id)\n                : base(Storage.Loose, refName, id)\n            {\n                _lastModified = mtime;\n            }\n\n            public long getLastModified()\n            {\n                return _lastModified;\n            }\n\n            public LooseRef peel(ObjectIdRef newLeaf)\n            {\n                return this;\n            }\n        }\n\n        private class LooseUnpeeled : Unpeeled, LooseRef\n        {\n            private readonly long _lastModified;\n\n            public LooseUnpeeled(long mtime, string refName, ObjectId id)\n                : base(Storage.Loose, refName, id)\n            {\n                _lastModified = mtime;\n            }\n\n            public long getLastModified()\n            {\n                return _lastModified;\n            }\n\n            public LooseRef peel(ObjectIdRef newLeaf)\n            {\n                if (newLeaf.getPeeledObjectId() != null)\n                    return new LoosePeeledTag(_lastModified, Name,\n                                              ObjectId, newLeaf.PeeledObjectId);\n                else\n                    return new LooseNonTag(_lastModified, Name, ObjectId);\n            }\n        }\n\n        private class LooseSymbolicRef : SymbolicRef, LooseRef\n        {\n            private readonly long _lastModified;\n\n            public LooseSymbolicRef(long mtime, string refName, Ref target)\n                : base(refName, target)\n            {\n                _lastModified = mtime;\n            }\n\n            public long getLastModified()\n            {\n                return _lastModified;\n            }\n\n            public LooseRef peel(ObjectIdRef newLeaf)\n            {\n                // We should never try to peel the symbolic references.\n                throw new NotSupportedException();\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/RefDirectoryRename.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n * Copyright (C) 2009, Robin Rosenberg\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Rename any reference stored by {@link RefDirectory}.\n    /// <para/>\n    /// This class works by first renaming the source reference to a temporary name,\n    /// then renaming the temporary name to the destination reference.\n    /// <para/>\n    /// This strategy permits switching a reference like {@code refs/heads/foo},\n    /// which is a file, to {@code refs/heads/foo/bar}, which is stored inside a\n    /// directory that happens to match the source name.\n    /// </summary>\n    public class RefDirectoryRename : RefRename\n    {\n        private readonly RefDirectory _refdb;\n\n        /// <summary>\n        /// The value of the source reference at the start of the rename.\n        /// <para/>\n        /// At the end of the rename the destination reference must have this same\n        /// value, otherwise we have a concurrent update and the rename must fail\n        /// without making any changes.\n        /// </summary>\n        private ObjectId _objId;\n\n        /// <summary>\n        /// True if HEAD must be moved to the destination reference.\n        /// </summary>\n        private bool _updateHead;\n\n        /// <summary>\n        /// A reference we backup {@link #objId} into during the rename.\n        /// </summary>\n        private RefDirectoryUpdate _tmp;\n\n        public RefDirectoryRename(RefDirectoryUpdate src, RefDirectoryUpdate dst)\n            : base(src, dst)\n        {\n            _refdb = (RefDirectory)src.getRefDatabase();\n        }\n\n        protected override RefUpdate.RefUpdateResult doRename()\n        {\n            if (source.getRef().isSymbolic())\n                return RefUpdate.RefUpdateResult.IO_FAILURE; // not supported\n\n            var rw = new RevWalk.RevWalk(_refdb.getRepository());\n            _objId = source.getOldObjectId();\n            _updateHead = needToUpdateHEAD();\n            _tmp = _refdb.newTemporaryUpdate();\n            try\n            {\n                // First backup the source so its never unreachable.\n                _tmp.setNewObjectId(_objId);\n                _tmp.setForceUpdate(true);\n                _tmp.disableRefLog();\n                switch (_tmp.update(rw))\n                {\n                    case RefUpdate.RefUpdateResult.NEW:\n                    case RefUpdate.RefUpdateResult.FORCED:\n                    case RefUpdate.RefUpdateResult.NO_CHANGE:\n                        break;\n                    default:\n                        return _tmp.getResult();\n                }\n\n                // Save the source's log under the temporary name, we must do\n                // this before we delete the source, otherwise we lose the log.\n                if (!renameLog(source, _tmp))\n                    return RefUpdate.RefUpdateResult.IO_FAILURE;\n\n                // If HEAD has to be updated, link it now to destination.\n                // We have to link before we delete, otherwise the delete\n                // fails because its the current branch.\n                RefUpdate dst = destination;\n                if (_updateHead)\n                {\n                    if (!linkHEAD(destination))\n                    {\n                        renameLog(_tmp, source);\n                        return RefUpdate.RefUpdateResult.LOCK_FAILURE;\n                    }\n\n                    // Replace the update operation so HEAD will log the rename.\n                    dst = _refdb.newUpdate(Constants.HEAD, false);\n                    dst.setRefLogIdent(destination.getRefLogIdent());\n                    dst.setRefLogMessage(destination.getRefLogMessage(), false);\n                }\n\n                // Delete the source name so its path is free for replacement.\n                source.setExpectedOldObjectId(_objId);\n                source.setForceUpdate(true);\n                source.disableRefLog();\n                if (source.delete(rw) != RefUpdate.RefUpdateResult.FORCED)\n                {\n                    renameLog(_tmp, source);\n                    if (_updateHead)\n                        linkHEAD(source);\n                    return source.getResult();\n                }\n\n                // Move the log to the destination.\n                if (!renameLog(_tmp, destination))\n                {\n                    renameLog(_tmp, source);\n                    source.setExpectedOldObjectId(ObjectId.ZeroId);\n                    source.setNewObjectId(_objId);\n                    source.update(rw);\n                    if (_updateHead)\n                        linkHEAD(source);\n                    return RefUpdate.RefUpdateResult.IO_FAILURE;\n                }\n\n                // Create the destination, logging the rename during the creation.\n                dst.setExpectedOldObjectId(ObjectId.ZeroId);\n                dst.setNewObjectId(_objId);\n                if (dst.update(rw) != RefUpdate.RefUpdateResult.NEW)\n                {\n                    // If we didn't create the destination we have to undo\n                    // our work. Put the log back and restore source.\n                    if (renameLog(destination, _tmp))\n                        renameLog(_tmp, source);\n                    source.setExpectedOldObjectId(ObjectId.ZeroId);\n                    source.setNewObjectId(_objId);\n                    source.update(rw);\n                    if (_updateHead)\n                        linkHEAD(source);\n                    return dst.getResult();\n                }\n\n                return RefUpdate.RefUpdateResult.RENAMED;\n            }\n            finally\n            {\n                // Always try to free the temporary name.\n                try\n                {\n                    _refdb.delete(_tmp);\n                }\n                catch (IOException)\n                {\n                    _refdb.fileFor(_tmp.getName()).Delete();\n                }\n            }\n        }\n\n        private bool renameLog(RefUpdate src, RefUpdate dst)\n        {\n            FileInfo srcLog = _refdb.logFor(src.getName());\n            FileInfo dstLog = _refdb.logFor(dst.getName());\n\n            if (!srcLog.Exists)\n                return true;\n\n            if (!rename(srcLog.FullName, dstLog.FullName))\n                return false;\n\n            // There be dragons\n\n\n\n            try\n            {\n                int levels = RefDirectory.levelsIn(src.getName()) - 2;\n                RefDirectory.delete(srcLog, levels);\n                return true;\n            }\n            catch (IOException)\n            {\n                rename(dstLog.FullName, srcLog.FullName);\n                return false;\n            }\n        }\n\n        private static bool rename(string src, string dst)\n        {\n            if (new FileInfo(src).RenameTo(dst))\n                return true;\n\n            DirectoryInfo dir = new FileInfo(dst).Directory;\n            if ((dir.Exists || !dir.Mkdirs()) && !dir.IsDirectory())\n                return false;\n            return new FileInfo(src).RenameTo(dst);\n        }\n\n        private bool linkHEAD(RefUpdate target)\n        {\n            try\n            {\n                RefUpdate u = _refdb.newUpdate(Constants.HEAD, false);\n                u.disableRefLog();\n                switch (u.link(target.getName()))\n                {\n                    case RefUpdate.RefUpdateResult.NEW:\n                    case RefUpdate.RefUpdateResult.FORCED:\n                    case RefUpdate.RefUpdateResult.NO_CHANGE:\n                        return true;\n                    default:\n                        return false;\n                }\n            }\n            catch (IOException)\n            {\n                return false;\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RefDirectoryUpdate.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Updates any reference stored by <see cref=\"RefDirectory\"/>.\n    /// </summary>\n    public class RefDirectoryUpdate : RefUpdate\n    {\n        private readonly RefDirectory _database;\n\n        private LockFile _lock;\n\n        public RefDirectoryUpdate(RefDirectory r, Ref @ref)\n            : base(@ref)\n        {\n            _database = r;\n        }\n\n        public override RefDatabase getRefDatabase()\n        {\n            return _database;\n        }\n\n        public override Repository getRepository()\n        {\n            return _database.getRepository();\n        }\n\n        protected override bool tryLock(bool deref)\n        {\n            Ref dst = Ref;\n            if (deref)\n                dst = dst.getLeaf();\n            string name = dst.getName();\n            _lock = new LockFile(_database.fileFor(name));\n            if (_lock.Lock())\n            {\n                dst = _database.getRef(name);\n                OldObjectId = (dst != null ? dst.getObjectId() : null);\n                return true;\n            }\n            else\n            {\n                return false;\n            }\n        }\n\n        public override void unlock()\n        {\n            if (_lock != null)\n            {\n                _lock.Unlock();\n                _lock = null;\n            }\n        }\n\n        protected override RefUpdateResult doUpdate(RefUpdateResult status)\n        {\n            _lock.setNeedStatInformation(true);\n            _lock.Write(NewObjectId);\n\n            string msg = getRefLogMessage();\n            if (msg != null)\n            {\n                if (isRefLogIncludingResult())\n                {\n                    string strResult = toResultString(status);\n                    if (strResult != null)\n                    {\n                        if (msg.Length > 0)\n                            msg = msg + \": \" + strResult;\n                        else\n                            msg = strResult;\n                    }\n                }\n                _database.log(this, msg, true);\n            }\n            if (!_lock.Commit())\n                return RefUpdateResult.LOCK_FAILURE;\n            _database.stored(this, _lock.CommitLastModified);\n            return status;\n        }\n\n        private static string toResultString(RefUpdateResult status)\n        {\n            switch (status)\n            {\n                case RefUpdateResult.FORCED:\n                    return \"forced-update\";\n                case RefUpdateResult.FAST_FORWARD:\n                    return \"fast forward\";\n                case RefUpdateResult.NEW:\n                    return \"created\";\n                default:\n                    return null;\n            }\n        }\n\n        protected override RefUpdateResult doDelete(RefUpdateResult status)\n        {\n            if (Ref.getLeaf().getStorage() != Storage.New)\n                _database.delete(this);\n            return status;\n        }\n\n        protected override RefUpdateResult doLink(string target)\n        {\n            _lock.setNeedStatInformation(true);\n            _lock.Write(Constants.encode(RefDirectory.SYMREF + target + '\\n'));\n\n            string msg = getRefLogMessage();\n            if (msg != null)\n                _database.log(this, msg, false);\n            if (!_lock.Commit())\n                return RefUpdateResult.LOCK_FAILURE;\n            _database.storedSymbolicRef(this, _lock.CommitLastModified, target);\n\n            if (Ref.getStorage() == Storage.New)\n                return RefUpdateResult.NEW;\n            return RefUpdateResult.FORCED;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/RefRename.cs",
    "content": "/*\n * Copyright (C) 2009, Robin Rosenberg\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// A RefUpdate combination for renaming a reference.\n    /// <para/>\n    /// If the source reference is currently pointed to by {@code HEAD}, then the\n    /// HEAD symbolic reference is updated to point to the new destination.\n    /// </summary>\n    public abstract class RefRename {\n        /// <summary>\n        /// Update operation to read and delete the source reference.\n        /// </summary>\n        protected RefUpdate source;\n\n        /// <summary>\n        /// Update operation to create/overwrite the destination reference.\n        /// </summary>\n        protected RefUpdate destination;\n\n        private RefUpdate.RefUpdateResult result = RefUpdate.RefUpdateResult.NOT_ATTEMPTED;\n\n        /// <summary>\n        /// Initialize a new rename operation.\n        /// </summary>\n        /// <param name=\"src\">operation to read and delete the source.</param>\n        /// <param name=\"dst\">operation to create (or overwrite) the destination.</param>\n        protected RefRename(RefUpdate src, RefUpdate dst) {\n            source = src;\n            destination = dst;\n\n            Repository repo = destination.getRepository();\n            string cmd = \"\";\n            if (source.getName().StartsWith(Constants.R_HEADS)\n                && destination.getName().StartsWith(Constants.R_HEADS))\n                cmd = \"Branch: \";\n            setRefLogMessage(cmd + \"renamed \"\n                             + repo.ShortenRefName(source.getName()) + \" to \"\n                             + repo.ShortenRefName(destination.getName()));\n        }\n\n        /// <returns>identity of the user making the change in the reflog.</returns>\n        public PersonIdent getRefLogIdent() {\n            return destination.getRefLogIdent();\n        }\n\n        /// <summary>\n        /// Set the identity of the user appearing in the reflog.\n        /// <para/>\n        /// The timestamp portion of the identity is ignored. A new identity with the\n        /// current timestamp will be created automatically when the rename occurs\n        /// and the log record is written.\n        /// </summary>\n        /// <param name=\"pi\">\n        /// identity of the user. If null the identity will be\n        /// automatically determined based on the repository\n        /// configuration.\n        /// </param>\n        public void setRefLogIdent(PersonIdent pi) {\n            destination.setRefLogIdent(pi);\n        }\n\n        /// <summary>\n        /// Get the message to include in the reflog.\n        /// </summary>\n        /// <returns>\n        /// message the caller wants to include in the reflog; null if the\n        /// rename should not be logged.\n        /// </returns>\n        public string getRefLogMessage() {\n            return destination.getRefLogMessage();\n        }\n\n        /// <summary>\n        /// Set the message to include in the reflog.\n        /// </summary>\n        /// <param name=\"msg\">the message to describe this change.</param>\n        public void setRefLogMessage(string msg) {\n            if (msg == null)\n                disableRefLog();\n            else\n                destination.setRefLogMessage(msg, false);\n        }\n\n        /// <summary>\n        /// Don't record this rename in the ref's associated reflog.\n        /// </summary>\n        public void disableRefLog() {\n            destination.setRefLogMessage(\"\", false);\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <returns>result of rename operation</returns>\n        public RefUpdate.RefUpdateResult getResult() {\n            return result;\n        }\n\n        /// <returns>the result of the new ref update</returns>\n        public RefUpdate.RefUpdateResult rename()  {\n            try {\n                result = doRename();\n                return result;\n            } catch (IOException) {\n                result = RefUpdate.RefUpdateResult.IO_FAILURE;\n                throw;\n            }\n        }\n\n        /// <returns>the result of the rename operation.</returns>\n        protected abstract RefUpdate.RefUpdateResult doRename();\n\n        /// <returns>\n        /// true if the {@code Constants#HEAD} reference needs to be linked\n        /// to the new destination name.\n        /// </returns>\n        protected bool needToUpdateHEAD(){\n            Ref head = source.getRefDatabase().getRef(Constants.HEAD);\n            if (head.isSymbolic()) {\n                head = head.getTarget();\n                return head.getName().Equals(source.getName());\n            }\n            return false;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/RefUpdate.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core\n{\n    public static class RefUpdateExtensions\n    {\n        public static ObjectId getNewObjectId(this RefUpdate refUpdate)\n        {\n            return refUpdate.NewObjectId;\n        }\n\n        public static void setNewObjectId(this RefUpdate refUpdate, AnyObjectId id)\n        {\n            refUpdate.NewObjectId = id.Copy();\n        }\n\n        public static bool isForceUpdate(this RefUpdate refUpdate)\n        {\n            return refUpdate.IsForceUpdate;\n        }\n\n        public static void setForceUpdate(this RefUpdate refUpdate, bool b)\n        {\n            refUpdate.IsForceUpdate = b;\n        }\n        public static string getName(this RefUpdate refUpdate)\n        {\n            return refUpdate.Name;\n        }\n        public static Ref getRef(this RefUpdate refUpdate)\n        {\n            return refUpdate.Ref;\n        }\n\n        public static ObjectId getExpectedOldObjectId(this RefUpdate refUpdate)\n        {\n            return refUpdate.ExpectedOldObjectId;\n        }\n\n        public static void setExpectedOldObjectId(this RefUpdate refUpdate, AnyObjectId id)\n        {\n            refUpdate.ExpectedOldObjectId = id != null ? id.ToObjectId() : null; ;\n        }\n\n        public static ObjectId getOldObjectId(this RefUpdate refUpdate)\n        {\n            return refUpdate.OldObjectId;\n        }\n\n        public static void setOldObjectId(this RefUpdate refUpdate, AnyObjectId id)\n        {\n            refUpdate.OldObjectId = id != null ? id.ToObjectId() : null; ;\n        }\n\n        public static RefUpdate.RefUpdateResult getResult(this RefUpdate refUpdate)\n        {\n            return refUpdate.Result;\n        }\n\n    }\n\n    /// <summary>\n    /// Creates, updates or deletes any reference.\n    /// </summary>\n    public abstract class RefUpdate\n    {\n        /// <summary>\n        /// Status of an update request.\n        /// </summary>\n        public enum RefUpdateResult\n        {\n            /// <summary>\n            /// The ref update/delete has not been attempted by the caller.\n            /// </summary>\n            NOT_ATTEMPTED,\n\n            /// <summary>\n            /// The ref could not be locked for update/delete.\n            /// <para/>\n            /// This is generally a transient failure and is usually caused by\n            /// another process trying to access the ref at the same time as this\n            /// process was trying to update it. It is possible a future operation\n            /// will be successful.\n            /// </summary>\n            LOCK_FAILURE,\n\n            /// <summary>\n            /// Same value already stored.\n            /// <para/>\n            /// Both the old value and the new value are identical. No change was\n            /// necessary for an update. For delete the branch is removed.\n            /// </summary>\n            NO_CHANGE,\n\n            /// <summary>\n            /// The ref was created locally for an update, but ignored for delete.\n            /// <para/>\n            /// The ref did not exist when the update started, but it was created\n            /// successfully with the new value.\n            /// </summary>\n            NEW,\n\n            /// <summary>\n            /// The ref had to be forcefully updated/deleted.\n            /// <para/>\n            /// The ref already existed but its old value was not fully merged into\n            /// the new value. The configuration permitted a forced update to take\n            /// place, so ref now contains the new value. History associated with the\n            /// objects not merged may no longer be reachable.\n            /// </summary>\n            FORCED,\n\n            /// <summary>\n            /// The ref was updated/deleted in a fast-forward way.\n            /// <para/>\n            /// The tracking ref already existed and its old value was fully merged\n            /// into the new value. No history was made unreachable.\n            /// </summary>\n            FAST_FORWARD,\n\n            /// <summary>\n            /// Not a fast-forward and not stored.\n            /// <para/>\n            /// The tracking ref already existed but its old value was not fully\n            /// merged into the new value. The configuration did not allow a forced\n            /// update/delete to take place, so ref still contains the old value. No\n            /// previous history was lost.\n            /// </summary>\n            REJECTED,\n\n            /// <summary>\n            /// Rejected because trying to delete the current branch.\n            /// <para/>\n            /// Has no meaning for update.\n            /// </summary>\n            REJECTED_CURRENT_BRANCH,\n\n            /// <summary>\n            /// The ref was probably not updated/deleted because of I/O error.\n            /// <para/>\n            /// Unexpected I/O error occurred when writing new ref. Such error may\n            /// result in uncertain state, but most probably ref was not updated.\n            /// <para/>\n            /// This kind of error doesn't include {@link #LOCK_FAILURE}, which is a\n            /// different case.\n            /// </summary>\n            IO_FAILURE,\n\n            /// <summary>\n            /// The ref was renamed from another name\n            /// </summary>\n            RENAMED\n        }\n\n        /// <summary>\n        /// New value the caller wants this ref to have.\n        /// </summary>\n        private ObjectId newValue;\n\n        /// <summary>\n        /// Does this specification ask for forced updated (rewind/reset)?\n        /// </summary>\n        private bool force;\n\n        /// <summary>\n        /// Identity to record action as within the reflog.\n        /// </summary>\n        private PersonIdent refLogIdent;\n\n        /// <summary>\n        /// Message the caller wants included in the reflog.\n        /// </summary>\n        private string refLogMessage;\n\n\n        /// <summary>\n        /// Should the Result value be appended to <see cref=\"refLogMessage\"/>.\n        /// </summary>\n        private bool refLogIncludeResult;\n\n        /// <summary>\n        /// Old value of the ref, obtained after we lock it.\n        /// </summary>\n        private ObjectId oldValue;\n\n        /// <summary>\n        /// If non-null, the value {@link #oldValue} must have to continue.\n        /// </summary>\n        private ObjectId expValue;\n\n        /// <summary>\n        /// Result of the update operation.\n        /// </summary>\n        private RefUpdateResult result = RefUpdateResult.NOT_ATTEMPTED;\n\n        private Ref _ref;\n\n        protected RefUpdate(Ref @ref)\n        {\n            _ref = @ref;\n            oldValue = @ref.getObjectId();\n            refLogMessage = \"\";\n        }\n\n        /// <returns>the reference database this update modifies.</returns>\n        public abstract RefDatabase getRefDatabase();\n\n        /// <returns>the repository storing the database's objects.</returns>\n        public abstract Repository getRepository();\n\n        /// <summary>\n        /// Try to acquire the lock on the reference.\n        /// <para/>\n        /// If the locking was successful the implementor must set the current\n        /// identity value by calling <see cref=\"set_OldObjectId\"/>.\n        /// </summary>\n        /// <param name=\"deref\">\n        /// true if the lock should be taken against the leaf level\n        /// reference; false if it should be taken exactly against the\n        /// current reference.\n        /// </param>\n        /// <returns>\n        /// true if the lock was acquired and the reference is likely\n        /// protected from concurrent modification; false if it failed.\n        /// </returns>\n        protected abstract bool tryLock(bool deref);\n\n        /// <summary>\n        /// Releases the lock taken by {@link #tryLock} if it succeeded.\n        /// </summary>\n        public abstract void unlock();\n\n        protected abstract RefUpdateResult doUpdate(RefUpdateResult desiredResult);\n\n        protected abstract RefUpdateResult doDelete(RefUpdateResult desiredResult);\n\n        protected abstract RefUpdateResult doLink(string target);\n\n        /// <summary>name of the underlying ref this update will operate on.</summary>\n        public string Name\n        {\n            get { return Ref.getName(); }\n        }\n\n        /// <summary>\n        /// the reference this update will create or modify.\n        /// </summary>\n        public Ref Ref\n        {\n            get { return _ref; }\n        }\n\n        /// <summary>new value the ref will be (or was) updated to.</summary>\n        public ObjectId NewObjectId\n        {\n            get { return newValue; }\n            set { newValue = value.Copy(); }\n        }\n\n        /// <summary>\n        /// the expected value of the ref after the lock is taken, but\n        /// before update occurs. Null to avoid the compare and swap test.\n        /// Use <see cref=\"ObjectId.ZeroId\"/> to indicate expectation of a\n        /// non-existant ref.\n        /// </summary>\n        public ObjectId ExpectedOldObjectId\n        {\n            get { return expValue; }\n            set { expValue = value != null ? value.ToObjectId() : null; }\n        }\n\n        /// <summary>\n        /// Will this update want to forcefully change the ref, this ignoring merge results ?\n        /// </summary>\n        public bool IsForceUpdate\n        {\n            get { return force; }\n            set { force = value; }\n        }\n\n        /// <returns>identity of the user making the change in the reflog.</returns>\n        public PersonIdent getRefLogIdent()\n        {\n            return refLogIdent;\n        }\n\n        /// <summary>\n        /// Set the identity of the user appearing in the reflog.\n        /// <para/>\n        /// The timestamp portion of the identity is ignored. A new identity with the\n        /// current timestamp will be created automatically when the update occurs\n        /// and the log record is written.\n        /// </summary>\n        /// <param name=\"pi\">\n        /// identity of the user. If null the identity will be\n        /// automatically determined based on the repository\n        /// configuration.\n        /// </param>\n        public void setRefLogIdent(PersonIdent pi)\n        {\n            refLogIdent = pi;\n        }\n\n        /// <summary>\n        /// Get the message to include in the reflog.\n        /// </summary>\n        /// <returns>\n        /// message the caller wants to include in the reflog; null if the\n        /// update should not be logged.\n        /// </returns>\n        public string getRefLogMessage()\n        {\n            return refLogMessage;\n        }\n\n        /// <returns>{@code true} if the ref log message should show the result.</returns>\n        protected bool isRefLogIncludingResult()\n        {\n            return refLogIncludeResult;\n        }\n\n        /// <summary>\n        /// Set the message to include in the reflog.\n        /// </summary>\n        /// <param name=\"msg\">\n        /// the message to describe this change. It may be null if\n        /// appendStatus is null in order not to append to the reflog\n        /// </param>\n        /// <param name=\"appendStatus\">\n        /// true if the status of the ref change (fast-forward or\n        /// forced-update) should be appended to the user supplied\n        /// message.\n        /// </param>\n        public void setRefLogMessage(string msg, bool appendStatus)\n        {\n            if (msg == null && !appendStatus)\n                disableRefLog();\n            else if (msg == null && appendStatus)\n            {\n                refLogMessage = \"\";\n                refLogIncludeResult = true;\n            }\n            else\n            {\n                refLogMessage = msg;\n                refLogIncludeResult = appendStatus;\n            }\n        }\n\n        /// <summary>\n        /// Don't record this update in the ref's associated reflog.\n        /// </summary>\n        public void disableRefLog()\n        {\n            refLogMessage = null;\n            refLogIncludeResult = false;\n        }\n\n        ///<summary>\n        /// The old value of the ref, prior to the update being attempted.\n        /// <para/>\n        /// This value may differ before and after the update method. Initially it is\n        /// populated with the value of the ref before the lock is taken, but the old\n        /// value may change if someone else modified the ref between the time we\n        /// last read it and when the ref was locked for update.\n        /// </summary>\n        public ObjectId OldObjectId\n        {\n            get { return oldValue; }\n            set { oldValue = value; }\n        }\n\n\n        /// <summary>\n        /// Get the status of this update.\n        /// <para/>\n        /// The same value that was previously returned from an update method.\n        /// </summary>\n        /// <returns></returns>\n        public RefUpdateResult Result\n        {\n            get { return result; }\n        }\n\n        private void requireCanDoUpdate()\n        {\n            if (newValue == null)\n                throw new InvalidOperationException(\"A NewObjectId is required.\");\n        }\n\n        /// <summary>\n        /// Force the ref to take the new value.\n        /// <para/>\n        /// This is just a convenient helper for setting the force flag, and as such\n        /// the merge test is performed.\n        /// </summary>\n        /// <returns>the result status of the update.</returns>\n        public RefUpdateResult forceUpdate()\n        {\n            force = true;\n            return update();\n        }\n\n        /// <summary>\n        /// Gracefully update the ref to the new value.\n        /// <para/>\n        /// Merge test will be performed according to <see cref=\"IsForceUpdate\"/>.\n        /// <para/>\n        /// This is the same as:\n        /// \n        /// <pre>\n        /// return update(new RevWalk(getRepository()));\n        /// </pre>\n        /// </summary>\n        /// <returns>the result status of the update.</returns>\n        public RefUpdateResult update()\n        {\n            return update(new RevWalk.RevWalk(getRepository()));\n        }\n\n        /// <summary>\n        /// Gracefully update the ref to the new value.\n        /// <para/>\n        /// Merge test will be performed according to <see cref=\"IsForceUpdate\"/>.\n        /// </summary>\n        /// <param name=\"walk\">\n        /// a RevWalk instance this update command can borrow to perform\n        /// the merge test. The walk will be reset to perform the test.\n        /// </param>\n        /// <returns>\n        /// the result status of the update.\n        /// </returns>\n        public RefUpdateResult update(RevWalk.RevWalk walk)\n        {\n            requireCanDoUpdate();\n            try\n            {\n                return result = updateImpl(walk, new UpdateStore(this));\n            }\n            catch (IOException x)\n            {\n                result = RefUpdateResult.IO_FAILURE;\n                throw x;\n            }\n        }\n\n        /// <summary>\n        /// Delete the ref.\n        /// <para/>\n        /// This is the same as:\n        /// \n        /// <pre>\n        /// return delete(new RevWalk(getRepository()));\n        /// </pre>\n        /// </summary>\n        /// <returns>the result status of the delete.</returns>\n        public RefUpdateResult delete()\n        {\n            return delete(new RevWalk.RevWalk(getRepository()));\n        }\n\n        /// <summary>\n        /// Delete the ref.\n        /// </summary>\n        /// <param name=\"walk\">\n        /// a RevWalk instance this delete command can borrow to perform\n        /// the merge test. The walk will be reset to perform the test.\n        /// </param>\n        /// <returns>the result status of the delete.</returns>\n        public RefUpdateResult delete(RevWalk.RevWalk walk)\n        {\n            string myName = Ref.getLeaf().getName();\n            if (myName.StartsWith(Constants.R_HEADS))\n            {\n                Ref head = getRefDatabase().getRef(Constants.HEAD);\n                while (head.isSymbolic())\n                {\n                    head = head.getTarget();\n                    if (myName.Equals(head.getName()))\n                        return result = RefUpdateResult.REJECTED_CURRENT_BRANCH;\n                }\n            }\n\n            try\n            {\n                return result = updateImpl(walk, new DeleteStore(this));\n            }\n            catch (IOException)\n            {\n                result = RefUpdateResult.IO_FAILURE;\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Replace this reference with a symbolic reference to another reference.\n        /// <para/>\n        /// This exact reference (not its traversed leaf) is replaced with a symbolic\n        /// reference to the requested name.\n        /// </summary>\n        /// <param name=\"target\">\n        /// name of the new target for this reference. The new target name\n        /// must be absolute, so it must begin with {@code refs/}.\n        /// </param>\n        /// <returns><see cref=\"RefUpdateResult.NEW\"/> or <see cref=\"RefUpdateResult.FORCED\"/> on success.</returns>\n        public RefUpdateResult link(string target)\n        {\n            if (!target.StartsWith(Constants.R_REFS))\n                throw new ArgumentException(\"Not \" + Constants.R_REFS);\n            if (getRefDatabase().isNameConflicting(Name))\n                return RefUpdateResult.LOCK_FAILURE;\n            try\n            {\n                if (!tryLock(false))\n                    return RefUpdateResult.LOCK_FAILURE;\n\n                Ref old = getRefDatabase().getRef(Name);\n                if (old != null && old.isSymbolic())\n                {\n                    Ref dst = old.getTarget();\n                    if (target.Equals(dst.getName()))\n                        return result = RefUpdateResult.NO_CHANGE;\n                }\n\n                if (old != null && old.getObjectId() != null)\n                    OldObjectId = (old.getObjectId());\n\n                Ref dst2 = getRefDatabase().getRef(target);\n                if (dst2 != null && dst2.getObjectId() != null)\n                    NewObjectId = (dst2.getObjectId());\n\n                return result = doLink(target);\n            }\n            catch (IOException)\n            {\n                result = RefUpdateResult.IO_FAILURE;\n                throw;\n            }\n            finally\n            {\n                unlock();\n            }\n        }\n\n\n        private RefUpdateResult updateImpl(RevWalk.RevWalk walk, Store store)\n        {\n            RevObject newObj;\n            RevObject oldObj;\n\n            if (getRefDatabase().isNameConflicting(Name))\n                return RefUpdateResult.LOCK_FAILURE;\n            try\n            {\n                if (!tryLock(true))\n                    return RefUpdateResult.LOCK_FAILURE;\n                if (expValue != null)\n                {\n                    ObjectId o;\n                    o = oldValue != null ? oldValue : ObjectId.ZeroId;\n                    if (!AnyObjectId.equals(expValue, o))\n                        return RefUpdateResult.LOCK_FAILURE;\n                }\n                if (oldValue == null)\n                    return store.execute(RefUpdateResult.NEW);\n\n                newObj = safeParse(walk, newValue);\n                oldObj = safeParse(walk, oldValue);\n                if (newObj == oldObj)\n                    return store.execute(RefUpdateResult.NO_CHANGE);\n\n                if (newObj is RevCommit && oldObj is RevCommit)\n                {\n                    if (walk.isMergedInto((RevCommit)oldObj, (RevCommit)newObj))\n                        return store.execute(RefUpdateResult.FAST_FORWARD);\n                }\n\n                if (IsForceUpdate)\n                    return store.execute(RefUpdateResult.FORCED);\n                return RefUpdateResult.REJECTED;\n            }\n            finally\n            {\n                unlock();\n            }\n        }\n\n        private static RevObject safeParse(RevWalk.RevWalk rw, AnyObjectId id)\n        {\n            try\n            {\n                return id != null ? rw.parseAny(id) : null;\n            }\n            catch (MissingObjectException)\n            {\n                // We can expect some objects to be missing, like if we are\n                // trying to force a deletion of a branch and the object it\n                // points to has been pruned from the database due to freak\n                // corruption accidents (it happens with 'git new-work-dir').\n                //\n                return null;\n            }\n        }\n\n        /// <summary>\n        /// Handle the abstraction of storing a ref update. This is because both\n        /// updating and deleting of a ref have merge testing in common.\n        /// </summary>\n        private abstract class Store\n        {\n\n            public abstract RefUpdateResult execute(RefUpdateResult status);\n        }\n\n        private class UpdateStore : Store\n        {\n            private readonly RefUpdate _refUpdate;\n\n            public UpdateStore(RefUpdate refUpdate)\n            {\n                _refUpdate = refUpdate;\n            }\n\n            public override RefUpdateResult execute(RefUpdateResult status)\n            {\n                if (status == RefUpdateResult.NO_CHANGE)\n                    return status;\n                return _refUpdate.doUpdate(status);\n            }\n        }\n\n        private class DeleteStore : Store\n        {\n            private readonly RefUpdate _refUpdate;\n\n            public DeleteStore(RefUpdate refUpdate)\n            {\n                _refUpdate = refUpdate;\n            }\n\n            public override RefUpdateResult execute(RefUpdateResult status)\n            {\n                return _refUpdate.doDelete(status);\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/RefWriter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Charles O'Farrell <charleso@charleso.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Writes out refs to the <see cref=\"Constants.INFO_REFS\"/> and\n    /// <see cref=\"Constants.PACKED_REFS\"/> files.\n    /// \n    /// This class is abstract as the writing of the files must be handled by the\n    /// caller. This is because it is used by transport classes as well.\n    /// </summary>\n    public abstract class RefWriter\n    {\n\n        private readonly IEnumerable<Ref> refs;\n\n        /// <param name=\"refs\">\n        /// the complete set of references. This should have been computed\n        /// by applying updates to the advertised refs already discovered.\n        /// </param>\n        protected RefWriter(IEnumerable<Ref> refs)\n        {\n            this.refs = RefComparator.Sort(refs);\n        }\n\n        /// <param name=\"refs\">\n        /// the complete set of references. This should have been computed\n        /// by applying updates to the advertised refs already discovered.\n        /// </param>\n        protected RefWriter(IDictionary<String, Ref> refs)\n        {\n            if (refs is RefMap)\n                this.refs = refs.Values;\n            else\n                this.refs = RefComparator.Sort(refs.Values);\n        }\n\n        protected RefWriter(RefList<Ref> list)\n        {\n            refs = list.asList();\n        }\n\n        /// <summary>\n        /// Rebuild the <see cref=\"Constants.INFO_REFS\"/>.\n        /// <para />\n        /// This method rebuilds the contents of the <see cref=\"Constants.INFO_REFS\"/> file\n        /// to match the passed list of references.\n        /// </summary>\n        public void writeInfoRefs()\n        {\n            var w = new StringBuilder();\n            var tmp = new char[Constants.OBJECT_ID_STRING_LENGTH];\n            foreach (Ref r in refs)\n            {\n                if (Constants.HEAD.Equals(r.Name))\n                {\n                    // Historically HEAD has never been published through\n                    // the INFO_REFS file. This is a mistake, but its the\n                    // way things are.\n                    //\n                    continue;\n                }\n\n                r.ObjectId.CopyTo(tmp, w);\n                w.Append('\\t');\n                w.Append(r.Name);\n                w.Append('\\n');\n\n                if (r.PeeledObjectId != null)\n                {\n                    r.PeeledObjectId.CopyTo(tmp, w);\n                    w.Append('\\t');\n                    w.Append(r.Name);\n                    w.Append(\"^{}\\n\");\n                }\n            }\n            writeFile(Constants.INFO_REFS, Constants.encode(w.ToString()));\n        }\n\n        /// <summary>\n        /// Rebuild the <see cref=\"Constants.PACKED_REFS\"/> file.\n        /// <para />\n        /// This method rebuilds the contents of the <see cref=\"Constants.PACKED_REFS\"/>\n        /// file to match the passed list of references, including only those refs\n        /// that have a storage type of <see cref=\"Storage.Packed\"/>.\n        /// </summary>\n        public void writePackedRefs()\n        {\n            bool peeled = false;\n\n            foreach (Ref r in refs)\n            {\n                if (r.StorageFormat.IsPacked && r.IsPeeled)\n                {\n                    peeled = true;\n                    break;\n                }\n            }\n\n            var w = new StringBuilder();\n            if (peeled)\n            {\n                w.Append(RefDirectory.PACKED_REFS_HEADER);\n                if (peeled)\n                    w.Append(RefDirectory.PACKED_REFS_PEELED);\n                w.Append('\\n');\n            }\n\n            var tmp = new char[Constants.OBJECT_ID_STRING_LENGTH];\n            foreach (Ref r in refs)\n            {\n                if (r.StorageFormat != Storage.Packed)\n                    continue;\n\n                r.ObjectId.CopyTo(tmp, w);\n                w.Append(' ');\n                w.Append(r.Name);\n                w.Append('\\n');\n\n                if (r.PeeledObjectId != null)\n                {\n                    w.Append('^');\n                    r.PeeledObjectId.CopyTo(tmp, w);\n                    w.Append('\\n');\n                }\n            }\n            writeFile(Constants.PACKED_REFS, Constants.encode(w.ToString()));\n        }\n\n        /// <summary>\n        /// Handles actual writing of ref files to the git repository, which may\n        /// differ slightly depending on the destination and transport.\n        /// </summary>\n        /// <param name=\"file\">path to ref file.</param>\n        /// <param name=\"content\">byte content of file to be written.</param>\n        protected abstract void writeFile(String file, byte[] content);\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/ReflogReader.cs",
    "content": "/*\n * Copyright (C) 2009, Robin Rosenberg\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Utility for reading reflog entries.\n\t/// </summary>\n    public class ReflogReader\n    {\n\t\t#region Nested Types\n\n        public class Entry\n        {\n\t\t\tprivate readonly ObjectId oldId;\n\t\t\tprivate readonly ObjectId newId;\n\t\t\tprivate readonly PersonIdent who;\n\t\t\tprivate readonly string comment;\n\n            public Entry(byte[] raw, int pos)\n            {\n                oldId = ObjectId.FromString(raw, pos);\n                pos += Constants.OBJECT_ID_STRING_LENGTH;\n                if (raw[pos++] != ' ')\n                    throw new ArgumentException(\"Raw log message does not parse as log entry\");\n                newId = ObjectId.FromString(raw, pos);\n                pos += Constants.OBJECT_ID_STRING_LENGTH;\n                if (raw[pos++] != ' ')\n                    throw new ArgumentException(\"Raw log message does not parse as log entry\");\n                who = RawParseUtils.parsePersonIdentOnly(raw, pos);\n                int p0 = RawParseUtils.next(raw, pos, (byte)'\\t');\n\n                if (p0 == -1)\n                    throw new ArgumentException(\"Raw log message does not parse as log entry\");\n\n                int p1 = RawParseUtils.nextLF(raw, p0);\n                if (p1 == -1)\n                    throw new ArgumentException(\"Raw log message does not parse as log entry\");\n\n                comment = RawParseUtils.decode(raw, p0, p1 - 1);\n            }\n\n\t\t\t/// <summary>\n\t\t\t/// Gets the commit id before the change.\n\t\t\t/// </summary>\n            public ObjectId getOldId()\n            {\n                return oldId;\n            }\n\n\t\t\t/// <summary>\n\t\t\t/// Gets the commit id after the change.\n\t\t\t/// </summary>\n            public ObjectId getNewId()\n            {\n                return newId;\n            }\n\n\t\t\t/// <summary>\n\t\t\t/// Gets the user performing the change.\n\t\t\t/// </summary>\n            public PersonIdent getWho()\n            {\n                return who;\n            }\n\n\t\t\t/// <summary>\n\t\t\t/// Gets the textual description of the change.\n\t\t\t/// </summary>\n            public string getComment()\n            {\n                return comment;\n            }\n\n            public override string ToString()\n            {\n                return \"Entry[\" + oldId.Name + \", \" + newId.Name + \", \" + getWho() + \", \" + getComment() + \"]\";\n            }\n        }\n\n\t\t#endregion\n\n\t\tprivate readonly FileInfo _logName;\n\n\t\t///\t<summary>\n\t\t/// Parsed reflog entry.\n\t\t/// </summary>\n\t\tpublic ReflogReader(Repository db, string refName)\n\t\t{\n\t\t\tif (db == null)\n\t\t\t\tthrow new ArgumentNullException (\"db\");\n\t\t\t_logName = new FileInfo(\n\t\t\t\tPath.Combine(\n\t\t\t\t\tdb.Directory.FullName,\n\t\t\t\t\t\tPath.Combine(\"logs\", refName)).Replace('/', Path.DirectorySeparatorChar));\n        }\n\n\t\t///\t<summary>\n\t\t/// Get the last entry in the reflog.\n\t\t/// </summary>\n\t\t/// <returns>The latest reflog entry, or null if no log.</returns>\n\t\t/// <exception cref=\"IOException\"></exception>\n        public Entry getLastEntry()\n        {\n            var entries = getReverseEntries(1);\n            return entries.Count > 0 ? entries[0] : null;\n        }\n\n\t\t/// <summary></summary>\n\t\t/// <returns> all reflog entries in reverse order.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic IList<Entry> getReverseEntries()\n\t\t{\n\t\t\treturn getReverseEntries(int.MaxValue);\n\t\t}\n\n\t\t///\t<param name=\"max\">Max number of entries to read.</param>\n\t\t///\t<returns>All reflog entries in reverse order.</returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic IList<Entry> getReverseEntries(int max)\n        {\n\t\t\tbyte[] log;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlog = IO.ReadFully(_logName);\n\t\t\t}\n\t\t\tcatch (DirectoryNotFoundException)\n\t\t\t{\n\t\t\t\treturn new List<Entry>();\n\t\t\t}\n\t\t\tcatch (FileNotFoundException)\n\t\t\t{\n\t\t\t\treturn new List<Entry>();\n\t\t\t}\n            \n            int rs = RawParseUtils.prevLF(log, log.Length);\n            var ret = new List<Entry>();\n            while (rs >= 0 && max-- > 0)\n            {\n                rs = RawParseUtils.prevLF(log, rs);\n                Entry entry = new Entry(log, rs < 0 ? 0 : rs + 2);\n                ret.Add(entry);\n            }\n\n            return ret;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RefsChangedEventArgs.cs",
    "content": "\n/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Robin Rosenberg <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n\t\n\t\n\tpublic class RefsChangedEventArgs : RepositoryChangedEventArgs\n\t{\n\t\t\n\t\tpublic RefsChangedEventArgs(Repository repo)\n\t\t\t: base(repo)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format(\"RefsChangedEventsArgs[{0}]\", this.Repository);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Repository.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing Tamir.SharpSsh.java.util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Represents a Git repository. A repository holds all objects and refs used for\n    /// managing source code (could by any type of file, but source code is what\n    /// SCM's are typically used for).\n    /// <para />\n    /// In Git terms all data is stored in GIT_DIR, typically a directory called\n    /// .git. A work tree is maintained unless the repository is a bare repository.\n    /// Typically the .git directory is located at the root of the work dir.\n    /// <ul>\n    /// <li>GIT_DIR\n    /// \t<ul>\n    /// \t\t<li>objects/ - objects</li>\n    /// \t\t<li>refs/ - tags and heads</li>\n    /// \t\t<li>config - configuration</li>\n    /// \t\t<li>info/ - more configurations</li>\n    /// \t</ul>\n    /// </li>\n    /// </ul>\n    /// <para />\n    /// This class is thread-safe.\n    /// <para />\n    /// This implementation only handles a subtly undocumented subset of git features.\n    /// </summary>\n    public class Repository : IDisposable\n    {\n        private AtomicInteger _useCnt = new AtomicInteger(1);\n        internal readonly RefDatabase _refDb; // [henon] need internal for API\n\n        private readonly ObjectDirectory _objectDatabase;\n\n        private GitIndex _index;\n\n        // private readonly List<DirectoryInfo> _objectsDirs; // never used.\n\n        private List<RepositoryListener> listeners = new List<RepositoryListener>(); //TODO: make thread safe\n        static private List<RepositoryListener> allListeners = new List<RepositoryListener>(); //TODO: make thread safe\n\n        private DirectoryInfo workDir;\n\n        private FileInfo indexFile;\n        private readonly object _padLock = new object();\n\n        /// <summary>\n        /// Construct a representation of a Git repository.\n        /// The work tree, object directory, alternate object directories and index file locations are deduced from the given git directory and the default rules.\n        /// </summary>\n        /// <param name=\"d\">GIT_DIR (the location of the repository metadata).</param>\n        public Repository(DirectoryInfo d)\n            : this(d, null, null, null, null)  // go figure it out\n        {\n        }\n\n        /// <summary>\n        /// Construct a representation of a Git repository.\n        /// The work tree, object directory, alternate object directories and index file locations are deduced from the given git directory and the default rules.\n        /// </summary>\n        /// <param name=\"d\">GIT_DIR (the location of the repository metadata).</param>\n        /// <param name=\"workTree\">GIT_WORK_TREE (the root of the checkout). May be null for default value.</param>\n        public Repository(DirectoryInfo d, DirectoryInfo workTree)\n            : this(d, workTree, null, null, null) // go figure it out \n        {\n        }\n\n        /// <summary>\n        /// Construct a representation of a Git repository using the given parameters possibly overriding default conventions..\n        /// </summary>\n        /// <param name=\"d\">GIT_DIR (the location of the repository metadata). May be null for default value in which case it depends on GIT_WORK_TREE.</param>\n        /// <param name=\"workTree\">GIT_WORK_TREE (the root of the checkout). May be null for default value if GIT_DIR is</param>\n        /// <param name=\"objectDir\">GIT_OBJECT_DIRECTORY (where objects and are stored). May be null for default value. Relative names ares resolved against GIT_WORK_TREE</param>\n        /// <param name=\"alternateObjectDir\">GIT_ALTERNATE_OBJECT_DIRECTORIES (where more objects are read from). May be null for default value. Relative names ares resolved against GIT_WORK_TREE</param>\n        /// <param name=\"indexFile\">GIT_INDEX_FILE (the location of the index file). May be null for default value. Relative names ares resolved against GIT_WORK_TREE.</param>\n        public Repository(DirectoryInfo d, DirectoryInfo workTree, DirectoryInfo objectDir,\n                DirectoryInfo[] alternateObjectDir, FileInfo indexFile)\n        {\n            if (workTree != null)\n            {\n                workDir = workTree;\n                if (d == null)\n                    Directory = PathUtil.CombineDirectoryPath(workTree, Constants.DOT_GIT);\n                else\n                    Directory = d;\n            }\n            else\n            {\n                if (d != null)\n                    Directory = d;\n                else\n                {\n                    Dispose();\n                    throw new ArgumentException(\"Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor\");\n                }\n            }\n\n            var userConfig = SystemReader.getInstance().openUserConfig();\n\n            try\n            {\n                userConfig.load();\n            }\n            catch (ConfigInvalidException e1)\n            {\n                Dispose();\n\n                throw new IOException(\"User config file \"\n                    + userConfig.getFile().FullName + \" invalid: \"\n                    + e1, e1);\n            }\n\n            Config = new RepositoryConfig(userConfig, (FileInfo)FS.resolve(Directory, \"config\"));\n\n            try\n            {\n                Config.load();\n            }\n            catch (ConfigInvalidException e1)\n            {\n                Dispose();\n                throw new IOException(\"Unknown repository format\", e1);\n            }\n\n            if (workDir == null)\n            {\n                String workTreeConfig = Config.getString(\"core\", null, \"worktree\");\n                if (workTreeConfig != null)\n                {\n                    workDir = (DirectoryInfo)FS.resolve(d, workTreeConfig);\n                }\n                else\n                {\n                    workDir = Directory.Parent;\n                }\n            }\n\n            _refDb = new RefDirectory(this);\n            if (objectDir != null)\n                _objectDatabase = new ObjectDirectory(PathUtil.CombineDirectoryPath(objectDir, \"\"),\n                        alternateObjectDir);\n            else\n                _objectDatabase = new ObjectDirectory(PathUtil.CombineDirectoryPath(Directory, \"objects\"),\n                        alternateObjectDir);\n\n            if (indexFile != null)\n                this.indexFile = indexFile;\n            else\n                this.indexFile = PathUtil.CombineFilePath(Directory, \"index\");\n\n            if (_objectDatabase.exists())\n            {\n                string repositoryFormatVersion = Config.getString(\"core\", null, \"repositoryFormatVersion\");\n\n                if (!\"0\".Equals(repositoryFormatVersion))\n                {\n                    Dispose();\n                    throw new IOException(\"Unknown repository format \\\"\"\n                                          + repositoryFormatVersion + \"\\\"; expected \\\"0\\\".\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Create a new Git repository initializing the necessary files and\n        /// directories.\n        /// </summary>\n        public void Create()\n        {\n            lock (_padLock)\n            {\n                Create(false);\n            }\n        }\n\n        /// <summary>\n        /// Create a new Git repository initializing the necessary files and\n        /// directories.\n        /// </summary>\n        /// <param name=\"bare\">if true, a bare repository is created.</param>\n        public bool Create(bool bare)\n        {\n            var reinit = false;\n\n            if (Config.getFile().Exists)\n            {\n                reinit = true;\n            }\n\n            if (!reinit)\n            {\n                Directory.Mkdirs();\n                _refDb.create();\n                _objectDatabase.create();\n\n                RefUpdate head = UpdateRef(Constants.HEAD);\n                head.disableRefLog();\n                head.link(Constants.R_HEADS + Constants.MASTER);\n            }\n\n            Config.setInt(\"core\", null, \"repositoryformatversion\", 0);\n            Config.setBoolean(\"core\", null, \"filemode\", true);\n            Config.setBoolean(\"core\", null, \"bare\", bare);\n            Config.setBoolean(\"core\", null, \"logallrefupdates\", !bare);\n            Config.setBoolean(\"core\", null, \"autocrlf\", false);\n\n            Config.save();\n\n            return reinit;\n        }\n\n        public DirectoryInfo ObjectsDirectory\n        {\n            get { return _objectDatabase.getDirectory(); }\n        }\n\n        public DirectoryInfo Directory { get; private set; }\n        public DirectoryInfo WorkingDirectory { get { return workDir; } }\n\n        /// <summary>\n        /// Override default workdir\n        /// </summary>\n        /// <param name=\"workTree\">the work tree directory</param>\n        public void setWorkDir(DirectoryInfo workTree)\n        {\n            workDir = workTree;\n        }\n\n        public RepositoryConfig Config { get; private set; }\n\n        /// <summary>\n        /// Construct a filename where the loose object having a specified SHA-1\n        /// should be stored. If the object is stored in a shared repository the path\n        /// to the alternative repo will be returned. If the object is not yet store\n        /// a usable path in this repo will be returned. It is assumed that callers\n        /// will look for objects in a pack first.\n        /// </summary>\n        /// <param name=\"objectId\"></param>\n        /// <returns>Suggested file name</returns>\n        public FileInfo ToFile(AnyObjectId objectId)\n        {\n            return _objectDatabase.fileFor(objectId);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"objectId\"></param>\n        /// <returns>\n        /// true if the specified object is stored in this repo or any of the\n        /// known shared repositories.\n        /// </returns>\n        public bool HasObject(AnyObjectId objectId)\n        {\n            return _objectDatabase.hasObject(objectId);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"windowCursor\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        /// <param name=\"id\">SHA-1 of an object.</param>\n        /// <returns>\n        /// A <see cref=\"ObjectLoader\"/> for accessing the data of the named\n        /// object, or null if the object does not exist.\n        /// </returns>\n        public ObjectLoader OpenObject(WindowCursor windowCursor, AnyObjectId id)\n        {\n            return _objectDatabase.openObject(windowCursor, id);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"id\">SHA-1 of an object.</param>\n        /// <returns>\n        /// A <see cref=\"ObjectLoader\"/> for accessing the data of the named\n        /// object, or null if the object does not exist.\n        /// </returns>\n        public ObjectLoader OpenObject(AnyObjectId id)\n        {\n            var wc = new WindowCursor();\n            try\n            {\n                return OpenObject(wc, id);\n            }\n            finally\n            {\n                wc.Release();\n            }\n        }\n\n        /// <summary>\n        /// Open object in all packs containing specified object.\n        /// </summary>\n        /// <param name=\"objectId\">id of object to search for</param>\n        /// <param name=\"windowCursor\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        /// <returns>\n        /// Collection of loaders for this object, from all packs containing\n        /// this object\n        /// </returns>\n        public IEnumerable<PackedObjectLoader> OpenObjectInAllPacks(AnyObjectId objectId, WindowCursor windowCursor)\n        {\n            var result = new List<PackedObjectLoader>();\n            OpenObjectInAllPacks(objectId, result, windowCursor);\n            return result;\n        }\n\n        /// <summary>\n        /// Open object in all packs containing specified object.\n        /// </summary>\n        /// <param name=\"objectId\"><see cref=\"ObjectId\"/> of object to search for</param>\n        /// <param name=\"resultLoaders\">\n        /// Result collection of loaders for this object, filled with\n        /// loaders from all packs containing specified object\n        /// </param>\n        /// <param name=\"windowCursor\">\n        /// Temporary working space associated with the calling thread.\n        /// </param>\n        public void OpenObjectInAllPacks(AnyObjectId objectId, ICollection<PackedObjectLoader> resultLoaders,\n                                         WindowCursor windowCursor)\n        {\n            _objectDatabase.OpenObjectInAllPacks(resultLoaders, windowCursor, objectId);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"id\">SHA'1 of a blob</param>\n        /// <returns>\n        /// An <see cref=\"ObjectLoader\"/> for accessing the data of a named blob\n        /// </returns>\n        public ObjectLoader OpenBlob(ObjectId id)\n        {\n            return OpenObject(id);\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"id\">SHA'1 of a tree</param>\n        /// <returns>\n        /// An <see cref=\"ObjectLoader\"/> for accessing the data of a named tree\n        /// </returns>\n        public ObjectLoader OpenTree(ObjectId id)\n        {\n            return OpenObject(id);\n        }\n\n        /// <summary>\n        /// Access a Commit object using a symbolic reference. This reference may\n        /// be a SHA-1 or ref in combination with a number of symbols translating\n        /// from one ref or SHA1-1 to another, such as HEAD^ etc.\n        /// </summary>\n        /// <param name=\"resolveString\">a reference to a git commit object</param>\n        /// <returns>A <see cref=\"Commit\"/> named by the specified string</returns>\n        public Commit MapCommit(string resolveString)\n        {\n            ObjectId id = Resolve(resolveString);\n            return id != null ? MapCommit(id) : null;\n        }\n\n        /// <summary>\n        /// Access a Commit by SHA'1 id.\n        /// </summary>\n        /// <param name=\"id\"></param>\n        /// <returns>Commit or null</returns>\n        public Commit MapCommit(ObjectId id)\n        {\n            ObjectLoader or = OpenObject(id);\n            if (or == null)\n            {\n                return null;\n            }\n\n            byte[] raw = or.Bytes;\n            if (Constants.OBJ_COMMIT == or.Type)\n            {\n                return new Commit(this, id, raw);\n            }\n\n            throw new IncorrectObjectTypeException(id, ObjectType.Commit);\n        }\n\n        /// <summary>\n        /// Access any type of Git object by id and\n        /// </summary>\n        /// <param name=\"id\">SHA-1 of object to read</param>\n        /// <param name=\"refName\">optional, only relevant for simple tags</param>\n        /// <returns>The Git object if found or null</returns>\n        public object MapObject(ObjectId id, string refName)\n        {\n            ObjectLoader or = OpenObject(id);\n\n            if (or == null)\n            {\n                return null;\n            }\n\n            byte[] raw = or.Bytes;\n            switch ((ObjectType)(or.Type))\n            {\n                case ObjectType.Tree:\n                    return MakeTree(id, raw);\n\n                case ObjectType.Commit:\n                    return MakeCommit(id, raw);\n\n                case ObjectType.Tag:\n                    return MakeTag(id, refName, raw);\n\n                case ObjectType.Blob:\n                    return raw;\n\n                default:\n                    throw new IncorrectObjectTypeException(id,\n                        \"COMMIT nor TREE nor BLOB nor TAG\");\n            }\n        }\n\n        private object MakeCommit(ObjectId id, byte[] raw)\n        {\n            return new Commit(this, id, raw);\n        }\n\n        /// <summary>\n        /// Access a Tree object using a symbolic reference. This reference may\n        /// be a SHA-1 or ref in combination with a number of symbols translating\n        /// from one ref or SHA1-1 to another, such as HEAD^{tree} etc.\n        /// </summary>\n        /// <param name=\"revstr\">a reference to a git commit object</param>\n        /// <returns>a Tree named by the specified string</returns>\n        public Tree MapTree(string revstr)\n        {\n            ObjectId id = Resolve(revstr);\n            return (id != null) ? MapTree(id) : null;\n        }\n\n        /// <summary>\n        /// Access a Tree by SHA'1 id.\n        /// </summary>\n        /// <param name=\"id\"></param>\n        /// <returns>Tree or null</returns>\n        public Tree MapTree(ObjectId id)\n        {\n            ObjectLoader or = OpenObject(id);\n            if (or == null)\n            {\n                return null;\n            }\n\n            byte[] raw = or.Bytes;\n            switch (((ObjectType)or.Type))\n            {\n                case ObjectType.Tree:\n                    return new Tree(this, id, raw);\n\n                case ObjectType.Commit:\n                    return MapTree(ObjectId.FromString(raw, 5));\n            }\n\n            throw new IncorrectObjectTypeException(id, ObjectType.Tree);\n        }\n\n        private Tree MakeTree(ObjectId id, byte[] raw)\n        {\n            return new Tree(this, id, raw);\n        }\n\n        private Tag MakeTag(ObjectId id, string refName, byte[] raw)\n        {\n            return new Tag(this, id, refName, raw);\n        }\n\n\n        /// <summary>\n        /// Access a tag by symbolic name.\n        /// </summary>\n        /// <param name=\"revstr\"></param>\n        /// <returns>Tag or null</returns>\n        public Tag MapTag(string revstr)\n        {\n            ObjectId id = Resolve(revstr);\n            return id != null ? MapTag(revstr, id) : null;\n        }\n\n        /// <summary>\n        /// Access a Tag by SHA'1 id\n        /// </summary>\n        /// <param name=\"refName\"></param>\n        /// <param name=\"id\"></param>\n        /// <returns>Commit or null</returns>\n        public Tag MapTag(string refName, ObjectId id)\n        {\n            ObjectLoader or = OpenObject(id);\n            if (or == null) return null;\n\n            byte[] raw = or.Bytes;\n\n            if (ObjectType.Tag == (ObjectType)or.Type)\n            {\n                return new Tag(this, id, refName, raw);\n            }\n\n            return new Tag(this, id, refName, null);\n        }\n\n        /// <summary>\n        /// Create a command to update (or create) a ref in this repository.\n        /// </summary>\n        /// <param name=\"refName\">\n        /// name of the ref the caller wants to modify.\n        /// </param>\n        /// <returns>\n        /// An update command. The caller must finish populating this command\n        /// and then invoke one of the update methods to actually make a\n        /// change.\n        /// </returns>\n        public RefUpdate UpdateRef(string refName)\n        {\n            return UpdateRef(refName, false);\n        }\n\n        /// <summary>\n        /// Create a command to update, create or delete a ref in this repository.\n        /// </summary>\n        /// <param name=\"refName\">name of the ref the caller wants to modify.</param>\n        /// <param name=\"detach\">true to create a detached head</param>\n        /// <returns>An update command. The caller must finish populating this command and then invoke one of the update methods to actually make a change.</returns>\n        public RefUpdate UpdateRef(string refName, bool detach)\n        {\n            return _refDb.newUpdate(refName, detach);\n        }\n\n        ///\t<summary>\n        /// Create a command to rename a ref in this repository\n        ///\t</summary>\n        ///\t<param name=\"fromRef\">Name of ref to rename from.</param>\n        ///\t<param name=\"toRef\">Name of ref to rename to.</param>\n        ///\t<returns>\n        /// An update command that knows how to rename a branch to another.\n        /// </returns>\n        ///\t<exception cref=\"IOException\">The rename could not be performed.</exception>\n        public RefRename RenameRef(string fromRef, string toRef)\n        {\n            return _refDb.newRename(fromRef, toRef);\n        }\n\n        ///\t<summary>\n        /// Parse a git revision string and return an object id.\n        ///\t<para />\n        ///\tCurrently supported is combinations of these.\n        ///\t<ul>\n        ///\t <li>SHA-1 - a SHA-1</li>\n        ///\t <li>refs/... - a ref name</li>\n        ///\t <li>ref^n - nth parent reference</li>\n        ///\t <li>ref~n - distance via parent reference</li>\n        ///\t <li>ref@{n} - nth version of ref</li>\n        ///\t <li>ref^{tree} - tree references by ref</li>\n        ///\t <li>ref^{commit} - commit references by ref</li>\n        ///\t</ul>\n        ///\t<para />\n        ///\tNot supported is\n        ///\t<ul>\n        ///\t <li>timestamps in reflogs, ref@{full or relative timestamp}</li>\n        ///\t <li>abbreviated SHA-1's</li>\n        ///\t</ul>\n        ///\t</summary>\n        ///\t<param name=\"revision\">A git object references expression.</param>\n        ///\t<returns>\n        /// An <see cref=\"ObjectId\"/> or null if revstr can't be resolved to any <see cref=\"ObjectId\"/>.\n        /// </returns>\n        ///\t<exception cref=\"IOException\">On serious errors.</exception>\n        public ObjectId Resolve(string revision)\n        {\n            object oref = null;\n            ObjectId refId = null;\n\n            // [ammachado] Avoid the loop if the reference is not a special one.\n            if (revision.IndexOfAny(new[] { '^', '~', '@' }) == -1)\n            {\n                return ResolveSimple(revision);\n            }\n\n            for (int i = 0; i < revision.Length; ++i)\n            {\n                switch (revision[i])\n                {\n                    case '^':\n                        if (refId == null)\n                        {\n                            var refstr = new string(revision.ToCharArray(0, i));\n                            refId = ResolveSimple(refstr);\n                            if (refId == null) return null;\n                        }\n\n                        if (i + 1 < revision.Length)\n                        {\n                            switch (revision[i + 1])\n                            {\n                                case '0':\n                                case '1':\n                                case '2':\n                                case '3':\n                                case '4':\n                                case '5':\n                                case '6':\n                                case '7':\n                                case '8':\n                                case '9':\n\n                                    int j;\n                                    oref = MapObject(refId, null);\n\n                                    while (oref is Tag)\n                                    {\n                                        var tag = (Tag)oref;\n                                        refId = tag.Id;\n                                        oref = MapObject(refId, null);\n                                    }\n\n                                    Commit oCom = (oref as Commit);\n                                    if (oCom == null)\n                                    {\n                                        throw new IncorrectObjectTypeException(refId, ObjectType.Commit);\n                                    }\n\n                                    for (j = i + 1; j < revision.Length; ++j)\n                                    {\n                                        if (!Char.IsDigit(revision[j])) break;\n                                    }\n\n                                    var parentnum = new string(revision.ToCharArray(i + 1, j - i - 1));\n\n                                    int pnum;\n\n                                    try\n                                    {\n                                        pnum = Convert.ToInt32(parentnum);\n                                    }\n                                    catch (FormatException)\n                                    {\n                                        throw new RevisionSyntaxException(revision, \"Invalid commit parent number\");\n                                    }\n                                    if (pnum != 0)\n                                    {\n                                        ObjectId[] parents = oCom.ParentIds;\n                                        if (pnum > parents.Length)\n                                            refId = null;\n                                        else\n                                            refId = parents[pnum - 1];\n                                    }\n\n                                    i = j - 1;\n                                    break;\n\n                                case '{':\n                                    int k;\n                                    string item = null;\n                                    for (k = i + 2; k < revision.Length; ++k)\n                                    {\n                                        if (revision[k] != '}') continue;\n                                        item = new string(revision.ToCharArray(i + 2, k - i - 2));\n                                        break;\n                                    }\n\n                                    i = k;\n                                    if (item != null)\n                                    {\n                                        if (item.Equals(\"tree\"))\n                                        {\n                                            oref = MapObject(refId, null);\n                                            while (oref is Tag)\n                                            {\n                                                var t = (Tag)oref;\n                                                refId = t.Id;\n                                                oref = MapObject(refId, null);\n                                            }\n                                            Treeish oTree = (oref as Treeish);\n                                            if (oTree != null)\n                                            {\n                                                refId = oTree.TreeId;\n                                            }\n                                            else\n                                            {\n                                                throw new IncorrectObjectTypeException(refId, ObjectType.Tree);\n                                            }\n                                        }\n                                        else if (item.Equals(\"commit\"))\n                                        {\n                                            oref = MapObject(refId, null);\n                                            while (oref is Tag)\n                                            {\n                                                var t = (Tag)oref;\n                                                refId = t.Id;\n                                                oref = MapObject(refId, null);\n                                            }\n                                            if (!(oref is Commit))\n                                            {\n                                                throw new IncorrectObjectTypeException(refId, ObjectType.Commit);\n                                            }\n                                        }\n                                        else if (item.Equals(\"blob\"))\n                                        {\n                                            oref = MapObject(refId, null);\n                                            while (oref is Tag)\n                                            {\n                                                var t = (Tag)oref;\n                                                refId = t.Id;\n                                                oref = MapObject(refId, null);\n                                            }\n                                            if (!(oref is byte[]))\n                                            {\n                                                throw new IncorrectObjectTypeException(refId, ObjectType.Commit);\n                                            }\n                                        }\n                                        else if (string.Empty.Equals(item))\n                                        {\n                                            oref = MapObject(refId, null);\n                                            while (oref is Tag)\n                                            {\n                                                var t = (Tag)oref;\n                                                refId = t.Id;\n                                                oref = MapObject(refId, null);\n                                            }\n                                        }\n                                        else\n                                        {\n                                            throw new RevisionSyntaxException(revision);\n                                        }\n                                    }\n                                    else\n                                    {\n                                        throw new RevisionSyntaxException(revision);\n                                    }\n                                    break;\n\n                                default:\n                                    oref = MapObject(refId, null);\n                                    Commit oComm = (oref as Commit);\n                                    if (oComm != null)\n                                    {\n                                        ObjectId[] parents = oComm.ParentIds;\n                                        refId = parents.Length == 0 ? null : parents[0];\n                                    }\n                                    else\n                                    {\n                                        throw new IncorrectObjectTypeException(refId, ObjectType.Commit);\n                                    }\n                                    break;\n                            }\n                        }\n                        else\n                        {\n                            oref = MapObject(refId, null);\n                            while (oref is Tag)\n                            {\n                                var tag = (Tag)oref;\n                                refId = tag.Id;\n                                oref = MapObject(refId, null);\n                            }\n\n                            Commit oCom = (oref as Commit);\n                            if (oCom != null)\n                            {\n                                ObjectId[] parents = oCom.ParentIds;\n                                refId = parents.Length == 0 ? null : parents[0];\n                            }\n                            else\n                            {\n                                throw new IncorrectObjectTypeException(refId, Constants.TYPE_COMMIT);\n                            }\n                        }\n                        break;\n\n                    case '~':\n                        if (oref == null)\n                        {\n                            var refstr = new string(revision.ToCharArray(0, i));\n                            refId = ResolveSimple(refstr);\n                            if (refId == null) return null;\n                            oref = MapObject(refId, null);\n                        }\n\n                        while (oref is Tag)\n                        {\n                            var tag = (Tag)oref;\n                            refId = tag.Id;\n                            oref = MapObject(refId, null);\n                        }\n\n                        if (!(oref is Commit))\n                        {\n                            throw new IncorrectObjectTypeException(refId, Constants.TYPE_COMMIT);\n                        }\n\n                        int l;\n                        for (l = i + 1; l < revision.Length; ++l)\n                        {\n                            if (!Char.IsDigit(revision[l]))\n                                break;\n                        }\n\n                        var distnum = new string(revision.ToCharArray(i + 1, l - i - 1));\n                        int dist;\n\n                        try\n                        {\n                            dist = Convert.ToInt32(distnum);\n                        }\n                        catch (FormatException)\n                        {\n                            throw new RevisionSyntaxException(\"Invalid ancestry length\", revision);\n                        }\n                        while (dist > 0)\n                        {\n\n                            ObjectId[] parents = ((Commit)oref).ParentIds;\n                            if (parents.Length == 0)\n                            {\n                                refId = null;\n                                break;\n                            }\n                            refId = parents[0];\n                            oref = MapCommit(refId);\n                            --dist;\n                        }\n                        i = l - 1;\n                        break;\n\n                    case '@':\n                        int m;\n                        string time = null;\n                        for (m = i + 2; m < revision.Length; ++m)\n                        {\n                            if (revision[m] != '}') continue;\n                            time = new string(revision.ToCharArray(i + 2, m - i - 2));\n                            break;\n                        }\n\n                        if (time != null)\n                        {\n                            throw new RevisionSyntaxException(\"reflogs not yet supported by revision parser yet\", revision);\n                        }\n                        i = m - 1;\n                        break;\n\n                    default:\n                        if (refId != null)\n                        {\n                            throw new RevisionSyntaxException(revision);\n                        }\n                        break;\n                }\n            }\n\n            if (refId == null)\n            {\n                refId = ResolveSimple(revision);\n            }\n\n            return refId;\n        }\n\n        private ObjectId ResolveSimple(string revstr)\n        {\n            if (ObjectId.IsId(revstr))\n            {\n                return ObjectId.FromString(revstr);\n            }\n            Ref r = _refDb.getRef(revstr);\n            return r != null ? r.ObjectId : null;\n        }\n\n        public void IncrementOpen()\n        {\n            _useCnt.incrementAndGet();\n        }\n\n        /// <summary>\n        /// Close all resources used by this repository\n        /// </summary>\n        public void Close()\n        {\n            int usageCount = _useCnt.decrementAndGet();\n            if (usageCount == 0)\n            {\n                if (_objectDatabase != null)\n                {\n                    _objectDatabase.Dispose();\n                    _refDb.Dispose();\n                }\n#if DEBUG\n                GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n            }\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~Repository()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: \" + Directory);\n        }\n#endif\n\n        public void OpenPack(FileInfo pack, FileInfo idx)\n        {\n            _objectDatabase.openPack(pack, idx);\n        }\n\n        public ObjectDirectory ObjectDatabase\n        {\n            get { return _objectDatabase; }\n        }\n\n        /// <summary>\n        /// The reference database which stores the reference namespace.\n        /// </summary>\n        public RefDatabase RefDatabase\n        {\n            get { return _refDb; }\n        }\n\n        /// <summary>\n        /// Gets a representation of the index associated with this repo\n        /// </summary>\n        public GitIndex Index\n        {\n            get\n            {\n                if (_index == null)\n                {\n                    _index = new GitIndex(this);\n                    _index.Read();\n                }\n                else\n                {\n                    _index.RereadIfNecessary();\n                }\n\n                return _index;\n            }\n        }\n\n        /// <returns>the index file location</returns>\n        public FileInfo getIndexFile()\n        {\n            return indexFile;\n        }\n\n        /// <summary>\n        /// Replaces any windows director separators (backslash) with /\n        /// </summary>\n        /// <param name=\"bytes\"></param>\n        /// <returns></returns>\n        internal static byte[] GitInternalSlash(byte[] bytes)\n        {\n            if (Path.DirectorySeparatorChar == '/') // [henon] DirectorySeparatorChar == \\\n            {\n                return bytes;\n            }\n\n            for (int i = 0; i < bytes.Length; ++i)\n            {\n                if (bytes[i] == Path.DirectorySeparatorChar)\n                {\n                    bytes[i] = (byte)'/';\n                }\n            }\n\n            return bytes;\n        }\n\n        /// <summary>\n        /// Strip work dir and return normalized repository path\n        /// </summary>\n        /// <param name=\"workDir\">Work directory</param>\n        /// <param name=\"file\">File whose path shall be stripp off it's workdir</param>\n        /// <returns>Normalized repository relative path</returns>\n        public static string StripWorkDir(FileSystemInfo workDir, FileSystemInfo file)\n        {\n            string filePath = file.DirectoryName();\n            string workDirPath = workDir.DirectoryName();\n\n            if (filePath.Length <= workDirPath.Length ||\n                filePath[workDirPath.Length] != Path.DirectorySeparatorChar ||\n                !filePath.StartsWith(workDirPath))\n            {\n                FileSystemInfo absWd = new DirectoryInfo(workDir.DirectoryName());\n                FileSystemInfo absFile = new FileInfo(file.FullName);\n\n                if (absWd.FullName == workDir.FullName && absFile.FullName == file.FullName)\n                {\n                    return string.Empty;\n                }\n\n                return StripWorkDir(absWd, absFile);\n            }\n\n            string relName = filePath.Substring(workDirPath.Length + 1);\n\n            if (Path.DirectorySeparatorChar != '/')\n            {\n                relName = relName.Replace(Path.DirectorySeparatorChar, '/');\n            }\n\n            return relName;\n        }\n\n        /**\n\t     * Register a {@link RepositoryListener} which will be notified\n\t     * when ref changes are detected.\n\t     *\n\t     * @param l\n\t     */\n        public void addRepositoryChangedListener(RepositoryListener l)\n        {\n            listeners.Add(l);\n        }\n\n        /**\n         * Remove a registered {@link RepositoryListener}\n         * @param l\n         */\n        public void removeRepositoryChangedListener(RepositoryListener l)\n        {\n            listeners.Remove(l);\n        }\n\n        /**\n         * Register a global {@link RepositoryListener} which will be notified\n         * when a ref changes in any repository are detected.\n         *\n         * @param l\n         */\n        public static void addAnyRepositoryChangedListener(RepositoryListener l)\n        {\n            allListeners.Add(l);\n        }\n\n        /**\n         * Remove a globally registered {@link RepositoryListener}\n         * @param l\n         */\n        public static void removeAnyRepositoryChangedListener(RepositoryListener l)\n        {\n            allListeners.Remove(l);\n        }\n\n        internal void fireRefsChanged()\n        {\n            var @event = new RefsChangedEventArgs(this);\n            List<RepositoryListener> all;\n            lock (listeners)\n            {\n                all = new List<RepositoryListener>(listeners);\n            }\n            lock (allListeners)\n            {\n                all.AddRange(allListeners);\n            }\n            foreach (RepositoryListener l in all)\n            {\n                l.refsChanged(@event);\n            }\n        }\n\n        internal void fireIndexChanged()\n        {\n            var @event = new IndexChangedEventArgs(this);\n            List<RepositoryListener> all;\n            lock (listeners)\n            {\n                all = new List<RepositoryListener>(listeners);\n            }\n            lock (allListeners)\n            {\n                all.AddRange(allListeners);\n            }\n            foreach (RepositoryListener l in all)\n            {\n                l.indexChanged(@event);\n            }\n        }\n\n        /**\n * Force a scan for changed refs.\n *\n * @throws IOException\n */\n        public void scanForRepoChanges()\n        {\n            getAllRefs(); // This will look for changes to refs\n            var index = Index; // This will detect changes in the index\n        }\n        /// <summary>\n        /// Gets the <see cref=\"Repository\"/> state\n        /// </summary>\n        public RepositoryState RespositoryState\n        {\n            get\n            {\n                // Pre Git-1.6 logic\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \".dotest\")).Exists)\n                {\n                    return RepositoryState.Rebasing;\n                }\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \".dotest-merge\")).Exists)\n                {\n                    return RepositoryState.RebasingInteractive;\n                }\n\n                // From 1.6 onwards\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"rebase-apply/rebasing\")).Exists)\n                {\n                    return RepositoryState.RebasingRebasing;\n                }\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"rebase-apply/applying\")).Exists)\n                {\n                    return RepositoryState.Apply;\n                }\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"rebase-apply\")).Exists)\n                {\n                    return RepositoryState.Rebasing;\n                }\n\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"rebase-merge/interactive\")).Exists)\n                {\n                    return RepositoryState.RebasingInteractive;\n                }\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"rebase-merge\")).Exists)\n                {\n                    return RepositoryState.RebasingMerge;\n                }\n\n                // Both versions\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"MERGE_HEAD\")).Exists)\n                {\n                    return RepositoryState.Merging;\n                }\n\n                if (new FileInfo(Path.Combine(WorkingDirectory.FullName, \"BISECT_LOG\")).Exists)\n                {\n                    return RepositoryState.Bisecting;\n                }\n\n                return RepositoryState.Safe;\n            }\n        }\n\n        /// <returns>mutable map of all known refs (heads, tags, remotes).</returns>\n        public IDictionary<string, Ref> getAllRefs()\n        {\n            try\n            {\n                return _refDb.getRefs(RefDatabase.ALL);\n            }\n            catch (IOException)\n            {\n                return new Dictionary<string, Ref>();\n            }\n        }\n\n        public Ref getRef(string name)\n        {\n            return _refDb.getRef(name);\n        }\n\n        /// <returns>\n        /// mutable map of all tags; key is short tag name (\"v1.0\") and value\n        /// of the entry contains the ref with the full tag name\n        /// (\"refs/tags/v1.0\").\n        /// </returns>\n        public IDictionary<string, Ref> getTags()\n        {\n            try\n            {\n                return _refDb.getRefs(Constants.R_TAGS);\n            }\n            catch (IOException)\n            {\n                return new Dictionary<string, Ref>();\n            }\n        }\n\n        public Ref Head\n        {\n            get { return getRef(Constants.HEAD); }\n        }\n\n        public Ref Peel(Ref pRef)\n        {\n            try\n            {\n                return _refDb.peel(pRef);\n            }\n            catch (IOException)\n            {\n                // Historical accident; if the reference cannot be peeled due\n                // to some sort of repository access problem we claim that the\n                // same as if the reference was not an annotated tag.\n                return pRef;\n            }\n        }\n\n        /**\n\t     * @return a map with all objects referenced by a peeled ref.\n\t     */\n        public Dictionary<AnyObjectId, List<Ref>> getAllRefsByPeeledObjectId()\n        {\n            IDictionary<string, Ref> allRefs = getAllRefs();\n            var ret = new Dictionary<AnyObjectId, List<Ref>>(allRefs.Count);\n            foreach (Ref @ref in allRefs.Values)\n            {\n                Ref ref2 = @ref;\n                ref2 = Peel(ref2);\n                AnyObjectId target = ref2.PeeledObjectId;\n                if (target == null)\n                    target = ref2.ObjectId;\n                // We assume most Sets here are singletons\n                List<Ref> oset = ret.put(target, new List<Ref> { ref2 });\n                if (oset != null)\n                {\n                    // that was not the case (rare)\n                    if (oset.Count == 1)\n                    {\n                        // Was a read-only singleton, we must copy to a new Set\n                        oset = new List<Ref>(oset);\n                    }\n                    ret.put(target, oset);\n                    oset.Add(ref2);\n                }\n            }\n            return ret;\n        }\n\n        public static Repository Open(string directory)\n        {\n            return Open(new DirectoryInfo(directory));\n        }\n\n        public static Repository Open(DirectoryInfo directory)\n        {\n            var name = directory.FullName;\n            if (name.EndsWith(Constants.DOT_GIT_EXT))\n            {\n                return new Repository(directory);\n            }\n\n            var subDirectories = directory.GetDirectories(Constants.DOT_GIT);\n            if (subDirectories.Length > 0)\n            {\n                return new Repository(subDirectories[0]);\n            }\n\n            if (directory.Parent == null) return null;\n\n            return Open(directory.Parent);\n        }\n\n        /// <summary>\n        /// Check validity of a ref name. It must not contain character that has\n        /// a special meaning in a Git object reference expression. Some other\n        /// dangerous characters are also excluded.\n        /// </summary>\n        /// <param name=\"refName\"></param>\n        /// <returns>\n        /// Returns true if <paramref name=\"refName\"/> is a valid ref name.\n        /// </returns>\n        public static bool IsValidRefName(string refName)\n        {\n            int len = refName.Length;\n\n            if (len == 0) return false;\n\n            if (refName.EndsWith(LockFile.SUFFIX)) return false;\n\n            int components = 1;\n            char p = '\\0';\n            for (int i = 0; i < len; i++)\n            {\n                char c = refName[i];\n                if (c <= ' ') return false;\n\n                switch (c)\n                {\n                    case '.':\n                        switch (p)\n                        {\n                            case '\\0':\n                            case '/':\n                            case '.':\n                                return false;\n                        }\n\n                        if (i == len - 1) return false;\n                        break;\n\n                    case '/':\n                        if (i == 0 || i == len - 1) return false;\n                        components++;\n                        break;\n\n                    case '{':\n                        if (p == '@') return false;\n                        break;\n\n                    case '~':\n                    case '^':\n                    case ':':\n                    case '?':\n                    case '[':\n                    case '*':\n                    case '\\\\':\n                        return false;\n                }\n                p = c;\n            }\n\n            return components > 1;\n        }\n\n        public Commit OpenCommit(ObjectId id)\n        {\n            return MapCommit(id);\n        }\n\n        public override string ToString()\n        {\n            return \"Repository[\" + Directory + \"]\";\n        }\n\n        public void Dispose()\n        {\n            Close();\n        }\n\n        /// <summary>\n        /// Get the name of the reference that {@code HEAD} points to.\n        /// Returns name of current branch (for example {@code refs/heads/master}) or\n        /// an ObjectId in hex format if the current branch is detached.\n        /// <para/>\n        /// This is essentially the same as doing:\n        /// \n        /// <code>\n        /// return getRef(Constants.HEAD).getTarget().getName()\n        /// </code>\n        /// \n        /// Except when HEAD is detached, in which case this method returns the\n        /// current ObjectId in hexadecimal string format.\n        /// </summary>\n        public string FullBranch\n        {\n            get\n            {\n                Ref head = getRef(Constants.HEAD);\n\n                if (head == null)\n                    return null;\n                if (head.isSymbolic())\n                    return head.getTarget().getName();\n                if (head.getObjectId() != null)\n                    return head.getObjectId().Name;\n                return null;\n\n            }\n        }\n\n        /// <summary>\n        /// Get the short name of the current branch that {@code HEAD} points to.\n        /// <para/>\n        /// This is essentially the same as {@link #getFullBranch()}, except the\n        /// leading prefix {@code refs/heads/} is removed from the reference before\n        /// it is returned to the caller.\n        /// </summary>\n        /// <returns>\n        /// name of current branch (for example {@code master}), or an\n        /// ObjectId in hex format if the current branch is detached.\n        /// </returns>\n        public string getBranch()\n        {\n            string name = FullBranch;\n            if (name != null)\n                return ShortenRefName(name);\n            return name;\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"refName\"></param>\n        /// <returns>A more user friendly ref name</returns>\n        public string ShortenRefName(string refName)\n        {\n            if (refName.StartsWith(Constants.R_HEADS))\n            {\n                return refName.Substring(Constants.R_HEADS.Length);\n            }\n\n            if (refName.StartsWith(Constants.R_TAGS))\n            {\n                return refName.Substring(Constants.R_TAGS.Length);\n            }\n\n            if (refName.StartsWith(Constants.R_REMOTES))\n            {\n                return refName.Substring(Constants.R_REMOTES.Length);\n            }\n\n            return refName;\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"refName\"></param>\n        /// <returns>\n        /// A <see cref=\"ReflogReader\"/> for the supplied <paramref name=\"refName\"/>,\n        /// or null if the named ref does not exist.\n        /// </returns>\n        /// <exception cref=\"IOException\">The <see cref=\"Ref\"/> could not be accessed.</exception>\n        public ReflogReader ReflogReader(string refName)\n        {\n            Ref gitRef = getRef(refName);\n            if (gitRef != null)\n            {\n                return new ReflogReader(this, gitRef.Name);\n            }\n\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RepositoryCache.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public class RepositoryCache\n    {\n        private static readonly RepositoryCache Cache = new RepositoryCache();\n\n        public static RepositoryCache Instance\n        {\n            get { return Cache; }\n        }\n\n        public static Repository open(Key location)\n        {\n            return open(location, true);\n        }\n\n        public static Repository open(Key location, bool mustExist)\n        {\n            return Cache.openRepository(location, mustExist);\n        }\n\n        public static void register(Repository db)\n        {\n\t\t\tif (db == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"db\");\n\t\t\t\n            Cache.registerRepository(FileKey.exact(db.Directory), db);\n        }\n\n        public static void close(Repository db)\n        {\n\t\t\tif (db == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"db\");\n\t\t\t\n            Cache.unregisterRepository(FileKey.exact(db.Directory));\n        }\n\n        public static void clear()\n        {\n            Cache.clearAll();\n        }\n\n        private readonly Dictionary<Key, WeakReference<Repository>> cacheMap;\n        private readonly Lock[] openLocks;\n\n        public RepositoryCache()\n        {\n            cacheMap = new Dictionary<Key, WeakReference<Repository>>();\n            openLocks = new Lock[4];\n            for (int i = 0; i < openLocks.Length; i++)\n                openLocks[i] = new Lock();\n        }\n\n        private Repository openRepository(Key location, bool mustExist)\n        {\n            WeakReference<Repository> @ref = cacheMap.GetValue(location);\n            Repository db = @ref != null ? @ref.get() : null;\n\n            if (db == null)\n            {\n                lock (lockFor(location))\n                {\n                    @ref = cacheMap.GetValue(location);\n                    db = @ref != null ? @ref.get() : null;\n                    if (db == null)\n                    {\n                        db = location.open(mustExist);\n                        @ref = new WeakReference<Repository>(db);\n                        cacheMap.AddOrReplace(location, @ref);\n                    }\n                }\n            }\n\n            db.IncrementOpen();\n            return db;\n        }\n\n        private void registerRepository(Key location, Repository db)\n        {\n            db.IncrementOpen();\n            WeakReference<Repository> newRef = new WeakReference<Repository>(db);\n            WeakReference<Repository> oldRef = cacheMap.put(location, newRef);\n            Repository oldDb = oldRef != null ? oldRef.get() : null;\n            if (oldDb != null)\n                oldDb.Dispose();\n\n        }\n\n        private void unregisterRepository(Key location)\n        {\n            WeakReference<Repository> oldRef = cacheMap.GetValue(location);\n            cacheMap.Remove(location);\n            Repository oldDb = oldRef != null ? oldRef.get() : null;\n            if (oldDb != null)\n                oldDb.Dispose();\n        }\n\n        private void clearAll()\n        {\n            for (int stage = 0; stage < 2; stage++)\n            {\n                var keysToRemove = new List<Key>();\n\n                foreach (KeyValuePair<Key, WeakReference<Repository>> e in cacheMap)\n                {\n                    Repository db = e.Value.get();\n                    if (db != null)\n                        db.Dispose();\n\n                    keysToRemove.Add(e.Key);\n                }\n\n                foreach (Key key in keysToRemove)\n                {\n                    cacheMap.Remove(key);\n                }\n            }\n        }\n\n        private Lock lockFor(Key location)\n        {\n            return openLocks[(((uint) location.GetHashCode()) >> 1)%openLocks.Length];\n        }\n\n        private class Lock\n        {\n        } ;\n\n        public interface Key\n        {\n            Repository open(bool mustExist);\n        }\n\n        public class FileKey : Key\n        {\n            public static FileKey exact(DirectoryInfo dir)\n            {\n                return new FileKey(dir);\n            }\n\n            public static FileKey lenient(DirectoryInfo dir)\n            {\n                DirectoryInfo gitdir = resolve(dir);\n                return new FileKey(gitdir ?? dir);\n            }\n\n            private readonly DirectoryInfo path;\n\n            public FileKey(DirectoryInfo dir)\n            {\n                path = dir;\n            }\n\n            public DirectoryInfo getFile()\n            {\n                return path;\n            }\n\n            public Repository open(bool mustExist)\n            {\n                if (mustExist && !isGitRepository(path))\n                    throw new RepositoryNotFoundException(path);\n                return new Repository(path);\n            }\n\n            public override int GetHashCode()\n            {\n                return path.FullName.GetHashCode();\n            }\n\n            public override bool Equals(object obj)\n            {\n\t\t\t\tFileKey fk = (obj as FileKey);\n\t\t\t\tif ( fk != null)\n\t\t\t\t{\n\t\t\t\t\treturn path.FullName.Equals(fk.path.FullName);\n\t\t\t\t}\n\t\t\t\t\n                return false;\n            }\n\n            public override string ToString()\n            {\n                return path.FullName;\n            }\n\n            public static bool isGitRepository(DirectoryInfo dir)\n            {\n                return FS.resolve(dir, \"objects\").Exists && FS.resolve(dir, \"refs\").Exists &&\n                       isValidHead(new FileInfo(Path.Combine(dir.FullName, Constants.HEAD)));\n            }\n\n            private static bool isValidHead(FileInfo head)\n            {\n                string r = readFirstLine(head);\n                return head.Exists && r != null && (r.StartsWith(\"ref: refs/\") || ObjectId.IsId(r));\n            }\n\n            private static string readFirstLine(FileInfo head)\n            {\n                try\n                {\n                    byte[] buf = IO.ReadFully(head, 4096);\n                    int n = buf.Length;\n                    if (n == 0)\n                        return null;\n                    if (buf[n - 1] == '\\n')\n                        n--;\n                    return RawParseUtils.decode(buf, 0, n);\n                }\n                catch (IOException)\n                {\n                    return null;\n                }\n            }\n\n        \tprivate static DirectoryInfo resolve(DirectoryInfo directory)\n            {\n                if (isGitRepository(directory))\n                {\n                    return directory;\n                }\n\n                if (isGitRepository(PathUtil.CombineDirectoryPath(directory, Constants.DOT_GIT)))\n\t\t\t\t{\n                    return PathUtil.CombineDirectoryPath(directory, Constants.DOT_GIT);\n\t\t\t\t}\n\n                string name = directory.Name;\n                DirectoryInfo parent = directory.Parent;\n                if (isGitRepository(new DirectoryInfo(Path.Combine(parent.FullName, name + Constants.DOT_GIT_EXT))))\n                {\n                    return new DirectoryInfo(Path.Combine(parent.FullName, name + Constants.DOT_GIT_EXT));\n                }\n\n                return null;\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/RepositoryChangedEventArgs.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Robin Rosenberg <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core\n{\n\t\n\t\n\tpublic class RepositoryChangedEventArgs : EventArgs\n\t{\n\t\tpublic Repository Repository { get; internal set;}\n\t\t\n\t\tpublic RepositoryChangedEventArgs(Repository repository)\n\t\t{\n\t\t\tthis.Repository = repository;\n\t\t}\n\t\t\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format(\"RespositoryChangedEventArgs[{0}]\", Repository);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RepositoryConfig.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Thad Hughes <thadh@thad.corp.google.com>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\n    public class RepositoryConfig : FileBasedConfig\n    {\n        public const string BRANCH_SECTION = \"branch\";\n\n        public RepositoryConfig(Repository repo)\n            : this(SystemReader.getInstance().openUserConfig(), new FileInfo(Path.Combine(repo.Directory.FullName, \"config\")))\n        {\n\t\t\tif (repo == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"repo\");\n            \n        }\n\n        public RepositoryConfig(Config @base, FileInfo cfgLocation)\n            : base(@base, cfgLocation)\n        {\n            \n        }\n\n        public CoreConfig getCore()\n        {\n            return get(CoreConfig.KEY);\n        }\n\n        public TransferConfig getTransfer()\n        {\n            return get(TransferConfig.KEY);\n        }\n\n        public UserConfig getUserConfig()\n        {\n            return get(UserConfig.KEY);\n        }\n\n        public string getAuthorName()\n        {\n            return getUserConfig().getAuthorName();\n        }\n\n        public string getCommitterName()\n        {\n            return getUserConfig().getCommitterName();\n        }\n\n        public string getAuthorEmail()\n        {\n            return getUserConfig().getAuthorEmail();\n        }\n\n        public string getCommitterEmail()\n        {\n            return getUserConfig().getCommitterEmail();\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/RepositoryListener.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n    public interface RepositoryListener\n    {\n        /**\n\t * Invoked when a ref changes\n\t *\n\t * @param e\n\t *            information about the changes.\n\t */\n        void refsChanged(RefsChangedEventArgs e);\n\n        /**\n         * Invoked when the index changes\n         *\n         * @param e\n         *            information about the changes.\n         */\n        void indexChanged(IndexChangedEventArgs e);\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/RepositoryState.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com> \n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    [Complete]\n    public sealed class RepositoryState\n    {\n        public readonly static RepositoryState Apply = new RepositoryState(false, false, true, \"Apply mailbox\");\n        public readonly static RepositoryState Safe = new RepositoryState(true, true, true, \"Normal\");\n        public readonly static RepositoryState Merging = new RepositoryState(false, false, false, \"Conflicts\");\n        public readonly static RepositoryState Rebasing = new RepositoryState(false, false, true, \"Rebase/Apply mailbox\");\n        public readonly static RepositoryState RebasingRebasing = new RepositoryState(false, false, true, \"Rebase\");\n        public readonly static RepositoryState RebasingMerge = new RepositoryState(false, false, true, \"Rebase w/merge\");\n        public readonly static RepositoryState RebasingInteractive = new RepositoryState(false, false, true, \"Rebase interactive\");\n        public readonly static RepositoryState Bisecting = new RepositoryState(true, false, false, \"Bisecting\");\n\n        public bool CanCheckout { get; private set; }\n        public bool CanResetHead { get; private set; }\n        public bool CanCommit { get; private set; }\n        public string Description { get; private set; }\n\n        private RepositoryState(bool checkout, bool resetHead, bool commit, string description)\n        {\n            this.CanCheckout = checkout;\n            this.CanResetHead = resetHead;\n            this.CanCommit = commit;\n            this.Description = description;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/RevPlot/AbstractPlotRenderer.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.RevPlot;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.RevPlot \n{\n\t/// <summary>\n\t/// Basic commit graph renderer for graphical user interfaces.\n\t/// <para>\n\t/// Lanes are drawn as columns left-to-right in the graph, and the commit short\n\t/// message is drawn to the right of the lane lines for this cell. It is assumed\n\t/// that the commits are being drawn as rows of some sort of table.\n\t/// </para>\n\t/// <para>\n\t/// Client applications can subclass this implementation to provide the necessary\n\t/// drawing primitives required to display a commit graph. Most of the graph\n\t/// layout is handled by this class, allowing applications to implement only a\n\t/// handful of primitive stubs.\n\t/// </para>\n\t/// <para>\n\t/// This class is suitable for us within an AWT TableCellRenderer or within a SWT\n\t/// PaintListener registered on a Table instance. It is meant to rubber stamp the\n\t/// graphics necessary for one row of a plotted commit list.\n\t/// </para>\n\t/// <para>\n\t/// Subclasses should call {@link #paintCommit(PlotCommit, int)} after they have\n\t/// otherwise configured their instance to draw one commit into the current\n\t/// location.\n\t/// </para>\n\t/// <para>\n\t/// All drawing methods assume the coordinate space for the current commit's cell\n\t/// starts at (upper left corner is) 0,0. If this is not true (like say in SWT)\n\t/// the implementation must perform the cell offset computations within the\n\t/// various draw methods.\n\t/// </para>\n\t/// </summary>\n\t/// <typeparam name=\"TColor\">type of color object used by the graphics library.</typeparam>\n\tpublic abstract class AbstractPlotRenderer<TColor> {\n\t\tprivate static int LANE_WIDTH = 14;\n\t\n\t\tprivate static int LINE_WIDTH = 2;\n\t\n\t\tprivate static int LEFT_PAD = 2;\n\t\n\t    /// <summary>\n\t    /// Paint one commit using the underlying graphics library.\n\t    /// </summary>\n\t    /// <param name=\"commit\">the commit to render in this cell. Must not be null.</param>\n\t    /// <param name=\"h\">total height (in pixels) of this cell.</param>\n\t    protected virtual void paintCommit(PlotCommit commit, int h) {\n\t\t\tif (commit == null)\n\t\t\t\tthrow new ArgumentNullException (\"commit\");\n\t\t\t\n\t\t\tint dotSize = computeDotSize(h);\n\t\t\tPlotLane myLane = commit.getLane();\n\t\t\tint myLaneX = laneC(myLane);\n\t\t\tTColor myColor = laneColor(myLane);\n\t\n\t\t\tint maxCenter = 0;\n\t\t\tforeach (PlotLane passingLane in (PlotLane[]) commit.passingLanes) {\n\t\t\t\tint cx = laneC(passingLane);\n\t\t\t\tTColor c = laneColor(passingLane);\n\t\t\t\tdrawLine(c, cx, 0, cx, h, LINE_WIDTH);\n\t\t\t\tmaxCenter = Math.Max(maxCenter, cx);\n\t\t\t}\n\t\n\t\t\tint nParent = commit.ParentCount;\n\t\t\tfor (int i = 0; i < nParent; i++) {\n\t\t\t\tPlotCommit p;\n\t\t\t\tPlotLane pLane;\n\t\t\t\tTColor pColor;\n\t\t\t\tint cx;\n\t\n\t\t\t\tp = (PlotCommit) commit.GetParent(i);\n\t\t\t\tpLane = p.getLane();\n\t\t\t\tif (pLane == null)\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\tpColor = laneColor(pLane);\n\t\t\t\tcx = laneC(pLane);\n\t\n\t\t\t\tif (Math.Abs(myLaneX - cx) > LANE_WIDTH) {\n\t\t\t\t\tif (myLaneX < cx) {\n\t\t\t\t\t\tint ix = cx - LANE_WIDTH / 2;\n\t\t\t\t\t\tdrawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);\n\t\t\t\t\t\tdrawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint ix = cx + LANE_WIDTH / 2;\n\t\t\t\t\t\tdrawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);\n\t\t\t\t\t\tdrawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdrawLine(pColor, myLaneX, h / 2, cx, h, LINE_WIDTH);\n\t\t\t\t}\n\t\t\t\tmaxCenter = Math.Max(maxCenter, cx);\n\t\t\t}\n\t\n\t\t\tint dotX = myLaneX - dotSize / 2 - 1;\n\t\t\tint dotY = (h - dotSize) / 2;\n\t\n\t\t\tif (commit.getChildCount() > 0)\n\t\t\t\tdrawLine(myColor, myLaneX, 0, myLaneX, dotY, LINE_WIDTH);\n\t\n\t\t\tif (commit.has(RevFlag.UNINTERESTING))\n\t\t\t\tdrawBoundaryDot(dotX, dotY, dotSize, dotSize);\n\t\t\telse\n\t\t\t\tdrawCommitDot(dotX, dotY, dotSize, dotSize);\n\t\n\t\t\tint textx = Math.Max(maxCenter + LANE_WIDTH / 2, dotX + dotSize) + 8;\n\t\t\tint n = commit.refs == null ? 0 : commit.refs.Length;\n\t\t\tfor (int i = 0; i < n; ++i) {\n\t\t\t\ttextx += drawLabel(textx + dotSize, h/2, commit.refs[i]);\n\t\t\t}\n\t\n\t\t\tString msg = commit.getShortMessage();\n\t\t\tdrawText(msg, textx + dotSize + n*2, h / 2);\n\t\t}\n\t\n\t\t/// <summary>\n\t    /// Draw a decoration for the Ref ref at x,y\n\t\t/// </summary>\n\t\t/// <param name=\"x\">left</param>\n\t\t/// <param name=\"y\">top</param>\n\t\t/// <param name=\"ref\">A peeled ref</param>\n\t    /// <returns>width of label in pixels</returns>\n\t    protected abstract int drawLabel(int x, int y, Ref @ref);\n\t\n\t\tprivate int computeDotSize(int h) {\n\t\t\tint d = (int) (Math.Min(h, LANE_WIDTH) * 0.50f);\n\t\t\td += (d & 1);\n\t\t\treturn d;\n\t\t}\n\t\n\t    /// <summary>\n\t    /// Obtain the color reference used to paint this lane.\n\t\t /// <para>\n\t\t /// Colors returned by this method will be passed to the other drawing\n\t\t /// primitives, so the color returned should be application specific.\n\t\t /// </para>\n\t\t /// <para>\n\t\t /// If a null lane is supplied the return value must still be acceptable to a\n\t\t /// drawing method. Usually this means the implementation should return a\n\t\t /// default color.\n\t    /// </para>\n\t    /// </summary>\n\t    /// <param name=\"myLane\">the current lane. May be null.</param>\n\t    /// <returns>graphics specific color reference. Must be a valid color.</returns>\n\t    protected abstract TColor laneColor(PlotLane myLane);\n\t\n\t\t/// <summary>\n\t    /// Draw a single line within this cell. \n\t\t/// </summary>\n\t    /// <param name=\"color\">the color to use while drawing the line.</param>\n\t    /// <param name=\"x1\">starting X coordinate, 0 based.</param>\n\t    /// <param name=\"y1\">starting Y coordinate, 0 based.</param>\n\t    /// <param name=\"x2\">ending X coordinate, 0 based.</param>\n\t    /// <param name=\"y2\">ending Y coordinate, 0 based.</param>\n\t    /// <param name=\"width\">number of pixels wide for the line. Always at least 1.</param>\n\t    protected abstract void drawLine(TColor color, int x1, int y1, int x2,\n\t\t\t\tint y2, int width);\n\t\n\t    /// <summary>\n\t    /// Draw a single commit dot.\n\t    /// <para>\n\t    /// Usually the commit dot is a filled oval in blue, then a drawn oval in\n\t    /// black, using the same coordinates for both operations.\n\t    /// </para>\n\t    /// </summary>\n\t    /// <param name=\"x\">upper left of the oval's bounding box.</param>\n\t    /// <param name=\"y\">upper left of the oval's bounding box.</param>\n\t    /// <param name=\"w\">width of the oval's bounding box.</param>\n\t    /// <param name=\"h\">height of the oval's bounding box.</param>\n\t\tprotected abstract void drawCommitDot(int x, int y, int w, int h);\n\t\n\t    /// <summary>\n\t    /// Draw a single boundary commit (aka uninteresting commit) dot.\n\t    /// <para>\n\t    /// Usually a boundary commit dot is a light gray oval with a white center.</para>\n\t    /// </summary>\n\t    /// <param name=\"x\">upper left of the oval's bounding box.</param>\n\t    /// <param name=\"y\">upper left of the oval's bounding box.</param>\n\t    /// <param name=\"w\">width of the oval's bounding box.</param>\n\t    /// <param name=\"h\">height of the oval's bounding box.</param>\n\t    protected abstract void drawBoundaryDot(int x, int y, int w, int h);\n\t\n\t    /// <summary>\n\t    /// Draw a single line of text.\n\t    /// <para>\n\t    /// The font and colors used to render the text are left up to the\n\t    /// implementation.\n\t    /// </para>\n\t    /// </summary>\n\t    /// <param name=\"msg\">the text to draw. Does not contain LFs.</param>\n\t    /// <param name=\"x\">first pixel from the left that the text can be drawn at. Character data must not appear before this position.</param>\n\t    /// <param name=\"y\">pixel coordinate of the centerline of the text. Implementations must adjust this coordinate to account for the way their implementation handles font rendering.</param>\n\t\tprotected abstract void drawText(String msg, int x, int y);\n\t\n\t\tprivate int laneX(PlotLane myLane) {\n\t\t\tint p = myLane != null ? myLane.getPosition() : 0;\n\t\t\treturn LEFT_PAD + LANE_WIDTH * p;\n\t\t}\n\t\n\t\tprivate int laneC(PlotLane myLane) {\n\t\t\treturn laneX(myLane) + LANE_WIDTH / 2;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevPlot/PlotCommit.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.RevPlot\n{\n    /// <summary>\n    /// A commit reference to a commit in the DAG.\n    /// </summary>\n    public class PlotCommit : RevCommit\n    {\n\n        /// <summary>\n        /// Obtain the lane this commit has been plotted into.\n        /// </summary>\n        /// <returns>the assigned lane for this commit.</returns>\n        public PlotLane getLane()\n        {\n            return lane;\n        }\n\n        static PlotCommit[] NO_CHILDREN = { };\n\n        static PlotLane[] NO_LANES = { };\n\n        public PlotLane[] passingLanes;\n\n        public PlotLane lane;\n\n        public PlotCommit[] children;\n\n        public Ref[] refs;\n\n        /// <summary>\n        /// Create a new commit.\n        /// </summary>\n        /// <param name=\"id\">the identity of this commit.</param>\n        /// <param name=\"tags\">the tags associated with this commit, null for no tags</param>\n        public PlotCommit(AnyObjectId id, Ref[] tags) : base(id)\n        {\n            this.refs = tags;\n            passingLanes = NO_LANES;\n            children = NO_CHILDREN;\n        }\n\n        public void addPassingLane(PlotLane c) {\n            int cnt = passingLanes.Length;\n            if (cnt == 0)\n                passingLanes = new PlotLane[] { c };\n            else if (cnt == 1)\n                passingLanes = new PlotLane[] { passingLanes[0], c };\n            else {\n                PlotLane[] n = new PlotLane[cnt + 1];\n                System.Array.Copy(passingLanes, 0, n, 0, cnt);\n                n[cnt] = c;\n                passingLanes = n;\n            }\n        }\n\n        public void addChild(PlotCommit c)\n        {\n            int cnt = children.Length;\n            if (cnt == 0)\n                children = new PlotCommit[] { c };\n            else if (cnt == 1)\n                children = new PlotCommit[] { children[0], c };\n            else\n            {\n                var n = new PlotCommit[cnt + 1];\n                System.Array.Copy(children, 0, n, 0, cnt);\n                n[cnt] = c;\n                children = n;\n            }\n        }\n\n\n        /// <summary>\n        /// Get the number of child commits listed in this commit.\n        /// </summary>\n        /// <returns>number of children; always a positive value but can be 0.</returns>\n        public int getChildCount()\n        {\n            return children.Length;\n        }\n\n        /// <summary>\n        /// Get the nth child from this commit's child list.\n        /// </summary>\n        /// <param name=\"nth\">child index to obtain. Must be in the range 0 through <see cref=\"getChildCount\"/>() - 1</param>\n        /// <returns>the specified child.</returns>\n        public PlotCommit getChild(int nth)\n        {\n            return children[nth];\n        }\n\n        /// <summary>\n        /// Determine if the given commit is a child (descendant) of this commit.\n        /// </summary>\n        /// <param name=\"c\">the commit to test.</param>\n        /// <returns>true if the given commit built on top of this commit.</returns>\n        public bool isChild(PlotCommit c)\n        {\n            foreach (PlotCommit a in children)\n                if (a == c)\n                    return true;\n            return false;\n        }\n\n        public override void reset()\n        {\n            passingLanes = NO_LANES;\n            children = NO_CHILDREN;\n            lane = null;\n            base.reset();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevPlot/PlotCommitList.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.RevPlot\n{\n    /// <summary>\n    /// An ordered list of <see cref=\"PlotCommit\"/> subclasses.\n    /// <para>\n    /// Commits are allocated into lanes as they enter the list, based upon their\n    /// connections between descendant (child) commits and ancestor (parent) commits.\n    /// </para>\n    /// <para>\n    /// The source of the list must be a {@link PlotWalk} and {@link #fillTo(int)}\n    /// must be used to populate the list.\n    /// </para>\n    /// </summary>\n    public class PlotCommitList :\n        RevCommitList<PlotCommit> {\n        private int lanesAllocated;\n\n        private SortedList<int, int> freeLanes = new SortedList<int, int>();\n\n        private HashSet<PlotLane> activeLanes = new HashSet<PlotLane>(); // was new HashSet<PlotLane>(32);\n\n        public override void clear() {\n            base.clear();\n            lanesAllocated = 0;\n            freeLanes.Clear();\n            activeLanes.Clear();\n        }\n\n        public override void Source(RevWalk.RevWalk walker) {\n            if (!(walker is PlotWalk))\n                throw new ArgumentException(\"Not a \" + typeof(PlotWalk).FullName);\n            base.Source(walker);\n        }\n        \n        /// <summary>\n        /// Find the set of lanes passing through a commit's row.\n        /// <para>Lanes passing through a commit are lanes that the commit is not directly\n        /// on, but that need to travel through this commit to connect a descendant\n        /// (child) commit to an ancestor (parent) commit. Typically these lanes will\n        /// be drawn as lines in the passed commit's box, and the passed commit won't\n        /// appear to be connected to those lines.</para>\n        /// <para>This method modifies the passed collection by adding the lanes in any order.</para>\n        /// </summary>\n        /// <param name=\"currCommit\">the commit the caller needs to get the lanes from.</param>\n        /// <param name=\"result\">collection to add the passing lanes into.</param>\n        public void findPassingThrough(PlotCommit currCommit,\n                                       Collection<PlotLane> result) \n\t\t{\n\t\t\tif (currCommit == null)\n\t\t\t\tthrow new ArgumentNullException (\"currCommit\");\n        \tif (result == null)\n\t\t\t\tthrow new ArgumentNullException (\"result\");\n\t\t\t\n            foreach (PlotLane p in currCommit.passingLanes)\n                result.Add((PlotLane) p);\n        }\n\n        protected override void enter(int index, PlotCommit currCommit) {\n            setupChildren(currCommit);\n\n            int nChildren = currCommit.getChildCount();\n            if (nChildren == 0)\n                return;\n\n            if (nChildren == 1 && currCommit.children[0].ParentCount < 2) {\n                // Only one child, child has only us as their parent.\n                // Stay in the same lane as the child.\n                //\n                PlotCommit c = currCommit.children[0];\n                if (c.lane == null) {\n                    // Hmmph. This child must be the first along this lane.\n                    //\n                    c.lane = nextFreeLane();\n                    activeLanes.Add(c.lane);\n                }\n\n                for (int r = index - 1; r >= 0; r--) {\n                    PlotCommit rObj = get(r);\n                    if (rObj == c)\n                        break;\n                    rObj.addPassingLane(c.lane);\n                }\n                currCommit.lane = c.lane;\n                currCommit.lane.parent = currCommit;\n            } else {\n                // More than one child, or our child is a merge.\n                // Use a different lane.\n                //\n\n                for (int i = 0; i < nChildren; i++) {\n                    PlotCommit c = currCommit.children[i];\n                    if (activeLanes.Remove(c.lane)) {\n                        recycleLane(c.lane);\n                        freeLanes.Add(c.lane.getPosition(), c.lane.getPosition());\n                    }\n                }\n\n                currCommit.lane = nextFreeLane();\n                currCommit.lane.parent = currCommit;\n                activeLanes.Add(currCommit.lane);\n\n                int remaining = nChildren;\n                for (int r = index - 1; r >= 0; r--) {\n                    PlotCommit rObj = get(r);\n                    if (currCommit.isChild(rObj)) {\n                        if (--remaining == 0)\n                            break;\n                    }\n                    rObj.addPassingLane(currCommit.lane);\n                }\n            }\n        }\n\n        private void setupChildren(PlotCommit currCommit) {\n            int nParents = currCommit.ParentCount;\n            for (int i = 0; i < nParents; i++)\n                ((PlotCommit)currCommit.GetParent(i)).addChild(currCommit);\n        }\n\n        private PlotLane nextFreeLane() {\n            PlotLane p = createLane();\n            if (freeLanes.Count == 0) {\n                p.position = lanesAllocated++;\n            } else {\n                int min = freeLanes.First().Key;\n                p.position = min;\n                freeLanes.Remove(min);\n            }\n            return p;\n        }\n\n        /// <returns>a new Lane appropriate for this particular PlotList.</returns>\n        protected PlotLane createLane()\n        {\n            return new PlotLane();\n        }\n\n        /// <summary>\n        /// Return colors and other reusable information to the plotter when a lane is no longer needed.\n        /// </summary>\n        protected void recycleLane(PlotLane lane)\n        {\n            // Nothing.\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevPlot/PlotLane.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.RevPlot\n{\n    /// <summary>\n    ///  A line space within the graph.\n    /// <para>Commits are strung onto a lane. For many UIs a lane represents a column.</para>\n    /// </summary>\n    public class PlotLane\n    {\n        public PlotCommit parent;\n\n        public int position;\n\n        /// <summary>\n        /// Logical location of this lane within the graphing plane.\n        /// </summary>\n        /// <returns>location of this lane, 0 through the maximum number of lanes.</returns>\n        public int getPosition() {\n            return position;\n        }\n\n        public int hashCode() {\n            return position;\n        }\n\n        public bool equals(Object o) {\n            return o == this;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevPlot/PlotWalk.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.RevPlot\n{\n    /// <summary>\n    /// Specialized RevWalk for visualization of a commit graph.\n    /// </summary>\n    public class PlotWalk : RevWalk.RevWalk {\n\n        private Dictionary<AnyObjectId, List<Ref>> reverseRefMap;\n\n        public override void Dispose() {\n            base.Dispose();\n            reverseRefMap.Clear();\n        }\n\n        /// <summary>\n        /// Create a new revision walker for a given repository.\n        /// </summary>\n        /// <param name=\"repo\">the repository the walker will obtain data from.</param>\n        public PlotWalk(Repository repo) : base(repo) {\n            base.sort(RevSort.TOPO, true);\n            reverseRefMap = repo.getAllRefsByPeeledObjectId();\n        }\n\n        public override void sort(RevSort.Strategy s, bool use) {\n            if (s == RevSort.TOPO && !use)\n                throw new ArgumentException(\"Topological sort required.\");\n            base.sort(s, use);\n        }\n\n        protected override RevCommit createCommit(AnyObjectId id) {\n            return new PlotCommit(id, getTags(id));\n        }\n\n        /// <returns>the list of knows tags referring to this commit</returns>\n        protected Ref[] getTags(AnyObjectId commitId) {\n            if (!reverseRefMap.ContainsKey(commitId))\n                return null;\n            Ref[] tags = reverseRefMap[commitId].ToArray();\n            Array.Sort(tags, new PlotRefComparator(Repository));\n            return tags;\n        }\n\n        class PlotRefComparator : IComparer<Ref> {\n            private readonly Repository _repository;\n\n            public PlotRefComparator(Repository repository)\n            {\n                _repository = repository;\n            }\n\n            public int Compare(Ref o1, Ref o2) {\n                try {\n                    Object obj1 = _repository.MapObject(o1.ObjectId, o1.Name);\n                    Object obj2 = _repository.MapObject(o2.ObjectId, o2.Name);\n                    long t1 = timeof(obj1);\n                    long t2 = timeof(obj2);\n                    if (t1 > t2)\n                        return -1;\n                    if (t1 < t2)\n                        return 1;\n                    return 0;\n                } catch (IOException) {\n                    // ignore\n                    return 0;\n                }\n            }\n            long timeof(Object o) {\n                if (o is Commit)\n                    return ((Commit)o).Committer.When;\n                if (o is Tag)\n                    return ((Tag)o).Tagger.When;\n                return 0;\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/AbstractRevQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\n\nnamespace GitSharp.Core.RevWalk\n{\n    public abstract class AbstractRevQueue : Generator\n    {\n        public static readonly AbstractRevQueue EmptyQueue = new AlwaysEmptyQueue();\n\n\t\tprivate readonly GeneratorOutputType _outputType;\n\n\t\tprotected AbstractRevQueue()\n\t\t{\n\t\t}\n\n    \tprotected AbstractRevQueue(GeneratorOutputType outputType)\n    \t{\n    \t\t_outputType = outputType;\n    \t}\n\n    \t/// <summary>\n        /// Add a commit to the queue.\n\t\t/// <para />\n\t\t/// This method always adds the commit, even if it is already in the queue or\n\t\t/// previously was in the queue but has already been removed. To control\n\t\t/// queue admission use <see cref=\"add(RevCommit, RevFlag)\"/>.\n        /// </summary>\n\t\t/// <param name=\"c\">Commit to add.</param>\n        public abstract void add(RevCommit c);\n\n        /**\n         * Add a commit if it does not have a flag set yet, then set the flag.\n         * <para />\n         * This method permits the application to test if the commit has the given\n         * flag; if it does not already have the flag than the commit is added to\n         * the queue and the flag is set. This later will prevent the commit from\n         * being added twice.\n         * \n         * @param c\n         *            commit to add.\n         * @param queueControl\n         *            flag that controls admission to the queue.\n         */\n        public void add(RevCommit c, RevFlag queueControl)\n        {\n            if (!c.has(queueControl))\n            {\n                c.add(queueControl);\n                add(c);\n            }\n        }\n\n        /// <summary>\n        /// Add a commit's parents if one does not have a flag set yet.\n\t\t/// <para />\n\t\t/// This method permits the application to test if the commit has the given\n\t\t/// flag; if it does not already have the flag than the commit is added to\n\t\t/// the queue and the flag is set. This later will prevent the commit from\n\t\t/// being added twice.\n        /// </summary>\n        /// <param name=\"c\">\n        /// commit whose parents should be added.\n        /// </param>\n        /// <param name=\"queueControl\">\n        /// flag that controls admission to the queue.\n        /// </param>\n        public void addParents(RevCommit c, RevFlag queueControl)\n        {\n            RevCommit[] pList = c.Parents;\n            if (pList == null) return;\n            foreach (RevCommit p in pList)\n            {\n            \tadd(p, queueControl);\n            }\n        }\n\n        /// <summary>\n\t\t/// Remove all entries from this queue.\n        /// </summary>\n        public abstract void clear();\n\n        internal abstract bool everbodyHasFlag(int f);\n\n        internal abstract bool anybodyHasFlag(int f);\n\n\t\t/// <summary>\n\t\t/// Current output flags set for this generator instance.\n\t\t/// </summary>\n        public override GeneratorOutputType OutputType\n        {\n\t\t\tget { return _outputType; }\n        }\n\n        protected static void Describe(StringBuilder s, RevCommit c)\n        {\n            s.Append(c.ToString());\n            s.Append('\\n');\n        }\n\n    \t#region Nested Types\n\n    \tpublic class AlwaysEmptyQueue : AbstractRevQueue\n    \t{\n    \t\tpublic override void add(RevCommit c)\n    \t\t{\n    \t\t\tthrow new InvalidOperationException();\n    \t\t}\n\n    \t\tpublic override RevCommit next()\n    \t\t{\n    \t\t\treturn null;\n    \t\t}\n\n    \t\tinternal override bool anybodyHasFlag(int f)\n    \t\t{\n    \t\t\treturn false;\n    \t\t}\n\n    \t\tinternal override bool everbodyHasFlag(int f)\n    \t\t{\n    \t\t\treturn true;\n    \t\t}\n\n    \t\tpublic override void clear()\n    \t\t{\n    \t\t\t// Nothing to clear, we have no state.\n    \t\t}\n\n    \t}\n\n    \t#endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/BlockObjQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\n    public class BlockObjQueue\n    {\n        private BlockFreeList free;\n\n        private Block head;\n\n        private Block tail;\n\n        /** Create an empty queue. */\n        public BlockObjQueue()\n        {\n            free = new BlockFreeList();\n        }\n\n        public void add(RevObject c)\n        {\n            Block b = tail;\n            if (b == null)\n            {\n                b = free.newBlock();\n                b.add(c);\n                head = b;\n                tail = b;\n                return;\n            }\n            else if (b.isFull())\n            {\n                b = free.newBlock();\n                tail.next = b;\n                tail = b;\n            }\n            b.add(c);\n        }\n\n        public RevObject next()\n        {\n            Block b = head;\n            if (b == null)\n                return null;\n\n            RevObject c = b.pop();\n            if (b.isEmpty())\n            {\n                head = b.next;\n                if (head == null)\n                    tail = null;\n                free.freeBlock(b);\n            }\n            return c;\n        }\n\n        public class BlockFreeList\n        {\n            private Block next;\n\n            public Block newBlock()\n            {\n                Block b = next;\n                if (b == null)\n                    return new Block();\n                next = b.next;\n                b.clear();\n                return b;\n            }\n\n            public void freeBlock(Block b)\n            {\n                b.next = next;\n                next = b;\n            }\n        }\n\n        public class Block\n        {\n            private static int BLOCK_SIZE = 256;\n\n            /** Next block in our chain of blocks; null if we are the last. */\n            public Block next;\n\n            /** Our table of queued objects. */\n            public RevObject[] objects = new RevObject[BLOCK_SIZE];\n\n            /** Next valid entry in {@link #objects}. */\n            public int headIndex;\n\n            /** Next free entry in {@link #objects} for addition at. */\n            public int tailIndex;\n\n            public bool isFull()\n            {\n                return tailIndex == BLOCK_SIZE;\n            }\n\n            public bool isEmpty()\n            {\n                return headIndex == tailIndex;\n            }\n\n            public void add(RevObject c)\n            {\n                objects[tailIndex++] = c;\n            }\n\n            public RevObject pop()\n            {\n                return objects[headIndex++];\n            }\n\n            public void clear()\n            {\n                next = null;\n                headIndex = 0;\n                tailIndex = 0;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/BlockRevQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n    public abstract class BlockRevQueue : AbstractRevQueue\n    {\n        private BlockFreeList _free;\n\n\t\t/// <summary>\n\t\t/// Create an empty revision queue.\n\t\t/// </summary>\n\t\tprotected BlockRevQueue()\n\t\t\t: base(GeneratorOutputType.None)\n\t\t{\n\t\t\t_free = new BlockFreeList();\n\t\t}\n\n        /// <summary>\n\t\t/// Create an empty revision queue.\n        /// </summary>\n    \tprotected BlockRevQueue(GeneratorOutputType outputType)\n\t\t\t: base(outputType)\n        {\n            _free = new BlockFreeList();\n        }\n\n    \tprotected BlockRevQueue(Generator s)\n\t\t\t: this(s.OutputType)\n        {\n\t\t\t_free = new BlockFreeList();\n            s.shareFreeList(this);\n        \n\t\t\twhile(true)\n            {\n                RevCommit c = s.next();\n                if (c == null) break;\n                add(c);\n            }\n        }\n\n\t\tpublic BlockFreeList Free\n\t\t{\n\t\t\tget { return _free; }\n\t\t}\n\n        /// <summary>\n        /// Reconfigure this queue to share the same free list as another.\n\t\t/// <para />\n\t\t/// Multiple revision queues can be connected to the same free list, making\n\t\t/// it less expensive for applications to shuttle commits between them. This\n\t\t/// method arranges for the receiver to take from / return to the same free\n\t\t/// list as the supplied queue.\n\t\t/// <para />\n\t\t/// Free lists are not thread-safe. Applications must ensure that all queues\n\t\t/// sharing the same free list are doing so from only a single thread.\n        /// </summary>\n\t\t/// <param name=\"q\">the other queue we will steal entries from.</param>\n        public override void shareFreeList(BlockRevQueue q)\n        {\n            _free = q._free;\n        }\n\n    \t#region Nested Types\n\n    \tpublic class BlockFreeList\n    \t{\n    \t\tprivate Block _next;\n\n    \t\tpublic Block newBlock()\n    \t\t{\n    \t\t\tBlock b = _next;\n    \t\t\tif (b == null)\n    \t\t\t{\n    \t\t\t\treturn new Block();\n    \t\t\t}\n    \t\t\t_next = b.Next;\n    \t\t\tb.clear();\n    \t\t\treturn b;\n    \t\t}\n\n    \t\tpublic void freeBlock(Block b)\n    \t\t{\n    \t\t\tb.Next = _next;\n    \t\t\t_next = b;\n    \t\t}\n\n    \t\tpublic void clear()\n    \t\t{\n    \t\t\t_next = null;\n    \t\t}\n    \t}\n\n    \tpublic class Block\n    \t{\n    \t\tpublic static readonly int BLOCK_SIZE = 256;\n    \t\tprivate readonly RevCommit[] _commits;\n\n    \t\tpublic Block()\n\t\t\t{\n\t\t\t\t_commits = new RevCommit[BLOCK_SIZE];\n\t\t\t}\n\n    \t\t/// <summary>\n    \t\t/// Next free entry in <see cref=\"Commits\"/> for addition at.\n    \t\t/// </summary>\n    \t\tpublic int TailIndex { get; set; }\n\n    \t\t/// <summary>\n    \t\t/// Next valid entry in <see cref=\"Commits\"/>.\n    \t\t/// </summary>\n    \t\tpublic int HeadIndex { get; set; }\n\n    \t\t/// <summary>\n\t\t\t/// Our table of queued commits.\n\t\t\t/// </summary>\n    \t\tpublic RevCommit[] Commits\n    \t\t{\n    \t\t\tget { return _commits; }\n    \t\t}\n\n    \t\t/// <summary>\n    \t\t/// Next block in our chain of blocks; null if we are the last.\n    \t\t/// </summary>\n    \t\tpublic Block Next { get; set; }\n\n    \t\tpublic bool isFull()\n    \t\t{\n    \t\t\treturn TailIndex == BLOCK_SIZE;\n    \t\t}\n\n    \t\tpublic bool isEmpty()\n    \t\t{\n    \t\t\treturn HeadIndex == TailIndex;\n    \t\t}\n\n    \t\tpublic bool canUnpop()\n    \t\t{\n    \t\t\treturn HeadIndex > 0;\n    \t\t}\n\n    \t\tpublic void add(RevCommit c)\n    \t\t{\n    \t\t\t_commits[TailIndex++] = c;\n    \t\t}\n\n    \t\tpublic void unpop(RevCommit c)\n    \t\t{\n    \t\t\t_commits[--HeadIndex] = c;\n    \t\t}\n\n    \t\tpublic RevCommit pop()\n    \t\t{\n    \t\t\treturn _commits[HeadIndex++];\n    \t\t}\n\n    \t\tpublic RevCommit peek()\n    \t\t{\n    \t\t\treturn _commits[HeadIndex];\n    \t\t}\n\n    \t\tpublic void clear()\n    \t\t{\n    \t\t\tNext = null;\n    \t\t\tHeadIndex = 0;\n    \t\t\tTailIndex = 0;\n    \t\t}\n\n    \t\tpublic void resetToMiddle()\n    \t\t{\n    \t\t\tHeadIndex = TailIndex = BLOCK_SIZE / 2;\n    \t\t}\n\n    \t\tpublic void resetToEnd()\n    \t\t{\n    \t\t\tHeadIndex = TailIndex = BLOCK_SIZE;\n    \t\t}\n    \t}\n\n    \t#endregion\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/BoundaryGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.RevWalk\n{\n\tpublic class BoundaryGenerator : Generator\n\t{\n\t\tprivate Generator _generator;\n\n\t\tpublic BoundaryGenerator(RevWalk w, Generator s)\n\t\t{\n\t\t\t_generator = new InitialGenerator(w, s, this);\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return _generator.OutputType | GeneratorOutputType.HasUninteresting; }\n\t\t}\n\n\t\tpublic override void shareFreeList(BlockRevQueue q)\n\t\t{\n\t\t\t_generator.shareFreeList(q);\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\treturn _generator.next();\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class InitialGenerator : Generator, IDisposable\n\t\t{\n\t\t\tprivate static readonly int Parsed = RevWalk.PARSED;\n\t\t\tprivate static readonly int Duplicate = RevWalk.TEMP_MARK;\n\n\t\t\tprivate readonly RevWalk _walk;\n\t\t\tprivate readonly FIFORevQueue _held;\n\t\t\tprivate readonly Generator _source;\n\t\t\tprivate readonly BoundaryGenerator _parent;\n\n\t\t\tpublic InitialGenerator(RevWalk w, Generator s, BoundaryGenerator parent) // [henon] parent needed because we cannot access outer instances in C#\n\t\t\t{\n\t\t\t\t_walk = w;\n\t\t\t\t_held = new FIFORevQueue();\n\t\t\t\t_source = s;\n\t\t\t\t_source.shareFreeList(_held);\n\t\t\t\t_parent = parent;\n\t\t\t}\n\n\t\t\tpublic override GeneratorOutputType OutputType\n\t\t\t{\n\t\t\t\tget { return _source.OutputType; }\n\t\t\t}\n\n\t\t\tpublic override void shareFreeList(BlockRevQueue q)\n\t\t\t{\n\t\t\t\tq.shareFreeList(_held);\n\t\t\t}\n\n\t\t\tpublic override RevCommit next()\n\t\t\t{\n\t\t\t\tRevCommit c = _source.next();\n\t\t\t\tif (c != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (RevCommit p in c.Parents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((p.Flags & RevWalk.UNINTERESTING) != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_held.add(p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\n\t\t\t\tvar boundary = new FIFORevQueue();\n\t\t\t\tboundary.shareFreeList(_held);\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tc = _held.next();\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif ((c.Flags & Duplicate) != 0) continue;\n\t\t\t\t\tif ((c.Flags & Parsed) == 0)\n\t\t\t\t\t{\n                        c.parseHeaders(_walk);\n\t\t\t\t\t}\n\t\t\t\t\tc.Flags |= Duplicate;\n\t\t\t\t\tboundary.add(c);\n\t\t\t\t}\n\t\t\t\tboundary.removeFlag(Duplicate);\n\t\t\t\t_parent._generator = boundary;\n\t\t\t\treturn boundary.next();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Dispose ()\n\t\t\t{\n\t\t\t\t_walk.Dispose();\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/DateRevQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// A queue of commits sorted by commit time order.\n\t/// </summary>\n\tpublic class DateRevQueue : AbstractRevQueue\n\t{\n\t\tprivate Entry _head;\n\t\tprivate Entry _free;\n\n\t\t/// <summary>\n\t\t/// Create an empty date queue.\n\t\t/// </summary>\n\t\tpublic DateRevQueue()\n\t\t{\n\t\t}\n\n\t\tpublic DateRevQueue(Generator s)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = s.next();\n\t\t\t\tif (c == null) break;\n\t\t\t\tadd(c);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void add(RevCommit c)\n\t\t{\n\t\t\tEntry q = _head;\n\t\t\tlong when = c.CommitTime;\n\t\t\tEntry n = NewEntry(c);\n\t\t\tif (q == null || when > q.Commit.CommitTime)\n\t\t\t{\n\t\t\t\tn.Next = q;\n\t\t\t\t_head = n;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tEntry p = q.Next;\n\t\t\t\twhile (p != null && p.Commit.CommitTime > when)\n\t\t\t\t{\n\t\t\t\t\tq = p;\n\t\t\t\t\tp = q.Next;\n\t\t\t\t}\n\t\t\t\tn.Next = q.Next;\n\t\t\t\tq.Next = n;\n\t\t\t}\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\tEntry q = _head;\n\t\t\tif (q == null) return null;\n\t\t\t_head = q.Next;\n\t\t\tFreeEntry(q);\n\t\t\treturn q.Commit;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Peek at the Next commit, without removing it.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The Next available commit; null if there are no commits left.\n\t\t/// </returns>\n\t\tpublic RevCommit peek()\n\t\t{\n\t\t\treturn _head != null ? _head.Commit : null;\n\t\t}\n\n\t\tpublic override void clear()\n\t\t{\n\t\t\t_head = null;\n\t\t\t_free = null;\n\t\t}\n\n\t\tinternal override bool everbodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Entry q = _head; q != null; q = q.Next)\n\t\t\t{\n\t\t\t\tif ((q.Commit.Flags & f) == 0) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tinternal override bool anybodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Entry q = _head; q != null; q = q.Next)\n\t\t\t{\n\t\t\t\tif ((q.Commit.Flags & f) != 0) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return base.OutputType | GeneratorOutputType.SortCommitTimeDesc; }\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar s = new StringBuilder();\n\t\t\tfor (Entry q = _head; q != null; q = q.Next)\n\t\t\t{\n\t\t\t\tDescribe(s, q.Commit);\n\t\t\t}\n\t\t\treturn s.ToString();\n\t\t}\n\n\t\tprivate Entry NewEntry(RevCommit c)\n\t\t{\n\t\t\tEntry r = _free;\n\t\t\tif (r == null)\n\t\t\t{\n\t\t\t\tr = new Entry();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_free = r.Next;\n\t\t\t}\n\t\t\tr.Commit = c;\n\t\t\treturn r;\n\t\t}\n\n\t\tprivate void FreeEntry(Entry e)\n\t\t{\n\t\t\te.Next = _free;\n\t\t\t_free = e;\n\t\t}\n\n\t\tinternal class Entry\n\t\t{\n\t\t\tpublic Entry Next { get; set; }\n\t\t\tpublic RevCommit Commit { get; set; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/DelayRevQueue.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\n\n    /**\n     * Delays commits to be at least {@link PendingGenerator#OVER_SCAN} late.\n     * <para />\n     * This helps to \"fix up\" weird corner cases resulting from clock skew, by\n     * slowing down what we produce to the caller we get a better chance to ensure\n     * PendingGenerator reached back far enough in the graph to correctly mark\n     * commits {@link RevWalk#UNINTERESTING} if necessary.\n     * <para />\n     * This generator should appear before {@link FixUninterestingGenerator} if the\n     * lower level {@link #pending} isn't already fully buffered.\n     */\n    class DelayRevQueue : Generator\n    {\n        private readonly Generator _pending;\n        private readonly FIFORevQueue _delay;\n        private int _size;\n\n        public DelayRevQueue(Generator g)\n        {\n            _pending = g;\n            _delay = new FIFORevQueue();\n        }\n\n        public override GeneratorOutputType OutputType\n        {\n            get { return _pending.OutputType; }\n        }\n\n        public override RevCommit next()\n        {\n            while (_size < PendingGenerator.OVER_SCAN)\n            {\n                RevCommit c = _pending.next();\n                if (c == null) break;\n                _delay.add(c);\n                _size++;\n            }\n\n            RevCommit cc = _delay.next();\n            if (cc == null) return null;\n            _size--;\n            return cc;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/EndGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n    public class EndGenerator : Generator\n    {\n        public static readonly EndGenerator Instance = new EndGenerator();\n\n\t\tpublic override RevCommit next()\n        {\n            return null;\n        }\n\n        public override GeneratorOutputType OutputType\n        {\n\t\t\tget { return 0; }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/FIFORevQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// A queue of commits in FIFO order.\n\t/// </summary>\n\tpublic class FIFORevQueue : BlockRevQueue\n\t{\n\t\tprivate Block _head;\n\t\tprivate Block _tail;\n\n\t\t/// <summary>\n\t\t/// Create an empty FIFO queue.\n\t\t/// </summary>\n\t\tpublic FIFORevQueue()\n\t\t{\n\t\t}\n\n\t\tpublic FIFORevQueue(Generator s)\n\t\t\t: base(s)\n\t\t{\n\t\t}\n\n\t\tpublic override void add(RevCommit c)\n\t\t{\n\t\t\tBlock b = _tail;\n\t\t\tif (b == null)\n\t\t\t{\n\t\t\t\tb = Free.newBlock();\n\t\t\t\tb.add(c);\n\t\t\t\t_head = b;\n\t\t\t\t_tail = b;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (b.isFull())\n\t\t\t{\n\t\t\t\tb = Free.newBlock();\n\t\t\t\t_tail.Next = b;\n\t\t\t\t_tail = b;\n\t\t\t}\n\t\t\tb.add(c);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Insert the commit pointer at the front of the queue.\n\t\t/// </summary>\n\t\t/// <param name=\"c\">\n\t\t/// The commit to insert into the queue.\n\t\t/// </param>\n\t\tpublic void unpop(RevCommit c)\n\t\t{\n\t\t\tBlock b = _head;\n\t\t\tif (b == null)\n\t\t\t{\n\t\t\t\tb = Free.newBlock();\n\t\t\t\tb.resetToMiddle();\n\t\t\t\tb.add(c);\n\t\t\t\t_head = b;\n\t\t\t\t_tail = b;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (b.canUnpop())\n\t\t\t{\n\t\t\t\tb.unpop(c);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tb = Free.newBlock();\n\t\t\tb.resetToEnd();\n\t\t\tb.unpop(c);\n\t\t\tb.Next = _head;\n\t\t\t_head = b;\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\tBlock b = _head;\n\t\t\tif (b == null) return null;\n\n\t\t\tRevCommit c = b.pop();\n\t\t\tif (b.isEmpty())\n\t\t\t{\n\t\t\t\t_head = b.Next;\n\t\t\t\tif (_head == null)\n\t\t\t\t{\n\t\t\t\t\t_tail = null;\n\t\t\t\t}\n\t\t\t\tFree.freeBlock(b);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic override void clear()\n\t\t{\n\t\t\t_head = null;\n\t\t\t_tail = null;\n\t\t\tFree.clear();\n\t\t}\n\n\t\tinternal override bool everbodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Block b = _head; b != null; b = b.Next)\n\t\t\t{\n\t\t\t\tfor (int i = b.HeadIndex; i < b.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif ((b.Commits[i].Flags & f) == 0) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tinternal override bool anybodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Block b = _head; b != null; b = b.Next)\n\t\t\t{\n\t\t\t\tfor (int i = b.HeadIndex; i < b.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif ((b.Commits[i].Flags & f) != 0) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void removeFlag(int flag)\n\t\t{\n\t\t\tint notFlag = ~flag;\n\t\t\tfor (Block b = _head; b != null; b = b.Next)\n\t\t\t{\n\t\t\t\tfor (int i = b.HeadIndex; i < b.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tb.Commits[i].Flags &= notFlag;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar s = new StringBuilder();\n\t\t\tfor (Block q = _head; q != null; q = q.Next)\n\t\t\t{\n\t\t\t\tfor (int i = q.HeadIndex; i < q.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tDescribe(s, q.Commits[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn s.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/AndRevFilter.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Includes a commit only if all subfilters include the same commit.\n\t/// <para />\n\t/// Classic shortcut behavior is used, so evaluation of the\n\t/// <seealso cref=\"RevFilter.include(RevWalk, RevCommit)\"/> method stops as soon as a false\n\t/// result is obtained. Applications can improve filtering performance by placing\n\t/// faster filters that are more likely to reject a result earlier in the list.\n\t/// </summary>\n\tpublic abstract class AndRevFilter : RevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Create a filter with two filters, both of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">First filter to test.</param>\n\t\t///\t<param name=\"b\">Second filter to test.</param>\n\t\t///\t<returns>\n\t\t/// A filter that must match both input filters.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(RevFilter a, RevFilter b)\n\t\t{\n\t\t\tif (a == ALL) return b;\n\t\t\tif (b == ALL) return a;\n\n\t\t\treturn new Binary(a, b);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a filter around many filters, all of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"list\">\n\t\t/// List of filters to match against. Must contain at least 2\n\t\t/// filters.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// A filter that must match all input filters.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(RevFilter[] list)\n\t\t{\n\t\t\tif (list.Length == 2)\n\t\t\t{\n\t\t\t\treturn create(list[0], list[1]);\n\t\t\t}\n\n\t\t\tif (list.Length < 2)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"At least two filters needed.\");\n\t\t\t}\n\n\t\t\tvar subfilters = new RevFilter[list.Length];\n\t\t\tArray.Copy(list, 0, subfilters, 0, list.Length);\n\t\t\treturn new List(subfilters);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a filter around many filters, all of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"list\">\n\t\t/// List of filters to match against. Must contain at least 2\n\t\t/// filters.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// A filter that must match all input filters.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(IEnumerable<RevFilter> list)\n\t\t{\n\t\t\tif (list.Count() < 2)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"At least two filters needed.\");\n\t\t\t}\n\n\t\t\tRevFilter[] subfilters = list.ToArray();\n\t\t\tif (subfilters.Length == 2)\n\t\t\t{\n\t\t\t\treturn create(subfilters[0], subfilters[1]);\n\t\t\t}\n\n\t\t\treturn new List(subfilters);\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class Binary : AndRevFilter\n\t\t{\n\t\t\tprivate readonly RevFilter _a;\n\t\t\tprivate readonly RevFilter _b;\n\n\t\t\tinternal Binary(RevFilter one, RevFilter two)\n\t\t\t{\n\t\t\t\t_a = one;\n\t\t\t\t_b = two;\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn _a.include(walker, cmit) && _b.include(walker, cmit);\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn new Binary(_a.Clone(), _b.Clone());\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"(\" + _a + \" AND \" + _b + \")\";\n\t\t\t}\n\t\t}\n\n\t\tprivate class List : AndRevFilter\n\t\t{\n\t\t\tprivate readonly RevFilter[] _subfilters;\n\n\t\t\tinternal List(RevFilter[] list)\n\t\t\t{\n\t\t\t\t_subfilters = list;\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\tforeach (RevFilter f in _subfilters)\n\t\t\t\t{\n\t\t\t\t\tif (!f.include(walker, cmit)) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\tvar s = new RevFilter[_subfilters.Length];\n\t\t\t\tfor (int i = 0; i < s.Length; i++)\n\t\t\t\t{\n\t\t\t\t\ts[i] = _subfilters[i].Clone();\n\t\t\t\t}\n\n\t\t\t\treturn new List(s);\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tvar r = new StringBuilder();\n\t\t\t\tr.Append(\"(\");\n\t\t\t\tfor (int i = 0; i < _subfilters.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tr.Append(\" AND \");\n\t\t\t\t\t}\n\t\t\t\t\tr.Append(_subfilters[i].ToString());\n\t\t\t\t}\n\t\t\t\tr.Append(\")\");\n\t\t\t\treturn r.ToString();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/AuthorRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Matches only commits whose author name matches the pattern.\n\t/// </summary>\n\tpublic static class AuthorRevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Create a new author filter.\n\t\t///\t<para />\n\t\t///\tAn optimized substring search may be automatically selected if the\n\t\t///\tpattern does not contain any regular expression meta-characters.\n\t\t///\t<para />\n\t\t///\tThe search is performed using a case-insensitive comparison. The\n\t\t///\tcharacter encoding of the commit message itself is not respected. The\n\t\t///\tfilter matches on raw UTF-8 byte sequences.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pattern\">Regular expression pattern to match.</param>\n\t\t///\t<returns>\n\t\t/// A new filter that matches the given expression against the author\n\t\t/// name and address of a commit.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(string pattern)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(pattern))\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"pattern\", \"Cannot match on empty string.\");\n\t\t\t}\n\n\t\t\tif (SubStringRevFilter.safe(pattern))\n\t\t\t{\n\t\t\t\treturn new SubStringSearch(pattern);\n\t\t\t}\n\n\t\t\treturn new PatternSearch(pattern);\n\t\t}\n\n\t\tprivate static string TextFor(RevCommit cmit)\n\t\t{\n\t\t\tbyte[] raw = cmit.RawBuffer;\n\t\t\tint b = RawParseUtils.author(raw, 0);\n\t\t\tif (b < 0) return string.Empty;\n\t\t\tint e = RawParseUtils.nextLF(raw, b, (byte)'>');\n\t\t\treturn Constants.CHARSET.GetString(raw, b, e);\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class PatternSearch : PatternMatchRevFilter\n\t\t{\n\t\t\tpublic PatternSearch(string patternText):  base(patternText, true, true, RegexOptions.IgnoreCase)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn new PatternSearch(Pattern);\n\t\t\t}\n\t\t}\n\n\t\tprivate class SubStringSearch : SubStringRevFilter\n\t\t{\n\t\t\tinternal SubStringSearch(string patternText) : base(patternText)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string Text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/CommitTimeRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Selects commits based upon the commit time field.\n\t/// </summary>\n\tpublic abstract class CommitTimeRevFilter : RevFilter\n\t{\n\t\tprivate readonly int _when;  // seconds since  epoch, will overflow 2038.\n\n\t\t/// <summary>\n\t\t/// Create a new filter to select commits before a given date/time.\n\t\t/// </summary>\n\t\t/// <param name=\"ts\">the point in time to cut on.</param>\n\t\t/// <returns>\n\t\t/// a new filter to select commits on or before <paramref name=\"ts\"/>.\n\t\t/// </returns>\n\t\tpublic static RevFilter Before(DateTime ts)\n\t\t{\n            return new BeforeCommitTimeRevFilter(ts.ToMillisecondsSinceEpoch());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new filter to select commits After a given date/time.\n\t\t/// </summary>\n\t\t/// <param name=\"ts\">the point in time to cut on.</param>\n\t\t/// <returns>\n\t\t/// a new filter to select commits on or After <paramref name=\"ts\"/>.\n\t\t/// </returns>\n\t\tpublic static RevFilter After(DateTime ts)\n\t\t{\n\t\t\treturn new AfterCommitTimeRevFilter(ts.ToMillisecondsSinceEpoch());\n\t\t}\n\n\t    /// <summary>\n\t    /// Create a new filter to select commits after or equal a given date/time <code>since</code>\n\t    /// and before or equal a given date/time <code>until</code>.\n\t    /// </summary>\n\t    /// <param name=\"since\"> the point in time to cut on.</param>\n\t    /// <param name=\"until\"> the point in time to cut off.</param>\n\t    /// <returns>a new filter to select commits between the given date/times.</returns>\n\t    public static RevFilter Between(DateTime since, DateTime until)\n\t    {\n\t        return new BetweenCommitTimeRevFilter(since.ToMillisecondsSinceEpoch(), until.ToMillisecondsSinceEpoch());\n\t    }\n\n\t\tprivate CommitTimeRevFilter(long ts)\n\t\t{\n\t\t\t_when = (int)(ts / 1000);\n\t\t}\n\n\t\tpublic override RevFilter Clone()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class BeforeCommitTimeRevFilter : CommitTimeRevFilter\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"ts\">git internal time (seconds since epoch)</param>\n\t\t\tpublic BeforeCommitTimeRevFilter(long ts)\n\t\t\t\t: base(ts)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn cmit.CommitTime <= _when;\n\t\t\t}\n\n            public override string ToString()\n            {\n                return base.ToString() + \"(\" + ((long)_when * 1000).MillisToUtcDateTime() + \")\";\n            }\n\t\t}\n\n\t\tprivate class AfterCommitTimeRevFilter : CommitTimeRevFilter\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"ts\">git internal time (seconds since epoch)</param>\n\t\t\tpublic AfterCommitTimeRevFilter(long ts)\n\t\t\t\t: base(ts)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\t// Since the walker sorts commits by commit time we can be\n\t\t\t\t// reasonably certain there is nothing remaining worth our\n\t\t\t\t// scanning if this commit is before the point in question.\n\t\t\t\t//\n\t\t\t\tif (cmit.CommitTime < _when)\n\t\t\t\t{\n\t\t\t\t\tthrow StopWalkException.INSTANCE;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n            public override string ToString()\n            {\n                return base.ToString() + \"(\" + ((long)_when * 1000).MillisToUtcDateTime() + \")\";\n            }\n\t\t}\n\n\t\tprivate class BetweenCommitTimeRevFilter : CommitTimeRevFilter\n\t\t{\n\t\t\tprivate readonly int _until;\n\n            internal BetweenCommitTimeRevFilter(long since, long until)\n                : base(since)\n\t\t\t{\n\t\t\t\t_until = (int)(until / 1000);\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn cmit.CommitTime <= _until && cmit.CommitTime >= _when;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n                return base.ToString() + \"(\" + ((long)_when * 1000).MillisToUtcDateTime() + \" - \" + ((long)_until * 1000).MillisToUtcDateTime() + \")\";\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/CommitterRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Matches only commits whose committer name matches the pattern.\n\t/// </summary>\n\tpublic static class CommitterRevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Create a new committer filter.\n\t\t///\t<para />\n\t\t///\tAn optimized substring search may be automatically selected if the\n\t\t///\tpattern does not contain any regular expression meta-characters.\n\t\t///\t<para />\n\t\t///\tThe search is performed using a case-insensitive comparison. The\n\t\t///\tcharacter encoding of the commit message itself is not respected. The\n\t\t///\tfilter matches on raw UTF-8 byte sequences.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pattern\">Regular expression pattern to match.</param>\n\t\t///\t<returns>\n\t\t/// A new filter that matches the given expression against the author\n\t\t/// name and address of a commit.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(string pattern)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(pattern))\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Cannot match on empty string.\");\n\t\t\t}\n\n\t\t\tif (SubStringRevFilter.safe(pattern))\n\t\t\t{\n\t\t\t\treturn new SubStringSearch(pattern);\n\t\t\t}\n\n\t\t\treturn new PatternSearch(pattern);\n\t\t}\n\n\t\tprivate static string TextFor(RevCommit cmit)\n\t\t{\n\t\t\tbyte[] raw = cmit.RawBuffer;\n\t\t\tint b = RawParseUtils.committer(raw, 0);\n\t\t\tif (b < 0) return string.Empty;\n\t\t\tint e = RawParseUtils.nextLF(raw, b, (byte)'>');\n\t\t\treturn Constants.CHARSET.GetString(raw, b, e);\n\t\t}\n\n\t\tprivate class PatternSearch : PatternMatchRevFilter\n\t\t{\n\t\t\tpublic PatternSearch(string patternText)\n\t\t\t\t: base(patternText, true, true, RegexOptions.IgnoreCase)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn new PatternSearch(Pattern);\n\t\t\t}\n\t\t}\n\n\t\tprivate class SubStringSearch : SubStringRevFilter\n\t\t{\n\t\t\tpublic SubStringSearch(string patternText)\n\t\t\t\t: base(patternText)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string Text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/MessageRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Matches only commits whose message matches the pattern.\n\t/// </summary>\n\tpublic static class MessageRevFilter\n\t{\n\t\t/// <summary>\n\t\t/// Create a message filter.\n\t\t///\t<para />\n\t\t///\tAn optimized substring search may be automatically selected if the\n\t\t///\tpattern does not contain any regular expression meta-characters.\n\t\t///\t<para />\n\t\t///\tThe search is performed using a case-insensitive comparison. The\n\t\t///\tcharacter encoding of the commit message itself is not respected. The\n\t\t///\tfilter matches on raw UTF-8 byte sequences.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pattern\">Regular expression pattern to match.</param>\n\t\t///\t<returns>\n\t\t/// A new filter that matches the given expression against the\n\t\t/// message body of the commit.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(string pattern)\n\t\t{\n\t\t\tif (pattern.Length == 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Cannot match on empty string.\");\n\t\t\t}\n\n\t\t\tif (SubStringRevFilter.safe(pattern))\n\t\t\t{\n\t\t\t\treturn new SubStringSearch(pattern);\n\t\t\t}\n\n\t\t\treturn new PatternSearch(pattern);\n\t\t}\n\n\t\tprivate static string TextFor(RevCommit cmit)\n\t\t{\n\t\t\tbyte[] raw = cmit.RawBuffer;\n\t\t\tint b = RawParseUtils.commitMessage(raw, 0);\n\t\t\tif (b < 0)\n\t\t\t{\n\t\t\t\treturn string.Empty;\n\t\t\t}\n\n\t\t\treturn Constants.CHARSET.GetString(raw, b, raw.Length);\n\t\t}\n\n\t\tprivate class PatternSearch : PatternMatchRevFilter\n\t\t{\n\t\t\tpublic PatternSearch(string patternText)\n\t\t\t\t: base(patternText, true, true, RegexOptions.IgnoreCase | RegexOptions.Singleline)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn new PatternSearch(Pattern);\n\t\t\t}\n\t\t}\n\n\t\tprivate class SubStringSearch : SubStringRevFilter\n\t\t{\n\t\t\tinternal SubStringSearch(string patternText)\n\t\t\t\t: base(patternText)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override string Text(RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn TextFor(cmit);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/NotRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Includes a commit only if the subfilter does not include the commit.\n\t/// </summary>\n\tpublic class NotRevFilter : RevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Create a filter that negates the result of another filter.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">Filter to negate.</param>\n\t\t///\t<returns>\n\t\t/// A filter that does the reverse of <code>a</code>.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(RevFilter a)\n\t\t{\n\t\t\treturn new NotRevFilter(a);\n\t\t}\n\n\t\tprivate readonly RevFilter _a;\n\n\t\tprivate NotRevFilter(RevFilter one)\n\t\t{\n\t\t\t_a = one;\n\t\t}\n\n\t\tpublic override RevFilter negate()\n\t\t{\n\t\t\treturn _a;\n\t\t}\n\n\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t{\n\t\t\treturn !_a.include(walker, cmit);\n\t\t}\n\n\t\tpublic override RevFilter Clone()\n\t\t{\n\t\t\treturn new NotRevFilter(_a.Clone());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"NOT \" + _a;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/OrRevFilter.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\n\n\t/// <summary>\n\t/// Includes a commit if any subfilters include the same commit.\n\t/// <para />\n\t/// Classic shortcut behavior is used, so evaluation of the\n\t/// <seealso cref=\"RevFilter.include(RevWalk, RevCommit)\"/> method stops as soon as a true\n\t/// result is obtained. Applications can improve filtering performance by placing\n\t/// faster filters that are more likely to accept a result earlier in the list.\n\t/// </summary>\n\tpublic abstract class OrRevFilter : RevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Create a filter with two filters, one of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">First filter to test.</param>\n\t\t///\t<param name=\"b\">Second filter to test.</param>\n\t\t///\t<returns>\n\t\t/// A filter that must match at least one input filter.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(RevFilter a, RevFilter b)\n\t\t{\n\t\t\tif (a == ALL || b == ALL) return ALL;\n\t\t\treturn new Binary(a, b);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a filter around many filters, one of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"list\">\n\t\t///\tList of filters to match against. Must contain at least 2\n\t\t///\tfilters.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// A filter that must match at least one input filter.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(RevFilter[] list)\n\t\t{\n\t\t\tif (list.Length == 2)\n\t\t\t{\n\t\t\t\treturn create(list[0], list[1]);\n\t\t\t}\n\n\t\t\tif (list.Length < 2)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"At least two filters needed.\");\n\t\t\t}\n\n\t\t\tvar subfilters = new RevFilter[list.Length];\n\t\t\tArray.Copy(list, 0, subfilters, 0, list.Length);\n\t\t\treturn new List(subfilters);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a filter around many filters, one of which must match.\n\t\t///\t</summary>\n\t\t///\t<param name=\"list\">\n\t\t/// List of filters to match against. Must contain at least 2\n\t\t/// filters.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// A filter that must match at least one input filter.\n\t\t/// </returns>\n\t\tpublic static RevFilter create(IEnumerable<RevFilter> list)\n\t\t{\n\t\t\tif (list.Count() < 2)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"At least two filters needed.\");\n\t\t\t}\n\n\t\t\tRevFilter[] subfilters = list.ToArray();\n\n\t\t\tif (subfilters.Length == 2)\n\t\t\t{\n\t\t\t\treturn create(subfilters[0], subfilters[1]);\n\t\t\t}\n\n\t\t\treturn new List(subfilters);\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class Binary : OrRevFilter\n\t\t{\n\t\t\tprivate readonly RevFilter _a;\n\t\t\tprivate readonly RevFilter _b;\n\n\t\t\tinternal Binary(RevFilter one, RevFilter two)\n\t\t\t{\n\t\t\t\t_a = one;\n\t\t\t\t_b = two;\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn _a.include(walker, cmit) || _b.include(walker, cmit);\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn new Binary(_a.Clone(), _b.Clone());\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"(\" + _a + \" OR \" + _b + \")\";\n\t\t\t}\n\t\t}\n\n\t\tprivate class List : OrRevFilter\n\t\t{\n\t\t\tprivate readonly RevFilter[] _subfilters;\n\n\t\t\tpublic List(RevFilter[] list)\n\t\t\t{\n\t\t\t\t_subfilters = list;\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\tforeach (RevFilter f in _subfilters)\n\t\t\t\t{\n\t\t\t\t\tif (f.include(walker, cmit))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\tvar s = new RevFilter[_subfilters.Length];\n\t\t\t\tfor (int i = 0; i < s.Length; i++)\n\t\t\t\t{\n\t\t\t\t\ts[i] = _subfilters[i].Clone();\n\t\t\t\t}\n\n\t\t\t\treturn new List(s);\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tvar r = new StringBuilder();\n\t\t\t\tr.Append(\"(\");\n\t\t\t\tfor (int i = 0; i < _subfilters.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0) r.Append(\" OR \");\n\t\t\t\t\tr.Append(_subfilters[i].ToString());\n\t\t\t\t}\n\t\t\t\tr.Append(\")\");\n\t\t\t\treturn r.ToString();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/PatternMatchRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text.RegularExpressions;\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Abstract filter that searches text using extended regular expressions.\n\t/// </summary>\n\tpublic abstract class PatternMatchRevFilter : RevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Encode a string pattern for faster matching on byte arrays.\n\t\t///\t<para />\n\t\t///\tForce the characters to our funny UTF-8 only convention that we use on\n\t\t///\traw buffers. This avoids needing to perform character set decodes on the\n\t\t///\tindividual commit buffers.\n\t\t///\t</summary>\n\t\t///\t<param name=\"patternText\">\n\t\t///\toriginal pattern string supplied by the user or the\n\t\t///\tapplication.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// Same pattern, but re-encoded to match our funny raw UTF-8\n\t\t///\tcharacter sequence <seealso cref=\"RawCharSequence\"/>.\n\t\t/// </returns>\n\t\tprivate static string forceToRaw(string patternText) // [henon] I believe, such recoding is not necessary in C#, is it?\n\t\t{\n\t\t    byte[] b = Constants.encode(patternText);\n\t\t\tvar needle = new StringBuilder(b.Length);\n\t\t\tfor (int i = 0; i < b.Length; i++)\n\t\t\t{\n\t\t\t\tneedle.Append((char)(b[i] & 0xff));\n\t\t\t}\n\t\t\treturn needle.ToString();\n\t\t}\n\n\t\tprivate readonly string _patternText;\n\t\tprivate readonly Regex _compiledPattern;\n\n\t\t///\t<summary>\n\t\t/// Construct a new pattern matching filter.\n\t\t///\t</summary>\n\t\t///\t<param name=\"pattern\">\n\t\t///\tText of the pattern. Callers may want to surround their\n\t\t///\tpattern with \".*\" on either end to allow matching in the\n\t\t///\tmiddle of the string.\n\t\t/// </param>\n\t\t///\t<param name=\"innerString\">\n\t\t///\tShould .* be wrapped around the pattern of ^ and $ are\n\t\t///\tmissing? Most users will want this set.\n\t\t/// </param>\n\t\t///\t<param name=\"rawEncoding\">\n\t\t///\tshould <seealso cref=\"forceToRaw(String)\"/> be applied to the pattern\n\t\t///\tbefore compiling it?\n\t\t/// </param>\n\t\t///\t<param name=\"flags\">\n\t\t///\tflags from <seealso cref=\"Pattern\"/> to control how matching performs. </param>\n\t\tinternal PatternMatchRevFilter(string pattern, bool innerString, bool rawEncoding, RegexOptions flags)\n\t\t{\n\t\t\tif (pattern.Length == 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Cannot match on empty string.\");\n\t\t\t}\n\n\t\t\t_patternText = pattern;\n\n\t\t\tif (innerString)\n\t\t\t{\n\t\t\t\tif (!pattern.StartsWith(\"^\") && !pattern.StartsWith(\".*\"))\n\t\t\t\t{\n\t\t\t\t\tpattern = \".*\" + pattern;\n\t\t\t\t}\n\t\t\t\tif (!pattern.EndsWith(\"$\") && !pattern.EndsWith(\".*\"))\n\t\t\t\t{\n\t\t\t\t\tpattern = pattern + \".*\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tstring p = rawEncoding ? forceToRaw(pattern) : pattern;\n\t\t\t_compiledPattern = new Regex(p, flags); //.matcher(\"\");\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get the pattern this filter uses.\n\t\t///\t</summary>\n\t\t///\t<returns>\n\t\t/// The pattern this filter is applying to candidate strings.\n\t\t/// </returns>\n\t\tprotected string Pattern\n\t\t{\n\t\t\tget { return _patternText; }\n\t\t}\n\n\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t{\n\t\t\treturn _compiledPattern.IsMatch(text(cmit));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Obtain the raw text to match against.\n\t\t///\t</summary>\n\t\t///\t<param name=\"cmit\">Current commit being evaluated.</param>\n\t\t///\t<returns>\n\t\t/// Sequence for the commit's content that we need to match on.\n\t\t/// </returns>\n\t\tprotected abstract string text(RevCommit cmit); // [henon] changed returntype from CharSequence to string! we have no equivalent for CharSequences in C# and Regex works with strings only.\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn base.ToString() + \"(\\\"\" + _patternText + \"\\\")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/RevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Selects interesting revisions during walking.\n\t/// <para />\n\t/// This is an abstract interface. Applications may implement a subclass, or use\n\t/// one of the predefined implementations already available within this package.\n\t/// Filters may be chained together using <see cref=\"AndRevFilter\"/> and\n\t/// <see cref=\"OrRevFilter\"/> to create complex boolean expressions.\n\t/// <para />\n\t/// Applications should install the filter on a RevWalk by\n\t/// <seealso cref=\"RevWalk.setRevFilter(RevFilter)\"/> prior to starting traversal.\n\t/// <para />\n\t/// Unless specifically noted otherwise a RevFilter implementation is not thread\n\t/// safe and may not be shared by different RevWalk instances at the same time.\n\t/// This restriction allows RevFilter implementations to cache state within their\n\t/// instances during <seealso cref=\"include(RevWalk, RevCommit)\"/> if it is beneficial to\n\t/// their implementation. Deep clones created by <seealso cref=\"Clone()\"/> may be used to\n\t/// construct a thread-safe copy of an existing filter.\n\t/// <para />\n\t/// <b>Message filters:</b>\n\t/// <ul>\n\t/// <li>Author name/email: <seealso cref=\"AuthorRevFilter\"/></li>\n\t/// <li>Committer name/email: <seealso cref=\"CommitterRevFilter\"/></li>\n\t/// <li>Message body: <seealso cref=\"MessageRevFilter\"/></li>\n\t/// </ul>\n\t/// <para />\n\t/// <b>Merge filters:</b>\n\t/// <ul>\n\t/// <li>Skip all merges: <seealso cref=\"NO_MERGES\"/>.</li>\n\t/// </ul>\n\t/// <para />\n\t/// <b>Boolean modifiers:</b>\n\t/// <ul>\n\t/// <li>AND: <seealso cref=\"AndRevFilter\"/></li>\n\t/// <li>OR: <seealso cref=\"OrRevFilter\"/></li>\n\t/// <li>NOT: <seealso cref=\"NotRevFilter\"/></li>\n\t/// </ul>\n\t/// </summary>\n\tpublic abstract class RevFilter\n\t{\n\t\t/// <summary>\n\t\t/// Default filter that always returns true (thread safe).\n\t\t/// </summary>\n\t\tpublic static readonly RevFilter ALL = new RevFilterAll();\n\n\t\t/// <summary>\n\t\t/// Default filter that always returns false (thread safe).\n\t\t/// </summary>\n\t\tpublic static readonly RevFilter NONE = new RevFilterNone();\n\n\t\t/// <summary>\n\t\t/// Excludes commits with more than one parent (thread safe).\n\t\t/// </summary>\n\t\tpublic static readonly RevFilter NO_MERGES = new RevFilterNoMerges();\n\n\t\t/// <summary>\n\t\t/// Selects only merge bases of the starting points (thread safe).\n\t\t/// <para />\n\t\t/// This is a special case filter that cannot be combined with any other\n\t\t/// filter. Its include method always throws an exception as context\n\t\t/// information beyond the arguments is necessary to determine if the\n\t\t/// supplied commit is a merge base.\n\t\t/// </summary>\n\t\tpublic static readonly RevFilter MERGE_BASE = new RevFilterMergeBase();\n\n\t\t/// <summary>\n\t\t/// Create a new filter that does the opposite of this filter.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A new filter that includes commits this filter rejects.\n\t\t/// </returns>\n\t\tpublic virtual RevFilter negate()\n\t\t{\n\t\t\treturn NotRevFilter.create(this);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if the supplied commit should be included in results.\n\t\t/// </summary>\n\t\t/// <param name=\"walker\">\n\t\t/// The active walker this filter is being invoked from within.\n\t\t/// </param>\n\t\t/// <param name=\"cmit\">\n\t\t/// The commit currently being tested. The commit has been parsed\n\t\t/// and its body is available for inspection.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// true to include this commit in the results; false to have this\n\t\t/// commit be omitted entirely from the results.\n\t\t/// </returns>\n\t\t/// <exception cref=\"StopWalkException\">\n\t\t/// The filter knows for certain that no additional commits can\n\t\t/// ever match, and the current commit doesn't match either. The\n\t\t/// walk is halted and no more results are provided.\n\t\t/// </exception>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// An object the filter needs to consult to determine its answer\n\t\t/// does not exist in the Git repository the Walker is operating\n\t\t/// on. Filtering this commit is impossible without the object.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// An object the filter needed to consult was not of the\n\t\t/// expected object type. This usually indicates a corrupt\n\t\t/// repository, as an object link is referencing the wrong type.\n\t\t/// </exception>\n\t\t/// <exception cref=\"Exception\">\n\t\t/// A loose object or pack file could not be Read to obtain data\n\t\t/// necessary for the filter to make its decision.\n\t\t/// </exception>\n\t\tpublic abstract bool include(RevWalk walker, RevCommit cmit);\n\n\t\t/// <summary>\n\t\t/// Clone this revision filter, including its parameters.\n\t\t/// <para />\n\t\t/// This is a deep Clone. If this filter embeds objects or other filters it\n\t\t/// must also Clone those, to ensure the instances do not share mutable data.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Another copy of this filter, suitable for another thread.\n\t\t/// </returns>\n\t\tpublic abstract RevFilter Clone();\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tstring n = GetType().Name;\n\t\t\tint lastDot = n.LastIndexOf('.');\n\t\t\tif (lastDot >= 0)\n\t\t\t{\n\t\t\t\tn = n.Substring(lastDot + 1);\n\t\t\t}\n\t\t\treturn n.Replace('$', '.');\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class RevFilterAll : RevFilter\n\t\t{\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"ALL\";\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Default filter that always returns false (thread safe).\n\t\t/// </summary>\n\t\tprivate class RevFilterNone : RevFilter\n\t\t{\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"NONE\";\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Excludes commits with more than one parent (thread safe).\n\t\t/// </summary>\n\t\tprivate class RevFilterNoMerges : RevFilter\n\t\t{\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn cmit.ParentCount < 2;\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"NO_MERGES\";\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Selects only merge bases of the starting points (thread safe).\n\t\t///\t<para />\n\t\t///\tThis is a special case filter that cannot be combined with any other\n\t\t///\tfilter. Its include method always throws an exception as context\n\t\t///\tinformation beyond the arguments is necessary to determine if the\n\t\t///\tsupplied commit is a merge base. </summary>\n\t\tprivate class RevFilterMergeBase : RevFilter\n\t\t{\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Cannot be combined.\");\n\t\t\t}\n\n\t\t\tpublic override RevFilter Clone()\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"MERGE_BASE\";\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/RevFlagFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Matches only commits with some/all RevFlags already set.\n\t/// </summary>\n\tpublic abstract class RevFlagFilter : RevFilter\n\t{\n\t\tprivate readonly RevFlagSet _flags;\n\n\t\t/// <summary>\n\t\t/// Create a new filter that tests for a single flag.\n\t\t///\t</summary>\n\t\t/// <param name=\"a\">The flag to test.</param>\n\t\t///\t<returns>\n\t\t/// Filter that selects only commits with flag <paramref name=\"a\"/>.\n\t\t/// </returns>\n\t\tpublic static RevFilter has(RevFlag a)\n\t\t{\n\t\t\tvar s = new RevFlagSet { a };\n\t\t\treturn new HasAll(s);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a new filter that tests all flags in a set.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">Set of flags to test.</param>\n\t\t///\t<returns>\n\t\t/// Filter that selects only commits with all flags in <paramref name=\"a\"/>.\n\t\t/// </returns>\n\t\tpublic static RevFilter hasAll(params RevFlag[] a)\n\t\t{\n\t\t\tvar set = new RevFlagSet();\n\t\t\tforeach (RevFlag flag in a)\n\t\t\t{\n\t\t\t\tset.Add(flag);\n\t\t\t}\n\t\t\treturn new HasAll(set);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a new filter that tests all flags in a set.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">Set of flags to test.</param>\n\t\t///\t<returns> filter that selects only commits with all flags in <paramref name=\"a\"/>.\n\t\t/// </returns>\n\t\tpublic static RevFilter hasAll(RevFlagSet a)\n\t\t{\n\t\t\treturn new HasAll(new RevFlagSet(a));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a new filter that tests for any flag in a set.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">Set of flags to test. </param>\n\t\t///\t<returns>\n\t\t/// Filter that selects only commits with any flag in <code>a</code>.\n\t\t/// </returns>\n\t\tpublic static RevFilter hasAny(params RevFlag[] a)\n\t\t{\n\t\t\tvar set = new RevFlagSet();\n\t\t\tforeach (RevFlag flag in a)\n\t\t\t{\n\t\t\t\tset.Add(flag);\n\t\t\t}\n\t\t\treturn new HasAny(set);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a new filter that tests for any flag in a set.\n\t\t///\t</summary>\n\t\t///\t<param name=\"a\">Set of flags to test.</param>\n\t\t///\t<returns>\n\t\t/// Filter that selects only commits with any flag in <code>a</code>.\n\t\t/// </returns>\n\t\tpublic static RevFilter hasAny(RevFlagSet a)\n\t\t{\n\t\t\treturn new HasAny(new RevFlagSet(a));\n\t\t}\n\n\t\tinternal RevFlagFilter(RevFlagSet m)\n\t\t{\n\t\t\t_flags = m;\n\t\t}\n\n\t\tpublic override RevFilter Clone()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn base.ToString() + _flags;\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class HasAll : RevFlagFilter\n\t\t{\n\t\t\tpublic HasAll(RevFlagSet m)\n\t\t\t\t: base(m)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn cmit.hasAll(_flags);\n\t\t\t}\n\t\t}\n\n\t\tprivate class HasAny : RevFlagFilter\n\t\t{\n\t\t\tinternal HasAny(RevFlagSet m)\n\t\t\t\t: base(m)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t\t{\n\t\t\t\treturn cmit.hasAny(_flags);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/Filter/SubStringRevFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text.RegularExpressions;\n\nnamespace GitSharp.Core.RevWalk.Filter\n{\n\t/// <summary>\n\t/// Abstract filter that searches text using only substring search.\n\t/// </summary>\n\tpublic abstract class SubStringRevFilter : RevFilter\n\t{\n\t\t///\t<summary>\n\t\t/// Can this string be safely handled by a substring filter?\n\t\t///\t</summary>\n\t\t///\t<param name=\"pattern\">\n\t\t///\tthe pattern text proposed by the user.\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// True if a substring filter can perform this pattern match; false\n\t\t/// if <seealso cref=\"PatternMatchRevFilter\"/> must be used instead.\n\t\t/// </returns>\n\t\tpublic static bool safe(string pattern)\n\t\t{\n\t\t\tfor (int i = 0; i < pattern.Length; i++)\n\t\t\t{\n\t\t\t\tchar c = pattern[i];\n\t\t\t\tswitch (c)\n\t\t\t\t{\n\t\t\t\t\tcase '.':\n\t\t\t\t\tcase '?':\n\t\t\t\t\tcase '*':\n\t\t\t\t\tcase '+':\n\t\t\t\t\tcase '{':\n\t\t\t\t\tcase '}':\n\t\t\t\t\tcase '(':\n\t\t\t\t\tcase ')':\n\t\t\t\t\tcase '[':\n\t\t\t\t\tcase ']':\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate readonly string _patternText;\n\t\tprivate readonly Regex _pattern;\n\n\t\t///\t<summary>\n\t\t/// Construct a new matching filter.\n\t\t///\t</summary>\n\t\t///\t<param name=\"patternText\">\n\t\t///\ttext to locate. This should be a safe string as described by\n\t\t///\tthe <seealso cref=\"safe(string)\"/> as regular expression meta\n\t\t///\tcharacters are treated as literals.\n\t\t/// </param>\n\t\tinternal SubStringRevFilter(string patternText)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(patternText))\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"patternText\");\n\t\t\t}\n\n\t\t\t_patternText = patternText;\n\t\t\t_pattern = new Regex(patternText);\n\t\t}\n\n\t\tpublic override bool include(RevWalk walker, RevCommit cmit)\n\t\t{\n\t\t\treturn _pattern.IsMatch(Text(cmit));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Obtain the raw text to match against.\n\t\t///\t</summary>\n\t\t///\t<param name=\"cmit\">Current commit being evaluated.</param>\n\t\t///\t<returns>\n\t\t/// Sequence for the commit's content that we need to match on.\n\t\t/// </returns>\n\t\tprotected abstract string Text(RevCommit cmit);\n\n\t\tpublic override RevFilter Clone()\n\t\t{\n\t\t\treturn this; // Typically we are actually thread-safe.\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn base.ToString() + \"(\\\"\" + _patternText + \"\\\")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/FixUninterestingGenerator.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Filters out commits marked <see cref=\"RevWalk.UNINTERESTING\"/>.\n\t/// <para />\n\t/// This generator is only in front of another generator that has fully buffered\n\t/// commits, such that we are called only After the <see cref=\"PendingGenerator\"/> has\n\t/// exhausted its input queue and given up. It skips over any uninteresting\n\t/// commits that may have leaked out of the PendingGenerator due to clock skew\n\t/// being detected in the commit objects.\n\t/// </summary>\n\tclass FixUninterestingGenerator : Generator\n\t{\n\t\tprivate readonly Generator _pending;\n\n\t\tpublic FixUninterestingGenerator(Generator pendingGenerator)\n\t\t{\n\t\t\t_pending = pendingGenerator;\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return _pending.OutputType; }\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = _pending.next();\n\t\t\t\tif (c == null) return null;\n\t\t\t\tif ((c.Flags & RevWalk.UNINTERESTING) == 0)\n\t\t\t\t{\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/FooterKey.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Case insensitive key for a <see cref=\"FooterLine\"/>.\n\t/// </summary>\n\tpublic class FooterKey\n\t{\n        /// <summary>\n\t\t/// Standard <code>Signed-off-by</code>\n        /// </summary>\n        public static FooterKey SIGNED_OFF_BY = new FooterKey(\"Signed-off-by\");\n\n\t\t/// <summary>\n\t\t/// Standard <code>Acked-by</code>\n\t\t/// </summary>\n        public static FooterKey ACKED_BY = new FooterKey(\"Acked-by\");\n\n        /// <summary>\n\t\t/// Standard <code>CC</code>\n        /// </summary>\n        public static FooterKey CC = new FooterKey(\"CC\");\n\n        private readonly string _name;\n        private readonly byte[] _raw;\n\n\t\t/// <summary>\n\t\t/// Create a key for a specific footer line.\n\t\t/// </summary>\n\t\t/// <param _name=\"keyName\">Name of the footer line.</param>\n\t\tpublic FooterKey(string keyName)\n\t\t{\n\t\t\tif (keyName == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"keyName\");\n\t\t\t\n\t\t\t_name = keyName;\n\t\t\t_raw = Constants.encode(keyName.ToLowerInvariant());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"FooterKey[\" + _name + \"]\";\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _name; }\n\t\t}\n\n\t\tpublic byte[] Raw\n\t\t{\n\t\t\tget { return _raw; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/FooterLine.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Single line at the end of a message, such as a \"Signed-off-by: someone\".\n\t/// <para />\n\t/// These footer lines tend to be used to represent additional information about\n\t/// a commit, like the path it followed through reviewers before finally being\n\t/// accepted into the project's main repository as an immutable commit.\n\t/// </summary>\n\t/// <seealso cref=\"RevCommit.GetFooterLines()\"/>\n\tpublic class FooterLine\n\t{\n\t\tprivate readonly byte[] _buffer;\n\t\tprivate readonly Encoding _enc;\n\t\tprivate readonly int _keyStart;\n\t\tprivate readonly int _keyEnd;\n\t\tprivate readonly int _valStart;\n\t\tprivate readonly int _valEnd;\n\n\t\tpublic FooterLine(byte[] b, Encoding e, int ks, int ke, int vs, int ve)\n\t\t{\n\t\t\t_buffer = b;\n\t\t\t_enc = e;\n\t\t\t_keyStart = ks;\n\t\t\t_keyEnd = ke;\n\t\t\t_valStart = vs;\n\t\t\t_valEnd = ve;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"key\">\n\t\t/// Key to test this line's key name against.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// true if <code>code key.Name.Equals(Key, StringComparison.InvariantCultureIgnoreCase))</code>.\n\t\t/// </returns>\n\t\tpublic bool Matches(FooterKey key)\n\t\t{\n\t\t\tif (key == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"key\");\n\t\t\t\n\t\t\tbyte[] kRaw = key.Raw;\n\t\t\tint len = kRaw.Length;\n\t\t\tint bPtr = _keyStart;\n\t\t\tif (_keyEnd - bPtr != len) return false;\n\n\t\t\tfor (int kPtr = 0; bPtr < len; )\n\t\t\t{\n\t\t\t\tbyte b = _buffer[bPtr++];\n\t\t\t\tif ('A' <= b && b <= 'Z')\n\t\t\t\t{\n\t\t\t\t\tb += 'a' - 'A';\n\t\t\t\t}\n\n\t\t\t\tif (b != kRaw[kPtr++]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Key name of this footer; that is the text before the \":\" on the\n\t\t/// line footer's line. The text is decoded according to the commit's\n\t\t/// specified (or assumed) character encoding.\n\t\t/// </summary>\n\t\tpublic string Key\n\t\t{\n\t\t\tget { return RawParseUtils.decode(_enc, _buffer, _keyStart, _keyEnd); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Value of this footer; that is the text after the \":\" and any\n\t\t/// leading whitespace has been skipped. May be the empty string if\n\t\t/// the footer has no value (line ended with \":\"). The text is\n\t\t/// decoded according to the commit's specified (or assumed)\n\t\t/// character encoding.\n\t\t/// </summary>\n\t\tpublic string Value\n\t\t{\n\t\t\tget { return RawParseUtils.decode(_enc, _buffer, _valStart, _valEnd); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// Extract the email address (if present) from the footer.\n\t\t/// <para />\n\t\t/// If there is an email address looking string inside of angle brackets\n\t\t/// (e.g. \"&lt;a@b&gt;\"), the return value is the part extracted from inside the\n\t\t/// brackets. If no brackets are found, then <see cref=\"Value\"/> is returned\n\t\t/// if the value contains an '@' sign. Otherwise, null.\n\t\t/// </summary>\n\t\t/// <returns>email address appearing in the value of this footer, or null.</returns>\n\t\tpublic string getEmailAddress()\n\t\t{\n\t\t\tint lt = RawParseUtils.nextLF(_buffer, _valStart, (byte)'<');\n\t\t\tif (_valEnd <= lt)\n\t\t\t{\n\t\t\t\tint at = RawParseUtils.nextLF(_buffer, _valStart, (byte)'@');\n\t\t\t\tif (_valStart < at && at < _valEnd)\n\t\t\t\t{\n\t\t\t\t\treturn Value;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tint gt = RawParseUtils.nextLF(_buffer, lt, (byte)'>');\n\t\t\tif (_valEnd < gt) return null;\n\t\t\t\n\t\t\treturn RawParseUtils.decode(_enc, _buffer, lt, gt - 1);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Key + \": \" + Value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/Generator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.RevWalk\n{\n\n\t/**\n\t * Produces commits for RevWalk to return to applications.\n\t * <para />\n\t * Implementations of this basic class provide the real work behind RevWalk.\n\t * Conceptually a Generator is an iterator or a queue, it returns commits until\n\t * there are no more relevant. Generators may be piped/stacked together to\n\t * Create a more complex set of operations.\n\t * \n\t * @see PendingGenerator\n\t * @see StartGenerator\n\t */\n\tpublic abstract class Generator\n\t{\n\t\t#region Enums\n\n\t\t[Flags]\n\t\t[Serializable]\n\t\tpublic enum GeneratorOutputType\n\t\t{\n\t\t\tNone = 0,\n\n\t\t\t/// <summary>\n\t\t\t/// Commits are sorted by commit date and time, descending.\n\t\t\t/// </summary>\n\t\t\tSortCommitTimeDesc = 1 << 0,\n\n\t\t\t/// <summary>\n\t\t\t/// Output may have <see cref=\"RevWalk.REWRITE\"/> marked on it.\n\t\t\t/// </summary>\n\t\t\tHasRewrite = 1 << 1,\n\n\t\t\t/// <summary>\n\t\t\t/// Output needs <see cref=\"RewriteGenerator\"/>.\n\t\t\t/// </summary>\n\t\t\tNeedsRewrite = 1 << 2,\n\n\t\t\t/// <summary>\n\t\t\t/// Topological ordering is enforced (all children before parents).\n\t\t\t/// </summary>\n\t\t\tSortTopo = 1 << 3,\n\n\t\t\t/// <summary>\n\t\t\t/// Output may have <see cref=\"RevWalk.UNINTERESTING\"/> marked on it.\n\t\t\t/// </summary>\n\t\t\tHasUninteresting = 1 << 4\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Connect the supplied queue to this generator's own free list (if any).\n\t\t/// </summary>\n\t\t/// <param name=\"q\">\n\t\t/// Another FIFO queue that wants to share our queue's free list.\n\t\t/// </param>\n\t\tpublic virtual void shareFreeList(BlockRevQueue q)\n\t\t{\n\t\t\t// Do nothing by default.\n\t\t}\n\n\t\t/// <summary>\n\t\t/// * Obtain flags describing the output behavior of this generator.\n\t\t/// </summary>\n\t\tpublic abstract GeneratorOutputType OutputType { get; }\n\n\t\t/// <summary>\n\t\t/// Return the next commit to the application, or the next generator.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Next available commit; null if no more are to be returned.\n\t\t/// </returns>\n\t\tpublic abstract RevCommit next();\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/LIFORevQueue.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// A queue of commits in LIFO order.\n\t/// </summary>\n\tpublic class LIFORevQueue : BlockRevQueue\n\t{\n\t\tprivate Block _head;\n\n\t\t/// <summary>\n\t\t/// Create an empty LIFO queue.\n\t\t/// </summary>\n\t\tinternal LIFORevQueue()\n\t\t{\n\t\t}\n\n\t\tpublic LIFORevQueue(Generator s)\n\t\t\t: base(s)\n\t\t{\n\t\t}\n\n\t\tpublic override void add(RevCommit c)\n\t\t{\n\t\t\tBlock b = _head;\n\t\t\tif (b == null || !b.canUnpop())\n\t\t\t{\n\t\t\t\tb = Free.newBlock();\n\t\t\t\tb.resetToEnd();\n\t\t\t\tb.Next = _head;\n\t\t\t\t_head = b;\n\t\t\t}\n\t\t\tb.unpop(c);\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\tBlock b = _head;\n\t\t\tif (b == null) return null;\n\n\t\t\tRevCommit c = b.pop();\n\t\t\tif (b.isEmpty())\n\t\t\t{\n\t\t\t\t_head = b.Next;\n\t\t\t\tFree.freeBlock(b);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic override void clear()\n\t\t{\n\t\t\t_head = null;\n\t\t\tFree.clear();\n\t\t}\n\n\t\tinternal override bool everbodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Block b = _head; b != null; b = b.Next)\n\t\t\t{\n\t\t\t\tfor (int i = b.HeadIndex; i < b.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif ((b.Commits[i].Flags & f) == 0) return false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tinternal override bool anybodyHasFlag(int f)\n\t\t{\n\t\t\tfor (Block b = _head; b != null; b = b.Next)\n\t\t\t{\n\t\t\t\tfor (int i = b.HeadIndex; i < b.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif ((b.Commits[i].Flags & f) != 0) return true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar s = new StringBuilder();\n\t\t\tfor (Block q = _head; q != null; q = q.Next)\n\t\t\t{\n\t\t\t\tfor (int i = q.HeadIndex; i < q.TailIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tDescribe(s, q.Commits[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn s.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/MergeBaseGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk.Filter;\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n    /// Computes the merge base(s) of the starting commits.\n\t/// <para />\n\t/// This generator is selected if the RevFilter is only\n\t/// <see cref=\"RevFilter.MERGE_BASE\"/>.\n\t/// <para />\n\t/// To compute the merge base we assign a temporary flag to each of the starting\n\t/// commits. The maximum number of starting commits is bounded by the number of\n\t/// free flags available in the RevWalk when the generator is initialized. These\n\t/// flags will be automatically released on the next reset of the RevWalk, but\n\t/// not until then, as they are assigned to commits throughout the history.\n\t/// <para />\n\t/// Several internal flags are reused here for a different purpose, but this\n\t/// should not have any impact as this generator should be run alone, and without\n\t/// any other generators wrapped around it.\n\t/// </summary>\n    public class MergeBaseGenerator : Generator, IDisposable\n    {\n        private const int Parsed = RevWalk.PARSED;\n        private const int InPending = RevWalk.SEEN;\n        private const int Popped = RevWalk.TEMP_MARK;\n        private const int MergeBase = RevWalk.REWRITE;\n        private readonly RevWalk _walker;\n        private readonly DateRevQueue _pending;\n        private int _branchMask;\n        private int _recarryTest;\n        private int _recarryMask;\n\n        public MergeBaseGenerator(RevWalk w)\n        {\n            _walker = w;\n            _pending = new DateRevQueue();\n        }\n\n        public void init(AbstractRevQueue p)\n        {\n            try\n            {\n                while (true)\n                {\n                    RevCommit c = p.next();\n                    if (c == null) break;\n                    Add(c);\n                }\n            }\n            finally\n            {\n                // Always free the flags immediately. This ensures the flags\n                // will be available for reuse when the walk resets.\n                //\n                _walker.freeFlag(_branchMask);\n\n                // Setup the condition used by CarryOntoOne to detect a late\n                // merge base and produce it on the next round.\n                //\n                _recarryTest = _branchMask | Popped;\n                _recarryMask = _branchMask | Popped | MergeBase;\n            }\n        }\n\n        private void Add(RevCommit c)\n        {\n            int flag = _walker.allocFlag();\n            _branchMask |= flag;\n            if ((c.Flags & _branchMask) != 0)\n            {\n                // This should never happen. RevWalk ensures we get a\n                // commit admitted to the initial queue only once. If\n                // we see this marks aren't correctly erased.\n                //\n                throw new InvalidOperationException(\"Stale RevFlags on \" + c);\n            }\n            c.Flags |= flag;\n            _pending.add(c);\n        }\n\n        public override GeneratorOutputType OutputType\n        {\n\t\t\tget { return GeneratorOutputType.None; }\n        }\n\n        public override RevCommit next()\n        {\n            while (true)\n            {\n                RevCommit c = _pending.next();\n                if (c == null)\n                {\n                    _walker.WindowCursor.Release();\n                    return null;\n                }\n\n                foreach (RevCommit p in c.Parents)\n                {\n                    if ((p.Flags & InPending) != 0) continue;\n                    if ((p.Flags & Parsed) == 0)\n                    {\n                    \tp.parseHeaders(_walker);\n                    }\n                    p.Flags |= InPending;\n                    _pending.add(p);\n                }\n\n                int carry = c.Flags & _branchMask;\n                bool mb = carry == _branchMask;\n                if (mb)\n                {\n                    // If we are a merge base make sure our ancestors are\n                    // also flagged as being popped, so that they do not\n                    // generate to the caller.\n                    //\n                    carry |= MergeBase;\n                }\n                CarryOntoHistory(c, carry);\n\n                if ((c.Flags & MergeBase) != 0)\n                {\n                    // This commit is an ancestor of a merge base we already\n                    // popped back to the caller. If everyone in pending is\n                    // that way we are done traversing; if not we just need\n                    // to move to the next available commit and try again.\n                    //\n                    if (_pending.everbodyHasFlag(MergeBase)) return null;\n                    continue;\n                }\n                c.Flags |= Popped;\n\n            \tif (!mb) continue;\n            \tc.Flags |= MergeBase;\n            \treturn c;\n            }\n        }\n\n        private void CarryOntoHistory(RevCommit c, int carry)\n        {\n            while (true)\n            {\n                RevCommit[] pList = c.Parents;\n                if (pList == null) return;\n                int n = pList.Length;\n                if (n == 0) return;\n\n                for (int i = 1; i < n; i++)\n                {\n                    RevCommit p = pList[i];\n                    if (!CarryOntoOne(p, carry))\n                    {\n                    \tCarryOntoHistory(p, carry);\n                    }\n                }\n\n                c = pList[0];\n                if (CarryOntoOne(c, carry)) break;\n            }\n        }\n\n        private bool CarryOntoOne(RevCommit p, int carry)\n        {\n            bool haveAll = (p.Flags & carry) == carry;\n            p.Flags |= carry;\n\n            if ((p.Flags & _recarryMask) == _recarryTest)\n            {\n                // We were popped without being a merge base, but we just got\n                // voted to be one. Inject ourselves back at the front of the\n                // pending queue and tell all of our ancestors they are within\n                // the merge base now.\n                //\n                p.Flags &= ~Popped;\n                _pending.add(p);\n                CarryOntoHistory(p, _branchMask | MergeBase);\n                return true;\n            }\n\n            // If we already had all carried flags, our parents do too.\n            // Return true to stop the caller from running down this leg\n            // of the revision graph any further.\n            //\n            return haveAll;\n        }\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_walker.Dispose();\n\t\t}\n\t\t\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/ObjectWalk.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n    /// Specialized subclass of RevWalk to include trees, blobs and tags.\n    /// <para />\n    /// Unlike RevWalk this subclass is able to remember starting roots that include\n    /// annotated tags, or arbitrary trees or blobs. Once commit generation is\n    /// complete and all commits have been popped by the application, individual\n    /// annotated tag, tree and blob objects can be popped through the additional\n    /// method <see cref=\"nextObject\"/>.\n    /// <para />\n    /// Tree and blob objects reachable from interesting commits are automatically\n    /// scheduled for inclusion in the results of <see cref=\"nextObject\"/>, returning\n    /// each object exactly once. Objects are sorted and returned according to the\n    /// the commits that reference them and the order they appear within a tree.\n    /// Ordering can be affected by changing the <see cref=\"RevSort\"/> used to order \n    /// the commits that are returned first.\n    /// </summary>\n    public class ObjectWalk : RevWalk\n    {\n        /// <summary>\n        /// Indicates a non-RevCommit is in <see cref=\"PendingObjects\"/>.\n        /// <para />\n        /// We can safely reuse <see cref=\"RevWalk.REWRITE\"/> here for the same value as it\n        /// is only set on RevCommit and <see cref=\"PendingObjects\"/> never has RevCommit\n        /// instances inserted into it.\n        /// </summary>\n        private const int InPending = REWRITE;\n\n        private CanonicalTreeParser _treeWalk;\n        private BlockObjQueue _pendingObjects;\n        private RevTree _currentTree;\n        private RevObject last;\n\n        /// <summary>\n        /// Create a new revision and object walker for a given repository.\n        /// </summary>\n        /// <param name=\"repo\">\n        /// The repository the walker will obtain data from.\n        /// </param>\n        public ObjectWalk(Repository repo)\n            : base(repo)\n        {\n            _pendingObjects = new BlockObjQueue();\n            _treeWalk = new CanonicalTreeParser();\n        }\n\n        /// <summary>\n        /// Mark an object or commit to start graph traversal from. \n        /// <para />\n        /// Callers are encouraged to use <see cref=\"RevWalk.parseAny(AnyObjectId)\"/>\n        /// instead of <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/>, as this method\n        /// requires the object to be parsed before it can be added as a root for the\n        /// traversal.\n        /// <para />\n        /// The method will automatically parse an unparsed object, but error\n        /// handling may be more difficult for the application to explain why a\n        /// RevObject is not actually valid. The object pool of this walker would\n        /// also be 'poisoned' by the invalid <see cref=\"RevObject\"/>.\n        /// <para />\n        /// This method will automatically call <see cref=\"RevWalk.markStart(RevCommit)\"/>\n        /// if passed RevCommit instance, or a <see cref=\"RevTag\"/> that directly (or indirectly)\n        /// references a <see cref=\"RevCommit\"/>.\n        /// </summary>\n        /// <param name=\"o\">\n        /// The object to start traversing from. The object passed must be\n        /// from this same revision walker.\n        /// </param>\n        /// <exception cref=\"MissingObjectException\">\n        /// The object supplied is not available from the object\n        /// database. This usually indicates the supplied object is\n        /// invalid, but the reference was constructed during an earlier\n        /// invocation to <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/>.\n        /// </exception>\n        /// <exception cref=\"IncorrectObjectTypeException\">\n        /// The object was not parsed yet and it was discovered during\n        /// parsing that it is not actually the type of the instance\n        /// passed in. This usually indicates the caller used the wrong\n        /// type in a <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/> call.\n        /// </exception>\n        /// <exception cref=\"Exception\">\n        /// A pack file or loose object could not be Read.\n        /// </exception>\n        public void markStart(RevObject o)\n        {\n            RevTag oTag = (o as RevTag);\n            while (oTag != null)\n            {\n                AddObject(o);\n                o = oTag.getObject();\n                parseHeaders(o);\n            }\n\n            RevCommit oComm = (o as RevCommit);\n            if (oComm != null)\n            {\n                base.markStart(oComm);\n            }\n            else\n            {\n                AddObject(o);\n            }\n        }\n\n        /// <summary>\n        /// Mark an object to not produce in the output.\n        /// <para />\n        /// Uninteresting objects denote not just themselves but also their entire\n        /// reachable chain, back until the merge base of an uninteresting commit and\n        /// an otherwise interesting commit.\n        /// <para />\n        /// Callers are encouraged to use <see cref=\"RevWalk.parseAny(AnyObjectId)\"/>\n        /// instead of <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/>, as this method\n        /// requires the object to be parsed before it can be added as a root for the\n        /// traversal.\n        /// <para />\n        /// The method will automatically parse an unparsed object, but error\n        /// handling may be more difficult for the application to explain why a\n        /// RevObject is not actually valid. The object pool of this walker would\n        /// also be 'poisoned' by the invalid <see cref=\"RevObject\"/>.\n        /// <para />\n        /// This method will automatically call <see cref=\"RevWalk.markStart(RevCommit)\"/>\n        /// if passed RevCommit instance, or a <see cref=\"RevTag\"/> that directly (or indirectly)\n        /// references a <see cref=\"RevCommit\"/>.\n        /// </summary>\n        /// <param name=\"o\">\n        /// The object to start traversing from. The object passed must be\n        /// from this same revision walker.\n        /// </param>\n        /// <exception cref=\"MissingObjectException\">\n        /// The object supplied is not available from the object\n        /// database. This usually indicates the supplied object is\n        /// invalid, but the reference was constructed during an earlier\n        /// invocation to <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/>.\n        /// </exception>\n        /// <exception cref=\"IncorrectObjectTypeException\">\n        /// The object was not parsed yet and it was discovered during\n        /// parsing that it is not actually the type of the instance\n        /// passed in. This usually indicates the caller used the wrong\n        /// type in a <see cref=\"RevWalk.lookupAny(AnyObjectId, int)\"/> call.\n        /// </exception>\n        /// <exception cref=\"Exception\">\n        /// A pack file or loose object could not be Read.\n        /// </exception>\n        public void markUninteresting(RevObject o)\n        {\n            RevTag oTag = (o as RevTag);\n            while (oTag != null)\n            {\n                o.Flags |= UNINTERESTING;\n                if (hasRevSort(RevSort.BOUNDARY))\n                {\n                    AddObject(o);\n                }\n                o = oTag.getObject();\n                parseHeaders(o);\n            }\n\n            RevCommit oComm = (o as RevCommit);\n            if (oComm != null)\n            {\n                base.markUninteresting(oComm);\n            }\n            else if (o is RevTree)\n            {\n                MarkTreeUninteresting(o);\n            }\n            else\n            {\n                o.Flags |= UNINTERESTING;\n            }\n\n            if (o.Type != Constants.OBJ_COMMIT && hasRevSort(RevSort.BOUNDARY))\n            {\n                AddObject(o);\n            }\n        }\n\n        public override RevCommit next()\n        {\n            while (true)\n            {\n                RevCommit r = base.next();\n\n                if (r == null) return null;\n\n                if ((r.Flags & UNINTERESTING) != 0)\n                {\n                    MarkTreeUninteresting(r.Tree);\n\n                    if (hasRevSort(RevSort.BOUNDARY))\n                    {\n                        _pendingObjects.add(r.Tree);\n                        return r;\n                    }\n\n                    continue;\n                }\n\n                _pendingObjects.add(r.Tree);\n\n                return r;\n            }\n        }\n\n        /// <summary>\n        /// Pop the next most recent object.\n        /// </summary>\n        /// <returns>next most recent object; null if traversal is over.</returns>\n        /// <exception cref=\"MissingObjectException\">\n        /// One or or more of the next objects are not available from the\n        /// object database, but were thought to be candidates for\n        /// traversal. This usually indicates a broken link.\n        /// </exception>\n        /// <exception cref=\"IncorrectObjectTypeException\">\n        /// One or or more of the objects in a tree do not match the type indicated.\n        /// </exception>\n        /// <exception cref=\"Exception\">\n        /// A pack file or loose object could not be Read.\n        /// </exception>\n        public RevObject nextObject()\n        {\n            if (last != null)\n            {\n                _treeWalk = last is RevTree ? enter(last) : _treeWalk.next();\n            }\n\n\n            while (!_treeWalk.eof())\n            {\n                FileMode mode = _treeWalk.EntryFileMode;\n\n                switch ((int)mode.ObjectType)\n                {\n                    case Constants.OBJ_BLOB:\n                        _treeWalk.getEntryObjectId(IdBuffer);\n\n                        RevBlob blob = lookupBlob(IdBuffer);\n                        if ((blob.Flags & SEEN) != 0) break;\n\n                        blob.Flags |= SEEN;\n                        if (ShouldSkipObject(blob)) break;\n\n                        last = blob;\n                        return blob;\n\n                    case Constants.OBJ_TREE:\n                        _treeWalk.getEntryObjectId(IdBuffer);\n\n                        RevTree tree = lookupTree(IdBuffer);\n                        if ((tree.Flags & SEEN) != 0) break;\n\n                        tree.Flags |= SEEN;\n                        if (ShouldSkipObject(tree)) break;\n\n                        last = tree;\n                        return tree;\n\n                    default:\n                        if (FileMode.GitLink.Equals(mode.Bits)) break;\n                        _treeWalk.getEntryObjectId(IdBuffer);\n\n                        throw new CorruptObjectException(\"Invalid mode \" + mode\n                                + \" for \" + IdBuffer.Name + \" '\"\n                                + _treeWalk.EntryPathString + \"' in \"\n                                + _currentTree.Name + \".\");\n                }\n\n                _treeWalk = _treeWalk.next();\n            }\n\n            last = null;\n            while (true)\n            {\n                RevObject obj = _pendingObjects.next();\n                if (obj == null) return null;\n                if ((obj.Flags & SEEN) != 0) continue;\n\n                obj.Flags |= SEEN;\n                if (ShouldSkipObject(obj)) continue;\n\n                RevTree oTree = (obj as RevTree);\n                if (oTree != null)\n                {\n                    _currentTree = oTree;\n                    _treeWalk = _treeWalk.resetRoot(Repository, _currentTree, WindowCursor);\n                }\n\n                return obj;\n            }\n        }\n\n        private CanonicalTreeParser enter(RevObject tree)\n        {\n            CanonicalTreeParser p = _treeWalk.createSubtreeIterator0(Repository, tree, WindowCursor);\n            if (p.eof())\n            {\n                // We can't tolerate the subtree being an empty tree, as\n                // that will break us out early before we visit all names.\n                // If it is, advance to the parent's next record.\n                //\n                return _treeWalk.next();\n            }\n            return p;\n        }\n\n        private bool ShouldSkipObject(RevObject o)\n        {\n            return (o.Flags & UNINTERESTING) != 0 && !hasRevSort(RevSort.BOUNDARY);\n        }\n\n        /// <summary>\n        /// Verify all interesting objects are available, and reachable.\n        /// <para />\n        /// Callers should populate starting points and ending points with\n        /// <see cref=\"markStart(RevObject)\"/> and <see cref=\"markUninteresting(RevObject)\"/>\n        /// and then use this method to verify all objects between those two points\n        /// exist in the repository and are readable.\n        /// <para />\n        /// This method returns successfully if everything is connected; it throws an\n        /// exception if there is a connectivity problem. The exception message\n        /// provides some detail about the connectivity failure.\n        /// </summary>\n        /// <exception cref=\"MissingObjectException\">\n        /// One or or more of the next objects are not available from the\n        /// object database, but were thought to be candidates for\n        /// traversal. This usually indicates a broken link.\n        /// </exception>\n        /// <exception cref=\"IncorrectObjectTypeException\">\n        /// One or or more of the objects in a tree do not match the type\n        /// indicated.\n        /// </exception>\n        /// <exception cref=\"Exception\">\n        /// A pack file or loose object could not be Read.\n        /// </exception>\n        public void checkConnectivity()\n        {\n            while (true)\n            {\n                RevCommit c = next();\n                if (c == null) break;\n            }\n\n            while (true)\n            {\n                RevObject o = nextObject();\n                if (o == null) break;\n\n                if (o is RevBlob && !Repository.HasObject(o))\n                {\n                    throw new MissingObjectException(o, Constants.TYPE_BLOB);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Get the current object's complete path.\n        /// <para />\n        /// This method is not very efficient and is primarily meant for debugging\n        /// and output generation. Applications should try to avoid calling it,\n        /// and if invoked do so only once per interesting entry, where the name is\n        /// absolutely required for correct function.\n        /// </summary>\n        /// <returns>\n        /// Complete path of the current entry, from the root of the\n        /// repository. If the current entry is in a subtree there will be at\n        /// least one '/' in the returned string. Null if the current entry\n        /// has no path, such as for annotated tags or root level trees.\n        /// </returns>\n        public string PathString\n        {\n            get { return last != null ? _treeWalk.EntryPathString : null; }\n        }\n\n        public override void Dispose()\n        {\n            base.Dispose();\n            _pendingObjects = new BlockObjQueue();\n            _treeWalk = new CanonicalTreeParser();\n            _currentTree = null;\n            last = null;\n        }\n\n        internal override void reset(int retainFlags)\n        {\n            base.reset(retainFlags);\n            _pendingObjects = new BlockObjQueue();\n            _treeWalk = new CanonicalTreeParser();\n            _currentTree = null;\n            last = null;\n        }\n\n        private void AddObject(RevObject obj)\n        {\n            if ((obj.Flags & InPending) != 0) return;\n\n            obj.Flags |= InPending;\n            _pendingObjects.add(obj);\n        }\n\n        private void MarkTreeUninteresting(RevObject tree)\n        {\n            if ((tree.Flags & UNINTERESTING) != 0) return;\n            tree.Flags |= UNINTERESTING;\n\n            _treeWalk = _treeWalk.resetRoot(Repository, tree, WindowCursor);\n            while (!_treeWalk.eof())\n            {\n                FileMode mode = _treeWalk.EntryFileMode;\n                var sType = (int)mode.ObjectType;\n\n                switch (sType)\n                {\n                    case Constants.OBJ_BLOB:\n                        _treeWalk.getEntryObjectId(IdBuffer);\n                        lookupBlob(IdBuffer).Flags |= UNINTERESTING;\n                        break;\n\n                    case Constants.OBJ_TREE:\n                        _treeWalk.getEntryObjectId(IdBuffer);\n                        RevTree t = lookupTree(IdBuffer);\n                        if ((t.Flags & UNINTERESTING) == 0)\n                        {\n                            t.Flags |= UNINTERESTING;\n                            _treeWalk = _treeWalk.createSubtreeIterator0(Repository, t, WindowCursor);\n                            continue;\n                        }\n                        break;\n\n                    default:\n                        if (FileMode.GitLink == FileMode.FromBits(mode.Bits)) break;\n                        _treeWalk.getEntryObjectId(IdBuffer);\n\n                        throw new CorruptObjectException(\"Invalid mode \" + mode\n                                + \" for \" + IdBuffer + \" \"\n                                + _treeWalk.EntryPathString + \" in \" + tree + \".\");\n                }\n\n                _treeWalk = _treeWalk.next();\n            }\n        }\n\n        public CanonicalTreeParser TreeWalk\n        {\n            get { return _treeWalk; }\n        }\n\n        public BlockObjQueue PendingObjects\n        {\n            get { return _pendingObjects; }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/PendingGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk.Filter;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Default (and first pass) RevCommit Generator implementation for RevWalk.\n\t/// <para />\n\t/// This generator starts from a set of one or more commits and process them in\n\t/// descending (newest to oldest) commit time order. Commits automatically cause\n\t/// their parents to be enqueued for further processing, allowing the entire\n\t/// commit graph to be walked. A <see cref=\"RevFilter\"/> may be used to select a subset\n\t/// of the commits and return them to the caller.\n\t/// </summary>\n\tpublic class PendingGenerator : Generator, IDisposable\n\t{\n\t\tprivate static readonly RevCommit InitLast;\n\n\t\t/**\n\t\t * Number of additional commits to scan After we think we are done.\n\t\t * <para />\n\t\t * This small buffer of commits is scanned to ensure we didn't miss anything\n\t\t * as a result of clock skew when the commits were made. We need to set our\n\t\t * constant to 1 additional commit due to the use of a pre-increment\n\t\t * operator when accessing the value.\n\t\t */\n\t\tpublic static readonly int OVER_SCAN = 5 + 1;\n\t\tpublic static readonly int PARSED = RevWalk.PARSED;\n\t\tpublic static readonly int SEEN = RevWalk.SEEN;\n\t\tpublic static readonly int UNINTERESTING = RevWalk.UNINTERESTING;\n\n\t\tprivate readonly RevFilter _filter;\n\t\tprivate readonly GeneratorOutputType _outputType;\n\t\tprivate readonly DateRevQueue _pending;\n\t\tprivate readonly RevWalk _walker;\n\n\t\tpublic bool CanDispose { get; set; }\n\n\t\t/** Last commit produced to the caller from {@link #Next()}. */\n\t\tprivate RevCommit _last = InitLast;\n\n\t\t/** \n         * Number of commits we have remaining in our over-scan allotment.\n         * <para />\n         * Only relevant if there are {@link #UNINTERESTING} commits in the\n         * {@link #_pending} queue.\n         */\n\t\tprivate int _overScan = OVER_SCAN;\n\n\t\tstatic PendingGenerator()\n\t\t{\n\t\t\tInitLast = new RevCommit(ObjectId.ZeroId) { CommitTime = int.MaxValue };\n\t\t}\n\n\t\tpublic PendingGenerator(RevWalk w, DateRevQueue p, RevFilter f, GeneratorOutputType outputType)\n\t\t{\n\t\t\t_walker = w;\n\t\t\t_pending = p;\n\t\t\t_filter = f;\n\t\t\t_outputType = outputType;\n\t\t\tCanDispose = true;\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return _outputType | GeneratorOutputType.SortCommitTimeDesc; }\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tRevCommit c = _pending.next();\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_walker.WindowCursor.Release();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tbool produce = !((c.Flags & UNINTERESTING) != 0) && _filter.include(_walker, c);\n\n\t\t\t\t\tforeach (RevCommit p in c.Parents)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((p.Flags & SEEN) != 0) continue;\n\t\t\t\t\t\tif ((p.Flags & PARSED) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tp.parseHeaders(_walker);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp.Flags |= SEEN;\n\t\t\t\t\t\t_pending.add(p);\n\t\t\t\t\t}\n\t\t\t\t\t_walker.carryFlagsImpl(c);\n\n\t\t\t\t\tif ((c.Flags & UNINTERESTING) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_pending.everbodyHasFlag(UNINTERESTING))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRevCommit n = _pending.peek();\n\t\t\t\t\t\t\tif (n != null && n.CommitTime >= _last.CommitTime)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// This is too close to call. The Next commit we\n\t\t\t\t\t\t\t\t// would pop is dated After the last one produced.\n\t\t\t\t\t\t\t\t// We have to keep going to ensure that we carry\n\t\t\t\t\t\t\t\t// flags as much as necessary.\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t_overScan = OVER_SCAN;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (--_overScan == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthrow StopWalkException.INSTANCE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_overScan = OVER_SCAN;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (CanDispose)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t    c.DisposeBody();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (produce)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn _last = c;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (CanDispose)\n\t\t\t\t\t{\n\t\t\t\t\t    c.DisposeBody();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (StopWalkException)\n\t\t\t{\n\t\t\t\t_walker.WindowCursor.Release();\n\t\t\t\t_pending.clear();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_walker.Dispose();\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevBlob.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n\t/// A binary file, or a symbolic link.\n    /// </summary>\n    public class RevBlob : RevObject\n    {\n        /// <summary>\n        /// Create a new blob reference.\n        /// </summary>\n\t\t/// <param name=\"id\">object name for the blob.</param>\n        internal RevBlob(AnyObjectId id)\n            : base(id)\n        {\n        }\n\n    \tpublic override int Type\n    \t{\n    \t\tget { return Constants.OBJ_BLOB; }\n    \t}\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevCommit.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// A commit reference to a commit in the DAG.\n\t/// </summary>\n\tpublic class RevCommit : RevObject\n\t{\n\t\tinternal static readonly RevCommit[] NoParents = { };\n\n\t\tprivate RevTree _tree;\n\t\tprivate byte[] _buffer;\n\n\t\t/// <summary>\n\t\t/// Create a new commit reference.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">object name for the commit.</param>\n\t\tpublic RevCommit(AnyObjectId id)\n\t\t\t: base(id)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the time from the \"committer \" line of the buffer.\n\t\t/// </summary>\n\t\tpublic int CommitTime { get; set; }\n\n\t\tpublic int InDegree { get; set; }\n\n\t\t/// <summary>\n\t\t/// Obtain an array of all parents (<b>NOTE - THIS IS NOT A COPY</b>).\n\t\t/// <para />\n\t\t/// This method is exposed only to provide very fast, efficient access to\n\t\t/// this commit's parent list. Applications relying on this list should be\n\t\t/// very careful to ensure they do not modify its contents during their use\n\t\t/// of it.\n\t\t/// </summary>\n\t\tpublic RevCommit[] Parents { get; set; }\n\n\t\t/// <summary>\n\t\t/// Get a reference to this commit's tree.\n\t\t/// </summary>\n\t\tpublic RevTree Tree\n\t\t{\n\t\t\tget { return _tree; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the number of parent commits listed in this commit.\n\t\t/// </summary>\n\t\tpublic int ParentCount\n\t\t{\n\t\t\tget { return Parents.Length; }\n\t\t}\n\n        internal override void parseHeaders(RevWalk walk)\n        {\n            parseCanonical(walk, loadCanonical(walk));\n        }\n\n        internal override void parseBody(RevWalk walk)\n        {\n            if (_buffer == null)\n            {\n                _buffer = loadCanonical(walk);\n                if ((Flags & PARSED) == 0)\n                    parseCanonical(walk, _buffer);\n            }\n        }\n\n\t\tpublic void parseCanonical(RevWalk walk, byte[] raw)\n\t\t{\n\t\t\tMutableObjectId idBuffer = walk.IdBuffer;\n\t\t\tidBuffer.FromString(raw, 5);\n\t\t\t_tree = walk.lookupTree(idBuffer);\n\n\t\t\tint ptr = 46;\n\t\t\tif (Parents == null)\n\t\t\t{\n\t\t\t\tvar pList = new RevCommit[1];\n\t\t\t\tint nParents = 0;\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tif (raw[ptr] != (byte)'p') break;\n\t\t\t\t\tidBuffer.FromString(raw, ptr + 7);\n\t\t\t\t\tRevCommit p = walk.lookupCommit(idBuffer);\n\t\t\t\t\tif (nParents == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpList[nParents++] = p;\n\t\t\t\t\t}\n\t\t\t\t\telse if (nParents == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tpList = new[] { pList[0], p };\n\t\t\t\t\t\tnParents = 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (pList.Length <= nParents)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRevCommit[] old = pList;\n\t\t\t\t\t\t\tpList = new RevCommit[pList.Length + 32];\n\t\t\t\t\t\t\tArray.Copy(old, 0, pList, 0, nParents);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpList[nParents++] = p;\n\t\t\t\t\t}\n\t\t\t\t\tptr += 48;\n\t\t\t\t}\n\t\t\t\tif (nParents != pList.Length)\n\t\t\t\t{\n\t\t\t\t\tRevCommit[] old = pList;\n\t\t\t\t\tpList = new RevCommit[nParents];\n\t\t\t\t\tArray.Copy(old, 0, pList, 0, nParents);\n\t\t\t\t}\n\t\t\t\tParents = pList;\n\t\t\t}\n\n\t\t\t// extract time from \"committer \"\n\t\t\tptr = RawParseUtils.committer(raw, ptr);\n\t\t\tif (ptr > 0)\n\t\t\t{\n\t\t\t\tptr = RawParseUtils.nextLF(raw, ptr, (byte)'>');\n\n\t\t\t\t// In 2038 commitTime will overflow unless it is changed to long.\n\t\t\t\tCommitTime = RawParseUtils.parseBase10(raw, ptr, null);\n\t\t\t}\n\n\t\t\tif (walk.isRetainBody())\n\t\t\t\t_buffer = raw;\n\t\t\tFlags |= PARSED;\n\t\t}\n\n\t\tpublic override int Type\n\t\t{\n\t\t\tget { return Constants.OBJ_COMMIT; }\n\t\t}\n\n\t\tpublic static void carryFlags(RevCommit c, int carry)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit[] pList = c.Parents;\n\t\t\t\tif (pList == null) return;\n\t\t\t\tint n = pList.Length;\n\t\t\t\tif (n == 0) return;\n\n\t\t\t\tfor (int i = 1; i < n; i++)\n\t\t\t\t{\n\t\t\t\t\tRevCommit p = pList[i];\n\t\t\t\t\tif ((p.Flags & carry) == carry) continue;\n\t\t\t\t\tp.Flags |= carry;\n\t\t\t\t\tcarryFlags(p, carry);\n\t\t\t\t}\n\n\t\t\t\tc = pList[0];\n\t\t\t\tif ((c.Flags & carry) == carry) return;\n\t\t\t\tc.Flags |= carry;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Carry a RevFlag set on this commit to its parents.\n\t\t/// <para />\n\t\t/// If this commit is parsed, has parents, and has the supplied flag set on\n\t\t/// it we automatically add it to the parents, grand-parents, and so on until\n\t\t/// an unparsed commit or a commit with no parents is discovered. This\n\t\t/// permits applications to force a flag through the history chain when\n\t\t/// necessary.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">\n\t\t/// The single flag value to carry back onto parents.\n\t\t/// </param>\n\t\tpublic void carry(RevFlag flag)\n\t\t{\n\t\t\tint carry = Flags & flag.Mask;\n\t\t\tif (carry != 0)\n\t\t\t{\n\t\t\t\tcarryFlags(this, carry);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse this commit buffer for display.\n\t\t/// </summary>\n\t\t/// <param name=\"walk\">\n\t\t/// revision walker owning this reference.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Parsed commit.\n\t\t/// </returns>\n\t\tpublic Commit AsCommit(RevWalk walk)\n\t\t{\n\t\t\treturn new Commit(walk.Repository, this, _buffer);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the nth parent from this commit's parent list.\n\t\t/// </summary>\n\t\t/// <param name=\"nth\">\n\t\t/// the specified parent\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Parent index to obtain. Must be in the range 0 through\n\t\t/// <see cref=\"ParentCount\"/>-1.\n\t\t/// </returns>\n\t\t/// <exception cref=\"IndexOutOfRangeException\">\n\t\t/// An invalid parent index was specified.\n\t\t/// </exception>\n\t\tpublic RevCommit GetParent(int nth)\n\t\t{\n\t\t\treturn Parents[nth];\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Obtain the raw unparsed commit body (<b>NOTE - THIS IS NOT A COPY</b>).\n\t\t/// <para />\n\t\t/// This method is exposed only to provide very fast, efficient access to\n\t\t/// this commit's message buffer within a RevFilter. Applications relying on\n\t\t/// this buffer should be very careful to ensure they do not modify its\n\t\t/// contents during their use of it.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This property returns the raw unparsed commit body. This is <b>NOT A COPY</b>.\n\t\t/// Altering the contents of this buffer may alter the walker's\n\t\t/// knowledge of this commit, and the results it produces.\n\t\t/// </remarks>\n\t\tpublic byte[] RawBuffer\n\t\t{\n\t\t\tget { return _buffer; }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse the author identity from the raw buffer.\n\t\t/// <para />\n\t\t/// This method parses and returns the content of the author line, after\n\t\t/// taking the commit's character set into account and decoding the author\n\t\t/// name and email address. This method is fairly expensive and produces a\n\t\t/// new PersonIdent instance on each invocation. Callers should invoke this\n\t\t/// method only if they are certain they will be outputting the result, and\n\t\t/// should cache the return value for as long as necessary to use all\n\t\t/// information from it.\n\t\t/// <para />\n\t\t/// <see cref=\"RevFilter\"/> implementations should try to use <seealso cref=\"RawParseUtils\"/> to scan\n\t\t/// the <seealso cref=\"RawBuffer\"/> instead, as this will allow faster evaluation\n\t\t/// of commits.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Identity of the author (name, email) and the time the commit was\n\t\t/// made by the author; null if no author line was found.\n\t\t/// </returns>\n\t\tpublic PersonIdent getAuthorIdent()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint nameB = RawParseUtils.author(raw, 0);\n\t\t\tif (nameB < 0) return null;\n\t\t\treturn RawParseUtils.parsePersonIdent(raw, nameB);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse the committer identity from the raw buffer.\n\t\t/// <para />\n\t\t/// This method parses and returns the content of the committer line, after\n\t\t/// taking the commit's character set into account and decoding the committer\n\t\t/// name and email address. This method is fairly expensive and produces a\n\t\t/// new PersonIdent instance on each invocation. Callers should invoke this\n\t\t/// method only if they are certain they will be outputting the result, and\n\t\t/// should cache the return value for as long as necessary to use all\n\t\t/// information from it.\n\t\t/// <para />\n\t\t/// <see cref=\"RevFilter\"/> implementations should try to use <seealso cref=\"RawParseUtils\"/> to scan\n\t\t/// the <seealso cref=\"RawBuffer\"/> instead, as this will allow faster evaluation\n\t\t/// of commits.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Identity of the committer (name, email) and the time the commit\n\t\t/// was made by the committer; null if no committer line was found.\n\t\t/// </returns>\n\t\tpublic PersonIdent getCommitterIdent()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint nameB = RawParseUtils.committer(raw, 0);\n\t\t\tif (nameB < 0) return null;\n\t\t\treturn RawParseUtils.parsePersonIdent(raw, nameB);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse the complete commit message and decode it to a string.\n\t\t/// <para />\n\t\t/// This method parses and returns the message portion of the commit buffer,\n\t\t/// After taking the commit's character set into account and decoding the\n\t\t/// buffer using that character set. This method is a fairly expensive\n\t\t/// operation and produces a new string on each invocation.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Decoded commit message as a string. Never null.\n\t\t/// </returns>\n\t\tpublic string getFullMessage()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint msgB = RawParseUtils.commitMessage(raw, 0);\n\t\t\tif (msgB < 0) return string.Empty;\n\t\t\tEncoding enc = RawParseUtils.parseEncoding(raw);\n\t\t\treturn RawParseUtils.decode(enc, raw, msgB, raw.Length);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse the commit message and return the first \"line\" of it.\n\t\t/// <para />\n\t\t/// The first line is everything up to the first pair of LFs. This is the\n\t\t/// \"oneline\" format, suitable for output in a single line display.\n\t\t/// <para />\n\t\t/// This method parses and returns the message portion of the commit buffer,\n\t\t/// after taking the commit's character set into account and decoding the\n\t\t/// buffer using that character set. This method is a fairly expensive\n\t\t/// operation and produces a new string on each invocation.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Decoded commit message as a string. Never null. The returned\n\t\t/// string does not contain any LFs, even if the first paragraph\n\t\t/// spanned multiple lines. Embedded LFs are converted to spaces.\n\t\t/// </returns>\n\t\tpublic string getShortMessage()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint msgB = RawParseUtils.commitMessage(raw, 0);\n\t\t\tif (msgB < 0)\n\t\t\t\treturn string.Empty;\n\n\t\t\tEncoding enc = RawParseUtils.parseEncoding(raw);\n\t\t\tint msgE = RawParseUtils.endOfParagraph(raw, msgB);\n\t\t\tstring str = RawParseUtils.decode(enc, raw, msgB, msgE);\n\t\t\tif (hasLF(raw, msgB, msgE))\n\t\t\t\tstr = str.Replace('\\n', ' ');\n\t\t\treturn str;\n\t\t}\n\n\t\tpublic static bool hasLF(byte[] r, int b, int e)\n\t\t{\n\t\t\twhile (b < e)\n\t\t\t{\n\t\t\t\tif (r[b++] == (byte)'\\n') return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Determine the encoding of the commit message buffer.\n\t\t/// <para />\n\t\t/// Locates the \"encoding\" header (if present) and then returns the proper\n\t\t/// character set to apply to this buffer to evaluate its contents as\n\t\t/// character data.\n\t\t/// <para />\n\t\t/// If no encoding header is present, <seealso cref=\"Constants.CHARSET\"/> is assumed.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The preferred encoding of <seealso cref=\"RawBuffer\"/>. \n\t\t/// </returns>\n\t\tpublic Encoding Encoding\n\t\t{\n\t\t\tget { return RawParseUtils.parseEncoding(_buffer); }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse the footer lines (e.g. \"Signed-off-by\") for machine processing.\n\t\t/// <para />\n\t\t/// This method splits all of the footer lines out of the last paragraph of\n\t\t/// the commit message, providing each line as a key-value pair, ordered by\n\t\t/// the order of the line's appearance in the commit message itself.\n\t\t/// <para />\n\t\t/// A footer line's key must match the pattern {@code ^[A-Za-z0-9-]+:}, while\n\t\t/// the value is free-form, but must not contain an LF. Very common keys seen\n\t\t/// in the wild are:\n\t\t/// <ul>\n\t\t/// <li>{@code Signed-off-by} (agrees to Developer Certificate of Origin)</li>\n\t\t/// <li>{@code Acked-by} (thinks change looks sane in context)</li>\n\t\t/// <li>{@code Reported-by} (originally found the issue this change fixes)</li>\n\t\t/// <li>{@code Tested-by} (validated change fixes the issue for them)</li>\n\t\t/// <li>{@code CC}, {@code Cc} (copy on all email related to this change)</li>\n\t\t/// <li>{@code Bug} (link to project's bug tracking system)</li>\n\t\t/// </ul>\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Ordered list of footer lines; empty list if no footers found.\n\t\t/// </returns>\n\t\tpublic IList<FooterLine> GetFooterLines()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint ptr = raw.Length - 1;\n\t\t\twhile (raw[ptr] == '\\n') // trim any trailing LFs, not interesting\n\t\t\t{\n\t\t\t\tptr--;\n\t\t\t}\n\n\t\t\tint msgB = RawParseUtils.commitMessage(raw, 0);\n\t\t\tvar r = new List<FooterLine>(4);\n\t\t\tEncoding enc = Encoding;\n\t\t\t\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tptr = RawParseUtils.prevLF(raw, ptr);\n\t\t\t\tif (ptr <= msgB)\n\t\t\t\t{\n\t\t\t\t\tbreak; // Don't parse commit headers as footer lines.\n\t\t\t\t}\n\n\t\t\t\tint keyStart = ptr + 2;\n\t\t\t\tif (raw[keyStart] == '\\n')\n\t\t\t\t{\n\t\t\t\t\tbreak; // Stop at first paragraph break, no footers above it.\n\t\t\t\t}\n\n\t\t\t\tint keyEnd = RawParseUtils.endOfFooterLineKey(raw, keyStart);\n\t\t\t\tif (keyEnd < 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue; // Not a well formed footer line, skip it.\n\t\t\t\t}\n\n\t\t\t\t// Skip over the ': *' at the end of the key before the value.\n\t\t\t\t//\n\t\t\t\tint valStart = keyEnd + 1;\n\t\t\t\twhile (valStart < raw.Length && raw[valStart] == ' ')\n\t\t\t\t{\n\t\t\t\t\tvalStart++;\n\t\t\t\t}\n\n\t\t\t\t// Value ends at the LF, and does not include it.\n\t\t\t\t//\n\t\t\t\tint valEnd = RawParseUtils.nextLF(raw, valStart);\n\t\t\t\tif (raw[valEnd - 1] == '\\n')\n\t\t\t\t{\n\t\t\t\t\tvalEnd--;\n\t\t\t\t}\n\n\t\t\t\tr.Add(new FooterLine(raw, enc, keyStart, keyEnd, valStart, valEnd));\n\t\t\t}\n\n\t\t\tr.Reverse();\n\n\t\t\treturn r;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get the values of all footer lines with the given key.\n\t\t/// </summary>\n\t\t/// <param name=\"keyName\">\n\t\t/// footer key to find values of, case insensitive.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// values of footers with key of <paramref name=\"keyName\"/>,  ordered by their \n\t\t/// order of appearance. Duplicates may be returned if the same\n\t\t/// footer appeared more than once. Empty list if no footers appear\n\t\t/// with the specified key, or there are no footers at all.\n\t\t/// </returns>\n\t\t///\t<seealso cref=\"GetFooterLines()\" />\n\t\tpublic IList<string> GetFooterLines(string keyName)\n\t\t{\n\t\t\treturn GetFooterLines(new FooterKey(keyName));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get the values of all footer lines with the given key.\n\t\t/// </summary>\n\t\t/// <param name=\"keyName\">\n\t\t/// footer key to find values of, case insensitive.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// values of footers with key of <paramref name=\"keyName\"/>,  ordered by their \n\t\t/// order of appearance. Duplicates may be returned if the same\n\t\t/// footer appeared more than once. Empty list if no footers appear\n\t\t/// with the specified key, or there are no footers at all.\n\t\t/// </returns>\n\t\t///\t<seealso cref=\"GetFooterLines()\" />\n        public IList<string> GetFooterLines(FooterKey keyName)\n\t\t{\n\t\t    IList<FooterLine> src = GetFooterLines();\n\t\t    if (src.isEmpty())\n\t\t    {\n\t\t        return new List<string>();\n\t\t    }\n\n\t\t    var r = new List<String>(src.Count);\n\t\t    foreach (FooterLine f in src)\n\t\t    {\n\t\t        if (f.Matches(keyName))\n\t\t        {\n\t\t            r.Add(f.Value);\n\t\t        }\n\t\t    }\n\t\t    return r;\n\t\t}\n\n\t    /// <summary>\n\t\t/// Reset this commit to allow another RevWalk with the same instances.\n\t\t/// <para />\n\t\t/// Subclasses <b>must</b> call <code>base.reset()</code> to ensure the\n\t\t/// basic information can be correctly cleared out.\n\t\t/// </summary>\n\t\tpublic virtual void reset()\n\t\t{\n\t\t\tInDegree = 0;\n\t\t}\n\n        public new void DisposeBody()\n        {\n            _buffer = null;\n        }\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar s = new StringBuilder();\n\t\t\ts.Append(Constants.typeString(Type));\n\t\t\ts.Append(' ');\n\t\t\ts.Append(Name);\n\t\t\ts.Append(' ');\n\t\t\ts.Append(CommitTime);\n\t\t\ts.Append(' ');\n\t\t\tappendCoreFlags(s);\n\t\t\treturn s.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevCommitList.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.RevWalk.Filter;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// An ordered list of <see cref=\"RevCommit\"/> subclasses.\n\t/// </summary>\n\t/// <typeparam name=\"T\">type of subclass of RevCommit the list is storing.</typeparam>\n\tpublic class RevCommitList<T> : RevObjectList<T>, IDisposable\n\t\twhere T : RevCommit\n\t{\n\t\tprivate RevWalk _walker;\n\n\t\tpublic override void clear()\n\t\t{\n\t\t\tbase.clear();\n\t\t\t_walker = null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Apply a flag to all commits matching the specified filter.\n\t\t/// \n\t\t/// <code>applyFlag(matching, flag, 0, size())</code>, but without\n\t\t/// the incremental behavior.\n\t\t/// </summary>\n\t\t/// <param name=\"matching\">\n\t\t/// the filter to test commits with. If the filter includes a\n\t\t/// commit it will have the flag set; if the filter does not\n\t\t/// include the commit the flag will be unset.\n\t\t/// </param>\n\t\t/// <param name=\"flag\">\n\t\t/// revision filter needed to Read additional objects, but an\n\t\t/// error occurred while reading the pack files or loose objects\n\t\t/// of the repository.\n\t\t/// </param>\n\t\tpublic void applyFlag(RevFilter matching, RevFlag flag)\n\t\t{\n\t\t\tapplyFlag(matching, flag, 0, Size);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Apply a flag to all commits matching the specified filter.\n\t\t/// \n\t\t/// This version allows incremental testing and application, such as from a\n\t\t/// background thread that needs to periodically halt processing and send\n\t\t/// updates to the UI.\n\t\t/// </summary>\n\t\t/// <param name=\"matching\">\n\t\t/// the filter to test commits with. If the filter includes a\n\t\t/// commit it will have the flag set; if the filter does not\n\t\t/// include the commit the flag will be unset.\n\t\t/// </param>\n\t\t/// <param name=\"flag\">\n\t\t/// the flag to Apply (or remove). Applications are responsible\n\t\t/// for allocating this flag from the source RevWalk.\n\t\t/// </param>\n\t\t/// <param name=\"rangeBegin\">\n\t\t/// first commit within the list to begin testing at, inclusive.\n\t\t/// Must not be negative, but may be beyond the end of the list.\n\t\t/// </param>\n\t\t/// <param name=\"rangeEnd\">\n\t\t/// last commit within the list to end testing at, exclusive. If\n\t\t/// smaller than or equal to <code>rangeBegin</code> then no\n\t\t/// commits will be tested.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t/// Revision filter needed to Read additional objects, but an\n\t\t/// error occurred while reading the pack files or loose objects\n\t\t/// of the repository.\n\t\t/// </remarks>\n\t\tpublic void applyFlag(RevFilter matching, RevFlag flag, int rangeBegin, int rangeEnd)\n\t\t{\n\t\t\tRevWalk w = flag.Walker;\n\t\t\trangeEnd = Math.Min(rangeEnd, Size);\n\t\t\twhile (rangeBegin < rangeEnd)\n\t\t\t{\n\t\t\t\tint index = rangeBegin;\n\t\t\t\tBlock s = Contents;\n\n\t\t\t\twhile (s.Shift > 0)\n\t\t\t\t{\n\t\t\t\t\tint i = index >> s.Shift;\n\t\t\t\t\tindex -= i << s.Shift;\n\t\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t\t}\n\n\t\t\t\twhile (rangeBegin++ < rangeEnd && index < BLOCK_SIZE)\n\t\t\t\t{\n\t\t\t\t\tvar c = (RevCommit)s.Contents[index++];\n\n\t\t\t\t\tif (matching.include(w, c))\n\t\t\t\t\t{\n\t\t\t\t\t\tc.add(flag);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tc.remove(flag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Remove the given flag from all commits.\n\t\t/// \n\t\t/// Same as <code>clearFlag(flag, 0, size())</code>, but without the\n\t\t/// incremental behavior.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">the flag to remove. Applications are responsible for\n\t\t/// allocating this flag from the source <see cref=\"RevWalk\"/>.</param>\n\t\tpublic void clearFlag(RevFlag flag)\n\t\t{\n\t\t\tclearFlag(flag, 0, Size);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Remove the given flag from all commits.\n\t\t/// \n\t\t/// This method is actually implemented in terms of:\n\t\t/// <code>applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd)</code>.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">\n\t\t/// The flag to remove. Applications are responsible for\n\t\t/// allocating this flag from the source <see cref=\"RevWalk\"/>.\n\t\t/// </param>\n\t\t/// <param name=\"rangeBegin\">\n\t\t/// First commit within the list to begin testing at, inclusive.\n\t\t/// Must not be negative, but may be beyond the end of the list.\n\t\t/// </param>\n\t\t/// <param name=\"rangeEnd\">\n\t\t/// Last commit within the list to end testing at, exclusive. If\n\t\t/// smaller than or equal to <code>rangeBegin</code> then no\n\t\t/// commits will be tested.\n\t\t/// </param>\n\t\tpublic void clearFlag(RevFlag flag, int rangeBegin, int rangeEnd)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tapplyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd);\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\t// Never happen. The filter we use does not throw any\n\t\t\t\t// exceptions, for any reason.\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Find the next commit that has the given flag set.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">the flag to test commits against.</param>\n\t\t/// <param name=\"begin\">\n\t\t/// First commit index to test at. Applications may wish to begin\n\t\t/// at 0, to test the first commit in the list.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Index of the first commit at or After index <code>begin</code>\n\t\t/// that has the specified flag set on it; -1 if no match is found.\n\t\t/// </returns>\n\t\tpublic int indexOf(RevFlag flag, int begin)\n\t\t{\n\t\t\twhile (begin < Size)\n\t\t\t{\n\t\t\t\tint index = begin;\n\t\t\t\tBlock s = Contents;\n\t\t\t\twhile (s.Shift > 0)\n\t\t\t\t{\n\t\t\t\t\tint i = index >> s.Shift;\n\t\t\t\t\tindex -= i << s.Shift;\n\t\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t\t}\n\n\t\t\t\twhile (begin++ < Size && index < BLOCK_SIZE)\n\t\t\t\t{\n\t\t\t\t\tvar c = (RevCommit)s.Contents[index++];\n\t\t\t\t\tif (c.has(flag))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn begin;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Find the next commit that has the given flag set.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">the flag to test commits against.</param>\n\t\t/// <param name=\"begin\">\n\t\t/// First commit index to test at. Applications may wish to begin\n\t\t/// at <code>size()-1</code>, to test the last commit in the\n\t\t/// list.</param>\n\t\t/// <returns>\n\t\t/// Index of the first commit at or before index <code>begin</code>\n\t\t/// that has the specified flag set on it; -1 if no match is found.\n\t\t/// </returns>\n\t\tpublic int LastIndexOf(RevFlag flag, int begin)\n\t\t{\n\t\t\tbegin = Math.Min(begin, Size - 1);\n\t\t\twhile (begin >= 0)\n\t\t\t{\n\t\t\t\tint index = begin;\n\t\t\t\tBlock s = Contents;\n\t\t\t\twhile (s.Shift > 0)\n\t\t\t\t{\n\t\t\t\t\tint i = index >> s.Shift;\n\t\t\t\t\tindex -= i << s.Shift;\n\t\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t\t}\n\n\t\t\t\twhile (begin-- >= 0 && index >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar c = (RevCommit)s.Contents[index--];\n\t\t\t\t\tif (c.has(flag))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn begin;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the revision walker this list populates itself from.\n\t\t/// </summary>\n\t\t/// <param name=\"walker\">the walker to populate from.</param>\n\t\tpublic virtual void Source(RevWalk walker)\n\t\t{\n\t\t\t_walker = walker;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Is this list still pending more items?\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if <see cref=\"fillTo(int)\"/> might be able to extend the list\n\t\t/// size when called.\n\t\t/// </returns>\n\t\tpublic bool IsPending\n\t\t{\n\t\t\tget { return _walker != null; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Ensure this list contains at least a specified number of commits.\n\t\t/// \n\t\t/// The revision walker specified by <see cref=\"Source(RevWalk)\"/> is pumped until\n\t\t/// the given number of commits are contained in this list. If there are\n\t\t/// fewer total commits available from the walk then the method will return\n\t\t/// early. Callers can test the  size of the list by <see cref=\"RevObjectList{T}.Size\"/> to\n\t\t/// determine if the high water mark specified was met.\n\t\t/// </summary>\n\t\t/// <param name=\"highMark\">\n\t\t/// Number of commits the caller wants this list to contain when\n\t\t/// the fill operation is complete.\n\t\t/// </param>\n\t\tpublic void fillTo(int highMark)\n\t\t{\n\t\t\tif (_walker == null || Size > highMark) return;\n\n\t\t\tGenerator p = _walker.Pending;\n\t\t\tT c = (T)p.next();\n\t\t\tif (c == null)\n\t\t\t{\n\t\t\t\t_walker.Pending = EndGenerator.Instance;\n\t\t\t\t_walker = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tenter(Size, c);\n\t\t\tadd(c);\n\t\t\tp = _walker.Pending;\n\n\t\t\twhile (Size <= highMark)\n\t\t\t{\n\t\t\t\tint index = Size;\n\t\t\t\tBlock s = Contents;\n\n\t\t\t\twhile (index >> s.Shift >= BLOCK_SIZE)\n\t\t\t\t{\n\t\t\t\t\ts = new Block(s.Shift + BLOCK_SHIFT);\n\t\t\t\t\ts.Contents[0] = Contents;\n\t\t\t\t\tContents = s;\n\t\t\t\t}\n\n\t\t\t\twhile (s.Shift > 0)\n\t\t\t\t{\n\t\t\t\t\tint i = index >> s.Shift;\n\t\t\t\t\tindex -= i << s.Shift;\n\t\t\t\t\tif (s.Contents[i] == null)\n\t\t\t\t\t{\n\t\t\t\t\t\ts.Contents[i] = new Block(s.Shift - BLOCK_SHIFT);\n\t\t\t\t\t}\n\t\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t\t}\n\n\t\t\t\tobject[] dst = s.Contents;\n\t\t\t\twhile (Size <= highMark && index < BLOCK_SIZE)\n\t\t\t\t{\n\t\t\t\t\tc = (T)p.next();\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_walker.Pending = EndGenerator.Instance;\n\t\t\t\t\t\t_walker = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tenter(Size++, c);\n\t\t\t\t\tdst[index++] = c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Optional callback invoked when commits enter the list by fillTo.\n\t\t/// \n\t\t/// This method is only called during <see cref=\"fillTo(int)\"/>.\n\t\t/// </summary>\n\t\t/// <param name=\"index\">the list position this object will appear at.</param>\n\t\t/// <param name=\"t\">the object being added (or set) into the list.</param>\n\t\tprotected virtual void enter(int index, T t)\n\t\t{\n\t\t\t// Do nothing by default.\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\tif (_walker != null)\r\t\t\t{\r\n\t\t\t    _walker.Dispose();\r\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevFlag.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Application level mark bit for <see cref=\"RevObject\"/>s.\n\t/// </summary>\n    public class RevFlag : IDisposable\n    {\n\t\t/// <summary>\n\t\t/// Uninteresting by <see cref=\"RevWalk.markUninteresting(RevCommit)\"/>.\n\t\t/// <para />\n\t\t/// We flag commits as uninteresting if the caller does not want commits\n\t\t/// reachable from a commit to <see cref=\"RevWalk.markUninteresting(RevCommit)\"/>.\n\t\t/// This flag is always carried into the commit's parents and is a key part\n\t\t/// of the \"rev-list B --not A\" feature; A is marked UNINTERESTING.\n\t\t/// <para />\n\t\t/// This is a static flag. Its RevWalk is not available.\n\t\t/// </summary>\n        public static RevFlag UNINTERESTING = new StaticRevFlag(\"UNINTERESTING\", RevWalk.UNINTERESTING);\n\n\t\t/// <summary>\n\t\t/// Get the revision walk instance this flag was created from.\n\t\t/// </summary>\n        public virtual RevWalk Walker { get; private set; }\n\n        public string Name { get; set; }\n        public int Mask { get; set; }\n\n        public RevFlag(RevWalk walker, string name, int mask)\n        {\n            Walker = walker;\n            Name = name;\n            Mask = mask;\n        }\n\n        public override string ToString()\n        {\n            return Name;\n        }   \n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\tWalker.Dispose();\n\t\t}\n\t\t\n    }\n\n\tpublic class StaticRevFlag : RevFlag\n\t{\n\t\tpublic StaticRevFlag(string name, int mask)\n\t\t\t: base(null, name, mask)\n\t\t{\n\t\t}\n\n\t\tpublic override RevWalk Walker\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(ToString()\n\t\t\t\t\t\t+ \" is a static flag and has no RevWalk instance\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevFlagSet.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Multiple application level mark bits for <see cref=\"RevObject\"/>s.\n\t/// </summary>\n\tpublic class RevFlagSet : HashSet<RevFlag>\n\t{\n\t\tpublic int Mask { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Create a set of flags.\n\t\t/// </summary>\n\t\tpublic RevFlagSet()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a set of flags.\n\t\t/// </summary>\n\t\t/// <param name=\"flags\">the set to copy flags from.</param>\n\t\tpublic RevFlagSet(RevFlagSet flags)\n\t\t{\n\t\t\tMask = flags.Mask;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a set of flags.\n\t\t/// </summary>\n\t\t/// <param name=\"collection\">the collection to copy flags from.</param>\n\t\tpublic RevFlagSet(IEnumerable<RevFlag> collection)\n\t\t\t: base(collection)\n\t\t{\n      addAll();\n    }\n\n\t  private void addAll()\n\t  {\n\t    foreach (var set in this)\n\t    {\n\t      Mask |= set.Mask;\n\t    }\n\t  }\n\n\t  public bool Equals(RevFlagSet other)\n\t  {\n\t    if (ReferenceEquals(null, other)) return false;\n\t    if (ReferenceEquals(this, other)) return true;\n\t    return other.Mask == Mask;\n\t  }\n\n\t  public override bool Equals(object obj)\n\t  {\n\t    if (ReferenceEquals(null, obj)) return false;\n\t    if (ReferenceEquals(this, obj)) return true;\n\t    if (obj.GetType() != typeof (RevFlagSet)) return false;\n\t    return Equals((RevFlagSet) obj);\n\t  }\n\n\t  public override int GetHashCode()\n\t  {\n\t    return Mask;\n\t  }\n\n\t  public static bool operator ==(RevFlagSet left, RevFlagSet right)\n\t  {\n\t    return Equals(left, right);\n\t  }\n\n\t  public static bool operator !=(RevFlagSet left, RevFlagSet right)\n\t  {\n\t    return !Equals(left, right);\n\t  }\n\n\t  public bool ContainsAll(IEnumerable<RevFlag> c) // [henon] was Collection<?> in java\n\t\t{\n\t\t\tRevFlagSet oFlag = (c as RevFlagSet);\n\t\t\tif (oFlag != null)\n\t\t\t{\n\t\t\t\tint cMask = oFlag.Mask;\n\t\t\t\treturn (Mask & cMask) == cMask;\n\t\t\t}\n\n\t\t\treturn c.All(flag => Contains(flag));\n\t\t}\n\n\t\tpublic new bool Add(RevFlag flag)\n\t\t{\n\t\t\tif ((Mask & flag.Mask) != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tMask |= flag.Mask;\n\n\t\t\tint p = 0;\n\t\t\tforeach(var x in this)\n\t\t\t{\n\t\t\t\tif(x.Mask < flag.Mask)\n\t\t\t\t{\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.Add(flag);\n\t\t}\n\n\t\tpublic new bool Remove(RevFlag flag)\n\t\t{\n\t\t\tif ((Mask & flag.Mask) == 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tMask &= ~flag.Mask;\n\n\t\t\treturn base.Remove(flag);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevObject.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n    /// Base object type accessed during revision walking.\n    /// </summary>\n    public abstract class RevObject : ObjectId, IEquatable<RevObject>\n    {\n        protected const int PARSED = 1;\n\n        protected RevObject(AnyObjectId name)\n            : base(name)\n        {\n        }\n\n        public int Flags { get; set; }\n\n        internal virtual void parseHeaders(RevWalk walk)\n        {\n            loadCanonical(walk);\n            Flags |= PARSED;\n        }\n\n        internal virtual void parseBody(RevWalk walk)\n        {\n            if ((Flags & PARSED) == 0)\n                parseHeaders(walk);\n        }\n\n        internal byte[] loadCanonical(RevWalk walk)\n        {\n            ObjectLoader ldr = walk.Repository.OpenObject(walk.WindowCursor, this);\n            if (ldr == null)\n            {\n                throw new MissingObjectException(this, Type);\n            }\n\n            byte[] data = ldr.CachedBytes;\n            if (Type != ldr.Type)\n            {\n                throw new IncorrectObjectTypeException(this, Type);\n            }\n\n            return data;\n        }\n\n        /// <summary>\n        /// Get Git object type. See <see cref=\"Constants\"/>.\n        /// </summary>\n        /// <returns></returns>\n        public abstract int Type { get; }\n\n        /// <summary>\n        /// Get the name of this object.\n        /// </summary>\n        /// <returns>Unique hash of this object.</returns>\n        public ObjectId getId()\n        {\n            return this;\n        }\n\n        public new bool Equals(object obj)\n        {\n            return ReferenceEquals(this, obj as RevObject);\n        }\n\n        public bool Equals(RevObject obj)\n        {\n            return ReferenceEquals(this, obj);\n        }\n\n\n        /// <summary>\n        /// Test to see if the flag has been set on this object.\n        /// </summary>\n        /// <param name=\"flag\">the flag to test.</param>\n        /// <returns>\n        /// true if the flag has been added to this object; false if not.\n        /// </returns>\n        public bool has(RevFlag flag)\n        {\n            return (Flags & flag.Mask) != 0;\n        }\n\n        /// <summary>\n        /// Test to see if any flag in the set has been set on this object.\n        /// </summary>\n        /// <param name=\"set\">the flags to test.</param>\n        /// <returns>\n        /// true if any flag in the set has been added to this object; false\n        /// if not.\n        /// </returns>\n        public bool hasAny(RevFlagSet set)\n        {\n            return (Flags & set.Mask) != 0;\n        }\n\n        /// <summary>\n        /// Test to see if all flags in the set have been set on this object.\n        /// </summary>\n        /// <param name=\"set\">the flags to test.</param>\n        /// <returns>true if all flags of the set have been added to this object;\n        /// false if some or none have been added.\n        /// </returns>\n        public bool hasAll(RevFlagSet set)\n        {\n            return (Flags & set.Mask) == set.Mask;\n        }\n\n        /// <summary>\n        /// Add a flag to this object.\n        /// <para />\n        /// If the flag is already set on this object then the method has no effect.\n        /// </summary>\n        /// <param name=\"flag\">\n        /// The flag to mark on this object, for later testing.\n        /// </param>\n        public void add(RevFlag flag)\n        {\n            Flags |= flag.Mask;\n        }\n\n        /// <summary>\n        /// Add a set of flags to this object.\n        /// </summary>\n        /// <param name=\"set\">\n        /// The set of flags to mark on this object, for later testing.\n        /// </param>\n        public void add(RevFlagSet set)\n        {\n            Flags |= set.Mask;\n        }\n\n        /// <summary>\n        /// Remove a flag from this object.\n        /// <para />\n        /// If the flag is not set on this object then the method has no effect.\n        /// </summary>\n        /// <param name=\"flag\">\n        /// The flag to remove from this object.\n        /// </param>\n        public void remove(RevFlag flag)\n        {\n            Flags &= ~flag.Mask;\n        }\n\n        /// <summary>\n        /// Remove a set of flags from this object.\n        /// </summary>\n        /// <param name=\"set\">\n        /// The flag to remove from this object.\n        /// </param>\n        public void remove(RevFlagSet set)\n        {\n            Flags &= ~set.Mask;\n        }\n\n        /// <summary>\n        /// Release as much memory as possible from this object.\n        /// </summary>\n        public virtual void DisposeBody()\n        {\n            // Nothing needs to be done for most objects.\n        }\n\n        public override string ToString()\n        {\n            var s = new StringBuilder();\n            s.Append(Constants.typeString(Type));\n            s.Append(' ');\n            s.Append(Name);\n            s.Append(' ');\n            appendCoreFlags(s);\n            return s.ToString();\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <param name=\"s\">\n        /// Buffer to Append a debug description of core RevFlags onto.\n        /// </param>\n        internal void appendCoreFlags(StringBuilder s)\n        {\n            s.Append((Flags & RevWalk.TOPO_DELAY) != 0 ? 'o' : '-');\n            s.Append((Flags & RevWalk.TEMP_MARK) != 0 ? 't' : '-');\n            s.Append((Flags & RevWalk.REWRITE) != 0 ? 'r' : '-');\n            s.Append((Flags & RevWalk.UNINTERESTING) != 0 ? 'u' : '-');\n            s.Append((Flags & RevWalk.SEEN) != 0 ? 's' : '-');\n            s.Append((Flags & RevWalk.PARSED) != 0 ? 'p' : '-');\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevObjectList.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Jonas Fonseca <fonseca@diku.dk>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// An ordered list of <see cref=\"RevObject\"/> subclasses.\n\t/// </summary>\n\t/// <typeparam name=\"T\">\n\t/// Type of subclass of RevObject the list is storing.\n\t/// </typeparam>\n\tpublic class RevObjectList<T> : IEnumerable<T> // [henon] was AbstractList\n\twhere T : RevObject\n\t{\n\t\tpublic static int BLOCK_SHIFT = 8;\n\t\tpublic static int BLOCK_SIZE = 1 << BLOCK_SHIFT;\n\n\t\t/// <summary>\n\t\t/// Items stored in this list.\n\t\t/// <para>\n\t\t/// If <see cref=\"Block.Shift\"/> = 0 this block holds the list elements; otherwise\n\t\t/// it holds pointers to other {@link Block} instances which use a shift that\n\t\t/// is <see cref=\"BLOCK_SHIFT\"/> smaller.\n\t\t/// </para>\n\t\t/// </summary>\n\t\tprotected Block Contents\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create an empty object list.\n\t\t/// </summary>\n\t\tpublic RevObjectList()\n\t\t{\n\t\t\tclear();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Current number of elements in the list.\n\t\t/// </summary>\n\t\tprotected int Size\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic void add(int index, T element)\n\t\t{\n\t\t\tif (index != Size)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Not add-at-end: \" + index);\n\t\t\t}\n\n\t\t\tset(index, element);\n\t\t\tSize++;\n\t\t}\n\n\t\tpublic void add(T element)\n\t\t{\n\t\t\tadd(Size, element);\n\t\t}\n\n\t\tpublic T set(int index, T element)\n\t\t{\n\t\t\tBlock s = Contents;\n\t\t\twhile (index >> s.Shift >= BLOCK_SIZE)\n\t\t\t{\n\t\t\t\ts = new Block(s.Shift + BLOCK_SHIFT);\n\t\t\t\ts.Contents[0] = Contents;\n\t\t\t\tContents = s;\n\t\t\t}\n\n\t\t\twhile (s.Shift > 0)\n\t\t\t{\n\t\t\t\tint i = index >> s.Shift;\n\t\t\t\tindex -= i << s.Shift;\n\n\t\t\t\tif (s.Contents[i] == null)\n\t\t\t\t{\n\t\t\t\t\ts.Contents[i] = new Block(s.Shift - BLOCK_SHIFT);\n\t\t\t\t}\n\n\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t}\n\t\t\tobject old = s.Contents[index];\n\t\t\ts.Contents[index] = element;\n\t\t\treturn (T)old;\n\t\t}\n\n\t\tpublic T get(int index)\n\t\t{\n\t\t\tBlock s = Contents;\n\n\t\t\tif (index >> s.Shift >= 1024)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\twhile (s != null && s.Shift > 0)\n\t\t\t{\n\t\t\t\tint i = index >> s.Shift;\n\t\t\t\tindex -= i << s.Shift;\n\t\t\t\ts = (Block)s.Contents[i];\n\t\t\t}\n\n\t\t\treturn s != null ? (T)s.Contents[index] : null;\n\t\t}\n\n\t\tpublic virtual void clear()\n\t\t{\n\t\t\tContents = new Block(0);\n\t\t\tSize = 0;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// One level of contents, either an intermediate level or a leaf level.\n\t\t/// </summary>\n\t\tpublic class Block : IEnumerable<T>\n\t\t{\n\t\t\tpublic object[] Contents { get; private set; }\n\t\t\tpublic int Shift { get; private set; }\n\n\t\t\tpublic Block(int s)\n\t\t\t{\n\t\t\t\tContents = new object[BLOCK_SIZE];\n\t\t\t\tShift = s;\n\t\t\t}\n\n\t\t\t#region Implementation of IEnumerable<object>\n\n\t\t\t/// <summary>\n\t\t\t/// Returns an enumerator that iterates through the collection.\n\t\t\t/// </summary>\n\t\t\t/// <returns>\n\t\t\t/// A <see cref=\"T:System.Collections.Generic.IEnumerator`1\"/> that can be used to iterate through the collection.\n\t\t\t/// </returns>\n\t\t\t/// <filterpriority>1</filterpriority>\n\t\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t\t{\n\t\t\t\tforeach (object o in Contents)\n\t\t\t\t{\n\t\t\t\t\tif (o == null) continue;\n\t\t\t\t\tif (o is Block)\n\t\t\t\t\t{\n\t\t\t\t\t\tBlock s = (Block)o;\n\t\t\t\t\t\tforeach (object os in s.Contents)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (os == null) continue;\n\t\t\t\t\t\t\tyield return (T)os;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tyield return (T)o;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Implementation of IEnumerable\n\n\t\t\t/// <summary>\n\t\t\t/// Returns an enumerator that iterates through a collection.\n\t\t\t/// </summary>\n\t\t\t/// <returns>\n\t\t\t/// An <see cref=\"T:System.Collections.IEnumerator\"/> object that can be used to iterate through the collection.\n\t\t\t/// </returns>\n\t\t\t/// <filterpriority>2</filterpriority>\n\t\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t\t{\n\t\t\t\treturn Contents.GetEnumerator();\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\t#region Implementation of IEnumerable<T>\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\treturn Contents.GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Implementation of IEnumerable\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn Contents.GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevSort.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.RevWalk\n{\n\n    /** Sorting strategies supported by {@link RevWalk} and {@link ObjectWalk}. */\n    public static class RevSort\n    {\n\t\t[Serializable]\n        public enum Strategy\n        {\n            /**\n             * No specific sorting is requested.\n             * <para />\n             * Applications should not rely upon the ordering produced by this strategy.\n             * Any ordering in the output is caused by low level implementation details\n             * and may change without notice.\n             */\n            NONE,\n\n            /**\n             * Sort by commit time, descending (newest first, oldest last).\n             * <para />\n             * This strategy can be combined with {@link #TOPO}.\n             */\n            COMMIT_TIME_DESC,\n\n            /**\n             * Topological sorting (all children before parents).\n             * <para />\n             * This strategy can be combined with {@link #COMMIT_TIME_DESC}.\n             */\n            TOPO,\n\n            /**\n             * Flip the output into the reverse ordering.\n             * <para />\n             * This strategy can be combined with the others described by this type as\n             * it is usually performed at the very end.\n             */\n            REVERSE,\n\n            /**\n             * Include {@link RevFlag#UNINTERESTING} boundary commits After all others.\n             * In {@link ObjectWalk}, objects associated with such commits (trees,\n             * blobs), and all other objects marked explicitly as UNINTERESTING are also\n             * included.\n             * <para />\n             * A boundary commit is a UNINTERESTING parent of an interesting commit that\n             * was previously output.\n             */\n            BOUNDARY,\n        }\n\n        public static Strategy NONE = Strategy.NONE;\n        public static Strategy COMMIT_TIME_DESC = Strategy.COMMIT_TIME_DESC;\n        public static Strategy TOPO = Strategy.TOPO;\n        public static Strategy REVERSE = Strategy.REVERSE;\n        public static Strategy BOUNDARY = Strategy.BOUNDARY;\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevTag.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// An annotated tag.\n\t/// </summary>\n\tpublic class RevTag : RevObject\n\t{\n\t\tprivate RevObject _object;\n\t\tprivate byte[] _buffer;\n\t\tprivate string _tagName;\n\n\t\t/// <summary>\n\t\t/// Create a new tag reference.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// Object name for the tag.\n\t\t/// </param>\n\t\tinternal RevTag(AnyObjectId id)\n\t\t\t: base(id)\n\t\t{\n\t\t}\n\n        internal override void parseHeaders(RevWalk walk)\n        {\n            parseCanonical(walk, loadCanonical(walk));\n        }\n\n        internal override void parseBody(RevWalk walk)\n        {\n            if (_buffer == null)\n            {\n                _buffer = loadCanonical(walk);\n                if ((Flags & PARSED) == 0)\n                    parseCanonical(walk, _buffer);\n            }\n        }\n\n\t\tpublic void parseCanonical(RevWalk walk, byte[] rawTag)\n\t\t{\n\t\t\tvar pos = new MutableInteger { value = 53 };\n\n\t\t\tint oType = Constants.decodeTypeString(this, rawTag, (byte)'\\n', pos);\n\t\t\twalk.IdBuffer.FromString(rawTag, 7);\n\t\t\t_object = walk.lookupAny(walk.IdBuffer, oType);\n\n\t\t\tint p = pos.value += 4; // \"tag \"\n\t\t\tint nameEnd = RawParseUtils.nextLF(rawTag, p) - 1;\n\t\t\t_tagName = RawParseUtils.decode(Constants.CHARSET, rawTag, p, nameEnd);\n\n            if (walk.isRetainBody())\n\t\t\t    _buffer = rawTag;\n\t\t\tFlags |= PARSED;\n\t\t}\n\n\t\tpublic override int Type\n\t\t{\n\t\t\tget { return Constants.OBJ_TAG; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse the tagger identity from the raw buffer.\n\t\t/// <para />\n\t\t/// This method parses and returns the content of the tagger line, After\n\t\t/// taking the tag's character set into account and decoding the tagger\n\t\t/// name and email address. This method is fairly expensive and produces a\n\t\t/// new PersonIdent instance on each invocation. Callers should invoke this\n\t\t/// method only if they are certain they will be outputting the result, and\n\t\t/// should cache the return value for as long as necessary to use all\n\t\t/// information from it.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Identity of the tagger (name, email) and the time the tag\n\t\t/// was made by the tagger; null if no tagger line was found.\n\t\t/// </returns>\n\t\tpublic PersonIdent getTaggerIdent()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint nameB = RawParseUtils.tagger(raw, 0);\n\t\t\tif (nameB < 0) return null;\n\t\t\treturn RawParseUtils.parsePersonIdent(raw, nameB);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse the complete tag message and decode it to a string.\n\t\t/// <para />\n\t\t/// This method parses and returns the message portion of the tag buffer,\n\t\t/// After taking the tag's character set into account and decoding the buffer\n\t\t/// using that character set. This method is a fairly expensive operation and\n\t\t/// produces a new string on each invocation.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Decoded tag message as a string. Never null.\n\t\t/// </returns>\n\t\tpublic string getFullMessage()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint msgB = RawParseUtils.tagMessage(raw, 0);\n\t\t\tif (msgB < 0) return string.Empty;\n\t\t\tEncoding enc = RawParseUtils.parseEncoding(raw);\n\t\t\treturn RawParseUtils.decode(enc, raw, msgB, raw.Length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse the tag message and return the first \"line\" of it.\n\t\t/// <para />\n\t\t/// The first line is everything up to the first pair of LFs. This is the\n\t\t/// \"oneline\" format, suitable for output in a single line display.\n\t\t/// <para />\n\t\t/// This method parses and returns the message portion of the tag buffer,\n\t\t/// After taking the tag's character set into account and decoding the buffer\n\t\t/// using that character set. This method is a fairly expensive operation and\n\t\t/// produces a new string on each invocation.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Decoded tag message as a string. Never null. The returned string\n\t\t/// does not contain any LFs, even if the first paragraph spanned\n\t\t/// multiple lines. Embedded LFs are converted to spaces.\n\t\t/// </returns>\n\t\tpublic string getShortMessage()\n\t\t{\n\t\t\tbyte[] raw = _buffer;\n\t\t\tint msgB = RawParseUtils.tagMessage(raw, 0);\n\t\t\tif (msgB < 0) return string.Empty;\n\n\t\t\tEncoding enc = RawParseUtils.parseEncoding(raw);\n\t\t\tint msgE = RawParseUtils.endOfParagraph(raw, msgB);\n\t\t\tstring str = RawParseUtils.decode(enc, raw, msgB, msgE);\n\t\t\tif (RevCommit.hasLF(raw, msgB, msgE))\n\t\t\t{\n\t\t\t\tstr = str.Replace('\\n', ' ');\n\t\t\t}\n\n\t\t\treturn str;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse this tag buffer for display.\n\t\t/// </summary>\n\t\t/// <param name=\"walk\">revision walker owning this reference.</param>\n\t\t/// <returns>parsed tag.</returns>\n\t\tpublic Tag asTag(RevWalk walk)\n\t\t{\n\t\t\treturn new Tag(walk.Repository, this, _tagName, _buffer);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get a reference to the @object this tag was placed on.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Object this tag refers to.\n\t\t/// </returns>\n\t\tpublic RevObject getObject()\n\t\t{\n\t\t\treturn _object;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the name of this tag, from the tag header.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Name of the tag, according to the tag header.\n\t\t/// </returns>\n\t\tpublic string getTagName()\n\t\t{\n\t\t\treturn _tagName;\n\t\t}\n\n        public new void DisposeBody()\n        {\n            _buffer = null;\n        }\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevTree.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n\t/// A reference to a tree of subtrees/files.\n    /// </summary>\n    public class RevTree : RevObject\n    {\n\t\t/// <summary>\n\t\t/// Create a new tree reference.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">Object name for the tree.</param>\n        internal RevTree(AnyObjectId id)\n            : base(id)\n        {\n        }\n\n    \tpublic override int Type\n    \t{\n    \t\tget { return Constants.OBJ_TREE; }\n    \t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RevWalk.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Walks a commit graph and produces the matching commits in order.\n\t/// <para />\n\t/// A RevWalk instance can only be used once to generate results. Running a\n\t/// second time requires creating a new RevWalk instance, or invoking\n\t/// <seealso cref=\"reset()\"/> before starting again. Resetting an existing instance may be\n\t/// faster for some applications as commit body parsing can be avoided on the\n\t/// later invocations.\n\t/// <para />\n\t/// RevWalk instances are not thread-safe. Applications must either restrict\n\t/// usage of a RevWalk instance to a single thread, or implement their own\n\t/// synchronization at a higher level.\n\t/// <para />\n\t/// Multiple simultaneous RevWalk instances per <seealso cref=\"Repository\"/> are permitted,\n\t/// even from concurrent threads. Equality of <seealso cref=\"RevCommit\"/>s from two\n\t/// different RevWalk instances is never true, even if their <seealso cref=\"ObjectId\"/>s\n\t/// are equal (and thus they describe the same commit).\n\t/// <para />\n\t/// The offered iterator is over the list of RevCommits described by the\n\t/// configuration of this instance. Applications should restrict themselves to\n\t/// using either the provided Iterator or <seealso cref=\"next()\"/>, but never use both on\n\t/// the same RevWalk at the same time. The Iterator may buffer RevCommits, while\n\t/// <seealso cref=\"next()\"/> does not.\n\t/// </summary>\n\tpublic class RevWalk : IEnumerable<RevCommit>, IDisposable\n\t{\n\t\t#region Enums\n\n\t\t[Flags]\n\t\t[Serializable]\n\t\tpublic enum RevWalkState\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Set on objects whose important header data has been loaded.\n\t\t\t/// <para />\n\t\t\t/// For a RevCommit this indicates we have pulled apart the tree and parent\n\t\t\t/// references from the raw bytes available in the repository and translated\n\t\t\t/// those to our own local RevTree and RevCommit instances. The raw buffer is\n\t\t\t/// also available for message and other header filtering.\n\t\t\t/// <para />\n\t\t\t/// For a RevTag this indicates we have pulled part the tag references to\n\t\t\t/// find out who the tag refers to, and what that object's type is.\n\t\t\t/// </summary>\n\t\t\tPARSED = 1 << 0,\n\n\t\t\t/// <summary>\n\t\t\t/// Set on RevCommit instances added to our <see cref=\"Pending\"/> queue.\n\t\t\t/// <para />\n\t\t\t/// We use this flag to avoid adding the same commit instance twice to our\n\t\t\t/// queue, especially if we reached it by more than one path.\n\t\t\t/// </summary>\n\t\t\tSEEN = 1 << 1,\n\n\t\t\t/// <summary>\n\t\t\t/// Set on RevCommit instances the caller does not want output.\n\t\t\t/// <para />\n\t\t\t/// We flag commits as uninteresting if the caller does not want commits\n\t\t\t/// reachable from a commit given to <see cref=\"markUninteresting(RevCommit)\"/>.\n\t\t\t/// This flag is always carried into the commit's parents and is a key part\n\t\t\t/// of the \"rev-list B --not A\" feature; A is marked UNINTERESTING.\n\t\t\t/// </summary>\n\t\t\tUNINTERESTING = 1 << 2,\n\n\t\t\t/// <summary>\n\t\t\t/// Set on a RevCommit that can collapse out of the history.\n\t\t\t/// <para />\n\t\t\t/// If the <see cref=\"TreeFilter\"/> concluded that this commit matches his\n\t\t\t/// parents' for all of the paths that the filter is interested in then we\n\t\t\t/// mark the commit REWRITE. Later we can rewrite the parents of a REWRITE\n\t\t\t/// child to remove chains of REWRITE commits before we produce the child to\n\t\t\t/// the application.\n\t\t\t/// </summary>\n\t\t\t/// <seealso cref=\"RewriteGenerator\"/>\n\t\t\tREWRITE = 1 << 3,\n\n\t\t\t/// <summary>\n\t\t\t/// Temporary mark for use within generators or filters.\n\t\t\t/// <para />\n\t\t\t/// This mark is only for local use within a single scope. If someone sets\n\t\t\t/// the mark they must unset it before any other code can see the mark.\n\t\t\t/// </summary>\n\t\t\tTEMP_MARK = 1 << 4,\n\n\t\t\t/// <summary>\n\t\t\t/// Temporary mark for use within {@link TopoSortGenerator}.\n\t\t\t/// <para />\n\t\t\t/// This mark indicates the commit could not produce when it wanted to, as at\n\t\t\t/// least one child was behind it. Commits with this flag are delayed until\n\t\t\t/// all children have been output first.\n\t\t\t/// </summary>\n\t\t\tTOPO_DELAY = 1 << 5,\n\t\t}\n\n\t\t#endregion\n\n\t\t///\t<summary>\n\t\t/// Set on objects whose important header data has been loaded.\n\t\t/// <para />\n\t\t/// For a RevCommit this indicates we have pulled apart the tree and parent\n\t\t/// references from the raw bytes available in the repository and translated\n\t\t/// those to our own local RevTree and RevCommit instances. The raw buffer is\n\t\t/// also available for message and other header filtering.\n\t\t/// <para />\n\t\t/// For a RevTag this indicates we have pulled part the tag references to\n\t\t/// find out who the tag refers to, and what that object's type is.\n\t\t/// </summary>\n\t\tinternal const int PARSED = 1 << 0;\n\n\t\t///\t<summary>\n\t\t/// Set on RevCommit instances added to our <seealso cref=\"Pending\"/> queue.\n\t\t/// <para />\n\t\t/// We use this flag to avoid adding the same commit instance twice to our\n\t\t/// queue, especially if we reached it by more than one path.\n\t\t/// </summary>\n\t\tinternal const int SEEN = 1 << 1;\n\n\t\t///\t<summary>\n\t\t/// Set on RevCommit instances the caller does not want output.\n\t\t/// <para />\n\t\t/// We flag commits as uninteresting if the caller does not want commits\n\t\t/// reachable from a commit given to <seealso cref=\"markUninteresting(RevCommit)\"/>.\n\t\t/// This flag is always carried into the commit's parents and is a key part\n\t\t/// of the \"rev-list B --not A\" feature; A is marked UNINTERESTING.\n\t\t/// </summary>\n\t\tinternal const int UNINTERESTING = 1 << 2;\n\n\t\t///\t<summary> \n\t\t/// Set on a RevCommit that can collapse out of the history.\n\t\t/// <para />\n\t\t/// If the <seealso cref=\"TreeFilter\"/> concluded that this commit matches his\n\t\t/// parents' for all of the paths that the filter is interested in then we\n\t\t/// mark the commit REWRITE. Later we can rewrite the parents of a REWRITE\n\t\t/// child to remove chains of REWRITE commits before we produce the child to\n\t\t/// the application.\n\t\t/// </summary>\n\t\t///\t<seealso cref=\"RewriteGenerator\" />\n\t\tinternal const int REWRITE = 1 << 3;\n\n\t\t///\t<summary>\n\t\t/// Temporary mark for use within generators or filters.\n\t\t/// <para />\n\t\t/// This mark is only for local use within a single scope. If someone sets\n\t\t/// the mark they must unset it before any other code can see the mark.\n\t\t/// </summary>\n\t\tinternal const int TEMP_MARK = 1 << 4;\n\n\t\t///\t<summary>\n\t\t/// Temporary mark for use within <seealso cref=\"TopoSortGenerator\"/>.\n\t\t/// <para />\n\t\t/// This mark indicates the commit could not produce when it wanted to, as at\n\t\t/// least one child was behind it. Commits with this flag are delayed until\n\t\t/// all children have been output first.\n\t\t/// </summary>\n\t\tinternal const int TOPO_DELAY = 1 << 5;\n\n\t\t// Number of flag bits we keep internal for our own use. See above flags.\n\t\tprivate const int ReservedFlags = 6;\n\t\tprivate const int AppFlags = -1 & ~((1 << ReservedFlags) - 1);\n\n\t\tprivate readonly ObjectIdSubclassMap<RevObject> _objects;\n\t\tprivate readonly List<RevCommit> _roots;\n\t\tprivate readonly HashSet<RevSort.Strategy> _sorting;\n\t\tprivate readonly Repository _db;\n\t\tprivate readonly WindowCursor _curs;\n\t\tprivate readonly MutableObjectId _idBuffer;\n\n\t\tprivate int _delayFreeFlags;\n\t\tprivate int _freeFlags;\n\t\tprivate int _carryFlags;\n\t\tprivate RevFilter _filter;\n\t\tprivate TreeFilter _treeFilter;\n\t\tprivate bool _retainBody;\n\n\t\t/// <summary>\n\t\t/// Create a new revision walker for a given repository.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\">\n\t\t/// The repository the walker will obtain data from.\n\t\t/// </param>\n\t\tpublic RevWalk(Repository repo)\n\t\t{\n\t\t\t_freeFlags = AppFlags;\n\t\t\t_carryFlags = UNINTERESTING;\n\n\t\t\t_db = repo;\n\t\t\t_curs = new WindowCursor();\n\t\t\t_idBuffer = new MutableObjectId();\n\t\t\t_objects = new ObjectIdSubclassMap<RevObject>();\n\t\t\t_roots = new List<RevCommit>();\n\t\t\tQueue = new DateRevQueue();\n\t\t\tPending = new StartGenerator(this);\n\t\t\t_sorting = new HashSet<RevSort.Strategy> { RevSort.NONE };\n\t\t\t_filter = RevFilter.ALL;\n\t\t\t_treeFilter = TreeFilter.ALL;\n\t\t    _retainBody = true;\n\t\t}\n\n\t\tpublic MutableObjectId IdBuffer\n\t\t{\n\t\t\tget { return _idBuffer; }\n\t\t}\n\n\t\tpublic WindowCursor WindowCursor\n\t\t{\n\t\t\tget { return _curs; }\n\t\t}\n\n\t\tpublic Generator Pending { get; set; }\n\n\t\tpublic AbstractRevQueue Queue { get; set; }\n\n\t\t/// <summary>\n\t\t/// Get the repository this walker loads objects from.\n\t\t/// </summary>\n\t\tpublic Repository Repository\n\t\t{\n\t\t\tget { return _db; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Mark a commit to start graph traversal from.\n\t\t/// <para />\n\t\t/// Callers are encouraged to use <see cref=\"parseCommit(AnyObjectId)\"/> to obtain\n\t\t/// the commit reference, rather than <see cref=\"lookupCommit(AnyObjectId)\"/>, as\n\t\t/// this method requires the commit to be parsed before it can be added as a\n\t\t/// root for the traversal.\n\t\t/// <para />\n\t\t/// The method will automatically parse an unparsed commit, but error\n\t\t/// handling may be more difficult for the application to explain why a\n\t\t/// <see cref=\"RevCommit\"/> is not actually a commit. The object pool of this \n\t\t/// walker would also be 'poisoned' by the non-commit RevCommit.\n\t\t/// </summary>\n\t\t/// <param name=\"c\">\n\t\t/// The commit to start traversing from. The commit passed must be\n\t\t/// from this same revision walker.\n\t\t/// </param>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// The commit supplied is not available from the object\n\t\t/// database. This usually indicates the supplied commit is\n\t\t/// invalid, but the reference was constructed during an earlier\n\t\t/// invocation to <see cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// The object was not parsed yet and it was discovered during\n\t\t/// parsing that it is not actually a commit. This usually\n\t\t/// indicates the caller supplied a non-commit SHA-1 to\n\t\t/// <see cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\tpublic void markStart(RevCommit c)\n\t\t{\n\t\t\tif ((c.Flags & SEEN) != 0) return;\n\t\t\tif ((c.Flags & PARSED) == 0)\n\t\t\t{\n\t\t\t\tc.parseHeaders(this);\n\t\t\t}\n\t\t\tc.Flags |= SEEN;\n\t\t\t_roots.Add(c);\n\t\t\tQueue.add(c);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Mark a commit to start graph traversal from.\n\t\t/// <para />\n\t\t/// Callers are encouraged to use <see cref=\"parseCommit(AnyObjectId)\"/> to obtain\n\t\t/// the commit reference, rather than <see cref=\"lookupCommit(AnyObjectId)\"/>, as\n\t\t/// this method requires the commit to be parsed before it can be added as a\n\t\t/// root for the traversal.\n\t\t/// <para />\n\t\t/// The method will automatically parse an unparsed commit, but error\n\t\t/// handling may be more difficult for the application to explain why a\n\t\t/// <see cref=\"RevCommit\"/> is not actually a commit. The object pool of this \n\t\t/// walker would also be 'poisoned' by the non-commit RevCommit.\n\t\t/// </summary>\n\t\t/// <param name=\"list\">\n\t\t/// Commits to start traversing from. The commits passed must be\n\t\t/// from this same revision walker.\n\t\t/// </param>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// The commit supplied is not available from the object\n\t\t/// database. This usually indicates the supplied commit is\n\t\t/// invalid, but the reference was constructed during an earlier\n\t\t/// invocation to <see cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// The object was not parsed yet and it was discovered during\n\t\t/// parsing that it is not actually a commit. This usually\n\t\t/// indicates the caller supplied a non-commit SHA-1 to\n\t\t/// <see cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\tpublic void markStart(IEnumerable<RevCommit> list)\n\t\t{\n\t\t\tforeach (RevCommit c in list)\n\t\t\t{\n\t\t\t\tmarkStart(c);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Mark a commit to not produce in the output.\n\t\t/// <para />\n\t\t/// Uninteresting commits denote not just themselves but also their entire\n\t\t/// ancestry chain, back until the merge base of an uninteresting commit and\n\t\t/// an otherwise interesting commit.\n\t\t/// <para />\n\t\t/// Callers are encouraged to use <seealso cref=\"parseCommit(AnyObjectId)\"/> to obtain\n\t\t/// the commit reference, rather than <seealso cref=\"lookupCommit(AnyObjectId)\"/>, as\n\t\t/// this method requires the commit to be parsed before it can be added as a\n\t\t/// root for the traversal.\n\t\t/// <para />\n\t\t/// The method will automatically parse an unparsed commit, but error\n\t\t/// handling may be more difficult for the application to explain why a\n\t\t/// RevCommit is not actually a commit. The object pool of this walker would\n\t\t/// also be 'poisoned' by the non-commit RevCommit.\n\t\t/// </summary>\n\t\t/// <param name=\"c\">\n\t\t/// The commit to start traversing from. The commit passed must be\n\t\t/// from this same revision walker.\n\t\t/// </param>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// The commit supplied is not available from the object\n\t\t/// database. This usually indicates the supplied commit is\n\t\t/// invalid, but the reference was constructed during an earlier\n\t\t/// invocation to <seealso cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// the object was not parsed yet and it was discovered during\n\t\t/// parsing that it is not actually a commit. This usually\n\t\t/// indicates the caller supplied a non-commit SHA-1 to\n\t\t/// <seealso cref=\"lookupCommit(AnyObjectId)\"/>.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic void markUninteresting(RevCommit c)\n\t\t{\n\t\t\tc.Flags |= UNINTERESTING;\n\t\t\tcarryFlagsImpl(c);\n\t\t\tmarkStart(c);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Determine if a commit is reachable from another commit.\n\t\t/// <para />\n\t\t/// A commit <code>base</code> is an ancestor of <code>tip</code> if we\n\t\t/// can find a path of commits that leads from <code>tip</code> and ends at\n\t\t/// <code>base</code>.\n\t\t/// <para />\n\t\t/// This utility function resets the walker, inserts the two supplied\n\t\t/// commits, and then executes a walk until an answer can be obtained.\n\t\t/// Currently allocated RevFlags that have been added to RevCommit instances\n\t\t/// will be retained through the reset.\n\t\t/// </summary>\n\t\t/// <param name=\"base\">\n\t\t/// commit the caller thinks is reachable from <code>tip</code>.\n\t\t/// </param>\n\t\t/// <param name=\"tip\">\n\t\t/// commit to start iteration from, and which is most likely a\n\t\t/// descendant (child) of <code>base</code>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// true if there is a path directly from <code>tip</code> to\n\t\t/// <code>base</code> (and thus <code>base</code> is fully merged\n\t\t/// into <code>tip</code>); false otherwise.\n\t\t/// </returns>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// one or or more of the next commit's parents are not available\n\t\t/// from the object database, but were thought to be candidates\n\t\t/// for traversal. This usually indicates a broken link.\n\t\t/// </exception>\n\t\t///\t<exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one or or more of the next commit's parents are not actually\n\t\t/// commit objects.\n\t\t/// </exception>\n\t\t///\t<exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic bool isMergedInto(RevCommit @base, RevCommit tip)\n\t\t{\n\t\t\tRevFilter oldRF = _filter;\n\t\t\tTreeFilter oldTF = _treeFilter;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFinishDelayedFreeFlags();\n\t\t\t\treset(~_freeFlags & AppFlags);\n\t\t\t\t_filter = RevFilter.MERGE_BASE;\n\t\t\t\t_treeFilter = TreeFilter.ALL;\n\t\t\t\tmarkStart(tip);\n\t\t\t\tmarkStart(@base);\n\t\t\t\treturn (next() == @base);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t_filter = oldRF;\n\t\t\t\t_treeFilter = oldTF;\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Pop the next most recent commit.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Next most recent commit; null if traversal is over.\n\t\t/// </returns>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// one or or more of the next commit's parents are not available\n\t\t/// from the object database, but were thought to be candidates\n\t\t/// for traversal. This usually indicates a broken link.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// one or or more of the next commit's parents are not actually\n\t\t/// commit objects.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic virtual RevCommit next()\n\t\t{\n\t\t\treturn Pending.next();\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Obtain the sort types applied to the commits returned.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The sorting strategies employed. At least one strategy is always\n\t\t/// used, but that strategy may be <seealso cref=\"RevSort.NONE\"/>.\n\t\t/// </returns>\n\t\tpublic HashSet<RevSort.Strategy> RevSortStrategy\n\t\t{\n\t\t\tget { return new HashSet<RevSort.Strategy>(_sorting); }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Check whether the provided sorting strategy is enabled.\n\t\t/// </summary>\n\t\t/// <param name=\"sort\">\n\t\t/// a sorting strategy to look for.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// True if this strategy is enabled, false otherwise\n\t\t/// </returns>\n\t\tpublic bool hasRevSort(RevSort.Strategy sort)\n\t\t{\n\t\t\treturn _sorting.Contains(sort);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Select a single sorting strategy for the returned commits.\n\t\t/// <para />\n\t\t/// Disables all sorting strategies, then enables only the single strategy\n\t\t/// supplied by the caller.\n\t\t/// </summary>\n\t\t/// <param name=\"s\">a sorting strategy to enable.</param>\n\t\tpublic void sort(RevSort.Strategy s)\n\t\t{\n\t\t\tassertNotStarted();\n\t\t\t_sorting.Clear();\n\t\t\t_sorting.Add(s);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add or remove a sorting strategy for the returned commits.\n\t\t/// <para />\n\t\t/// Multiple strategies can be applied at once, in which case some strategies\n\t\t/// may take precedence over others. As an example, <seealso cref=\"RevSort.TOPO\"/> must\n\t\t/// take precedence over <seealso cref=\"RevSort.NONE\"/>, otherwise it\n\t\t/// cannot enforce its ordering.\n\t\t/// </summary>\n\t\t/// <param name=\"s\">A sorting strategy to enable or disable.</param>\n\t\t///\t<param name=\"use\">\n\t\t/// true if this strategy should be used, false if it should be\n\t\t/// removed.\n\t\t/// </param>\n\t\tpublic virtual void sort(RevSort.Strategy s, bool use)\n\t\t{\n\t\t\tassertNotStarted();\n\t\t\tif (use)\n\t\t\t{\n\t\t\t\t_sorting.Add(s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_sorting.Remove(s);\n\t\t\t}\n\n\t\t\tif (_sorting.Count > 1)\n\t\t\t{\n\t\t\t\t_sorting.Remove(RevSort.NONE);\n\t\t\t}\n\t\t\telse if (_sorting.Count == 0)\n\t\t\t{\n\t\t\t\t_sorting.Add(RevSort.NONE);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the currently configured commit filter.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Return the current filter. Never null as a filter is always needed.\n\t\t/// </returns>\n\t\tpublic RevFilter getRevFilter()\n\t\t{\n\t\t\treturn _filter;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Set the commit filter for this walker.\n\t\t/// <para />\n\t\t/// Multiple filters may be combined by constructing an arbitrary tree of\n\t\t/// <seealso cref=\"AndRevFilter\"/> or <seealso cref=\"OrRevFilter\"/> instances to\n\t\t/// describe the boolean expression required by the application. Custom\n\t\t/// filter implementations may also be constructed by applications.\n\t\t/// <para />\n\t\t/// Note that filters are not thread-safe and may not be shared by concurrent\n\t\t/// RevWalk instances. Every RevWalk must be supplied its own unique filter,\n\t\t/// unless the filter implementation specifically states it is (and always\n\t\t/// will be) thread-safe. Callers may use <seealso cref=\"RevFilter.Clone()\"/> to create\n\t\t/// a unique filter tree for this RevWalk instance.\n\t\t/// </summary>\n\t\t/// <param name=\"newFilter\">\n\t\t/// The new filter. If null the special <seealso cref=\"RevFilter.ALL\"/>\n\t\t/// filter will be used instead, as it matches every commit.\n\t\t/// </param>\n\t\t/// <seealso cref=\"AndRevFilter\" />\n\t\t/// <seealso cref=\"OrRevFilter\" />\n\t\tpublic void setRevFilter(RevFilter newFilter)\n\t\t{\n\t\t\tassertNotStarted();\n\t\t\t_filter = newFilter ?? RevFilter.ALL;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Get the tree filter used to simplify commits by modified paths.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The current filter. Never null as a filter is always needed. If\n\t\t/// no filter is being applied <seealso cref=\"TreeFilter.ALL\"/> is returned.\n\t\t/// </returns>\n\t\tpublic TreeFilter getTreeFilter()\n\t\t{\n\t\t\treturn _treeFilter;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Set the tree filter used to simplify commits by modified paths.\n\t\t/// <para />\n\t\t/// If null or <seealso cref=\"TreeFilter.ALL\"/> the path limiter is removed. Commits\n\t\t/// will not be simplified.\n\t\t/// <para />\n\t\t/// If non-null and not <seealso cref=\"TreeFilter.ALL\"/> then the tree filter will be\n\t\t/// installed and commits will have their ancestry simplified to hide commits\n\t\t/// that do not contain tree entries matched by the filter.\n\t\t/// <para />\n\t\t/// Usually callers should be inserting a filter graph including\n\t\t/// <seealso cref=\"TreeFilter.ANY_DIFF\"/> along with one or more\n\t\t/// <seealso cref=\"PathFilter\"/> instances.\n\t\t/// </summary>\n\t\t/// <param name=\"newFilter\">\n\t\t/// New filter. If null the special <seealso cref=\"TreeFilter.ALL\"/> filter\n\t\t/// will be used instead, as it matches everything.\n\t\t/// </param>\n\t\t/// <seealso cref=\"PathFilter\"/>\n\t\tpublic void setTreeFilter(TreeFilter newFilter)\n\t\t{\n\t\t\tassertNotStarted();\n\t\t\t_treeFilter = newFilter ?? TreeFilter.ALL;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Should the body of a commit or tag be retained after parsing its headers?\n\t\t/// <para />\n\t\t/// Usually the body is always retained, but some application code might not\n\t\t/// care and would prefer to discard the body of a commit as early as\n\t\t/// possible, to reduce memory usage.\n\t\t/// </summary>\n\t\t/// <returns> true if the body should be retained; false it is discarded. </returns>\n\t\tpublic bool isRetainBody()\n\t\t{\n\t\t\treturn _retainBody;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Set whether or not the body of a commit or tag is retained.\n\t\t/// <para />\n\t\t/// If a body of a commit or tag is not retained, the application must\n\t\t/// call <seealso cref=\"parseBody(RevObject)\"/> before the body can be safely\n\t\t/// accessed through the type specific access methods.\n\t\t/// </summary>\n\t\t/// <param name=\"retain\">True to retain bodies; false to discard them early.</param>\n\t\tpublic void setRetainBody(bool retain)\n\t\t{\n\t\t\t_retainBody = retain;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to a blob without loading it.\n\t\t/// <para />\n\t\t/// The blob may or may not exist in the repository. It is impossible to tell\n\t\t/// from this method's return value.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">name of the blob object.</param>\n\t\t/// <returns>Reference to the blob object. Never null.</returns>\n\t\tpublic RevBlob lookupBlob(AnyObjectId id)\n\t\t{\n\t\t\tvar c = (RevBlob)_objects.Get(id);\n\t\t\tif (c == null)\n\t\t\t{\n\t\t\t\tc = new RevBlob(id);\n\t\t\t\t_objects.Add(c);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to a tree without loading it.\n\t\t/// <para />\n\t\t/// The tree may or may not exist in the repository. It is impossible to tell\n\t\t/// from this method's return value.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">Name of the tree object.</param>\n\t\t///\t<returns>Reference to the tree object. Never null.</returns>\n\t\tpublic RevTree lookupTree(AnyObjectId id)\n\t\t{\n\t\t\tvar c = (RevTree)_objects.Get(id);\n\t\t\tif (c == null)\n\t\t\t{\n\t\t\t\tc = new RevTree(id);\n\t\t\t\t_objects.Add(c);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to a commit without loading it.\n\t\t/// <para />\n\t\t/// The commit may or may not exist in the repository. It is impossible to\n\t\t/// tell from this method's return value.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">name of the commit object.</param>\n\t\t/// <returns> reference to the commit object. Never null.</returns>\n\t\tpublic RevCommit lookupCommit(AnyObjectId id)\n\t\t{\n\t\t\tvar c = (RevCommit)_objects.Get(id);\n\t\t\tif (c == null)\n\t\t\t{\n\t\t\t\tc = createCommit(id);\n\t\t\t\t_objects.Add(c);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to any object without loading it.\n\t\t/// <para />\n\t\t/// The object may or may not exist in the repository. It is impossible to\n\t\t/// tell from this method's return value.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">name of the object.</param>\n\t\t/// <param name=\"type\">\n\t\t/// type of the object. Must be a valid Git object type.\n\t\t/// </param>\n\t\t/// <returns>Reference to the object. Never null.\n\t\t/// </returns>\n\t\tpublic RevObject lookupAny(AnyObjectId id, int type)\n\t\t{\n\t\t\tRevObject r = _objects.Get(id);\n\t\t\tif (r == null)\n\t\t\t{\n\t\t\t\tswitch (type)\n\t\t\t\t{\n\t\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\t\t\tr = createCommit(id);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\t\t\tr = new RevTree(id);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\t\t\tr = new RevBlob(id);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\t\tr = new RevTag(id);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new ArgumentException(\"invalid git type: \" + type);\n\t\t\t\t}\n\n\t\t\t\t_objects.Add(r);\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to a commit and immediately parse its content.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"lookupCommit(AnyObjectId)\"/> this method only returns\n\t\t/// successfully if the commit object exists, is verified to be a commit, and\n\t\t/// was parsed without error.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">name of the commit object.</param>\n\t\t/// <returns>reference to the commit object. Never null.</returns>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// the supplied commit does not exist.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// the supplied id is not a commit or an annotated tag.\n\t\t/// </exception>\n\t\t///\t<exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic RevCommit parseCommit(AnyObjectId id)\n\t\t{\n\t\t\tRevObject c = parseAny(id);\n\t\t\tRevTag oTag = (c as RevTag);\n\t\t\twhile (oTag != null)\n\t\t\t{\n\t\t\t\tc = oTag.getObject();\n\t\t\t\tparseHeaders(c);\n\t\t\t}\n\n\t\t\tRevCommit oComm = (c as RevCommit);\n\t\t\tif (oComm == null)\n\t\t\t{\n\t\t\t\tthrow new IncorrectObjectTypeException(id.ToObjectId(), Constants.TYPE_COMMIT);\n\t\t\t}\n\n\t\t\treturn oComm;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to a tree.\n\t\t/// <para />\n\t\t/// This method only returns successfully if the tree object exists, is\n\t\t/// verified to be a tree.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// Name of the tree object, or a commit or annotated tag that may\n\t\t/// reference a tree.\n\t\t/// </param>\n\t\t/// <returns>Reference to the tree object. Never null.</returns>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// The supplied tree does not exist.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IncorrectObjectTypeException\">\n\t\t/// The supplied id is not a tree, a commit or an annotated tag.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// A pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic RevTree parseTree(AnyObjectId id)\n\t\t{\n\t\t\tRevObject c = parseAny(id);\n\t\t\tRevTag oTag = (c as RevTag);\n\t\t\twhile (oTag != null)\n\t\t\t{\n\t\t\t\tc = oTag.getObject();\n\t\t\t\tparseHeaders(c);\n\t\t\t}\n\n\t\t\tRevTree t = (c as RevTree);\n\t\t\tif ( t == null)\n\t\t\t{\n\t\t\t\tRevCommit oComm = (c as RevCommit);\n\t\t\t\tif (oComm != null)\n\t\t\t\t{\n\t\t\t\t\tt = oComm.Tree;\n\t\t\t\t}\n\t\t\t\telse if (t == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new IncorrectObjectTypeException(id.ToObjectId(), Constants.TYPE_TREE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tparseHeaders(t);\n\n\t\t\treturn t;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Locate a reference to any object and immediately parse its headers.\n\t\t/// <para />\n\t\t/// This method only returns successfully if the object exists and was parsed\n\t\t/// without error. Parsing an object can be expensive as the type must be\n\t\t/// determined. For blobs this may mean the blob content was unpacked\n\t\t/// unnecessarily, and thrown away.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">Name of the object.</param>\n\t\t/// <returns>Reference to the object. Never null.</returns>\n\t\t/// <exception cref=\"MissingObjectException\">the supplied does not exist.</exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic RevObject parseAny(AnyObjectId id)\n\t\t{\n\t\t\tRevObject r = _objects.Get(id);\n\t\t\tif (r == null)\n\t\t\t{\n\t\t\t\tObjectLoader ldr = _db.OpenObject(_curs, id);\n\t\t\t\tif (ldr == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new MissingObjectException(id.ToObjectId(), \"unknown\");\n\t\t\t\t}\n\n\t\t\t\tbyte[] data = ldr.CachedBytes;\n\t\t\t\tint type = ldr.Type;\n\t\t\t\tswitch (type)\n\t\t\t\t{\n\t\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRevCommit c = createCommit(id);\n\t\t\t\t\t\t\tc.parseCanonical(this, data);\n\t\t\t\t\t\t\tr = c;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tr = new RevTree(id);\n\t\t\t\t\t\t\tr.Flags |= PARSED;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tr = new RevBlob(id);\n\t\t\t\t\t\t\tr.Flags |= PARSED;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar t = new RevTag(id);\n\t\t\t\t\t\t\tt.parseCanonical(this, data);\n\t\t\t\t\t\t\tr = t;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new ArgumentException(\"Bad object type: \" + type);\n\t\t\t\t}\n\t\t\t\t_objects.Add(r);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparseHeaders(r);\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Ensure the object's critical headers have been parsed.\n\t\t///\t<para />\n\t\t///\tThis method only returns successfully if the object exists and was parsed\n\t\t///\twithout error.\n\t\t///\t</summary>\n\t\t///\t<param name=\"obj\">The object the caller needs to be parsed.</param>\n\t\t///\t<exception cref=\"MissingObjectException\">\n\t\t/// The supplied does not exist.\n\t\t/// </exception>\n\t\t///\t<exception cref=\"IOException\">\n\t\t/// A pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic void parseHeaders(RevObject obj)\n\t\t{\n\t\t\tif ((obj.Flags & PARSED) == 0)\n\t\t\t{\n\t\t\t\tobj.parseHeaders(this);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary> * Ensure the object's fully body content is available.\n\t\t///\t<para />\n\t\t///\tThis method only returns successfully if the object exists and was parsed\n\t\t///\twithout error.\n\t\t///\t</summary>\n\t\t///\t<param name=\"obj\">the object the caller needs to be parsed.</param>\n\t\t/// <exception cref=\"MissingObjectException\">\n\t\t/// the supplied does not exist.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// a pack file or loose object could not be read.\n\t\t/// </exception>\n\t\tpublic void parseBody(RevObject obj)\n\t\t{\n\t\t\tobj.parseBody(this);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create a new flag for application use during walking.\n\t\t/// <para />\n\t\t/// Applications are only assured to be able to create 24 unique flags on any\n\t\t/// given revision walker instance. Any flags beyond 24 are offered only if\n\t\t/// the implementation has extra free space within its internal storage.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">\n\t\t/// description of the flag, primarily useful for debugging.\n\t\t/// </param>\n\t\t/// <returns> newly constructed flag instance. </returns>\n\t\t/// <exception cref=\"ArgumentException\">\n\t\t/// too many flags have been reserved on this revision walker.\n\t\t/// </exception>\n\t\tpublic RevFlag newFlag(string name)\n\t\t{\n\t\t\tint m = allocFlag();\n\t\t\treturn new RevFlag(this, name, m);\n\t\t}\n\n\t\tpublic int allocFlag()\n\t\t{\n\t\t\tif (_freeFlags == 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(32 - ReservedFlags + \" flags already created.\");\n\t\t\t}\n\t\t\tint m = _freeFlags.LowestOneBit();\n\t\t\t_freeFlags &= ~m;\n\t\t\treturn m;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Automatically carry a flag from a child commit to its parents.\n\t\t/// <para />\n\t\t/// A carried flag is copied from the child commit onto its parents when the\n\t\t/// child commit is popped from the lowest level of walk's internal graph.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">\n\t\t/// The flag to carry onto parents, if set on a descendant.\n\t\t/// </param>\n\t\tpublic void carry(RevFlag flag)\n\t\t{\n\t\t\tif ((_freeFlags & flag.Mask) != 0)\n\t\t\t\tthrow new ArgumentException(flag.Name + \" is disposed.\");\n\t\t\tif (flag.Walker != this)\n\t\t\t\tthrow new ArgumentException(flag.Name + \" not from this.\");\n\t\t\t_carryFlags |= flag.Mask;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Automatically carry flags from a child commit to its parents.\n\t\t///\t<para />\n\t\t///\tA carried flag is copied from the child commit onto its parents when the\n\t\t///\tchild commit is popped from the lowest level of walk's internal graph.\n\t\t///\t</summary>\n\t\t///\t<param name=\"set\">\n\t\t///\tThe flags to carry onto parents, if set on a descendant.\n\t\t/// </param>\n\t\tpublic void carry(IEnumerable<RevFlag> set)\n\t\t{\n\t\t\tforeach (RevFlag flag in set)\n\t\t\t\tcarry(flag);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Allow a flag to be recycled for a different use.\n\t\t/// <para />\n\t\t/// Recycled flags always come back as a different Java object instance when\n\t\t/// assigned again by <seealso cref=\"newFlag(string)\"/>.\n\t\t/// <para />\n\t\t/// If the flag was previously being carried, the carrying request is\n\t\t/// removed. Disposing of a carried flag while a traversal is in progress has\n\t\t/// an undefined behavior.\n\t\t/// </summary>\n\t\t/// <param name=\"flag\">the to recycle.</param>\n\t\tpublic void disposeFlag(RevFlag flag)\n\t\t{\n\t\t\tfreeFlag(flag.Mask);\n\t\t}\n\n\t\tinternal void freeFlag(int mask)\n\t\t{\n\t\t\tif (IsNotStarted())\n\t\t\t{\n\t\t\t\t_freeFlags |= mask;\n\t\t\t\t_carryFlags &= ~mask;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_delayFreeFlags |= mask;\n\t\t\t}\n\t\t}\n\n\t\tprivate void FinishDelayedFreeFlags()\n\t\t{\n\t\t\tif (_delayFreeFlags == 0) return;\n\t\t\t_freeFlags |= _delayFreeFlags;\n\t\t\t_carryFlags &= ~_delayFreeFlags;\n\t\t\t_delayFreeFlags = 0;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Resets internal state and allows this instance to be used again.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"Dispose()\"/> previously acquired RevObject (and RevCommit)\n\t\t/// instances are not invalidated. RevFlag instances are not invalidated, but\n\t\t/// are removed from all RevObjects.\n\t\t/// </summary>\n\t\tpublic void reset()\n\t\t{\n\t\t\treset(0);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Resets internal state and allows this instance to be used again.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"Dispose()\"/> previously acquired RevObject (and RevCommit)\n\t\t/// instances are not invalidated. RevFlag instances are not invalidated, but\n\t\t/// are removed from all RevObjects.\n\t\t/// </summary>\n\t\t/// <param name=\"retainFlags\">\n\t\t/// application flags that should <b>not</b> be cleared from\n\t\t/// existing commit objects.\n\t\t/// </param>\n\t\tpublic void resetRetain(RevFlagSet retainFlags)\n\t\t{\n\t\t\treset(retainFlags.Mask);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Resets internal state and allows this instance to be used again.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"Dispose()\"/> previously acquired RevObject (and RevCommit)\n\t\t/// instances are not invalidated. RevFlag instances are not invalidated, but\n\t\t/// are removed from all RevObjects.\n\t\t/// </summary>\n\t\t/// <param name=\"retainFlags\">\n\t\t/// application flags that should <b>not</b> be cleared from\n\t\t/// existing commit objects.\n\t\t/// </param>\n\t\tpublic void resetRetain(params RevFlag[] retainFlags)\n\t\t{\n\t\t\tint mask = 0;\n\t\t\tforeach (RevFlag flag in retainFlags)\n\t\t\t\tmask |= flag.Mask;\n\t\t\treset(mask);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Resets internal state and allows this instance to be used again.\n\t\t/// <para />\n\t\t/// Unlike <seealso cref=\"Dispose()\"/> previously acquired RevObject (and RevCommit)\n\t\t/// instances are not invalidated. RevFlag instances are not invalidated, but\n\t\t/// are removed from all RevObjects.\n\t\t/// </summary>\n\t\t/// <param name=\"retainFlags\">\n\t\t/// application flags that should <b>not</b> be cleared from\n\t\t/// existing commit objects.\n\t\t/// </param>\n\t\tinternal virtual void reset(int retainFlags)\n\t\t{\n\t\t\tFinishDelayedFreeFlags();\n\t\t\tretainFlags |= PARSED;\n\t\t\tint clearFlags = ~retainFlags;\n\n\t\t\tvar q = new FIFORevQueue();\n\t\t\tforeach (RevCommit c in _roots)\n\t\t\t{\n\t\t\t\tif ((c.Flags & clearFlags) == 0) continue;\n\t\t\t\tc.Flags &= retainFlags;\n\t\t\t\tc.reset();\n\t\t\t\tq.add(c);\n\t\t\t}\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = q.next();\n\t\t\t\tif (c == null) break;\n\t\t\t\tif (c.Parents == null) continue;\n\n\t\t\t\tforeach (RevCommit p in c.Parents)\n\t\t\t\t{\n\t\t\t\t\tif ((p.Flags & clearFlags) == 0) continue;\n\t\t\t\t\tp.Flags &= retainFlags;\n\t\t\t\t\tp.reset();\n\t\t\t\t\tq.add(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_curs.Release();\n\t\t\t_roots.Clear();\n\t\t\tQueue = new DateRevQueue();\n\t\t\tPending = new StartGenerator(this);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Returns an Iterator over the commits of this walker.\n\t\t/// <para />\n\t\t/// The returned iterator is only useful for one walk. If this RevWalk gets\n\t\t/// reset a new iterator must be obtained to walk over the new results.\n\t\t/// <para />\n\t\t/// Applications must not use both the Iterator and the <seealso cref=\"next()\"/> API\n\t\t/// at the same time. Pick one API and use that for the entire walk.\n\t\t/// <para />\n\t\t/// If a checked exception is thrown during the walk (see <seealso cref=\"next()\"/>)\n\t\t/// it is rethrown from the Iterator as a <seealso cref=\"RevWalkException\"/>.\n\t\t/// </summary>\n\t\t/// <returns> an iterator over this walker's commits. </returns>\n\t\t/// <seealso cref=\"RevWalkException\"/>\n\t\tpublic Iterator<RevCommit> iterator()\n\t\t{\n\t\t\treturn new Iterator<RevCommit>(this);\n\t\t}\n\n\t\tpublic class Iterator<T> : IEnumerator<T>\n\t\t\twhere T : RevCommit\n\t\t{\n\t\t\tprivate T _first;\n\t\t\tprivate T _next;\n\t\t    private T _current;\n\t\t\tprivate RevWalk _revwalk;\n\n\t\t\tpublic Iterator(RevWalk revwalk)\n\t\t\t{\n\t\t\t\t_revwalk = revwalk;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_first = _next = (T)revwalk.next();\n                }\n                catch (MissingObjectException e)\n                {\n                    throw new RevWalkException(e);\n                }\n                catch (IncorrectObjectTypeException e)\n                {\n                    throw new RevWalkException(e);\n\t\t\t\t}\n\t\t\t\tcatch (IOException e)\n\t\t\t\t{\n\t\t\t\t\tthrow new RevWalkException(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic T Current\n\t\t\t{\n\t\t\t\tget { return _current; }\n\t\t\t}\n\n\t\t\tobject System.Collections.IEnumerator.Current\n\t\t\t{\n\t\t\t\tget { return Current; }\n\t\t\t}\n\n            public bool MoveNext()\n            {\n                if (!hasNext())\n                {\n                    _current = null;\n                    return false;\n                }\n\n                _current = (T)next();\n                return true;\n            }\n\n            public bool hasNext()\n            {\n                return _next != default(T);\n            }\n\n\t\t    public RevCommit next()\n\t\t    {\n\t\t        try\n\t\t        {\n\t\t            RevCommit r = _next;\n\t\t            _next = (T)_revwalk.next();\n\t\t            return r;\n\t\t        }\n\t\t        catch (MissingObjectException e)\n\t\t        {\n\t\t            throw new RevWalkException(e);\n\t\t        }\n\t\t        catch (IncorrectObjectTypeException e)\n\t\t        {\n\t\t            throw new RevWalkException(e);\n\t\t        }\n\t\t        catch (IOException e)\n\t\t        {\n\t\t            throw new RevWalkException(e);\n\t\t        }\n\t\t    }\n\n\t\t\tpublic void Reset()\n\t\t\t{\n\t\t\t\t_next = _first;\n                _current = null;\n\t\t\t}\n\n\t\t\t#region IDisposable Members\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t_first = null;\n\t\t\t\t_next = null;\n\t\t\t\t_revwalk.Dispose();\n\t\t\t    _revwalk = null;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Throws an exception if we have started producing output.\n\t\t/// </summary>\n\t\tinternal void assertNotStarted()\n\t\t{\n\t\t\tif (IsNotStarted()) return;\n\t\t\tthrow new InvalidOperationException(\"Output has already been started.\");\n\t\t}\n\n\t\tprivate bool IsNotStarted()\n\t\t{\n\t\t\treturn Pending is StartGenerator;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Construct a new unparsed commit for the given object.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t/// the object this walker requires a commit reference for.\n\t\t/// </param>\n\t\t/// <returns> a new unparsed reference for the object.\n\t\t/// </returns>\n\t\tprotected virtual RevCommit createCommit(AnyObjectId id)\n\t\t{\n\t\t\treturn new RevCommit(id);\n\t\t}\n\n\t\tinternal void carryFlagsImpl(RevCommit c)\n\t\t{\n\t\t\tint carry = c.Flags & _carryFlags;\n\t\t\tif (carry != 0)\n\t\t\t{\n\t\t\t\tRevCommit.carryFlags(c, carry);\n\t\t\t}\n\t\t}\n\n\t\t#region IEnumerable<RevCommit> Members\n\n\t\tpublic IEnumerator<RevCommit> GetEnumerator()\n\t\t{\n\t\t\treturn iterator();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEnumerable Members\n\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn iterator();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\n\t\t///\t<summary>\n\t\t/// Dispose all internal state and invalidate all RevObject instances.\n\t\t/// <para />\n\t\t/// All RevObject (and thus RevCommit, etc.) instances previously acquired\n\t\t/// from this RevWalk are invalidated by a dispose call. Applications must\n\t\t/// not retain or use RevObject instances obtained prior to the dispose call.\n\t\t/// All RevFlag instances are also invalidated, and must not be reused.\n\t\t/// </summary>\n\t\tpublic virtual void Dispose()\n\t\t{\n\t\t\t_freeFlags = AppFlags;\n\t\t\t_delayFreeFlags = 0;\n\t\t\t_carryFlags = UNINTERESTING;\n\t\t\t_objects.Clear();\n\t\t\t_curs.Release();\n\t\t\t_roots.Clear();\n\t\t\tQueue = new DateRevQueue();\n\t\t\tPending = new StartGenerator(this);\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RewriteGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Replaces a <see cref=\"RevCommit\"/>'s parents until not colored with \n\t/// <see cref=\"RevWalk.REWRITE\"/>.\n\t/// <para />\n\t/// Before a <see cref=\"RevCommit\"/> is returned to the caller its parents are updated to\n\t/// Create a dense DAG. Instead of reporting the actual parents as recorded when\n\t/// the commit was created the returned commit will reflect the Next closest\n\t/// commit that matched the revision walker's filters.\n\t/// <para />\n\t/// This generator is the second phase of a path limited revision walk and\n\t/// assumes it is receiving RevCommits from <see cref=\"RewriteTreeFilter\"/>,\n\t/// After they have been fully buffered by <see cref=\"AbstractRevQueue\"/>. The full\n\t/// buffering is necessary to allow the simple loop used within our own\n\t/// <see cref=\"RewriteCommit(RevCommit)\"/> to pull completely through a strand of\n\t/// <see cref=\"RevWalk.REWRITE\"/> colored commits and come up with a simplification\n\t/// that makes the DAG dense. Not fully buffering the commits first would cause\n\t/// this loop to abort early, due to commits not being parsed and colored\n\t/// correctly.\n\t/// </summary>\n\t/// <seealso cref=\"RewriteTreeFilter\"/>\n\tpublic class RewriteGenerator : Generator\n\t{\n\t\tprivate readonly Generator _source;\n\n\t\tpublic RewriteGenerator(Generator source)\n\t\t{\n\t\t\t_source = source;\n\t\t}\n\n\t\tpublic override void shareFreeList(BlockRevQueue q)\n\t\t{\n\t\t\t_source.shareFreeList(q);\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return _source.OutputType & ~GeneratorOutputType.NeedsRewrite; }\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = _source.next();\n\t\t\t\tif (c == null) return null;\n\n\t\t\t\tbool rewrote = false;\n\t\t\t\tRevCommit[] pList = c.Parents;\n\t\t\t\tint nParents = pList.Length;\n\t\t\t\tfor (int i = 0; i < nParents; i++)\n\t\t\t\t{\n\t\t\t\t\tRevCommit oldp = pList[i];\n\t\t\t\t\tRevCommit newp = RewriteCommit(oldp);\n\t\t\t\t\tif (oldp != newp)\n\t\t\t\t\t{\n\t\t\t\t\t\tpList[i] = newp;\n\t\t\t\t\t\trewrote = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (rewrote)\n\t\t\t\t{\n\t\t\t\t\tc.Parents = Cleanup(pList);\n\t\t\t\t}\n\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\tprivate static RevCommit RewriteCommit(RevCommit p)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit[] pList = p.Parents;\n\t\t\t\tif (pList.Length > 1)\n\t\t\t\t{\n\t\t\t\t\t// This parent is a merge, so keep it.\n\t\t\t\t\t//\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tif ((p.Flags & RevWalk.UNINTERESTING) != 0)\n\t\t\t\t{\n\t\t\t\t\t// Retain uninteresting parents. They show where the\n\t\t\t\t\t// DAG was cut off because it wasn't interesting.\n\t\t\t\t\t//\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tif ((p.Flags & RevWalk.REWRITE) == 0)\n\t\t\t\t{\n\t\t\t\t\t// This parent was not eligible for rewriting. We\n\t\t\t\t\t// need to keep it in the DAG.\n\t\t\t\t\t//\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\n\t\t\t\tif (pList.Length == 0)\n\t\t\t\t{\n\t\t\t\t\t// We can't go back any further, other than to\n\t\t\t\t\t// just delete the parent entirely.\n\t\t\t\t\t//\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tp = pList[0];\n\t\t\t}\n\t\t}\n\n\t\tprivate static RevCommit[] Cleanup(RevCommit[] oldList)\n\t\t{\n\t\t\t// Remove any duplicate parents caused due to rewrites (e.g. a merge\n\t\t\t// with two sides that both simplified back into the merge base).\n\t\t\t// We also may have deleted a parent by marking it null.\n\t\t\t//\n\t\t\tint newCnt = 0;\n\t\t\tfor (int o = 0; o < oldList.Length; o++)\n\t\t\t{\n\t\t\t\tRevCommit p = oldList[o];\n\t\t\t\tif (p == null) continue;\n\t\t\t\tif ((p.Flags & RevWalk.TEMP_MARK) != 0)\n\t\t\t\t{\n\t\t\t\t\toldList[o] = null;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tp.Flags |= RevWalk.TEMP_MARK;\n\t\t\t\tnewCnt++;\n\t\t\t}\n\n\t\t\tif (newCnt == oldList.Length)\n\t\t\t{\n\t\t\t\tforeach (RevCommit p in oldList)\n\t\t\t\t{\n\t\t\t\t\tp.Flags &= ~RevWalk.TEMP_MARK;\n\t\t\t\t}\n\t\t\t\treturn oldList;\n\t\t\t}\n\n\t\t\tvar newList = new RevCommit[newCnt];\n\t\t\tnewCnt = 0;\n\t\t\tforeach (RevCommit p in oldList)\n\t\t\t{\n\t\t\t\tif (p != null)\n\t\t\t\t{\n\t\t\t\t\tnewList[newCnt++] = p;\n\t\t\t\t\tp.Flags &= ~RevWalk.TEMP_MARK;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn newList;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/RewriteTreeFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.TreeWalk.Filter;\n\nnamespace GitSharp.Core.RevWalk\n{\n    /// <summary>\n    /// First phase of a path limited revision walk.\n\t/// <para />\n\t/// This filter is ANDed to evaluate After all other filters and ties the\n\t/// configured <see cref=\"TreeFilter\" /> into the revision walking process.\n\t/// <para />\n\t/// Each commit is differenced concurrently against all of its parents to look\n\t/// for tree entries that are interesting to the TreeFilter. If none are found\n\t/// the commit is colored with <see cref=\"RevWalk.REWRITE\"/>, allowing a later pass\n\t/// implemented by <see cref=\"RewriteGenerator\"/> to remove those colored commits from\n\t/// the DAG.\n    /// </summary>\n    /// <seealso cref=\"RewriteGenerator\"/>\n    public class RewriteTreeFilter : RevFilter\n    {\n        private const int Parsed = RevWalk.PARSED;\n        private const int Uninteresting = RevWalk.UNINTERESTING;\n        private const int Rewrite = RevWalk.REWRITE;\n        private readonly TreeWalk.TreeWalk _pathFilter;\n\n        public RewriteTreeFilter(RevWalk walker, TreeFilter t)\n        {\n            _pathFilter = new TreeWalk.TreeWalk(walker.Repository);\n            _pathFilter.setFilter(t);\n            _pathFilter.Recursive = t.shouldBeRecursive();\n        }\n\n        public override RevFilter Clone()\n        {\n            throw new InvalidOperationException();\n        }\n\n        public override bool include(RevWalk walker, RevCommit cmit)\n        {\n            // Reset the tree filter to scan this commit and parents.\n            //\n            RevCommit[] pList = cmit.Parents;\n            int nParents = pList.Length;\n            TreeWalk.TreeWalk tw = _pathFilter;\n            var trees = new ObjectId[nParents + 1];\n\n            for (int i = 0; i < nParents; i++)\n            {\n                RevCommit p = cmit.Parents[i];\n                if ((p.Flags & Parsed) == 0)\n                {\n                \tp.parseHeaders(walker);\n                }\n                trees[i] = p.Tree;\n            }\n\n            trees[nParents] = cmit.Tree;\n            tw.reset(trees);\n\n            if (nParents == 1)\n            {\n                // We have exactly one parent. This is a very common case.\n                //\n                int chgs = 0, adds = 0;\n                while (tw.next())\n                {\n                    chgs++;\n                    if (tw.getRawMode(0) == 0 && tw.getRawMode(1) != 0)\n                        adds++;\n                    else\n                        break; // no point in looking at this further.\n                }\n\n                if (chgs == 0)\n                {\n                    // No changes, so our tree is effectively the same as\n                    // our parent tree. We pass the buck to our parent.\n                    //\n                    cmit.Flags |= Rewrite;\n                    return false;\n                }\n\n\t\t\t\t// We have interesting items, but neither of the special\n\t\t\t\t// cases denoted above.\n\t\t\t\t//\n\t\t\t\treturn true;\n            }\n        \t\n\t\t\tif (nParents == 0)\n        \t{\n        \t\t// We have no parents to compare against. Consider us to be\n        \t\t// Rewrite only if we have no paths matching our filter.\n        \t\t//\n        \t\tif (tw.next()) return true;\n\n        \t\tcmit.Flags |= Rewrite;\n        \t\treturn false;\n        \t}\n\n        \t// We are a merge commit. We can only be Rewrite if we are same\n            // to _all_ parents. We may also be able to eliminate a parent if\n            // it does not contribute changes to us. Such a parent may be an\n            // uninteresting side branch.\n            //\n            var chgs_ = new int[nParents];\n            var adds_ = new int[nParents];\n            while (tw.next())\n            {\n                int myMode = tw.getRawMode(nParents);\n                for (int i = 0; i < nParents; i++)\n                {\n                    int pMode = tw.getRawMode(i);\n                    if (myMode == pMode && tw.idEqual(i, nParents)) continue;\n\n                    chgs_[i]++;\n                    if (pMode == 0 && myMode != 0)\n                    {\n                    \tadds_[i]++;\n                    }\n                }\n            }\n\n            bool same = false;\n            bool diff = false;\n            for (int i = 0; i < nParents; i++)\n            {\n                if (chgs_[i] == 0)\n                {\n                    // No changes, so our tree is effectively the same as\n                    // this parent tree. We pass the buck to only this one\n                    // parent commit.\n                    //\n\n                    RevCommit p = pList[i];\n                    if ((p.Flags & Uninteresting) != 0)\n                    {\n                        // This parent was marked as not interesting by the\n                        // application. We should look for another parent\n                        // that is interesting.\n                        //\n                        same = true;\n                        continue;\n                    }\n\n                    cmit.Flags |= Rewrite;\n                    cmit.Parents = new[] { p };\n                    return false;\n                }\n\n                if (chgs_[i] == adds_[i])\n                {\n                    // All of the differences from this parent were because we\n                    // added files that they did not have. This parent is our\n                    // \"empty tree root\" and thus their history is not relevant.\n                    // Cut our grandparents to be an empty list.\n                    //\n                    pList[i].Parents = RevCommit.NoParents;\n                }\n\n                // We have an interesting difference relative to this parent.\n                //\n                diff = true;\n            }\n\n            if (diff && !same)\n            {\n                // We did not abort above, so we are different in at least one\n                // way from all of our parents. We have to take the blame for\n                // that difference.\n                //\n                return true;\n            }\n\n            // We are the same as all of our parents. We must keep them\n            // as they are and allow those parents to flow into pending\n            // for further scanning.\n            //\n            cmit.Flags |= Rewrite;\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/RevWalk/StartGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.TreeWalk.Filter;\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Initial RevWalk generator that bootstraps a new walk.\n\t/// <para />\n\t/// Initially RevWalk starts with this generator as its chosen implementation.\n\t/// The first request for a <see cref=\"RevCommit\"/> from the <see cref=\"RevWalk\"/> \n\t/// instance calls to our <see cref=\"next()\"/> method, and we replace ourselves with \n\t/// the best <see cref=\"Generator\"/> implementation available based upon the \n\t/// current configuration.\n\t/// </summary>\n\tpublic class StartGenerator : Generator, IDisposable\n\t{\n\t\tprivate readonly RevWalk _walker;\n\n\t\tpublic StartGenerator(RevWalk walker)\n\t\t{\n\t\t\t_walker = walker;\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return 0; }\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\tRevWalk w = _walker;\n\t\t\tRevFilter rf = w.getRevFilter();\n\t\t\tTreeFilter tf = w.getTreeFilter();\n\t\t\tAbstractRevQueue q = _walker.Queue;\n\n\t\t\tif (rf == RevFilter.MERGE_BASE)\n\t\t\t{\n\t\t\t\t// Computing for merge bases is a special case and does not\n\t\t\t\t// use the bulk of the generator pipeline.\n\t\t\t\t//\n\t\t\t\tif (tf != TreeFilter.ALL)\n\t\t\t\t{\n\t\t\t\t\tthrow new InvalidOperationException(\"Cannot combine TreeFilter \" + tf + \" with RevFilter \" + rf + \".\");\n\t\t\t\t}\n\n\t\t\t\tvar mbg = new MergeBaseGenerator(w);\n\t\t\t\t_walker.Pending = mbg;\n\t\t\t\t_walker.Queue = AbstractRevQueue.EmptyQueue;\n\t\t\t\tmbg.init(q);\n\t\t\t\treturn mbg.next();\n\t\t\t}\n\n\t\t\tbool uninteresting = q.anybodyHasFlag(RevWalk.UNINTERESTING);\n\t\t\tbool boundary = _walker.hasRevSort(RevSort.BOUNDARY);\n\n\t\t\tif (!boundary && _walker is ObjectWalk)\n\t\t\t{\n\t\t\t\t// The object walker requires boundary support to color\n\t\t\t\t// trees and blobs at the boundary uninteresting so it\n\t\t\t\t// does not produce those in the result.\n\t\t\t\t//\n\t\t\t\tboundary = true;\n\t\t\t}\n\n\t\t\tif (boundary && !uninteresting)\n\t\t\t{\n\t\t\t\t// If we were not fed uninteresting commits we will never\n\t\t\t\t// construct a boundary. There is no reason to include the\n\t\t\t\t// extra overhead associated with that in our pipeline.\n\t\t\t\t//\n\t\t\t\tboundary = false;\n\t\t\t}\n\n\t\t\tDateRevQueue pending = (q as DateRevQueue);\n\t\t\tGeneratorOutputType pendingOutputType = 0;\n\t\t\tif (pending == null)\n\t\t\t{\n\t\t\t\tpending = new DateRevQueue(q);\n\t\t\t}\n\n\t\t\tif (tf != TreeFilter.ALL)\n\t\t\t{\n\t\t\t\trf = AndRevFilter.create(rf, new RewriteTreeFilter(w, tf));\n\t\t\t\tpendingOutputType |= GeneratorOutputType.HasRewrite | GeneratorOutputType.NeedsRewrite;\n\t\t\t}\n\n\t\t\t_walker.Queue = q;\n\t\t\tGenerator g = new PendingGenerator(w, pending, rf, pendingOutputType);\n\n\t\t\tif (boundary)\n\t\t\t{\n\t\t\t\t// Because the boundary generator may produce uninteresting\n\t\t\t\t// commits we cannot allow the pending generator to dispose\n\t\t\t\t// of them early.\n\t\t\t\t//\n\t\t\t\t((PendingGenerator)g).CanDispose = false;\n\t\t\t}\n\n\t\t\tif ((g.OutputType & GeneratorOutputType.NeedsRewrite) != GeneratorOutputType.None)\n\t\t\t{\n\t\t\t\t// Correction for an upstream NEEDS_REWRITE is to buffer\n\t\t\t\t// fully and then Apply a rewrite generator that can\n\t\t\t\t// pull through the rewrite chain and produce a dense\n\t\t\t\t// output graph.\n\t\t\t\t//\n\t\t\t\tg = new FIFORevQueue(g);\n\t\t\t\tg = new RewriteGenerator(g);\n\t\t\t}\n\n\t\t\tif (_walker.hasRevSort(RevSort.TOPO) && (g.OutputType & GeneratorOutputType.SortTopo) == 0)\n\t\t\t{\n\t\t\t\tg = new TopoSortGenerator(g);\n\t\t\t}\n\n\t\t\tif (_walker.hasRevSort(RevSort.REVERSE))\n\t\t\t{\n\t\t\t\tg = new LIFORevQueue(g);\n\t\t\t}\n\n\t\t\tif (boundary)\n\t\t\t{\n\t\t\t\tg = new BoundaryGenerator(w, g);\n\t\t\t}\n\t\t\telse if (uninteresting)\n\t\t\t{\n\t\t\t\t// Try to protect ourselves from uninteresting commits producing\n\t\t\t\t// due to clock skew in the commit time stamps. Delay such that\n\t\t\t\t// we have a chance at coloring enough of the graph correctly,\n\t\t\t\t// and then strip any UNINTERESTING nodes that may have leaked\n\t\t\t\t// through early.\n\t\t\t\t//\n\t\t\t\tif (pending.peek() != null)\n\t\t\t\t{\n\t\t\t\t\tg = new DelayRevQueue(g);\n\t\t\t\t}\n\t\t\t\tg = new FixUninterestingGenerator(g);\n\t\t\t}\n\n\t\t\tw.Pending = g;\n\t\t\treturn g.next();\n\t\t}\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_walker.Dispose();\n\t\t}\n\t\t\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/RevWalk/TopoSortGenerator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.RevWalk\n{\n\t/// <summary>\n\t/// Sorts commits in topological order.\n\t/// </summary>\n\tpublic class TopoSortGenerator : Generator\n\t{\n\t\tprivate static readonly int TopoDelay = RevWalk.TOPO_DELAY;\n\t\tprivate readonly FIFORevQueue _pending;\n\t\tprivate readonly GeneratorOutputType _outputType;\n\n\t\t/// <summary>\n\t\t/// Create a new sorter and completely spin the generator.\n\t\t/// <para />\n\t\t/// When the constructor completes the supplied generator will have no\n\t\t/// commits remaining, as all of the commits will be held inside of this\n\t\t/// generator's internal buffer.\n\t\t/// </summary>\n\t\t/// <param name=\"s\">\n\t\t/// Generator to pull all commits out of, and into this buffer.\n\t\t/// </param>\n\t\tpublic TopoSortGenerator(Generator s)\n\t\t{\n\t\t\t_pending = new FIFORevQueue();\n\t\t\t_outputType = s.OutputType | GeneratorOutputType.SortTopo;\n\t\t\ts.shareFreeList(_pending);\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = s.next();\n\t\t\t\tif (c == null) break;\n\t\t\t\tforeach (RevCommit p in c.Parents)\n\t\t\t\t{\n\t\t\t\t\tp.InDegree++;\n\t\t\t\t}\n\t\t\t\t_pending.add(c);\n\t\t\t}\n\t\t}\n\n\t\tpublic override GeneratorOutputType OutputType\n\t\t{\n\t\t\tget { return _outputType; }\n\t\t}\n\n\t\tpublic override void shareFreeList(BlockRevQueue q)\n\t\t{\n\t\t\tq.shareFreeList(_pending);\n\t\t}\n\n\t\tpublic override RevCommit next()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tRevCommit c = _pending.next();\n\t\t\t\tif (c == null) return null;\n\n\t\t\t\tif (c.InDegree > 0)\n\t\t\t\t{\n\t\t\t\t\t// At least one of our children is missing. We delay\n\t\t\t\t\t// production until all of our children are output.\n\t\t\t\t\t//\n\t\t\t\t\tc.Flags |= TopoDelay;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// All of our children have already produced,\n\t\t\t\t// so it is OK for us to produce now as well.\n\t\t\t\t//\n\t\t\t\tforeach (RevCommit p in c.Parents)\n\t\t\t\t{\n\t\t\t\t\tif (--p.InDegree == 0 && (p.Flags & TopoDelay) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// This parent tried to come before us, but we are\n\t\t\t\t\t\t// his last child. unpop the parent so it goes right\n\t\t\t\t\t\t// behind this child.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tp.Flags &= ~TopoDelay;\n\t\t\t\t\t\t_pending.unpop(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/SubmoduleConfig.cs",
    "content": "/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Transport;\n\nnamespace GitSharp.Core\n{\n\n    public class SubmoduleEntry\n    {\n\t\t[Serializable]\n        public enum UpdateMethod\n        {\n            Checkout,\n            Rebase,\n            Merge\n        }\n\n        public string Name { get; private set; }\n        public string Path { get; private set; }\n        public URIish Url { get; private set; }\n        public UpdateMethod Update { get; private set; }\n\n        public SubmoduleEntry(string name, string path, URIish url, UpdateMethod update)\n        {\n            Name = name;\n            Path = path;\n            Url = url;\n            Update = update;\n        }\n    }\n\n    public class SubmoduleConfig : FileBasedConfig\n    {\n        public SubmoduleConfig(Config cfg, Repository db)\n            : base(cfg, new FileInfo(Path.Combine(db.WorkingDirectory.FullName, \".gitmodules\")))\n        {\n        }\n\n        public SubmoduleConfig(Repository db)\n            : this(null, db)\n        {\n        }\n\n        public int SubmoduleCount\n        {\n            get\n            {\n                return getSubsections(\"submodule\").Count;\n            }\n        }\n\n        public SubmoduleEntry GetEntry(int index)\n        {\n            string name = getSubsections(\"submodule\")[index];\n            string path = getString(\"submodule\", name, \"path\");\n            string url = getString(\"submodule\", name, \"url\");\n            string update = getString(\"submodule\", name, \"update\");\n\n            SubmoduleEntry.UpdateMethod method;\n            switch (update)\n            {\n                case \"rebase\":\n                    method = SubmoduleEntry.UpdateMethod.Rebase;\n                    break;\n\n                case \"merge\":\n                    method = SubmoduleEntry.UpdateMethod.Merge;\n                    break;\n\n                default:\n                    method = SubmoduleEntry.UpdateMethod.Checkout;\n                    break;\n            }\n\n            return new SubmoduleEntry(name, path, new URIish(url), method);\n        }\n\n        public void AddEntry(SubmoduleEntry entry)\n        {\n\t\t\tif (entry == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"entry\");\n\t\t\t\n            setString(\"submodule\", entry.Name, \"path\", entry.Path);\n            setString(\"submodule\", entry.Name, \"url\", entry.Url.ToPrivateString());\n            if (entry.Update != SubmoduleEntry.UpdateMethod.Checkout)\n                setString(\"submodule\", entry.Name, \"update\", entry.Update.ToString().ToLowerInvariant());\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/SymbolicRef.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// A reference that indirectly points at another <see cref=\"Ref\"/>.\n    /// <para/>\n    /// A symbolic reference always derives its current value from the target\n    /// reference.\n    /// </summary>\n    public class SymbolicRef : Ref\n    {\n        private readonly string _name;\n        private readonly Ref _target;\n\n        /// <summary>\n        /// Create a new ref pairing.\n        /// </summary>\n        /// <param name=\"refName\">name of this ref.</param>\n        /// <param name=\"target\">the ref we reference and derive our value from.</param>\n        public SymbolicRef(string refName, Ref target)\n        {\n            _name = refName;\n            _target = target;\n        }\n\n        public string Name\n        {\n            get { return _name; }\n        }\n\n        public bool IsSymbolic\n        {\n            get { return true; }\n        }\n\n        public Ref Leaf\n        {\n            get\n            {\n                Ref dst = Target;\n                while (dst.IsSymbolic)\n                    dst = dst.Target;\n                return dst;\n            }\n        }\n\n        public Ref Target\n        {\n            get { return _target; }\n        }\n\n        public ObjectId ObjectId\n        {\n            get { return Leaf.ObjectId; }\n        }\n\n        public ObjectId PeeledObjectId\n        {\n            get { return Leaf.PeeledObjectId; }\n        }\n\n        public bool IsPeeled\n        {\n            get { return Leaf.IsPeeled; }\n        }\n\n        public Storage StorageFormat\n        {\n            get { return Storage.Loose; }\n        }\n\n        public override string ToString()\n        {\n            var r = new StringBuilder();\n            r.Append(\"SymbolicRef[\");\n            Ref cur = this;\n            while (cur.isSymbolic())\n            {\n                r.Append(cur.getName());\n                r.Append(\" -> \");\n                cur = cur.getTarget();\n            }\n            r.Append(cur.getName());\n            r.Append('=');\n            r.Append(ObjectId.ToString(cur.getObjectId()));\n            r.Append(\"]\");\n            return r.ToString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/SymlinkTreeEntry.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    public class SymlinkTreeEntry : TreeEntry\n    {\n        public SymlinkTreeEntry(Tree parent, ObjectId id, byte[] nameUTF8)\n            : base(parent, id, nameUTF8)\n        {\n        }\n\n        public override FileMode Mode\n        {\n            get { return FileMode.Symlink; }\n        }\n\n        public override void Accept(TreeVisitor tv, int flags)\n        {\n            if ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !this.IsModified)\n            {\n                return;\n            }\n\n            tv.VisitSymlink(this);\n        }\n\n        public override string ToString()\n        {\n            StringBuilder r = new StringBuilder();\n            r.Append(ObjectId.ToString(Id));\n            r.Append(\" S \");\n            r.Append(FullName);\n            return r.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/SystemReader.cs",
    "content": "using System;\nusing System.IO;\nusing System.Net;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t[Serializable]\n    public enum PlatformType\n    {\n        \n        Windows = 1,\n        Unix = 4,\n        Xbox = 5,\n        MacOSX = 6,\n        Suse = 20,\n        Ubuntu = 21,\n        RedHat = 22,\n        Unknown = 127,\n        UnixMono = 128\n    }\n\n\t[Serializable]\n    public enum ConfigFileType\n    {\n\n        System = 1,\n        Global = 2,\n        Repo = 3\n    }\n\n    public abstract class SystemReader\n    {\n        \n        private static SystemReader _instance = new InternalSystemReader();\n\n        /** @return the live instance to read system properties. */\n        public static SystemReader getInstance()\n        {\n            return _instance;\n        }\n\n        /**\n\t     * @param newReader\n\t     *            the new instance to use when accessing properties.\n\t     */\n        public static void setInstance(SystemReader newReader)\n        {\n            _instance = newReader;\n        }\n\n        /**\n\t     * Gets the hostname of the local host. If no hostname can be found, the\n\t     * hostname is set to the default value \"localhost\".\n\t     *\n\t     * @return the canonical hostname\n\t     */\n        public abstract string getHostname();\n\n        /**\n         * @param variable system variable to read\n         * @return value of the system variable\n         */\n        public abstract string getenv(string variable);\n        \n        /**\n\t     * @param key of the system property to read\n    \t * @return value of the system property\n\t     */\n        public abstract string getProperty(string key);\n\n        /**\n    \t * @return the git configuration found in the user home\n    \t */\n        public abstract FileBasedConfig openUserConfig();\n\n        /**\n        * @return the current system time\n        */\n        public abstract long getCurrentTime();\n\n        /**\n        * @param when TODO\n        * @return the local time zone\n        */\n        public abstract int getTimezone(long when);\n\n        /// <summary>\n        /// Returns Windows, Linux or Mac for identification of the OS in use\n        /// </summary>\n        /// <returns>Operating System name</returns>\n        public abstract PlatformType getOperatingSystem();\n\n        /// <summary>\n        /// Returns the GitSharp configuration file from the OS-dependant location.\n        /// </summary>\n        /// <returns></returns>\n        public abstract FileBasedConfig getConfigFile(ConfigFileType configType);\n        \n        /// <summary>\n        /// Returns the GitSharp configuration file based on a user-specified location.\n        /// </summary>\n        /// <returns></returns>\n        public abstract FileBasedConfig getConfigFile(string fileLocation);\n\n        private class InternalSystemReader : SystemReader\n        {\n            public override string getenv(string variable)\n            {\n                return Environment.GetEnvironmentVariable(variable);\n            }\n            public override string getProperty(string key)\n            {\n                //[java] return  System.getProperty(key);\n                string result = string.Empty;\n\n                switch (key)\n                {\n                    case Constants.OS_USER_NAME_KEY:\n                        using (System.Security.Principal.WindowsIdentity ident = System.Security.Principal.WindowsIdentity.GetCurrent())\n\t\t\t\t\t    {\n\t\t\t\t\t\t    result = ident.Name;\n                            int index = result.LastIndexOf('\\\\');\n                            if (result.Length >= index+1)\n                                result = result.Substring(index+1);\n                            break;\n\t\t\t\t        }\n                    default:\n                        throw new NotImplementedException(\"The \" + key + \" property has not been implemented. This was a Java feature.\");        \n                }\n                \n                return result;\n            }\n\n            public override FileBasedConfig openUserConfig()\n            {\n                DirectoryInfo home = FS.userHome();\n                return new FileBasedConfig(new FileInfo(Path.Combine(home.FullName, \".gitconfig\")));\n            }\n\n            public override string getHostname()\n            {\n                return Dns.GetHostName();\n            }\n\n            public override long getCurrentTime()\n            {\n                return DateTime.UtcNow.ToMillisecondsSinceEpoch();\n            }\n\n            public override int getTimezone(long when)\n            {\n                return (int)TimeZone.CurrentTimeZone.GetUtcOffset(when.MillisToUtcDateTime()).TotalMinutes;\n            }\n\n            public override PlatformType getOperatingSystem()\n            {\n                OperatingSystem os = Environment.OSVersion;\n                PlatformID pid = os.Platform;\n                PlatformType pType = PlatformType.Unknown;\n\n                switch (pid)\n                {\n                    case PlatformID.Win32NT:\n                    case PlatformID.Win32S:\n                    case PlatformID.Win32Windows:\n                    case PlatformID.WinCE:\n                        pType = PlatformType.Windows;\n                        break;\n                    case PlatformID.Unix:\n                        pType = PlatformType.Unix;\n                        break;\n                    //case PlatformID.MacOSX:\n                    //    pType = PlatformType.MacOSX;\n                    //    break;\n                    //case PlatformID.Xbox:\n                    //    pType = PlatformType.Xbox;\n                    //    break;\n                    default:\n                        // Mono used 128 as its internal Unix identifier before it was added by MS.\n                        if ((int)pid == (int)PlatformType.UnixMono)\n                        {\n                            pType = PlatformType.Unix;\n                            break;\n                        }\n                        throw new ArgumentException(\"OS support for '\" + os.VersionString + \" ' is not implemented.\");\n                }\n\n                //Testing should be added here to identify the flavor of *nix in use.\n                //This is primarily useful because *nix does not have a standardized install location\n                //or function call to identify \"special folders\".\n                if (pType == PlatformType.Unix)\n                {\n                }\n\n                return pType;\n            }\n\n            public override FileBasedConfig getConfigFile(ConfigFileType configType)\n            {\n            \tstring filename = string.Empty;\n            \t\n               \tswitch (configType)\n            \t{\n            \t\tcase ConfigFileType.Global:\n               \t\t\tfilename = Path.Combine(FS.globalHome().FullName, \".gitconfig\");\n            \t\t\tbreak;\n\t           \t\tcase ConfigFileType.System:\n            \t\t\tfilename = Path.Combine(FS.systemHome().FullName, \"gitconfig\");\n           \t\t\t\tbreak;\t\n            \t\tcase ConfigFileType.Repo:\n           \t\t\t\tfilename = Path.Combine(FS.userHome().FullName, Constants.DOT_GIT);\n           \t\t\t\tfilename = Path.Combine(filename, \"config\");\n            \t\t\tbreak;\n            \t\tdefault:\n            \t\t\tthrow new ArgumentException(\"getConfigFile used unknown Config filetype.\");\n                }\n               \t\n               \tFileInfo info = new FileInfo(filename);\n               \tif (info != null)\n            \t\treturn (new FileBasedConfig(info));\n               \telse\n               \t\tthrow new FileNotFoundException();\n            }\n            \n            public override FileBasedConfig getConfigFile(string fileLocation)\n            {\n            \tFileInfo info = new FileInfo(fileLocation);\n            \tif (info != null)\n            \t\treturn (new FileBasedConfig(info));\n               \telse\n               \t\tthrow new FileNotFoundException();\n            }\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Tag.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    public class Tag\n    {\n        public Repository Repository { get; internal set; }\n\n\t\tprivate PersonIdent author;\n\t\tprivate string message;\n\t\tprivate string tagType;\n        private byte[] raw;\n\n        /**\n         * Construct a new, yet unnamed Tag.\n         *\n         * @param db\n         */\n        public Tag(Repository db)\n        {\n            Repository = db;\n        }\n\n        /**\n         * Construct a Tag representing an existing with a known name referencing an known object.\n         * This could be either a simple or annotated tag.\n         *\n         * @param db {@link Repository}\n         * @param id target id.\n         * @param refName tag name or null\n         * @param raw data of an annotated tag.\n         */\n        public Tag(Repository db, ObjectId id, string refName, byte[] raw)\n        {\n            Repository = db;\n            if (raw != null)\n            {\n                TagId = id;\n                Id = ObjectId.FromString(raw, 7);\n            }\n            else\n                Id = id;\n            if (refName != null && refName.StartsWith(\"refs/tags/\"))\n                refName = refName.Substring(10);\n            TagName = refName;\n            this.raw = raw;\n        }\n\n        /**\n         * @return tagger of a annotated tag or null\n         */\n        public PersonIdent Author\n        {\n            get\n            {\n                decode();\n                return author;\n            }\n            set\n            {\n                author = value;\n            }\n        }\n\n        /**\n         * @return comment of an annotated tag, or null\n         */\n        public string Message\n        {\n            get\n            {\n                decode();\n                return message;\n            }\n            set\n            {\n                message = value;\n            }\n        }\n\n        private void decode()\n        {\n            // FIXME: handle I/O errors\n            if (raw == null) return;\n\n            using (var br = new StreamReader(new MemoryStream(raw)))\n            {\n                string n = br.ReadLine();\n                if (n == null || !n.StartsWith(\"object \"))\n                {\n                    throw new CorruptObjectException(TagId, \"no object\");\n                }\n                Id = ObjectId.FromString(n.Substring(7));\n                n = br.ReadLine();\n                if (n == null || !n.StartsWith(\"type \"))\n                {\n                    throw new CorruptObjectException(TagId, \"no type\");\n                }\n                TagType = n.Substring(\"type \".Length);\n                n = br.ReadLine();\n\n                if (n == null || !n.StartsWith(\"tag \"))\n                {\n                    throw new CorruptObjectException(TagId, \"no tag name\");\n                }\n                TagName = n.Substring(\"tag \".Length);\n                n = br.ReadLine();\n\n                // We should see a \"tagger\" header here, but some repos have tags\n                // without it.\n                if (n == null)\n                    throw new CorruptObjectException(TagId, \"no tagger header\");\n\n                if (n.Length > 0)\n                    if (n.StartsWith(\"tagger \"))\n                        Tagger = new PersonIdent(n.Substring(\"tagger \".Length));\n                    else\n                        throw new CorruptObjectException(TagId, \"no tagger/bad header\");\n\n                // Message should start with an empty line, but\n                StringBuilder tempMessage = new StringBuilder();\n                char[] readBuf = new char[2048];\n                int readLen;\n                int readIndex = 0;\n                while ((readLen = br.Read(readBuf, readIndex, readBuf.Length)) > 0)\n                {\n                    //readIndex += readLen;\n                    tempMessage.Append(readBuf, 0, readLen);\n                }\n                message = tempMessage.ToString();\n                if (message.StartsWith(\"\\n\"))\n                    message = message.Substring(1);\n            }\n\n            raw = null;\n        }\n\n\n        /**\n         * Store a tag.\n         * If author, message or type is set make the tag an annotated tag.\n         *\n         * @\n         */\n        public void Save()  //renamed from Tag\n        {\n            if (TagId != null)\n                throw new InvalidOperationException(\"exists \" + TagId);\n            ObjectId id;\n\n            if (author != null || message != null || tagType != null)\n            {\n                ObjectId tagid = new ObjectWriter(Repository).WriteTag(this);\n                TagId = tagid;\n                id = tagid;\n            }\n            else\n            {\n                id = Id;\n            }\n\n            RefUpdate ru = Repository.UpdateRef(Constants.R_TAGS + TagName);\n            ru.NewObjectId = id;\n            ru.setRefLogMessage(\"tagged \" + TagName, false);\n            if (ru.forceUpdate() == RefUpdate.RefUpdateResult.LOCK_FAILURE)\n                throw new ObjectWritingException(\"Unable to lock tag \" + TagName);\n        }\n\n        public override string ToString()\n        {\n            return \"tag[\" + TagName + TagType + Id + \" \" + Author + \"]\";\n        }\n\n        public ObjectId TagId { get; set; }\n\n        /**\n         * @return creator of this tag.\n         */\n        public PersonIdent Tagger\n        {\n            get { return Author; }\n            set { Author = value; }\n        }\n\n\n        /**\n         * @return tag target type\n         */\n        \n        public string TagType\n        {\n            get\n            {\n                decode();\n                return tagType;\n            }\n            set\n            {\n                tagType = value;\n            }\n        }\n\n        /// <summary>\n        /// the SHA'1 of the object this tag refers to\n        /// </summary>\n        public string TagName { get; set; }\n\n\n        /// <summary>Id of the object this tag refers to</summary>\n        public ObjectId Id { get; set; }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TextProgressMonitor.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n\tpublic class TextProgressMonitor : ProgressMonitor, IDisposable\n\t{\n\t\tprivate readonly TextWriter _writer;\n\t\tprivate DateTime _taskBeganAt;\n\t\tprivate string _message;\n\t\tprivate int _lastWorked;\n\t\tprivate int _totalWork;\n\t\tprivate bool _output;\n\n\t\tpublic TextProgressMonitor()\n\t\t\t: this(Console.Error)\n\t\t{\n\t\t}\n\n\t\tpublic TextProgressMonitor(TextWriter writer)\n\t\t{\n\t\t\t_writer = writer;\n\t\t\t_taskBeganAt = DateTime.Now;\n\t\t}\n\n\t\t#region ProgressMonitor Members\n\n\t\tpublic override void Start(int totalTasks)\n\t\t{\n\t\t\t_taskBeganAt = DateTime.Now;\n\t\t}\n\n\t\tpublic override void BeginTask(string title, int totalWork)\n\t\t{\n\t\t\tEndTask();\n\t\t\t_message = title;\n\t\t\t_lastWorked = 0;\n\t\t\t_totalWork = totalWork;\n\t\t}\n\n\t\tpublic override void Update(int completed)\n\t\t{\n\t\t\tif (_message == null) return;\n\t\t\tint cmp = _lastWorked + completed;\n\t\t\tif (!_output && ((DateTime.Now - _taskBeganAt).TotalMilliseconds < 500)) return;\n\n\t\t\tif (_totalWork == UNKNOWN)\n\t\t\t{\n\t\t\t\tDisplay(cmp);\n\t\t\t\t_writer.Flush();\n\t\t\t}\n\t\t\telse if ((cmp * 100 / _totalWork) != (_lastWorked * 100) / _totalWork)\n\t\t\t{\n\t\t\t\tDisplay(cmp);\n\t\t\t\t_writer.Flush();\n\t\t\t}\n\n\t\t\t_lastWorked = cmp;\n\t\t\t_output = true;\n\t\t}\n\n\t\tprivate void Display(int cmp)\n\t\t{\n\t\t\tvar m = new StringBuilder();\n\t\t\tm.Append('\\r');\n\t\t\tm.Append(_message);\n\t\t\tm.Append(\": \");\n\t\t\twhile (m.Length < 25)\n\t\t\t{\n\t\t\t\tm.Append(' ');\n\t\t\t}\n\n\t\t\tif (_totalWork == UNKNOWN)\n\t\t\t{\n\t\t\t\tm.Append(cmp);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstring twstr = _totalWork.ToString();\n\t\t\t\tstring cmpstr = cmp.ToString();\n\n\t\t\t\twhile (cmpstr.Length < twstr.Length)\n\t\t\t\t{\n\t\t\t\t\tcmpstr = \" \" + cmpstr;\n\t\t\t\t}\n\n\t\t\t\tint pcnt = (cmp * 100 / _totalWork);\n\t\t\t\tif (pcnt < 100)\n\t\t\t\t{\n\t\t\t\t\tm.Append(' ');\n\t\t\t\t}\n\n\t\t\t\tif (pcnt < 10)\n\t\t\t\t{\n\t\t\t\t\tm.Append(' ');\n\t\t\t\t}\n\n\t\t\t\tm.Append(pcnt);\n\t\t\t\tm.Append(\"% (\");\n\t\t\t\tm.Append(cmpstr);\n\t\t\t\tm.Append(\"/\");\n\t\t\t\tm.Append(twstr);\n\t\t\t\tm.Append(\")\");\n\t\t\t}\n\n\t\t\t_writer.Write(m);\n\t\t}\n\n\t\tpublic override void EndTask()\n\t\t{\n\t\t\tif (_output)\n\t\t\t{\n\t\t\t\tif (_totalWork != UNKNOWN)\n\t\t\t\t{\n\t\t\t\t\tDisplay(_totalWork);\n\t\t\t\t}\n\n\t\t\t\t_writer.WriteLine();\n\t\t\t}\n\n\t\t\t_output = false;\n\t\t\t_message = null;\n\t\t}\n\n\t\tpublic override bool IsCancelled\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_writer.Dispose();\n\t\t}\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/TransferConfig.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n\n    public class TransferConfig\n    {\n        private class SectionParser : Config.SectionParser<TransferConfig>\n        {\n            public TransferConfig parse(Config cfg)\n            {\n                return new TransferConfig(cfg);\n            }\n        }\n\n        public static Config.SectionParser<TransferConfig> KEY = new SectionParser();\n\n        private readonly bool fsckObjects;\n\n        public TransferConfig(Config rc)\n        {\n\t\t\tif (rc == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"rc\");\n\t\t\t\n            fsckObjects = rc.getBoolean(\"receive\", \"fsckobjects\", false);\n        }\n\n        public bool isFsckObjects()\n        {\n            return fsckObjects;\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BaseConnection.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Base helper class for implementing operations connections.\n    /// </summary>\n    public abstract class BaseConnection : IConnection, IDisposable\n    {\n        private IDictionary<string, Ref> _advertisedRefs = new Dictionary<string, Ref>();\n        private bool _startedOperation;\n\n        public IDictionary<string, Ref> RefsMap\n        {\n            get\n            {\n                return _advertisedRefs;\n            }\n        }\n\n        public ICollection<Ref> Refs\n        {\n            get\n            {\n                return _advertisedRefs.Values;\n            }\n        }\n\n        public Ref GetRef(string name)\n        {\n            return _advertisedRefs.get(name);\n\n        }\n\n        public abstract void Close();\n\n        /// <summary>\n        /// Denote the list of refs available on the remote repository.\n        /// <para/>\n        /// Implementors should invoke this method once they have obtained the refs\n        /// that are available from the remote repository.\n        /// </summary>\n        /// <param name=\"all\">\n        /// the complete list of refs the remote has to offer. This map\n        /// will be wrapped in an unmodifiable way to protect it, but it\n        /// does not get copied.\n        /// </param>\n        public void available(IDictionary<string, Ref> all)\n        {\n            _advertisedRefs = all;\n        }\n\n        /// <summary>\n        /// Helper method for ensuring one-operation per connection. Check whether\n        /// operation was already marked as started, and mark it as started.\n        /// </summary>\n        protected void markStartedOperation()\n        {\n            if (_startedOperation)\n                throw new TransportException(\"Only one operation call per connection is supported.\");\n            _startedOperation = true;\n        }\n\n        public virtual void Dispose()\n        {\n            Close();\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BaseFetchConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Base helper class for fetch connection implementations. Provides some common\n    /// typical structures and methods used during fetch connection.\n    /// <para/>\n    /// Implementors of fetch over pack-based protocols should consider using\n    /// <see cref=\"BasePackFetchConnection\"/> instead.\n    /// </summary>\n    public abstract class BaseFetchConnection : BaseConnection, IFetchConnection\n    {\n        public void Fetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)\n        {\n            markStartedOperation();\n            doFetch(monitor, want, have);\n        }\n        /// <summary>\n        /// Default implementation of <see cref=\"IFetchConnection.DidFetchIncludeTags\"/> -\n        /// returning false.\n        /// </summary>\n        public bool DidFetchIncludeTags\n        {\n            get\n            {\n                return false;\n            }\n        }\n\n        public abstract bool DidFetchTestConnectivity { get; }\n        public abstract List<PackLock> PackLocks { get; }\n        public abstract void SetPackLockMessage(string message);\n\n        /// <summary>\n        /// Implementation of <see cref=\"Fetch\"/>\n        /// without checking for multiple fetch.\n        /// </summary>\n        /// <param name=\"monitor\">as in <see cref=\"Fetch\"/></param>\n        /// <param name=\"want\">as in <see cref=\"Fetch\"/></param>\n        /// <param name=\"have\">as in <see cref=\"Fetch\"/></param>\n        protected abstract void doFetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have);\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BasePackConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Base helper class for pack-based operations implementations. Provides partial\n    /// implementation of pack-protocol - refs advertising and capabilities support,\n    /// and some other helper methods.\n    /// </summary>\n    public abstract class BasePackConnection : BaseConnection\n    {\n        /// <summary>\n        /// The repository this transport fetches into, or pushes out of.\n        /// </summary>\n        protected readonly Repository local;\n\n        /// <summary>\n        /// Remote repository location.\n        /// </summary>\n        protected readonly URIish uri;\n\n        /// <summary>\n        /// A transport connected to <see cref=\"uri\"/>.\n        /// </summary>\n        protected readonly Transport transport;\n\n        /// <summary>\n        /// Buffered output stream sending to the remote.\n        /// </summary>\n        protected Stream outStream;\n\n        /// <summary>\n        /// Buffered input stream reading from the remote.\n        /// </summary>\n        protected Stream inStream;\n\n        /// <summary>\n        /// Packet line decoder around <see cref=\"inStream\"/>.\n        /// </summary>\n        protected PacketLineIn pckIn;\n\n        /// <summary>\n        /// Packet line encoder around <see cref=\"outStream\"/>.\n        /// </summary>\n        protected PacketLineOut pckOut;\n\n        /// <summary>\n        /// Send <see cref=\"PacketLineOut.End\"/> before closing <see cref=\"outStream\"/>?\n        /// </summary>\n        protected bool outNeedsEnd;\n\n        /// <summary>\n        /// Capability tokens advertised by the remote side.\n        /// </summary>\n        private readonly List<string> remoteCapabilies = new List<string>();\n\n        /// <summary>\n        /// Extra objects the remote has, but which aren't offered as refs.\n        /// </summary>\n        protected readonly List<ObjectId> additionalHaves = new List<ObjectId>();\n\n        protected BasePackConnection(IPackTransport packTransport)\n        {\n            transport = (Transport)packTransport;\n            local = transport.Local;\n            uri = transport.Uri;\n        }\n\n        protected void init(Stream myStream)\n        {\n            init(myStream, myStream);\n        }\n\n        protected void init(Stream instream, Stream outstream)\n        {\n            inStream = instream is BufferedStream ? instream : new BufferedStream(instream, IndexPack.BUFFER_SIZE);\n            outStream = outstream is BufferedStream ? outstream : new BufferedStream(outstream, IndexPack.BUFFER_SIZE);\n\n            pckIn = new PacketLineIn(inStream);\n            pckOut = new PacketLineOut(outStream);\n\n            outNeedsEnd = true;\n        }\n\n        protected void readAdvertisedRefs()\n        {\n            try\n            {\n                readAdvertisedRefsImpl();\n            }\n            catch (TransportException)\n            {\n                Dispose();\n                throw;\n            }\n            catch (IOException err)\n            {\n                Dispose();\n                throw new TransportException(err.Message, err);\n            }\n            catch (Exception err)\n            {\n                Dispose();\n                throw new TransportException(err.Message, err);\n            }\n        }\n\n        private void readAdvertisedRefsImpl()\n        {\n            var avail = new Dictionary<string, Ref>();\n            while (true)\n            {\n                string line;\n\n                try\n                {\n                    line = pckIn.ReadString();\n                }\n                catch (EndOfStreamException)\n                {\n                    if (avail.Count == 0)\n                    {\n                        throw noRepository();\n                    }\n\n                    throw;\n                }\n\n                if (line == PacketLineIn.END)\n                    break;\n\n                if (avail.Count == 0)\n                {\n                    int nul = line.IndexOf('\\0');\n                    if (nul >= 0)\n                    {\n                        // The first line (if any) may contain \"hidden\"\n                        // capability values after a NUL byte.\n                        foreach (string c in line.Substring(nul + 1).Split(' '))\n                            remoteCapabilies.Add(c);\n                        line = line.Slice(0, nul);\n                    }\n                }\n\n                string name = line.Slice(41, line.Length);\n                if (avail.Count == 0 && name.Equals(\"capabilities^{}\"))\n                {\n                    // special line from git-receive-pack to show\n                    // capabilities when there are no refs to advertise\n                    continue;\n                }\n\n                ObjectId id = ObjectId.FromString(line.Slice(0, 40));\n                if (name.Equals(\".have\"))\n                    additionalHaves.Add(id);\n                else if (name.EndsWith(\"^{}\"))\n                {\n                    name = name.Slice(0, name.Length - 3);\n                    Ref prior = avail.get(name);\n                    if (prior == null)\n                        throw new PackProtocolException(uri, \"advertisement of \" + name + \"^{} came before \" + name);\n\n                    if (prior.PeeledObjectId != null)\n                        throw duplicateAdvertisement(name + \"^{}\");\n\n                    avail.put(name, new PeeledTag(Storage.Network, name, prior.ObjectId, id));\n                }\n                else\n                {\n                    Ref prior = avail.put(name, new PeeledNonTag(Storage.Network, name, id));\n                    if (prior != null)\n                        throw duplicateAdvertisement(name);\n                    \n                }\n            }\n            available(avail);\n        }\n\n        /// <summary>\n        /// Create an exception to indicate problems finding a remote repository. The\n        /// caller is expected to throw the returned exception.\n        /// <para/>\n        /// Subclasses may override this method to provide better diagnostics.\n        /// </summary>\n        /// <returns>\n        /// a TransportException saying a repository cannot be found and\n        /// possibly why.\n        /// </returns>\n        protected virtual TransportException noRepository()\n        {\n            return new NoRemoteRepositoryException(uri, \"not found.\");\n        }\n\n        protected bool isCapableOf(string option)\n        {\n            return remoteCapabilies.Contains(option);\n        }\n\n        protected bool wantCapability(StringBuilder b, string option)\n        {\n            if (!isCapableOf(option))\n                return false;\n            b.Append(' ');\n            b.Append(option);\n            return true;\n        }\n\n        private PackProtocolException duplicateAdvertisement(string name)\n        {\n            return new PackProtocolException(uri, \"duplicate advertisements of \" + name);\n        }\n\n        public override void Close()\n        {\n            if (outStream != null)\n            {\n                try\n                {\n                    if (outNeedsEnd)\n                        pckOut.End();\n                    outStream.Close();\n                }\n                catch (IOException)\n                {\n                    // Ignore any close errors.\n                }\n                finally\n                {\n                    outStream = null;\n                    pckOut = null;\n                }\n            } \n            \n            if (inStream != null)\n            {\n                try\n                {\n                    inStream.Close();\n                }\n                catch (IOException)\n                {\n                    // Ignore any close errors.\n                }\n                finally\n                {\n                    inStream = null;\n                    pckIn = null;\n                }\n            }\n\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~BasePackConnection()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: \" + this.uri);\n        }\n#endif\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BasePackFetchConnection.cs",
    "content": "/*\n * Copyright (C) 2008-2010, Google Inc.\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Fetch implementation using the native Git pack transfer service.\n    /// <para/>\n    /// This is the canonical implementation for transferring objects from the remote\n    /// repository to the local repository by talking to the 'git-upload-pack'\n    /// service. Objects are packed on the remote side into a pack file and then sent\n    /// down the pipe to us.\n    /// <para/>\n    /// This connection requires only a bi-directional pipe or socket, and thus is\n    /// easily wrapped up into a local process pipe, anonymous TCP socket, or a\n    /// command executed through an SSH tunnel.\n    /// <para/>\n    /// Concrete implementations should just call\n    /// <see cref=\"BasePackConnection.init(System.IO.Stream,System.IO.Stream)\"/> and\n    /// <see cref=\"BasePackConnection.readAdvertisedRefs\"/> methods in constructor or before any use. They\n    /// should also handle resources releasing in <see cref=\"BasePackConnection.Close\"/> method if needed.\n    /// </summary>\n    public class BasePackFetchConnection : BasePackConnection, IFetchConnection\n    {\n        /// <summary>\n        /// Maximum number of 'have' lines to send before giving up.\n        /// <para/>\n        /// During <see cref=\"Negotiate\"/> we send at most this many\n        /// commits to the remote peer as 'have' lines without an ACK response before\n        /// we give up.\n        /// </summary>\n        private const int MAX_HAVES = 256;\n\n        /// <summary>\n        /// Amount of data the client sends before starting to read.\n        /// <para/>\n        /// Any output stream given to the client must be able to buffer this many\n        /// bytes before the client will stop writing and start reading from the\n        /// input stream. If the output stream blocks before this many bytes are in\n        /// the send queue, the system will deadlock.\n        /// </summary>\n        protected const int MIN_CLIENT_BUFFER = 2 * 32 * 46 + 8;\n        public const string OPTION_INCLUDE_TAG = \"include-tag\";\n        public const string OPTION_MULTI_ACK = \"multi_ack\";\n        public const string OPTION_MULTI_ACK_DETAILED = \"multi_ack_detailed\";\n        public const string OPTION_THIN_PACK = \"thin-pack\";\n        public const string OPTION_SIDE_BAND = \"side-band\";\n        public const string OPTION_SIDE_BAND_64K = \"side-band-64k\";\n        public const string OPTION_OFS_DELTA = \"ofs-delta\";\n        public const string OPTION_SHALLOW = \"shallow\";\n        public const string OPTION_NO_PROGRESS = \"no-progress\";\n\n        public enum MultiAck\n        {\n            OFF,\n            CONTINUE,\n            DETAILED\n        }\n\n        private readonly RevWalk.RevWalk _walk;\n\n        /// <summary>\n        /// All commits that are immediately reachable by a local ref.\n        /// </summary>\n        private RevCommitList<RevCommit> _reachableCommits;\n\n        private readonly bool _allowOfsDelta;\n\n        /// <summary>\n        /// Marks an object as having all its dependencies.\n        /// </summary>\n        public readonly RevFlag REACHABLE;\n\n        /// <summary>\n        /// Marks a commit known to both sides of the connection.\n        /// </summary>\n        public readonly RevFlag COMMON;\n\n        /// <summary>\n        /// Marks a commit listed in the advertised refs.\n        /// </summary>\n        public readonly RevFlag ADVERTISED;\n\n        private MultiAck _multiAck = MultiAck.OFF;\n        private bool _thinPack;\n        private bool _sideband;\n        private bool _includeTags;\n        private string _lockMessage;\n        private PackLock _packLock;\n\n        public BasePackFetchConnection(IPackTransport packTransport)\n            : base(packTransport)\n        {\n            FetchConfig cfg = local.Config.get(FetchConfig.KEY);\n            _includeTags = transport.TagOpt != TagOpt.NO_TAGS;\n            _thinPack = transport.FetchThin;\n            _allowOfsDelta = cfg.AllowOfsDelta;\n\n            _walk = new RevWalk.RevWalk(local);\n            _reachableCommits = new RevCommitList<RevCommit>();\n            REACHABLE = _walk.newFlag(\"REACHABLE\");\n            COMMON = _walk.newFlag(\"COMMON\");\n            ADVERTISED = _walk.newFlag(\"ADVERTISED\");\n\n            _walk.carry(COMMON);\n            _walk.carry(REACHABLE);\n            _walk.carry(ADVERTISED);\n        }\n\n        private class FetchConfig\n        {\n            public static Config.SectionParser<FetchConfig> KEY = new FetchConfigSectionParser();\n\n            readonly bool _allowOfsDelta;\n\n            FetchConfig(Config c)\n            {\n                _allowOfsDelta = c.getBoolean(\"repack\", \"usedeltabaseoffset\", true);\n            }\n\n            private class FetchConfigSectionParser : Config.SectionParser<FetchConfig>\n            {\n                public FetchConfig parse(Config cfg)\n                {\n                    return new FetchConfig(cfg);\n                }\n            }\n\n            public bool AllowOfsDelta\n            {\n                get { return _allowOfsDelta; }\n            }\n        }\n\n        public void Fetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)\n        {\n            markStartedOperation();\n            doFetch(monitor, want, have);\n        }\n\n        public bool DidFetchIncludeTags\n        {\n            get { return false; }\n        }\n\n        public bool DidFetchTestConnectivity\n        {\n            get { return false; }\n        }\n\n        public void SetPackLockMessage(string message)\n        {\n            _lockMessage = message;\n        }\n\n        public List<PackLock> PackLocks\n        {\n            get\n            {\n                if (_packLock != null)\n                {\n                    return new List<PackLock> { _packLock };\n                }\n\n                return new List<PackLock>();\n            }\n        }\n\n        protected void doFetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)\n        {\n            try\n            {\n                MarkRefsAdvertised();\n                MarkReachable(have, MaxTimeWanted(want));\n\n                if (SendWants(want))\n                {\n                    Negotiate(monitor);\n\n                    _walk.Dispose();\n                    _reachableCommits = null;\n\n                    ReceivePack(monitor);\n                }\n            }\n            catch (CancelledException)\n            {\n                Dispose();\n                return; // Caller should test (or just know) this themselves.\n            }\n            catch (IOException err)\n            {\n                Dispose();\n                throw new TransportException(err.Message, err);\n            }\n            catch (Exception err)\n            {\n                Dispose();\n                throw new TransportException(err.Message, err);\n            }\n        }\n\n        private int MaxTimeWanted(IEnumerable<Ref> wants)\n        {\n            int maxTime = 0;\n            foreach (Ref r in wants)\n            {\n                try\n                {\n                    var obj = (_walk.parseAny(r.ObjectId) as RevCommit);\n                    if (obj != null)\n                    {\n                        int cTime = obj.CommitTime;\n                        if (maxTime < cTime)\n                            maxTime = cTime;\n                    }\n                }\n                catch (IOException)\n                {\n                    // We don't have it, but we want to fetch (thus fixing error).\n                }\n            }\n\n            return maxTime;\n        }\n\n        private void MarkReachable(IEnumerable<ObjectId> have, int maxTime)\n        {\n            foreach (Ref r in local.getAllRefs().Values)\n            {\n                try\n                {\n                    RevCommit o = _walk.parseCommit(r.ObjectId);\n                    o.add(REACHABLE);\n                    _reachableCommits.add(o);\n                }\n                catch (IOException)\n                {\n                    // If we cannot read the value of the ref skip it.\n                }\n            }\n\n            foreach (ObjectId id in have)\n            {\n                try\n                {\n                    RevCommit o = _walk.parseCommit(id);\n                    o.add(REACHABLE);\n                    _reachableCommits.add(o);\n                }\n                catch (IOException)\n                {\n                    // If we cannot read the value of the ref skip it.\n                }\n            }\n\n            if (maxTime > 0)\n            {\n                // Mark reachable commits until we reach maxTime. These may\n                // wind up later matching up against things we want and we\n                // can avoid asking for something we already happen to have.\n                //\n                DateTime maxWhen = (maxTime * 1000L).MillisToUtcDateTime();\n                _walk.sort(RevSort.COMMIT_TIME_DESC);\n                _walk.markStart(_reachableCommits);\n                _walk.setRevFilter(CommitTimeRevFilter.After(maxWhen));\n                for (; ; )\n                {\n                    RevCommit c = _walk.next();\n                    if (c == null)\n                        break;\n                    if (c.has(ADVERTISED) && !c.has(COMMON))\n                    {\n                        c.add(COMMON);\n                        c.carry(COMMON);\n                        _reachableCommits.add(c);\n                    }\n                }\n            }\n        }\n\n        private bool SendWants(IEnumerable<Ref> want)\n        {\n            bool first = true;\n            foreach (Ref r in want)\n            {\n                try\n                {\n                    if (_walk.parseAny(r.ObjectId).has(REACHABLE))\n                    {\n                        // We already have this object. Asking for it is\n                        // not a very good idea.\n                        //\n                        continue;\n                    }\n                }\n                catch (IOException)\n                {\n                    // Its OK, we don't have it, but we want to fix that\n                    // by fetching the object from the other side.\n                }\n\n                var line = new StringBuilder(46);\n                line.Append(\"want \");\n                line.Append(r.ObjectId.Name);\n                if (first)\n                {\n                    line.Append(EnableCapabilities());\n                    first = false;\n                }\n                line.Append('\\n');\n                pckOut.WriteString(line.ToString());\n            }\n            pckOut.End();\n            outNeedsEnd = false;\n            return !first;\n        }\n\n        private string EnableCapabilities()\n        {\n            var line = new StringBuilder();\n            if (_includeTags)\n                _includeTags = wantCapability(line, OPTION_INCLUDE_TAG);\n            if (_allowOfsDelta)\n                wantCapability(line, OPTION_OFS_DELTA);\n\n            if (wantCapability(line, OPTION_MULTI_ACK_DETAILED))\n                _multiAck = MultiAck.DETAILED;\n            else if (wantCapability(line, OPTION_MULTI_ACK))\n                _multiAck = MultiAck.CONTINUE;\n            else\n                _multiAck = MultiAck.OFF;\n\n            if (_thinPack)\n                _thinPack = wantCapability(line, OPTION_THIN_PACK);\n            if (wantCapability(line, OPTION_SIDE_BAND_64K))\n                _sideband = true;\n            else if (wantCapability(line, OPTION_SIDE_BAND))\n                _sideband = true;\n            return line.ToString();\n        }\n\n        private void Negotiate(ProgressMonitor monitor)\n        {\n            var ackId = new MutableObjectId();\n            int resultsPending = 0;\n            int havesSent = 0;\n            int havesSinceLastContinue = 0;\n            bool receivedContinue = false;\n            bool receivedAck = false;\n\n            NegotiateBegin();\n            for (; ; )\n            {\n                RevCommit c = _walk.next();\n                if (c == null)\n                {\n                    goto END_SEND_HAVES;\n                }\n\n                pckOut.WriteString(\"have \" + c.getId().Name + \"\\n\");\n                havesSent++;\n                havesSinceLastContinue++;\n\n                if ((31 & havesSent) != 0)\n                {\n                    // We group the have lines into blocks of 32, each marked\n                    // with a flush (aka end). This one is within a block so\n                    // continue with another have line.\n                    //\n                    continue;\n                }\n\n                if (monitor.IsCancelled)\n                    throw new CancelledException();\n\n                pckOut.End();\n                resultsPending++; // Each end will cause a result to come back.\n\n                if (havesSent == 32)\n                {\n                    // On the first block we race ahead and try to send\n                    // more of the second block while waiting for the\n                    // remote to respond to our first block request.\n                    // This keeps us one block ahead of the peer.\n                    //\n                    continue;\n                }\n\n                for (; ; )\n                {\n                    PacketLineIn.AckNackResult anr = pckIn.readACK(ackId);\n\n                    switch (anr)\n                    {\n                        case PacketLineIn.AckNackResult.NAK:\n                            // More have lines are necessary to compute the\n                            // pack on the remote side. Keep doing that.\n\n                            resultsPending--;\n                            goto END_READ_RESULT;\n\n                        case PacketLineIn.AckNackResult.ACK:\n                            // The remote side is happy and knows exactly what\n                            // to send us. There is no further negotiation and\n                            // we can break out immediately.\n\n                            _multiAck = MultiAck.OFF;\n                            resultsPending = 0;\n                            receivedAck = true;\n                            goto END_SEND_HAVES;\n\n                        case PacketLineIn.AckNackResult.ACK_CONTINUE:\n                        case PacketLineIn.AckNackResult.ACK_COMMON:\n                        case PacketLineIn.AckNackResult.ACK_READY:\n                            // The server knows this commit (ackId). We don't\n                            // need to send any further along its ancestry, but\n                            // we need to continue to talk about other parts of\n                            // our local history.\n\n                            MarkCommon(_walk.parseAny(ackId));\n                            receivedAck = true;\n                            receivedContinue = true;\n                            havesSinceLastContinue = 0;\n                            break;\n                    }\n\n\n                    if (monitor.IsCancelled)\n                        throw new CancelledException();\n                }\n\n            END_READ_RESULT:\n                if (receivedContinue && havesSinceLastContinue > MAX_HAVES)\n                {\n                    // Our history must be really different from the remote's.\n                    // We just sent a whole slew of have lines, and it did not\n                    // recognize any of them. Avoid sending our entire history\n                    // to them by giving up early.\n                    //\n                    break;\n                }\n            }\n\n        END_SEND_HAVES:\n\n            // Tell the remote side we have run out of things to talk about.\n            //\n            if (monitor.IsCancelled)\n                throw new CancelledException();\n            pckOut.WriteString(\"done\\n\");\n            pckOut.Flush();\n\n            if (!receivedAck)\n            {\n                // Apparently if we have never received an ACK earlier\n                // there is one more result expected from the done we\n                // just sent to the remote.\n                //\n                _multiAck = MultiAck.OFF;\n                resultsPending++;\n            }\n\n            while (resultsPending > 0 || _multiAck != MultiAck.OFF)\n            {\n                PacketLineIn.AckNackResult anr = pckIn.readACK(ackId);\n                resultsPending--;\n\n                switch (anr)\n                {\n                    case PacketLineIn.AckNackResult.NAK:\n                        // A NAK is a response to an end we queued earlier\n                        // we eat it and look for another ACK/NAK message.\n                        //\n                        break;\n\n                    case PacketLineIn.AckNackResult.ACK:\n                        // A solitary ACK at this point means the remote won't\n                        // speak anymore, but is going to send us a pack now.\n                        //\n                        goto END_READ_RESULT_2;\n\n                    case PacketLineIn.AckNackResult.ACK_CONTINUE:\n                    case PacketLineIn.AckNackResult.ACK_COMMON:\n                    case PacketLineIn.AckNackResult.ACK_READY:\n                        // We will expect a normal ACK to break out of the loop.\n                        //\n                        _multiAck = MultiAck.CONTINUE;\n                        break;\n                }\n\n                if (monitor.IsCancelled)\n                    throw new CancelledException();\n            }\n\n        END_READ_RESULT_2:\n            ;\n        }\n\n        private class NegotiateBeginRevFilter : RevFilter\n        {\n            private readonly RevFlag _common;\n            private readonly RevFlag _advertised;\n\n            public NegotiateBeginRevFilter(RevFlag c, RevFlag a)\n            {\n                _common = c;\n                _advertised = a;\n            }\n\n            public override RevFilter Clone()\n            {\n                return this;\n            }\n\n            public override bool include(RevWalk.RevWalk walker, RevCommit cmit)\n            {\n                bool remoteKnowsIsCommon = cmit.has(_common);\n                if (cmit.has(_advertised))\n                {\n                    // Remote advertised this, and we have it, hence common.\n                    // Whether or not the remote knows that fact is tested\n                    // before we added the flag. If the remote doesn't know\n                    // we have to still send them this object.\n                    //\n                    cmit.add(_common);\n                }\n                return !remoteKnowsIsCommon;\n            }\n        }\n\n        private void NegotiateBegin()\n        {\n            _walk.resetRetain(REACHABLE, ADVERTISED);\n            _walk.markStart(_reachableCommits);\n            _walk.sort(RevSort.COMMIT_TIME_DESC);\n            _walk.setRevFilter(new NegotiateBeginRevFilter(COMMON, ADVERTISED));\n        }\n\n        private void MarkRefsAdvertised()\n        {\n            foreach (Ref r in Refs)\n            {\n                MarkAdvertised(r.ObjectId);\n                if (r.PeeledObjectId != null)\n                    MarkAdvertised(r.PeeledObjectId);\n            }\n        }\n\n        private void MarkAdvertised(AnyObjectId id)\n        {\n            try\n            {\n                _walk.parseAny(id).add(ADVERTISED);\n            }\n            catch (IOException)\n            {\n                // We probably just do not have this object locally.\n            }\n        }\n\n        private void MarkCommon(RevObject obj)\n        {\n            obj.add(COMMON);\n            var oComm = (obj as RevCommit);\n            if (oComm != null)\n            {\n                oComm.carry(COMMON);\n            }\n        }\n\n        private void ReceivePack(ProgressMonitor monitor)\n        {\n\t\t\t  Stream input = inStream;\n\t\t\t  if (_sideband)\n\t\t\t\t  input = new SideBandInputStream(input, monitor);\n            IndexPack ip = IndexPack.Create(local, input);\n            ip.setFixThin(_thinPack);\n            ip.setObjectChecking(transport.CheckFetchedObjects);\n            ip.index(monitor);\n            _packLock = ip.renameAndOpenPack(_lockMessage);\n        }\n\n        public override void Dispose()\n        {\n            _walk.Dispose();\n            REACHABLE.Dispose();\n            COMMON.Dispose();\n            ADVERTISED.Dispose();\n            _reachableCommits.Dispose();\n            base.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BasePackPushConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Push implementation using the native Git pack transfer service.\n    /// <para/>\n    /// This is the canonical implementation for transferring objects to the remote\n    /// repository from the local repository by talking to the 'git-receive-pack'\n    /// service. Objects are packed on the local side into a pack file and then sent\n    /// to the remote repository.\n    /// <para/>\n    /// This connection requires only a bi-directional pipe or socket, and thus is\n    /// easily wrapped up into a local process pipe, anonymous TCP socket, or a\n    /// command executed through an SSH tunnel.\n    /// <para/>\n    /// This implementation honors <see cref=\"Transport.get_PushThin\"/> option.\n    /// <para/>\n    /// Concrete implementations should just call\n    /// <see cref=\"BasePackConnection.init(System.IO.Stream,System.IO.Stream)\"/> and\n    /// <see cref=\"BasePackConnection.readAdvertisedRefs\"/> methods in constructor or before any use. They\n    /// should also handle resources releasing in <see cref=\"BasePackConnection.Close\"/> method if needed.\n    /// </summary>\n    public abstract class BasePackPushConnection : BasePackConnection, IPushConnection\n    {\n        public const string CAPABILITY_REPORT_STATUS = \"report-status\";\n        public const string CAPABILITY_DELETE_REFS = \"delete-refs\";\n        public const string CAPABILITY_OFS_DELTA = \"ofs-delta\";\n\t\t  public const string CAPABILITY_SIDE_BAND_64K = \"side-band-64k\";\n\n        private readonly bool _thinPack;\n        private bool _capableDeleteRefs;\n        private bool _capableReport;\n        private bool _capableOfsDelta;\n        private bool _sentCommand;\n        private bool _shouldWritePack;\n\n        /// <summary>\n        /// Time in milliseconds spent transferring the pack data.\n        /// </summary>\n        private long packTransferTime;\n\n        protected BasePackPushConnection(IPackTransport packTransport)\n            : base(packTransport)\n        {\n            _thinPack = transport.PushThin;\n        }\n\n        public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)\n        {\n            markStartedOperation();\n            doPush(monitor, refUpdates);\n        }\n\n        protected override TransportException noRepository()\n        {\n            // Sadly we cannot tell the \"invalid URI\" case from \"push not allowed\".\n            // Opening a fetch connection can help us tell the difference, as any\n            // useful repository is going to support fetch if it also would allow\n            // push. So if fetch throws NoRemoteRepositoryException we know the\n            // URI is wrong. Otherwise we can correctly state push isn't allowed\n            // as the fetch connection opened successfully.\n            //\n            try\n            {\n                transport.openFetch().Close();\n            }\n            catch (NotSupportedException)\n            {\n                // Fall through.\n            }\n            catch (NoRemoteRepositoryException e)\n            {\n                // Fetch concluded the repository doesn't exist.\n                //\n                return e;\n            }\n            catch (TransportException)\n            {\n                // Fall through.\n            }\n\n            return new TransportException(uri, \"push not permitted\");\n        }\n\n        protected void doPush(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)\n        {\n            try\n            {\n                WriteCommands(refUpdates.Values, monitor);\n                if (_shouldWritePack)\n                    writePack(refUpdates, monitor);\n                if (_sentCommand && _capableReport)\n                    readStatusReport(refUpdates);\n            }\n            catch (TransportException)\n            {\n                throw;\n            }\n            catch (Exception e)\n            {\n                throw new TransportException(uri, e.Message, e);\n            }\n            finally\n            {\n                Dispose();\n            }\n        }\n\n        private void WriteCommands(IEnumerable<RemoteRefUpdate> refUpdates, ProgressMonitor monitor)\n        {\n            string capabilities = EnableCapabilities();\n            foreach (RemoteRefUpdate rru in refUpdates)\n            {\n                if (!_capableDeleteRefs && rru.IsDelete)\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.REJECTED_NODELETE;\n                    continue;\n                }\n\n                var sb = new StringBuilder();\n                Ref advertisedRef = GetRef(rru.RemoteName);\n                ObjectId oldId = (advertisedRef == null ? ObjectId.ZeroId : advertisedRef.ObjectId);\n                sb.Append(oldId.Name);\n                sb.Append(' ');\n                sb.Append(rru.NewObjectId.Name);\n                sb.Append(' ');\n                sb.Append(rru.RemoteName);\n                if (!_sentCommand)\n                {\n                    _sentCommand = true;\n                    sb.Append(capabilities);\n                }\n\n                pckOut.WriteString(sb.ToString());\n                rru.Status = RemoteRefUpdate.UpdateStatus.AWAITING_REPORT;\n                if (!rru.IsDelete)\n                    _shouldWritePack = true;\n            }\n\n            if (monitor.IsCancelled)\n                throw new TransportException(uri, \"push cancelled\");\n            pckOut.End();\n            outNeedsEnd = false;\n        }\n\n        private string EnableCapabilities()\n        {\n            var line = new StringBuilder();\n            _capableReport = wantCapability(line, CAPABILITY_REPORT_STATUS);\n            _capableDeleteRefs = wantCapability(line, CAPABILITY_DELETE_REFS);\n            _capableOfsDelta = wantCapability(line, CAPABILITY_OFS_DELTA);\n            if (line.Length > 0)\n                line[0] = '\\0';\n            return line.ToString();\n        }\n\n        private void writePack(IDictionary<string, RemoteRefUpdate> refUpdates, ProgressMonitor monitor)\n        {\n            PackWriter writer = new PackWriter(local, monitor);\n            List<ObjectId> remoteObjects = new List<ObjectId>(Refs.Count);\n            List<ObjectId> newObjects = new List<ObjectId>(refUpdates.Count);\n\n            foreach (Ref r in Refs)\n                remoteObjects.Add(r.ObjectId);\n\n            remoteObjects.AddRange(additionalHaves);\n            foreach (RemoteRefUpdate r in refUpdates.Values)\n            {\n                if (!ObjectId.ZeroId.Equals(r.NewObjectId))\n                    newObjects.Add(r.NewObjectId);\n            }\n\n            writer.Thin = _thinPack;\n            writer.DeltaBaseAsOffset = _capableOfsDelta;\n            writer.preparePack(newObjects, remoteObjects);\n            long start = SystemReader.getInstance().getCurrentTime();\n            writer.writePack(outStream);\n            packTransferTime = SystemReader.getInstance().getCurrentTime() - start;\n        }\n\n        private void readStatusReport(IDictionary<string, RemoteRefUpdate> refUpdates)\n        {\n            string unpackLine = readStringLongTimeout();\n            if (!unpackLine.StartsWith(\"unpack \"))\n            {\n                throw new PackProtocolException(uri, \"unexpected report line: \" + unpackLine);\n            }\n            string unpackStatus = unpackLine.Substring(\"unpack \".Length);\n            if (!unpackStatus.Equals(\"ok\"))\n            {\n                throw new TransportException(uri, \"error occoured during unpacking on the remote end: \" + unpackStatus);\n            }\n\n            String refLine;\n            while ((refLine = pckIn.ReadString()) != PacketLineIn.END)\n            {\n                bool ok = false;\n                int refNameEnd = -1;\n                if (refLine.StartsWith(\"ok \"))\n                {\n                    ok = true;\n                    refNameEnd = refLine.Length;\n                }\n                else if (refLine.StartsWith(\"ng \"))\n                {\n                    refNameEnd = refLine.IndexOf(' ', 3);\n                }\n                if (refNameEnd == -1)\n                {\n                    throw new PackProtocolException(uri + \": unexpected report line: \" + refLine);\n                }\n                string refName = refLine.Slice(3, refNameEnd);\n                string message = (ok ? null : refLine.Substring(refNameEnd + 1));\n                RemoteRefUpdate rru = refUpdates.get(refName);\n                if (rru == null)\n                    throw new PackProtocolException(uri\n                            + \": unexpected ref report: \" + refName);\n                if (ok)\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.OK;\n                }\n                else\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                    rru.Message = message;\n                }\n            }\n\n            foreach (RemoteRefUpdate rru in refUpdates.Values)\n            {\n                if (rru.Status == RemoteRefUpdate.UpdateStatus.AWAITING_REPORT)\n                {\n                    throw new PackProtocolException(uri + \": expected report for ref \" + rru.RemoteName +\n                                                    \" not received\");\n                }\n            }\n        }\n\n        private String readStringLongTimeout()\n        {\n            return pckIn.ReadString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BundleFetchConnection.cs",
    "content": "/*\n * Copyright (C) 2009, Constantine Plotnikov <constantine.plotnikov@gmail.com>\n * Copyright (C) 2008-2009, Google Inc.\n * Copyright (C) 2009, Matthias Sohn <matthias.sohn@sap.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Sasa Zivkov <sasa.zivkov@sap.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// [henon] Verified against jgit commit 96690904f53241e825a29be9558be319a0bbfba1\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Fetch connection for bundle based classes. It used by\n    /// instances of <see cref=\"ITransportBundle\"/>\n    /// </summary>\n    public class BundleFetchConnection : BaseFetchConnection\n    {\n        private readonly Transport _transport;\n        private Stream _bin;\n        private readonly IDictionary<ObjectId, string> _prereqs = new Dictionary<ObjectId, string>();\n        private string _lockMessage;\n        private PackLock _packLock;\n\n        public BundleFetchConnection(Transport transportBundle, Stream src)\n        {\n            _transport = transportBundle;\n            _bin = new BufferedStream(src, IndexPack.BUFFER_SIZE);\n            try\n            {\n                switch (readSignature())\n                {\n                    case 2:\n                        readBundleV2();\n                        break;\n\n                    default:\n                        throw new TransportException(_transport.Uri, \"not a bundle\");\n                }\n            }\n            catch (TransportException)\n            {\n                Close();\n                throw;\n            }\n            catch (IOException err)\n            {\n                Close();\n                throw new TransportException(_transport.Uri, err.Message, err);\n            }\n            catch (Exception err)\n            {\n                Close();\n                throw new TransportException(_transport.Uri, err.Message, err);\n            }\n        }\n\n        private int readSignature()\n        {\n            string rev = readLine(new byte[1024]);\n            if (TransportBundleConstants.V2_BUNDLE_SIGNATURE.Equals(rev))\n                return 2;\n            throw new TransportException(_transport.Uri, \"not a bundle\");\n        }\n\n        private void readBundleV2()\n        {\n            byte[] hdrbuf = new byte[1024];\n            var avail = new Dictionary<string, Ref>();\n            for (; ; )\n            {\n                string line = readLine(hdrbuf);\n                if (line.Length == 0)\n                    break;\n\n                if (line[0] == '-')\n                {\n                    ObjectId id = ObjectId.FromString(line.Slice(1, 41));\n                    String shortDesc = null;\n                    if (line.Length > 42)\n                        shortDesc = line.Substring(42);\n                    _prereqs.put(id, shortDesc);\n                    continue;\n                }\n\n                string name = line.Slice(41, line.Length);\n                ObjectId id2 = ObjectId.FromString(line.Slice(0, 40));\n                Ref prior = avail.put(name, new Unpeeled(Storage.Network, name, id2));\n                if (prior != null)\n                {\n                    throw duplicateAdvertisement(name);\n                }\n            }\n            available(avail);\n        }\n\n        private PackProtocolException duplicateAdvertisement(string name)\n        {\n            return new PackProtocolException(_transport.Uri, \"duplicate advertisement of \" + name);\n        }\n\n        private string readLine(byte[] hdrbuf)\n        {\n            long mark = _bin.Position;\n            int cnt = _bin.Read(hdrbuf, 0, hdrbuf.Length);\n            int lf = 0;\n            while (lf < cnt && hdrbuf[lf] != '\\n')\n                lf++;\n            _bin.Position = mark;\n            IO.skipFully(_bin, lf);\n            if (lf < cnt && hdrbuf[lf] == '\\n')\n                IO.skipFully(_bin, 1);\n\n            return RawParseUtils.decode(Constants.CHARSET, hdrbuf, 0, lf);\n        }\n\n        public override bool DidFetchTestConnectivity\n        {\n            get { return false; }\n        }\n\n        protected override void doFetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)\n        {\n            verifyPrerequisites();\n            try\n            {\n                IndexPack ip = newIndexPack();\n                ip.index(monitor);\n                _packLock = ip.renameAndOpenPack(_lockMessage);\n            }\n            catch (IOException err)\n            {\n                Close();\n                throw new TransportException(_transport.Uri, err.Message, err);\n            }\n            catch (Exception err)\n            {\n                Close();\n                throw new TransportException(_transport.Uri, err.Message, err);\n            }\n        }\n\n        public override void SetPackLockMessage(string message)\n        {\n            _lockMessage = message;\n        }\n\n        public override List<PackLock> PackLocks\n        {\n            get \n            {\n                if (_packLock != null)\n                {\n                    return new List<PackLock> { _packLock };\n                } \n\n                return new List<PackLock>();\n            }\n        }\n\n        private IndexPack newIndexPack()\n        {\n            IndexPack ip = IndexPack.Create(_transport.Local, _bin);\n            ip.setFixThin(true);\n            ip.setObjectChecking(_transport.CheckFetchedObjects);\n            return ip;\n        }\n\n        private void verifyPrerequisites()\n        {\n            if (_prereqs.isEmpty())\n                return;\n\n            using (var rw = new RevWalk.RevWalk(_transport.Local))\n            {\n                RevFlag PREREQ = rw.newFlag(\"PREREQ\");\n                RevFlag SEEN = rw.newFlag(\"SEEN\");\n\n                IDictionary<ObjectId, string> missing = new Dictionary<ObjectId, string>();\n                var commits = new List<RevObject>();\n                foreach (KeyValuePair<ObjectId, string> e in _prereqs)\n                {\n                    ObjectId p = e.Key;\n                    try\n                    {\n                        RevCommit c = rw.parseCommit(p);\n                        if (!c.has(PREREQ))\n                        {\n                            c.add(PREREQ);\n                            commits.Add(c);\n                        }\n                    }\n                    catch (MissingObjectException)\n                    {\n                        missing.put(p, e.Value);\n                    }\n                    catch (IOException err)\n                    {\n                        throw new TransportException(_transport.Uri, \"Cannot Read commit \" + p.Name, err);\n                    }\n                }\n\n                if (!missing.isEmpty())\n                    throw new MissingBundlePrerequisiteException(_transport.Uri, missing);\n\n                foreach (Ref r in _transport.Local.getAllRefs().Values)\n                {\n                    try\n                    {\n                        rw.markStart(rw.parseCommit(r.ObjectId));\n                    }\n                    catch (IOException)\n                    {\n                        // If we cannot read the value of the ref skip it.\n                    }\n                }\n\n                int remaining = commits.Count;\n                try\n                {\n                    RevCommit c;\n                    while ((c = rw.next()) != null)\n                    {\n                        if (c.has(PREREQ))\n                        {\n                            c.add(SEEN);\n                            if (--remaining == 0)\n                                break;\n                        }\n                    }\n                }\n                catch (IOException err)\n                {\n                    throw new TransportException(_transport.Uri, \"Cannot Read object\", err);\n                }\n\n                if (remaining > 0)\n                {\n                    foreach (RevObject o in commits)\n                    {\n                        if (!o.has(SEEN))\n                            missing.put(o, _prereqs.get(o));\n                    }\n                    throw new MissingBundlePrerequisiteException(_transport.Uri, missing);\n                }\n            }\n        }\n\n        public override void Close()\n        {\n            if (_bin != null)\n            {\n                try\n                {\n                    _bin.Dispose();\n                }\n                catch (IOException)\n                {\n                    // Ignore close failures.\n                }\n                finally\n                {\n                    _bin = null;\n                }\n            }\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~BundleFetchConnection()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed.\");\n        }\n#endif\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/BundleWriter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Creates a Git bundle file, for sneaker-net transport to another system.\n    /// <para/>\n    /// Bundles generated by this class can be later read in from a file URI using\n    /// the bundle transport, or from an application controlled buffer by the more\n    /// generic <see cref=\"TransportBundleStream\"/>.\n    /// <para/>\n    /// Applications creating bundles need to call one or more <code>include</code>\n    /// calls to reflect which objects should be available as refs in the bundle for\n    /// the other side to fetch. At least one include is required to create a valid\n    /// bundle file, and duplicate names are not permitted.\n    /// <para/>\n    /// Optional <code>assume</code> calls can be made to declare commits which the\n    /// recipient must have in order to fetch from the bundle file. Objects reachable\n    /// from these assumed commits can be used as delta bases in order to reduce the\n    /// overall bundle size.\n    /// </summary>\n    public class BundleWriter : IDisposable\n    {\n        private readonly PackWriter _packWriter;\n        private readonly Dictionary<String, ObjectId> _include;\n        private readonly HashSet<RevCommit> _assume;\n\n        /// <summary>\n        /// Create a writer for a bundle.\n        /// </summary>\n        /// <param name=\"repo\">repository where objects are stored.</param>\n        /// <param name=\"monitor\">operations progress monitor.</param>\n        public BundleWriter(Repository repo, ProgressMonitor monitor)\n        {\n            _packWriter = new PackWriter(repo, monitor);\n            _include = new Dictionary<String, ObjectId>();\n            _assume = new HashSet<RevCommit>();\n        }\n\n        /// <summary>\n        /// Include an object (and everything reachable from it) in the bundle.\n        /// </summary>\n        /// <param name=\"name\">\n        /// name the recipient can discover this object as from the\n        /// bundle's list of advertised refs . The name must be a valid\n        /// ref format and must not have already been included in this\n        /// bundle writer.\n        /// </param>\n        /// <param name=\"id\">\n        /// object to pack. Multiple refs may point to the same object.\n        /// </param>\n        public void include(String name, AnyObjectId id)\n        {\n            if (id == null)\n                throw new ArgumentNullException(\"id\");\n            if (!Repository.IsValidRefName(name))\n            {\n                throw new ArgumentException(\"Invalid ref name: \" + name);\n            }\n\n            if (_include.ContainsKey(name))\n            {\n                throw new InvalidOperationException(\"Duplicate ref: \" + name);\n            }\n\n            _include.put(name, id.ToObjectId());\n        }\n\n        /// <summary>\n        /// Include a single ref (a name/object pair) in the bundle.\n        /// This is a utility function for:\n        /// <code>include(r.getName(), r.getObjectId())</code>.\n        /// </summary>\n        /// <param name=\"r\">the ref to include.</param>\n        public void include(Ref r)\n        {\n            if (r == null)\n                throw new ArgumentNullException(\"r\");\n\n            include(r.Name, r.ObjectId);\n        }\n\n        /// <summary>\n        /// Assume a commit is available on the recipient's side.\n        /// <para/>\n        /// In order to fetch from a bundle the recipient must have any assumed\n        /// commit. Each assumed commit is explicitly recorded in the bundle header\n        /// to permit the recipient to validate it has these objects.\n        /// </summary>\n        /// <param name=\"c\">\n        /// the commit to assume being available. This commit should be\n        /// parsed and not disposed in order to maximize the amount of\n        /// debugging information available in the bundle stream.\n        /// </param>\n        public void assume(RevCommit c)\n        {\n            if (c != null)\n            {\n                _assume.Add(c);\n            }\n        }\n\n        /**\n         * Generate and write the bundle to the output stream.\n         * <para />\n         * This method can only be called once per BundleWriter instance.\n         *\n         * @param os\n         *            the stream the bundle is written to. If the stream is not\n         *            buffered it will be buffered by the writer. Caller is\n         *            responsible for closing the stream.\n         * @throws IOException\n         *             an error occurred reading a local object's data to include in\n         *             the bundle, or writing compressed object data to the output\n         *             stream.\n         */\n        public void writeBundle(Stream os)\n        {\n            if (!(os is BufferedStream))\n            {\n                os = new BufferedStream(os);\n            }\n\n            var inc = new HashSet<ObjectId>();\n            var exc = new HashSet<ObjectId>();\n\n            foreach (ObjectId objectId in _include.Values)\n            {\n                inc.Add(objectId);\n            }\n\n            foreach (RevCommit r in _assume)\n            {\n                exc.Add(r.getId());\n            }\n\n            _packWriter.Thin = exc.Count > 0;\n            _packWriter.preparePack(inc, exc);\n\n            var w = new StreamWriter(os, Constants.CHARSET);\n            w.Write(TransportBundleConstants.V2_BUNDLE_SIGNATURE);\n            w.Write(\"\\n\");\n\n            char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH];\n            foreach (RevCommit a in _assume)\n            {\n                w.Write(\"-\");\n                a.CopyTo(tmp, w);\n                if (a.RawBuffer != null)\n                {\n                    w.Write(\" \");\n                    w.Write(a.getShortMessage());\n                }\n                w.Write(\"\\n\");\n            }\n\n            foreach (var entry in _include)\n            {\n                entry.Value.CopyTo(tmp, w);\n                w.Write(\" \");\n                w.Write(entry.Key);\n                w.Write(\"\\n\");\n            }\n\n            w.Write(\"\\n\");\n            w.Flush();\n\n            _packWriter.writePack(os);\n        }\n\n        public void Dispose()\n        {\n            _packWriter.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/Daemon.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n\t/// <summary>\n\t/// Basic daemon for the anonymous <code>git://</code> transport protocol.\n\t/// </summary>\n\tpublic class Daemon\n\t{\n\t\tpublic const int DEFAULT_PORT = 9418;\n\t\tprivate const int BACKLOG = 5;\n\n\t\tpublic IPEndPoint MyAddress { get; private set; }\n\t\tpublic DaemonService[] Services { get; private set; }\n\t\tpublic Dictionary<string, Thread> Processors { get; private set; }\n\t\tpublic bool ExportAll { get; set; }\n\t\tpublic Dictionary<string, Repository> Exports { get; private set; }\n\t\tpublic ICollection<DirectoryInfo> ExportBase { get; private set; }\n\t\tpublic bool Run { get; private set; }\n\n\t\tprivate Thread acceptThread;\n\t\t\n\t\tprivate Object locker = new Object();\n\n\t\t/// <summary>\n\t\t///  Configure a daemon to listen on any available network port.\n\t\t/// </summary>\n\t\tpublic Daemon()\n\t\t\t: this(null)\n\t\t{\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Configure a new daemon for the specified network address.\n\t\t///\t</summary>\n\t\t///\t<param name=\"addr\">\n\t\t/// Address to listen for connections on. If null, any available\n\t\t/// port will be chosen on all network interfaces.\n\t\t/// </param>\n\t\tpublic Daemon(IPEndPoint addr)\n\t\t{\n\t\t\tMyAddress = addr;\n\t\t\tExports = new Dictionary<string, Repository>();\n\t\t\tExportBase = new List<DirectoryInfo>();\n\t\t\tProcessors = new Dictionary<string, Thread>();\n\t\t\tServices = new DaemonService[] { new UploadPackService(), new ReceivePackService() };\n\t\t}\n\n\t\t///\t<summary> * Lookup a supported service so it can be reconfigured.\n\t\t///\t</summary>\n\t\t///\t<param name=\"name\">\n\t\t///\tName of the service; e.g. \"receive-pack\"/\"git-receive-pack\" or\n\t\t///\t\"upload-pack\"/\"git-upload-pack\".\n\t\t/// </param>\n\t\t///\t<returns>\n\t\t/// The service; null if this daemon implementation doesn't support\n\t\t///\tthe requested service type.\n\t\t/// </returns>\n\t\tpublic DaemonService GetService(string name)\n\t\t{\n\t\t\tlock(locker)\n\t\t\t{\n\t\t\t\tif (!name.StartsWith(\"git-\"))\n\t\t\t\t\tname = \"git-\" + name;\n\t\t\t\tforeach (DaemonService s in Services)\n\t\t\t\t{\n\t\t\t\t\tif (s.Command.Equals(name))\n\t\t\t\t\t\treturn s;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add a single repository to the set that is exported by this daemon.\n\t\t///\t<para />\n\t\t///\tThe existence (or lack-thereof) of <code>git-daemon-export-ok</code> is\n\t\t///\tignored by this method. The repository is always published.\n\t\t///\t</summary>\n\t\t///\t<param name=\"name\">\n\t\t/// name the repository will be published under.\n\t\t/// </param>\n\t\t///\t<param name=\"db\">the repository instance. </param>\n\t\tpublic void ExportRepository(string name, Repository db)\n\t\t{\n            if (!name.EndsWith(Constants.DOT_GIT_EXT))\n                name = name + Constants.DOT_GIT_EXT;\n\t\t\tExports.Add(name, db);\n\t\t\tRepositoryCache.register(db);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Recursively export all Git repositories within a directory.\n\t\t/// </summary>\n\t\t/// <param name=\"dir\">\n\t\t/// the directory to export. This directory must not itself be a\n\t\t/// git repository, but any directory below it which has a file\n\t\t/// named <code>git-daemon-export-ok</code> will be published.\n\t\t/// </param>\n\t\tpublic void ExportDirectory(DirectoryInfo dir)\n\t\t{\n\t\t\tExportBase.Add(dir);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Start this daemon on a background thread.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\">\n\t\t/// the server socket could not be opened.\n\t\t/// </exception>\n\t\t/// <exception cref=\"InvalidOperationException\">\n\t\t/// the daemon is already running.\n\t\t/// </exception>\n\t\tpublic void Start()\n\t\t{\n\t\t\tif (acceptThread != null)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Daemon already running\");\n\t\t\t}\n\n\t\t\tvar listenSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\t\t\tlistenSock.Bind(MyAddress ?? new IPEndPoint(IPAddress.Any, 0));\n\t\t\tlistenSock.Listen(BACKLOG);\n\t\t\tMyAddress = (IPEndPoint)listenSock.LocalEndPoint;\n\n\t\t\tRun = true;\n\t\t\tacceptThread = new Thread(new ThreadStart(delegate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  while (Run)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  try\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  startClient(listenSock.Accept());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  catch (ThreadInterruptedException)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  catch (SocketException)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  try\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  listenSock.Close();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  catch (SocketException)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  finally\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  lock (this)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  acceptThread = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  }));\n\t\t\tacceptThread.Start();\n\t\t}\n\n\t\t/// <returns>\n\t\t/// true if this daemon is receiving connections.\n\t\t/// </returns>\n\t\tpublic virtual bool isRunning()\n\t\t{\n\t\t\tlock(locker)\n\t\t\t{\n\t\t\t\treturn Run;\n\t\t\t}\n\t\t}\n\n\t\tprivate void startClient(Socket s)\n\t\t{\n\t\t\tvar dc = new DaemonClient(this) { Peer = s.RemoteEndPoint };\n\n\t\t\t// [caytchen] TODO: insanse anonymous methods were ported 1:1 from jgit, do properly sometime\n\t\t\tvar t = new Thread(\n\t\t\t\tnew ThreadStart(delegate\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tusing(NetworkStream stream = new NetworkStream(s))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tdc.Execute(new BufferedStream(stream));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tcatch (SocketException)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tfinally\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\ts.Close();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcatch (SocketException)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}));\n\n\t\t\tt.Start();\n\t\t\tProcessors.Add(\"Git-Daemon-Client \" + s.RemoteEndPoint, t);\n\t\t}\n\n\t\tpublic DaemonService MatchService(string cmd)\n\t\t{\n\t\t\tforeach (DaemonService d in Services)\n\t\t\t{\n\t\t\t\tif (d.Handles(cmd))\n\t\t\t\t\treturn d;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Stop this daemon.\n\t\t/// </summary>\n\t\tpublic void Stop()\n\t\t{\n\t\t\tif (acceptThread != null)\n\t\t\t{\n\t\t\t\tRun = false;\n\t\t\t\t// [caytchen] behaviour probably doesn't match\n\t\t\t\t//acceptThread.Interrupt();\n\t\t\t}\n\t\t}\n\n\t\tpublic Repository OpenRepository(string name)\n\t\t{\n\t\t\t// Assume any attempt to use \\ was by a Windows client\n\t\t\t// and correct to the more typical / used in Git URIs.\n\t\t\t//\n\t\t\tname = name.Replace('\\\\', '/');\n\n\t\t\t// git://thishost/path should always be name=\"/path\" here\n\t\t\t//\n\t\t\tif (!name.StartsWith(\"/\")) return null;\n\n\t\t\t// Forbid Windows UNC paths as they might escape the base\n\t\t\t//\n\t\t\tif (name.StartsWith(\"//\")) return null;\n\n\t\t\t// Forbid funny paths which contain an up-reference, they\n\t\t\t// might be trying to escape and read /../etc/password.\n\t\t\t//\n\t\t\tif (name.Contains(\"/../\")) return null;\n\n\t\t\tname = name.Substring(1);\n\n\t\t\tRepository db = Exports[name];\n\t\t\tif (db != null) return db;\n            db = Exports[name + Constants.DOT_GIT_EXT];\n\t\t\tif (db != null) return db;\n\n\t\t\tDirectoryInfo[] search = ExportBase.ToArray();\n\t\t\tforeach (DirectoryInfo f in search)\n\t\t\t{\n\t\t\t\tstring p = f.ToString();\n\t\t\t\tif (!p.EndsWith(\"/\")) p = p + '/';\n\n\t\t\t\tdb = OpenRepository(new DirectoryInfo(p + name));\n\t\t\t\tif (db != null) return db;\n\n                db = OpenRepository(new DirectoryInfo(p + name + Constants.DOT_GIT_EXT));\n\t\t\t\tif (db != null) return db;\n\n                db = OpenRepository(new DirectoryInfo(p + name + \"/\" + Constants.DOT_GIT));\n\t\t\t\tif (db != null) return db;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate Repository OpenRepository(DirectoryInfo f)\n\t\t{\n\t\t\tif (Directory.Exists(f.ToString()) && CanExport(f))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn new Repository(f);\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate bool CanExport(DirectoryInfo d)\n\t\t{\n\t\t\tif (ExportAll) return true;\n\t\t\tstring p = d.ToString();\n\t\t\tif (!p.EndsWith(\"/\")) p = p + '/';\n\t\t\treturn File.Exists(p + \"git-daemon-export-ok\");\n\t\t}\n\n\t\t#region Nested Types\n\n\t\t// [caytchen] note these two were actually done anonymously in the original jgit\n\t\tclass UploadPackService : DaemonService\n\t\t{\n\t\t\tpublic UploadPackService()\n\t\t\t\t: base(\"upload-pack\", \"uploadpack\")\n\t\t\t{\n\t\t\t\tEnabled = true;\n\t\t\t}\n\n\t\t\tpublic override void Execute(DaemonClient client, Repository db)\n\t\t\t{\n\t\t\t\tvar rp = new UploadPack(db);\n\t\t\t\tStream stream = client.Stream;\n\t\t\t\trp.Upload(stream, null, null);\n\t\t\t}\n\t\t}\n\n\t\tclass ReceivePackService : DaemonService\n\t\t{\n\t\t\tpublic ReceivePackService()\n\t\t\t\t: base(\"receive-pack\", \"receivepack\")\n\t\t\t{\n\t\t\t\tEnabled = false;\n\t\t\t}\n\n\t\t\tpublic override void Execute(DaemonClient client, Repository db)\n\t\t\t{\n\t\t\t\tEndPoint peer = client.Peer;\n\n\t\t\t\tvar ipEndpoint = peer as IPEndPoint;\n\t\t\t\tif (ipEndpoint == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new InvalidOperationException(\"peer must be a IPEndPoint\");\n\t\t\t\t}\n\n\t\t\t\tstring host = Dns.GetHostEntry(ipEndpoint.Address).HostName ?? ipEndpoint.Address.ToString();\n\t\t\t\tvar rp = new ReceivePack(db);\n\t\t\t\tStream stream = client.Stream;\n\t\t\t\tconst string name = \"anonymous\";\n\t\t\t\tstring email = name + \"@\" + host;\n\t\t\t\trp.setRefLogIdent(new PersonIdent(name, email));\n\t\t\t\trp.receive(stream, stream, null);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Transport/DaemonClient.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing System.Net;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n\n    public class DaemonClient\n    {\n        public Daemon Daemon { get; private set; }\n        public EndPoint Peer { get; set; }\n        public Stream Stream { get; private set; }\n\n        public DaemonClient(Daemon d)\n        {\n            Daemon = d;\n        }\n\n        public void Execute(Stream inout)\n        {\n            Stream = inout;\n            string cmd = new PacketLineIn(inout).ReadStringRaw();\n            if (string.IsNullOrEmpty(cmd))\n                return;\n\n            int nul = cmd.IndexOf('\\0');\n            if (nul >= 0)\n            {\n                cmd = cmd.Slice(0, nul);\n            }\n\n            DaemonService srv = Daemon.MatchService(cmd);\n            if (srv == null)\n                return;\n            srv.Execute(this, cmd);\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/DaemonService.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n\n    public abstract class DaemonService\n    {\n        public string Command { get; private set; }\n        public string Config { get; private set; }\n        public bool Enabled { get; set; }\n        public bool Overridable { get; set; }\n\n        protected DaemonService(string cmdName, string cfgName)\n        {\n            Command = cmdName.StartsWith(\"git-\") ? cmdName : \"git-\" + cmdName;\n            Config = cfgName;\n            Overridable = true;\n        }\n\n        public bool Handles(string commandLine)\n        {\n            return Command.Length + 1 < commandLine.Length && commandLine[Command.Length] == ' ' &&\n                   commandLine.StartsWith(Command);\n        }\n\n        public void Execute(DaemonClient client, string commandLine)\n        {\n            string name = commandLine.Substring(Command.Length + 1);\n            Repository db = client.Daemon.OpenRepository(name);\n            if (db == null) return;\n            bool on = Enabled;\n            if (Overridable)\n                on = db.Config.getBoolean(\"daemon\", Config, on);\n            if (on)\n                Execute(client, db);\n        }\n\n        public abstract void Execute(DaemonClient client, Repository db);\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/DefaultSshSessionFactory.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Loads known hosts and private keys from <code>$HOME/.ssh</code>.\n    /// <para/>\n    /// This is the default implementation used by JGit and provides most of the\n    /// compatibility necessary to match OpenSSH, a popular implementation of SSH\n    /// used by C Git.\n    /// <para/>\n    /// If user interactivity is required by SSH (e.g. to obtain a password), the\n    /// connection will immediately fail.\n    /// </summary>\n    public class DefaultSshSessionFactory : SshConfigSessionFactory\n    {\n        protected override void configure(OpenSshConfig.Host hc, Session session)\n        {\n            // No additional configuration required.\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/FetchHeadRecord.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core.Transport\n{\n    public class FetchHeadRecord\n    {\n        public FetchHeadRecord(ObjectId newValue, bool notForMerge, string sourceName, URIish sourceUri)\n        {\n            NewValue = newValue;\n            NotForMerge = notForMerge;\n            SourceName = sourceName;\n            SourceURI = sourceUri;\n        }\n\n        public ObjectId NewValue { get; private set; }\n        public bool NotForMerge { get; private set; }\n        public string SourceName { get; private set; }\n        public URIish SourceURI { get; private set; }\n\n        public void Write(TextWriter sw)\n        {\n            string type;\n            string name;\n\n            if (SourceName.StartsWith(Constants.R_HEADS))\n            {\n                type = \"branch\";\n                name = SourceName.Substring(Constants.R_HEADS.Length);\n            }\n            else if (SourceName.StartsWith(Constants.R_TAGS))\n            {\n                type = \"tag\";\n                name = SourceName.Substring(Constants.R_TAGS.Length);\n            }\n            else if (SourceName.StartsWith(Constants.R_REMOTES))\n            {\n                type = \"remote branch\";\n                name = SourceName.Substring(Constants.R_REMOTES.Length);\n            }\n            else\n            {\n                type = string.Empty;\n                name = SourceName;\n            }\n\n            sw.Write(NewValue.Name);\n            sw.Write('\\t');\n\n            if (NotForMerge)\n            {\n                sw.Write(\"not-for-merge\");\n            }\n\n            sw.Write('\\t');\n            sw.Write(type);\n            sw.Write(\" '\");\n            sw.Write(name);\n            sw.Write(\"' of \");\n            sw.Write(SourceURI);\n            sw.Write('\\n');\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/FetchProcess.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    internal class FetchProcess\n    {\n        /// <summary> Transport we will fetch over.  </summary>\n        private readonly Transport _transport;\n\n        /// <summary> List of things we want to fetch from the remote repository.  </summary>\n        private readonly ICollection<RefSpec> _toFetch;\n\n        /// <summary> Set of refs we will actually wind up asking to obtain.  </summary>\n        private readonly IDictionary<ObjectId, Ref> _askFor = new Dictionary<ObjectId, Ref>();\n\n        /// <summary> Objects we know we have locally.  </summary>\n        private readonly HashSet<ObjectId> _have = new HashSet<ObjectId>();\n\n        /// <summary> Updates to local tracking branches (if any).  </summary>\n        private readonly List<TrackingRefUpdate> _localUpdates = new List<TrackingRefUpdate>();\n\n        /// <summary> Records to be recorded into FETCH_HEAD.  </summary>\n        private readonly List<FetchHeadRecord> _fetchHeadUpdates = new List<FetchHeadRecord>();\n\n        private readonly List<PackLock> _packLocks = new List<PackLock>();\n\n        private IFetchConnection _connection;\n\n        internal FetchProcess(Transport t, ICollection<RefSpec> f)\n        {\n            _transport = t;\n            _toFetch = f;\n        }\n\n        internal virtual void execute(ProgressMonitor monitor, FetchResult result)\n        {\n            _askFor.Clear();\n            _localUpdates.Clear();\n            _fetchHeadUpdates.Clear();\n            _packLocks.Clear();\n\n            try\n            {\n                executeImp(monitor, result);\n            }\n            finally\n            {\n                foreach (PackLock @lock in _packLocks)\n                {\n                    @lock.Unlock();\n                }\n            }\n        }\n\n        private void executeImp(ProgressMonitor monitor, FetchResult result)\n        {\n            _connection = _transport.openFetch();\n            try\n            {\n                result.SetAdvertisedRefs(_transport.Uri, _connection.RefsMap);\n                HashSet<Ref> matched = new HashSet<Ref>();\n                foreach (RefSpec spec in _toFetch)\n                {\n                    if (spec.Source == null)\n                        throw new TransportException(\"Source ref not specified for refspec: \" + spec);\n\n                    if (spec.Wildcard)\n                    {\n                        expandWildcard(spec, matched);\n                    }\n                    else\n                    {\n                        expandSingle(spec, matched);\n                    }\n                }\n\n                ICollection<Ref> additionalTags = new Collection<Ref>();\n\n                TagOpt tagopt = _transport.TagOpt;\n                if (tagopt == TagOpt.AUTO_FOLLOW)\n                {\n                    additionalTags = expandAutoFollowTags();\n                }\n                else if (tagopt == TagOpt.FETCH_TAGS)\n                {\n                    expandFetchTags();\n                }\n\n                bool includedTags;\n                if (_askFor.Count != 0 && !askForIsComplete())\n                {\n                    fetchObjects(monitor);\n                    includedTags = _connection.DidFetchIncludeTags;\n\n                    // Connection was used for object transfer. If we\n                    // do another fetch we must open a new connection.\n                    //\n                    closeConnection();\n                }\n                else\n                {\n                    includedTags = false;\n                }\n\n                if (tagopt == TagOpt.AUTO_FOLLOW && additionalTags.Count != 0)\n                {\n                    // There are more tags that we want to follow, but\n                    // not all were asked for on the initial request.\n                    foreach (ObjectId key in _askFor.Keys)\n                    {\n                        _have.Add(key);\n                    }\n\n                    _askFor.Clear();\n                    foreach (Ref r in additionalTags)\n                    {\n                        ObjectId id = r.PeeledObjectId;\n                        if (id == null || _transport.Local.HasObject(id))\n                        {\n                            wantTag(r);\n                        }\n                    }\n\n                    if (_askFor.Count != 0 && (!includedTags || !askForIsComplete()))\n                    {\n                        reopenConnection();\n                        if (_askFor.Count != 0)\n                        {\n                            fetchObjects(monitor);\n                        }\n                    }\n                }\n            }\n            finally\n            {\n                closeConnection();\n            }\n\n            using (RevWalk.RevWalk walk = new RevWalk.RevWalk(_transport.Local))\n            {\n                if (_transport.RemoveDeletedRefs)\n                {\n                    deleteStaleTrackingRefs(result, walk);\n                }\n\n                foreach (TrackingRefUpdate u in _localUpdates)\n                {\n                    try\n                    {\n                        u.Update(walk);\n                        result.Add(u);\n                    }\n                    catch (IOException err)\n                    {\n                        throw new TransportException(\"Failure updating tracking ref \" + u.LocalName + \": \" + err.Message, err);\n                    }\n                }\n            }\n\n            if (_fetchHeadUpdates.Count != 0)\n            {\n                try\n                {\n                    updateFETCH_HEAD(result);\n                }\n                catch (IOException err)\n                {\n                    throw new TransportException(\"Failure updating FETCH_HEAD: \" + err.Message, err);\n                }\n            }\n        }\n\n        private void fetchObjects(ProgressMonitor monitor)\n        {\n            try\n            {\n                _connection.SetPackLockMessage(\"jgit fetch \" + _transport.Uri);\n                _connection.Fetch(monitor, _askFor.Values, _have.ToList());\n            }\n            finally\n            {\n                _packLocks.AddRange(_connection.PackLocks);\n            }\n            if (_transport.CheckFetchedObjects && !_connection.DidFetchTestConnectivity && !askForIsComplete())\n                throw new TransportException(_transport.Uri, \"peer did not supply a complete object graph\");\n        }\n\n        private void closeConnection()\n        {\n            if (_connection != null)\n            {\n                _connection.Close();\n                _connection = null;\n            }\n        }\n\n        private void reopenConnection()\n        {\n            if (_connection != null)\n            {\n                return;\n            }\n\n            _connection = _transport.openFetch();\n\n            // Since we opened a new connection we cannot be certain\n            // that the system we connected to has the same exact set\n            // of objects available (think round-robin DNS and mirrors\n            // that aren't updated at the same time).\n            //\n            // We rebuild our askFor list using only the refs that the\n            // new connection has offered to us.\n            //\n            IDictionary<ObjectId, Ref> avail = new Dictionary<ObjectId, Ref>();\n            foreach (Ref r in _connection.Refs)\n            {\n                avail.put(r.getObjectId(), r);\n            }\n\n            ICollection<Ref> wants = new List<Ref>(_askFor.Values);\n            _askFor.Clear();\n            foreach (Ref want in wants)\n            {\n                Ref newRef = avail.get(want.ObjectId);\n                if (newRef != null)\n                {\n                    _askFor.put(newRef.ObjectId, newRef);\n                }\n                else\n                {\n                    removeFetchHeadRecord(want.ObjectId);\n                    removeTrackingRefUpdate(want.ObjectId);\n                }\n            }\n        }\n\n        private void removeTrackingRefUpdate(ObjectId want)\n        {\n            _localUpdates.RemoveAll(x => x.NewObjectId.Equals(want));\n        }\n\n        private void removeFetchHeadRecord(ObjectId want)\n        {\n            _fetchHeadUpdates.RemoveAll(x => x.NewValue.Equals(want));\n        }\n\n        private void updateFETCH_HEAD(FetchResult result)\n        {\n            using (LockFile @lock = new LockFile(PathUtil.CombineFilePath(_transport.Local.Directory, \"FETCH_HEAD\")))\n            {\n                if (@lock.Lock())\n                {\n                    using (StreamWriter w = new StreamWriter(@lock.GetOutputStream()))\n                    {\n                        foreach (FetchHeadRecord h in _fetchHeadUpdates)\n                        {\n                            h.Write(w);\n                            result.Add(h);\n                        }\n                    }\n\n                    @lock.Commit();\n                }\n            }\n        }\n\n        private bool askForIsComplete()\n        {\n            try\n            {\n                using (ObjectWalk ow = new ObjectWalk(_transport.Local))\n                {\n                    foreach (ObjectId want in _askFor.Keys)\n                    {\n                        ow.markStart(ow.parseAny(want));\n                    }\n                    foreach (Ref @ref in _transport.Local.getAllRefs().Values)\n                    {\n                        ow.markUninteresting(ow.parseAny(@ref.ObjectId));\n                    }\n                    ow.checkConnectivity();\n                    return true;\n                }\n            }\n            catch (MissingObjectException)\n            {\n                return false;\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(\"Unable to check connectivity.\", e);\n            }\n        }\n\n        private void expandWildcard(RefSpec spec, HashSet<Ref> matched)\n        {\n            foreach (Ref src in _connection.Refs)\n            {\n                if (spec.MatchSource(src) && matched.Add(src))\n                    want(src, spec.ExpandFromSource((src)));\n            }\n        }\n\n        private void expandSingle(RefSpec spec, HashSet<Ref> matched)\n        {\n            Ref src = _connection.GetRef(spec.Source);\n            if (src == null)\n            {\n                throw new TransportException(\"Remote does not have \" + spec.Source + \" available for fetch.\");\n            }\n            if (matched.Add(src))\n            {\n                want(src, spec);\n            }\n        }\n\n        private ICollection<Ref> expandAutoFollowTags()\n        {\n            ICollection<Ref> additionalTags = new List<Ref>();\n            IDictionary<string, Ref> haveRefs = _transport.Local.getAllRefs();\n            foreach (Ref r in _connection.Refs)\n            {\n                if (!isTag(r))\n                {\n                    continue;\n                }\n\n                if (r.PeeledObjectId == null)\n                {\n                    additionalTags.Add(r);\n                    continue;\n                }\n\n                Ref local = haveRefs.get(r.Name);\n                if (local != null)\n                {\n                    if (!r.ObjectId.Equals(local.ObjectId))\n                    {\n                        wantTag(r);\n                    }\n                }\n                else if (_askFor.ContainsKey(r.PeeledObjectId) || _transport.Local.HasObject(r.PeeledObjectId))\n                    wantTag(r);\n                else\n                    additionalTags.Add(r);\n            }\n            return additionalTags;\n        }\n\n        private void expandFetchTags()\n        {\n            IDictionary<string, Ref> haveRefs = _transport.Local.getAllRefs();\n            foreach (Ref r in _connection.Refs)\n            {\n                if (!isTag(r))\n                    continue;\n                Ref local = haveRefs.get(r.Name);\n                if (local == null || !r.ObjectId.Equals(local.ObjectId))\n                    wantTag(r);\n            }\n        }\n\n        private void wantTag(Ref r)\n        {\n            want(r, new RefSpec(r.Name, r.Name));\n        }\n\n        private void want(Ref src, RefSpec spec)\n        {\n            ObjectId newId = src.ObjectId;\n            if (spec.Destination != null)\n            {\n                try\n                {\n                    TrackingRefUpdate tru = createUpdate(spec, newId);\n                    if (newId.Equals(tru.OldObjectId))\n                    {\n                        return;\n                    }\n                    _localUpdates.Add(tru);\n                }\n                catch (System.IO.IOException err)\n                {\n                    // Bad symbolic ref? That is the most likely cause.\n                    throw new TransportException(\"Cannot resolve\" + \" local tracking ref \" + spec.Destination + \" for updating.\", err);\n                }\n            }\n\n            _askFor.put(newId, src);\n\n            FetchHeadRecord fhr = new FetchHeadRecord(newId, spec.Destination != null, src.Name, _transport.Uri);\n            _fetchHeadUpdates.Add(fhr);\n        }\n\n        private TrackingRefUpdate createUpdate(RefSpec spec, ObjectId newId)\n        {\n            return new TrackingRefUpdate(_transport.Local, spec, newId, \"fetch\");\n        }\n\n        private void deleteStaleTrackingRefs(FetchResult result, RevWalk.RevWalk walk)\n        {\n            Repository db = _transport.Local;\n            foreach (Ref @ref in db.getAllRefs().Values)\n            {\n                string refname = @ref.Name;\n                foreach (RefSpec spec in _toFetch)\n                {\n                    if (spec.MatchDestination(refname))\n                    {\n                        RefSpec s = spec.ExpandFromDestination(refname);\n                        if (result.GetAdvertisedRef(s.Source) == null)\n                        {\n                            deleteTrackingRef(result, db, walk, s, @ref);\n                        }\n                    }\n                }\n            }\n        }\n\n        private void deleteTrackingRef(FetchResult result, Repository db, RevWalk.RevWalk walk, RefSpec spec, Ref localRef)\n        {\n            string name = localRef.Name;\n            try\n            {\n                TrackingRefUpdate u = new TrackingRefUpdate(db, name, spec.Source, true, ObjectId.ZeroId, \"deleted\");\n                result.Add(u);\n                if (_transport.DryRun)\n                {\n                    return;\n                }\n\n                u.Delete(walk);\n\n                switch (u.Result)\n                {\n                    case RefUpdate.RefUpdateResult.NEW:\n                    case RefUpdate.RefUpdateResult.NO_CHANGE:\n                    case RefUpdate.RefUpdateResult.FAST_FORWARD:\n                    case RefUpdate.RefUpdateResult.FORCED:\n                        break;\n\n                    default:\n                        throw new TransportException(_transport.Uri, \"Cannot delete stale tracking ref \" + name + \": \" + Enum.GetName(typeof(RefUpdate.RefUpdateResult), u.Result));\n                }\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(_transport.Uri, \"Cannot delete stale tracking ref \" + name, e);\n            }\n        }\n\n        private static bool isTag(Ref r)\n        {\n            return isTag(r.Name);\n        }\n\n        private static bool isTag(string name)\n        {\n            return name.StartsWith(Constants.R_TAGS);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/FetchResult.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Final status after a successful fetch from a remote repository.\n    /// </summary>\n    public class FetchResult : OperationResult\n    {\n        private readonly IList<FetchHeadRecord> _forMerge = new List<FetchHeadRecord>();\n\n        public void Add(FetchHeadRecord r)\n        {\n            if (!r.NotForMerge)\n            {\n                _forMerge.Add(r);\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/HttpTransport.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// The base class for transports that use HTTP as underlying protocol. This class\n\t/// allows customizing HTTP connection settings.\n    /// </summary>\n    public abstract class HttpTransport : Transport\n    {\n        /// <summary>\n        /// Create a new transport instance.\n        /// </summary>\n        /// <param name=\"local\">\n        /// the repository this instance will fetch into, or push out of.\n\t\t/// This must be the repository passed to <see cref=\"Transport.open(Repository, URIish)\"/>\n\t\t/// </param>\n        /// <param name=\"uri\">\n        /// The URI used to access the remote repository. This must be the\n\t\t/// URI passed to <see cref=\"Transport.open(Repository, URIish)\"/>.\n        /// </param>\n        protected HttpTransport(Repository local, URIish uri)\n            : base(local, uri)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Represent connection for operation on a remote repository.\n    /// <para/>\n    /// Currently all operations on remote repository (fetch and push) provide\n    /// information about remote refs. Every connection is able to be closed and\n    /// should be closed - this is a connection client responsibility.\n    /// </summary>\n    public interface IConnection\n    {\n        /// <summary>\n        /// Get the complete map of refs advertised as available for fetching or\n        /// pushing.\n        /// <para/>\n        /// Returns available/advertised refs: map of refname to ref. Never null. Not\n        /// modifiable. The collection can be empty if the remote side has no\n        /// refs (it is an empty/newly created repository).\n        /// </summary>\n        IDictionary<string, Ref> RefsMap { get; }\n\n        /// <summary>\n        /// Get the complete list of refs advertised as available for fetching or\n        /// pushing.\n        /// <para/>\n        /// The returned refs may appear in any order. If the caller needs these to\n        /// be sorted, they should be copied into a new array or List and then sorted\n        /// by the caller as necessary.\n        /// \n        /// Returns available/advertised refs. Never null. Not modifiable. The\n        /// collection can be empty if the remote side has no refs (it is an\n        /// empty/newly created repository).\n        /// </summary>\n        ICollection<Ref> Refs { get; }\n\n        /// <summary>\n        /// Get a single advertised ref by name.\n        /// <para/>\n        /// The name supplied should be valid ref name. To get a peeled value for a\n        /// ref (aka <code>refs/tags/v1.0^{}</code>) use the base name (without\n        /// the <code>^{}</code> suffix) and look at the peeled object id.\n        /// </summary>\n        /// <param name=\"name\">name of the ref to obtain.</param>\n        /// <returns>the requested ref; null if the remote did not advertise this ref.</returns>\n        Ref GetRef(string name);\n\n        /// <summary>\n        /// Close any resources used by this connection.\n        /// <para/>\n        /// If the remote repository is contacted by a network socket this method\n        /// must close that network socket, disconnecting the two peers. If the\n        /// remote repository is actually local (same system) this method must close\n        /// any open file handles used to read the \"remote\" repository.</summary>\n        void Close();\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IFetchConnection.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Lists known refs from the remote and copies objects of selected refs.\n    /// <para/>\n    /// A fetch connection typically connects to the <code>git-upload-pack</code>\n    /// service running where the remote repository is stored. This provides a\n    /// one-way object transfer service to copy objects from the remote repository\n    /// into this local repository.\n    /// <para/>\n    /// Instances of a FetchConnection must be created by a <see cref=\"Transport\"/> that\n    /// implements a specific object transfer protocol that both sides of the\n    /// connection understand.\n    /// <para/>\n    /// FetchConnection instances are not thread safe and may be accessed by only one\n    /// thread at a time.\n    /// </summary>\n    public interface IFetchConnection : IConnection\n    {\n        /// <summary>\n        /// Fetch objects we don't have but that are reachable from advertised refs.\n        /// <para/>\n        /// Only one call per connection is allowed. Subsequent calls will result in\n        /// <see cref=\"TransportException\"/>.\n        /// <para/>\n        /// Implementations are free to use network connections as necessary to\n        /// efficiently (for both client and server) transfer objects from the remote\n        /// repository into this repository. When possible implementations should\n        /// avoid replacing/overwriting/duplicating an object already available in\n        /// the local destination repository. Locally available objects and packs\n        /// should always be preferred over remotely available objects and packs.\n        /// <see cref=\"Transport.get_FetchThin\"/> should be honored if applicable.\n        /// </summary>\n        /// <param name=\"monitor\">\n        /// progress monitor to inform the end-user about the amount of\n        /// work completed, or to indicate cancellation. Implementations\n        /// should poll the monitor at regular intervals to look for\n        /// cancellation requests from the user.\n        /// </param>\n        /// <param name=\"want\">\n        /// one or more refs advertised by this connection that the caller\n        /// wants to store locally.\n        /// </param>\n        /// <param name=\"have\">\n        /// additional objects known to exist in the destination\n        /// repository, especially if they aren't yet reachable by the ref\n        /// database. Connections should take this set as an addition to\n        /// what is reachable through all Refs, not in replace of it.\n        /// </param>\n        void Fetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have);\n\n        /// <summary>\n        /// Did the last <see cref=\"Fetch\"/> get tags?\n        /// <para/>\n        /// Some Git aware transports are able to implicitly grab an annotated tag if\n        /// <see cref=\"TagOpt.AUTO_FOLLOW\"/> or <see cref=\"TagOpt.FETCH_TAGS\"/> was selected and\n        /// the object the tag peels to (references) was transferred as part of the\n        /// last <see cref=\"Fetch\"/> call. If it is\n        /// possible for such tags to have been included in the transfer this method\n        /// returns true, allowing the caller to attempt tag discovery.\n        /// <para/>\n        /// By returning only true/false (and not the actual list of tags obtained)\n        /// the transport itself does not need to be aware of whether or not tags\n        /// were included in the transfer.\n        /// <para/>\n        /// Returns true if the last fetch call implicitly included tag objects;\n        /// false if tags were not implicitly obtained.\n        /// </summary>\n        bool DidFetchIncludeTags { get; }\n\n        /// <summary>\n        /// Did the last <see cref=\"Fetch\"/> validate\n        /// graph?\n        /// <para/>\n        /// Some transports walk the object graph on the client side, with the client\n        /// looking for what objects it is missing and requesting them individually\n        /// from the remote peer. By virtue of completing the fetch call the client\n        /// implicitly tested the object connectivity, as every object in the graph\n        /// was either already local or was requested successfully from the peer. In\n        /// such transports this method returns true.\n        /// <para/>\n        /// Some transports assume the remote peer knows the Git object graph and is\n        /// able to supply a fully connected graph to the client (although it may\n        /// only be transferring the parts the client does not yet have). Its faster\n        /// to assume such remote peers are well behaved and send the correct\n        /// response to the client. In such transports this method returns false.\n        /// <para/>\n        /// Returns true if the last fetch had to perform a connectivity check on the\n        /// client side in order to succeed; false if the last fetch assumed\n        /// the remote peer supplied a complete graph.\n        /// </summary>\n        bool DidFetchTestConnectivity { get; }\n\n        /// <summary>\n        /// Set the lock message used when holding a pack out of garbage collection.\n        /// <para/>\n        /// Callers that set a lock message <b>must</b> ensure they call\n        /// <see cref=\"PackLocks\"/> after\n        /// <see cref=\"Fetch\"/>, even if an exception\n        /// was thrown, and release the locks that are held.\n        /// </summary>\n        /// <param name=\"message\">message to use when holding a pack in place.</param>\n        void SetPackLockMessage(string message);\n\n        /// <summary>\n        /// All locks created by the last <see cref=\"Fetch\"/> call.\n        /// <para/>\n        /// Returns collection (possibly empty) of locks created by the last call to\n        /// fetch. The caller must release these after refs are updated in\n        /// order to safely permit garbage collection.\n        /// </summary>\n        List<PackLock> PackLocks { get; }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IPackTransport.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n\n    /**\n     * Marker interface an object transport using Git pack transfers.\n     * <para />\n     * Implementations of PackTransport setup connections and move objects back and\n     * forth by creating pack files on the source side and indexing them on the\n     * receiving side.\n     * \n     * @see BasePackFetchConnection\n     * @see BasePackPushConnection\n     */\n    public interface IPackTransport\n    {\n        // no methods in marker interface\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IPostReceiveHook.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// A simple no-op hook.\n    /// </summary>\n    internal class NULLReceiveHook : IPostReceiveHook\n    {\n        public void OnPostReceive(ReceivePack rp, ICollection<ReceiveCommand> commands)\n        {\n        }\n    }\n\n    public static class PostReceiveHook\n    {\n        public static IPostReceiveHook NULL = new NULLReceiveHook();\n    }\n\n    /// <summary>\n    /// Hook invoked by {@link ReceivePack} after all updates are executed.\n    /// <para/>\n    /// The hook is called after all commands have been processed. Only commands with\n    /// a status of {@link ReceiveCommand.Result#OK} are passed into the hook. To get\n    /// all commands within the hook, see {@link ReceivePack#getAllCommands()}.\n    /// <para/>\n    /// Any post-receive hook implementation should not update the status of a\n    /// command, as the command has already completed or failed, and the status has\n    /// already been returned to the client.\n    /// <para/>\n    /// Hooks should execute quickly, as they block the server and the client from\n    /// completing the connection.\n    /// </summary>\n    public interface IPostReceiveHook\n    {\n        /// <summary>\n        /// Invoked after all commands are executed and status has been returned.\n        /// </summary>\n        /// <param name=\"rp\">\n        /// the process handling the current receive. Hooks may obtain\n        /// details about the destination repository through this handle.\n        /// </param>\n        /// <param name=\"commands\">\n        /// unmodifiable set of successfully completed commands. May be\n        /// the empty set.\n        /// </param>\n        void OnPostReceive(ReceivePack rp, ICollection<ReceiveCommand> commands);\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IPreReceiveHook.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// A simple no-op hook.\n    /// </summary>\n    internal class NULLPreReceiveHook : IPreReceiveHook\n    {\n        public void onPreReceive(ReceivePack rp, ICollection<ReceiveCommand> commands)\n        {\n        }\n    }\n\n    public static class PreReceiveHook\n    {\n        public static IPreReceiveHook NULL = new NULLPreReceiveHook();\n    }\n \n    /// <summary>\n    /// Hook invoked by <see cref=\"ReceivePack\"/> before any updates are executed.\n    /// <para/>\n    /// The hook is called with any commands that are deemed valid after parsing them\n    /// from the client and applying the standard receive configuration options to\n    /// them:\n    /// <ul>\n    /// <li><code>receive.denyDenyDeletes</code></li>\n    /// <li><code>receive.denyNonFastForwards</code></li>\n    /// </ul>\n    /// This means the hook will not receive a non-fast-forward update command if\n    /// denyNonFastForwards is set to true in the configuration file. To get all\n    /// commands within the hook, see <see cref=\"ReceivePack.getAllCommands\"/>.\n    /// <para/>\n    /// As the hook is invoked prior to the commands being executed, the hook may\n    /// choose to block any command by setting its result status with\n    /// <see cref=\"ReceiveCommand.setResult(GitSharp.Core.Transport.ReceiveCommand.Result)\"/>.\n    /// <para/>\n    /// The hook may also choose to perform the command itself (or merely pretend\n    /// that it has performed the command), by setting the result status to\n    /// <see cref=\"ReceiveCommand.Result.OK\"/>.\n    /// <para/>\n    /// Hooks should run quickly, as they block the caller thread and the client\n    /// process from completing.\n    /// <para/>\n    /// Hooks may send optional messages back to the client via methods on\n    /// <see cref=\"ReceivePack\"/>. Implementors should be aware that not all network\n    /// transports support this output, so some (or all) messages may simply be\n    /// discarded. These messages should be advisory only.\n    /// </summary>\n    public interface IPreReceiveHook\n    {\n        /// <summary>\n        /// Invoked just before commands are executed.\n        /// <para/>\n        /// See the class description for how this method can impact execution.\n        /// </summary>\n        /// <param name=\"rp\">\n        /// the process handling the current receive. Hooks may obtain\n        /// details about the destination repository through this handle.\n        /// </param>\n        /// <param name=\"commands\">\n        /// unmodifiable set of valid commands still pending execution.\n        /// May be the empty set.\n        /// </param>\n        void onPreReceive(ReceivePack rp, ICollection<ReceiveCommand> commands);\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IPushConnection.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Lists known refs from the remote and sends objects to the remote.\n    /// <para/>\n    /// A push connection typically connects to the <code>git-receive-pack</code>\n    /// service running where the remote repository is stored. This provides a\n    /// one-way object transfer service to copy objects from the local repository\n    /// into the remote repository, as well as a way to modify the refs stored by the\n    /// remote repository.\n    /// <para/>\n    /// Instances of a PushConnection must be created by a {@link Transport} that\n    /// implements a specific object transfer protocol that both sides of the\n    /// connection understand.\n    /// <para/>\n    /// PushConnection instances are not thread safe and may be accessed by only one\n    /// thread at a time.\n    /// </summary>\n    public interface IPushConnection : IConnection\n    {\n        /// <summary>\n        /// Pushes to the remote repository basing on provided specification. This\n        /// possibly result in update/creation/deletion of refs on remote repository\n        /// and sending objects that remote repository need to have a consistent\n        /// objects graph from new refs.\n        /// <para />\n        /// Only one call per connection is allowed. Subsequent calls will result in\n        /// <see cref=\"TransportException\"/>.\n        /// <para />\n        /// Implementation may use local repository to send a minimum set of objects\n        /// needed by remote repository in efficient way.\n        /// <see cref=\"Transport.PushThin\"/> should be honored if applicable.\n        /// refUpdates should be filled with information about status of each update.\n        /// </summary>\n        /// <param name=\"monitor\">\n        /// progress monitor to update the end-user about the amount of\n        /// work completed, or to indicate cancellation. Implementors\n        /// should poll the monitor at regular intervals to look for\n        /// cancellation requests from the user.\n        /// </param>\n        /// <param name=\"refUpdates\">\n        /// map of remote refnames to remote refs update\n        /// specifications/statuses. Can't be empty. This indicate what\n        /// refs caller want to update on remote side. Only refs updates\n        /// with <see cref=\"RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED\"/> should passed.\n        /// Implementation must ensure that and appropriate status with\n        /// optional message should be set during call. No refUpdate with\n        /// <see cref=\"RemoteRefUpdate.UpdateStatus.AWAITING_REPORT\"/> or \n        /// <see cref=\"RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED\"/>\n        /// can be leaved by implementation after return from this call.\n        /// </param>\n        /// <exception cref=\"TransportException\">\n        /// Objects could not be copied due to a network failure,\n        /// critical protocol error, or error on remote side, or\n        /// connection was already used for push - new connection must be\n        /// created. Non-critical errors concerning only isolated refs\n        /// should be placed in refUpdates.\n        /// </exception>\n        void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates);\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/ITransportBundle.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Marker interface for transports that supports fetching from a git bundle\n    /// (sneaker-net object transport).\n    /// <para/>\n    /// Push support for a bundle is complex, as one does not have a peer to\n    /// communicate with to decide what the peer already knows. So push is not\n    /// supported by the bundle transport.\n    /// </summary>\n    public interface ITransportBundle : IPackTransport\n    {\n    }\n\n    public static class TransportBundleConstants\n    {\n        public static string V2_BUNDLE_SIGNATURE = \"# v2 git bundle\"; \n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IWalkTransport.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Marker interface for an object transport walking transport.\n    /// <para />\n    /// Implementations of WalkTransport transfer individual objects one at a time\n    /// from the loose objects directory, or entire packs if the source side does not\n    /// have the object as a loose object.\n    /// <para />\n    /// WalkTransports are not as efficient as {@link PackTransport} instances, but\n    /// can be useful in situations where a pack transport is not acceptable.\n    /// <para/>\n    /// see <see cref=\"WalkFetchConnection\"/>\n    /// </summary>\n    public interface IWalkTransport\n    {\n        // no methods in marker interface\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/IndexPack.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core.Transport\n{\n\t/// <summary>\n\t/// Indexes Git pack files for local use.\n\t/// </summary>\n\tpublic class IndexPack : IDisposable\n\t{\n\t\t/// <summary>\n\t\t/// Progress message when reading raw data from the pack.\n\t\t/// </summary>\n\t\tpublic const string PROGRESS_DOWNLOAD = \"Receiving objects\";\n\n\t\t/// <summary>\n\t\t/// Progress message when computing names of delta compressed objects.\n\t\t/// </summary>\n\t\tpublic const string PROGRESS_RESOLVE_DELTA = \"Resolving deltas\";\n\t\tpublic const string PackSuffix = \".pack\";\n\t\tpublic const string IndexSuffix = \".idx\";\n\n\t\t/// <summary>\n\t\t/// Size of the internal stream buffer.\n\t\t/// <para/>\n\t\t/// If callers are going to be supplying IndexPack a BufferedInputStream they\n\t\t/// should use this buffer size as the size of the buffer for that\n\t\t/// BufferedInputStream, and any other its may be wrapping. This way the\n\t\t/// buffers will cascade efficiently and only the IndexPack buffer will be\n\t\t/// receiving the bulk of the data stream.\n\t\t/// </summary>\n\t\tpublic const int BUFFER_SIZE = 8192;\n\n\n\t\t/// <summary>\n\t\t/// Create an index pack instance to load a new pack into a repository.\n\t\t/// <para/>\n\t\t/// The received pack data and generated index will be saved to temporary\n\t\t/// files within the repository's <code>objects</code> directory. To use the\n\t\t/// data contained within them call <see cref=\"renameAndOpenPack()\"/> once the\n\t\t/// indexing is complete.\n\t\t/// </summary>\n\t\t/// <param name=\"db\">the repository that will receive the new pack.</param>\n\t\t/// <param name=\"stream\">\n\t\t/// stream to read the pack data from. If the stream is buffered\n\t\t/// use <see cref=\"BUFFER_SIZE\"/> as the buffer size for the stream.\n\t\t/// </param>\n\t\t/// <returns>a new index pack instance.</returns>\n\t\tinternal static IndexPack Create(Repository db, Stream stream)\n\t\t{\n\t\t\tDirectoryInfo objdir = db.ObjectsDirectory;\n\t\t\tFileInfo tmp = CreateTempFile(\"incoming_\", PackSuffix, objdir);\n\t\t\tstring n = tmp.Name;\n\n\t\t\tvar basef = PathUtil.CombineFilePath(objdir, n.Slice(0, n.Length - PackSuffix.Length));\n\t\t\tvar ip = new IndexPack(db, stream, basef);\n\t\t\tip.setIndexVersion(db.Config.getCore().getPackIndexVersion());\n\t\t\treturn ip;\n\t\t}\n\n\t\tprivate readonly Repository _repo;\n\t\tprivate readonly FileStream _packOut;\n\t\tprivate Stream _stream;\n\t\tprivate readonly byte[] _buffer;\n\t\tprivate readonly MessageDigest _objectDigest;\n\t\tprivate readonly MutableObjectId _tempObjectId;\n\t\tprivate readonly Crc32 _crc = new Crc32();\n\n\t\t/// <summary>\n\t\t/// Object database used for loading existing objects\n\t\t/// </summary>\n\t\tprivate readonly ObjectDatabase _objectDatabase;\n\n\t\tprivate Inflater _inflater;\n\t\tprivate long _bBase;\n\t\tprivate int _bOffset;\n\t\tprivate int _bAvail;\n\t\tprivate ObjectChecker _objCheck;\n\t\tprivate bool _fixThin;\n\t\tprivate bool _keepEmpty;\n\t\tprivate bool _needBaseObjectIds;\n\t\tprivate int _outputVersion;\n\t\tprivate readonly FileInfo _dstPack;\n\t\tprivate readonly FileInfo _dstIdx;\n\t\tprivate long _objectCount;\n\t\tprivate PackedObjectInfo[] _entries;\n\t\tprivate HashSet<ObjectId> _newObjectIds;\n\t\tprivate int _deltaCount;\n\t\tprivate int _entryCount;\n\t\tprivate ObjectIdSubclassMap<DeltaChain> _baseById;\n\t\tprivate HashSet<ObjectId> _baseIds;\n\t\tprivate LongMap<UnresolvedDelta> _baseByPos;\n\t\tprivate byte[] _objectData;\n\t\tprivate MessageDigest _packDigest;\n\t\tprivate byte[] _packcsum;\n\n\t\t/// <summary>\n\t\t/// If <see cref=\"_fixThin\"/> this is the last byte of the original checksum.\n\t\t/// </summary>\n\t\tprivate long _originalEof;\n\t\tprivate WindowCursor _windowCursor;\n\n\t\t/// <summary>\n\t\t/// Create a new pack indexer utility.\n\t\t/// </summary>\n\t\t/// <param name=\"db\"></param>\n\t\t/// <param name=\"src\">\n\t\t/// stream to read the pack data from. If the stream is buffered\n\t\t/// use <see cref=\"BUFFER_SIZE\"/> as the buffer size for the stream.\n\t\t/// </param>\n\t\t/// <param name=\"dstBase\"></param>\n\t\tpublic IndexPack(Repository db, Stream src, FileInfo dstBase)\n\t\t{\n\t\t\t_repo = db;\n\t\t\t_objectDatabase = db.ObjectDatabase.newCachedDatabase();\n\t\t\t_stream = src;\n\t\t\t_inflater = InflaterCache.Instance.get();\n\t\t\t_windowCursor = new WindowCursor();\n\t\t\t_buffer = new byte[BUFFER_SIZE];\n\t\t\t_objectData = new byte[BUFFER_SIZE];\n\t\t\t_objectDigest = Constants.newMessageDigest();\n\t\t\t_tempObjectId = new MutableObjectId();\n\t\t\t_packDigest = Constants.newMessageDigest();\n\n\t\t\tif (dstBase != null)\n\t\t\t{\n\t\t\t\tDirectoryInfo dir = dstBase.Directory;\n\t\t\t\tstring nam = dstBase.Name;\n\t\t\t\t_dstPack = PathUtil.CombineFilePath(dir, GetPackFileName(nam));\n\t\t\t\t_dstIdx = PathUtil.CombineFilePath(dir, GetIndexFileName(nam));\n\t\t\t\t_packOut = _dstPack.Create();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_dstPack = null;\n\t\t\t\t_dstIdx = null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the pack index file format version this instance will create.\n\t\t/// </summary>\n\t\t/// <param name=\"version\">\n\t\t/// the version to write. The special version 0 designates the\n\t\t/// oldest (most compatible) format available for the objects.\n\t\t/// </param>\n\t\tpublic void setIndexVersion(int version)\n\t\t{\n\t\t\t_outputVersion = version;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this index pack instance to make a thin pack complete.\n\t\t/// <para/>\n\t\t/// Thin packs are sometimes used during network transfers to allow a delta\n\t\t/// to be sent without a base object. Such packs are not permitted on disk.\n\t\t/// They can be fixed by copying the base object onto the end of the pack.\n\t\t/// </summary>\n\t\t/// <param name=\"fix\">true to enable fixing a thin pack.</param>\n\t\tpublic void setFixThin(bool fix)\n\t\t{\n\t\t\t_fixThin = fix;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this index pack instance to keep an empty pack.\n\t\t/// <para/>\n\t\t/// By default an empty pack (a pack with no objects) is not kept, as doing\n\t\t/// so is completely pointless. With no objects in the pack there is no data\n\t\t/// stored by it, so the pack is unnecessary.\n\t\t/// </summary>\n\t\t/// <param name=\"empty\">true to enable keeping an empty pack.</param>\n\t\tpublic void setKeepEmpty(bool empty)\n\t\t{\n\t\t\t_keepEmpty = empty;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this index pack instance to keep track of new objects.\n\t\t/// <para/>\n\t\t/// By default an index pack doesn't save the new objects that were created\n\t\t/// when it was instantiated. Setting this flag to {@code true} allows the\n\t\t/// caller to use {@link #getNewObjectIds()} to retrieve that list.\n\t\t/// </summary>\n\t\t/// <param name=\"b\"> True to enable keeping track of new objects.</param>\n\t\tpublic void setNeedNewObjectIds(bool b)\n\t\t{\n\t\t\tif (b)\n\t\t\t\t_newObjectIds = new HashSet<ObjectId>();\n\t\t\telse\n\t\t\t\t_newObjectIds = null;\n\t\t}\n\n\t\tprivate bool needNewObjectIds()\n\t\t{\n\t\t\treturn _newObjectIds != null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this index pack instance to keep track of the objects assumed\n\t\t/// for delta bases.\n\t\t/// <para/>\n\t\t/// By default an index pack doesn't save the objects that were used as delta\n\t\t/// bases. Setting this flag to {@code true} will allow the caller to\n\t\t/// use <see>getBaseObjectIds()</see> to retrieve that list.\n\t\t/// </summary>\n\t\t///<param name=\"b\"> True to enable keeping track of delta bases.</param>\n\t\tpublic void setNeedBaseObjectIds(bool b)\n\t\t{\n\t\t\tthis._needBaseObjectIds = b;\n\t\t}\n\n\t\t/// <returns> the new objects that were sent by the user</returns>\t  \n\t\tpublic HashSet<ObjectId> getNewObjectIds()\n\t\t{\n\t\t\treturn _newObjectIds ?? new HashSet<ObjectId>();\n\t\t}\n\n\t\t/// <returns>the set of objects the incoming pack assumed for delta purposes</returns>\t  \n\t\tpublic HashSet<ObjectId> getBaseObjectIds()\n\t\t{\n\t\t\treturn _baseIds ?? new HashSet<ObjectId>();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure the checker used to validate received objects.\n\t\t/// <para/>\n\t\t/// Usually object checking isn't necessary, as Git implementations only\n\t\t/// create valid objects in pack files. However, additional checking may be\n\t\t/// useful if processing data from an untrusted source.\n\t\t/// </summary>\n\t\t/// <param name=\"oc\">the checker instance; null to disable object checking.</param>\n\t\tpublic void setObjectChecker(ObjectChecker oc)\n\t\t{\n\t\t\t_objCheck = oc;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure the checker used to validate received objects.\n\t\t/// <para/>\n\t\t/// Usually object checking isn't necessary, as Git implementations only\n\t\t/// create valid objects in pack files. However, additional checking may be\n\t\t/// useful if processing data from an untrusted source.\n\t\t/// <para/>\n\t\t/// This is shorthand for:\n\t\t/// \n\t\t/// <pre>\n\t\t/// setObjectChecker(on ? new ObjectChecker() : null);\n\t\t/// </pre>\n\t\t/// </summary>\n\t\t/// <param name=\"on\">true to enable the default checker; false to disable it.</param>\n\t\tpublic void setObjectChecking(bool on)\n\t\t{\n\t\t\tsetObjectChecker(on ? new ObjectChecker() : null);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Consume data from the input stream until the packfile is indexed.\n\t\t/// </summary>\n\t\t/// <param name=\"progress\">progress feedback</param>\n\t\tpublic void index(ProgressMonitor progress)\n\t\t{\n\t\t\tprogress.Start(2 /* tasks */);\n\t\t\ttry\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tReadPackHeader();\n\n\t\t\t\t\t_entries = new PackedObjectInfo[(int)_objectCount];\n\t\t\t\t\t_baseById = new ObjectIdSubclassMap<DeltaChain>();\n\t\t\t\t\t_baseByPos = new LongMap<UnresolvedDelta>();\n\n\t\t\t\t\tprogress.BeginTask(PROGRESS_DOWNLOAD, (int)_objectCount);\n\t\t\t\t\tfor (int done = 0; done < _objectCount; done++)\n\t\t\t\t\t{\n\t\t\t\t\t\tIndexOneObject();\n\t\t\t\t\t\tprogress.Update(1);\n\t\t\t\t\t\tif (progress.IsCancelled)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new IOException(\"Download cancelled\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tReadPackFooter();\n\t\t\t\t\tEndInput();\n\t\t\t\t\tprogress.EndTask();\n\n\t\t\t\t\tif (_deltaCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_packOut == null)\n\t\t\t\t\t\t\tthrow new IOException(\"need packOut\");\n\t\t\t\t\t\tResolveDeltas(progress);\n\t\t\t\t\t\tif (_needBaseObjectIds)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_baseIds = new HashSet<ObjectId>();\n\t\t\t\t\t\t\tforeach (var c in _baseById)\n\t\t\t\t\t\t\t\t_baseIds.Add(c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_entryCount < _objectCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!_fixThin)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthrow new IOException(\"pack has \" + (_objectCount - _entryCount) + \" unresolved deltas\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tFixThinPack(progress);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_packOut != null && (_keepEmpty || _entryCount > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t_packOut.Flush();\n\t\t\t\t\t}\n\n\t\t\t\t\t_packDigest = null;\n\t\t\t\t\t_baseById = null;\n\t\t\t\t\t_baseByPos = null;\n\n\t\t\t\t\tif (_dstIdx != null && (_keepEmpty || _entryCount > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteIdx();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tInflaterCache.Instance.release(_inflater);\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\t_inflater = null;\n\t\t\t\t\t\t_objectDatabase.close();\n\t\t\t\t\t}\n\t\t\t\t\t_windowCursor = WindowCursor.Release(_windowCursor);\n\n\t\t\t\t\tprogress.EndTask();\n\t\t\t\t\tif (_packOut != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_packOut.Dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (_keepEmpty || _entryCount > 0)\n\t\t\t\t{\n\t\t\t\t\tif (_dstPack != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_dstPack.IsReadOnly = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (_dstIdx != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_dstIdx.IsReadOnly = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\tif (_dstPack != null) _dstPack.DeleteFile();\n\t\t\t\tif (_dstIdx != null) _dstIdx.DeleteFile();\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tprivate void ResolveDeltas(ProgressMonitor progress)\n\t\t{\n\t\t\tprogress.BeginTask(PROGRESS_RESOLVE_DELTA, _deltaCount);\n\t\t\tint last = _entryCount;\n\t\t\tfor (int i = 0; i < last; i++)\n\t\t\t{\n\t\t\t\tint before = _entryCount;\n\t\t\t\tResolveDeltas(_entries[i]);\n\t\t\t\tprogress.Update(_entryCount - before);\n\t\t\t\tif (progress.IsCancelled)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Download cancelled during indexing\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tprogress.EndTask();\n\t\t}\n\n\t\tprivate void ResolveDeltas(PackedObjectInfo objectInfo)\n\t\t{\n\t\t\tif (_baseById.Get(objectInfo) != null || _baseByPos.containsKey(objectInfo.Offset))\n\t\t\t{\n\t\t\t\tint oldCrc = objectInfo.CRC;\n\t\t\t\tResolveDeltas(objectInfo.Offset, oldCrc, Constants.OBJ_BAD, null, objectInfo);\n\t\t\t}\n\t\t}\n\n\t\tprivate void ResolveDeltas(long pos, int oldCrc, int type, byte[] data, PackedObjectInfo oe)\n\t\t{\n\t\t\t_crc.Reset();\n\t\t\tPosition(pos);\n\t\t\tint c = ReadFromFile();\n\t\t\tint typecode = (c >> 4) & 7;\n\t\t\tlong sz = c & 15;\n\t\t\tint shift = 4;\n\t\t\twhile ((c & 0x80) != 0)\n\t\t\t{\n\t\t\t\tc = ReadFromFile();\n\t\t\t\tsz += (c & 0x7f) << shift;\n\t\t\t\tshift += 7;\n\t\t\t}\n\n\t\t\tswitch (typecode)\n\t\t\t{\n\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\ttype = typecode;\n\t\t\t\t\tdata = InflateFromFile((int)sz);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Constants.OBJ_OFS_DELTA:\n\t\t\t\t\tc = ReadFromFile() & 0xff;\n\t\t\t\t\twhile ((c & 128) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tc = ReadFromFile() & 0xff;\n\t\t\t\t\t}\n\t\t\t\t\tdata = BinaryDelta.Apply(data, InflateFromFile((int)sz));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Constants.OBJ_REF_DELTA:\n\t\t\t\t\t_crc.Update(_buffer, FillFromFile(20), 20);\n\t\t\t\t\tUse(20);\n\t\t\t\t\tdata = BinaryDelta.Apply(data, InflateFromFile((int)sz));\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new IOException(\"Unknown object type \" + typecode + \".\");\n\t\t\t}\n\n\t\t\tvar crc32 = (int)_crc.Value;\n\t\t\tif (oldCrc != crc32)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Corruption detected re-reading at \" + pos);\n\t\t\t}\n\n\t\t\tif (oe == null)\n\t\t\t{\n\t\t\t\t_objectDigest.Update(Constants.encodedTypeString(type));\n\t\t\t\t_objectDigest.Update((byte)' ');\n\t\t\t\t_objectDigest.Update(Constants.encodeASCII(data.Length));\n\t\t\t\t_objectDigest.Update(0);\n\t\t\t\t_objectDigest.Update(data);\n\t\t\t\t_tempObjectId.FromRaw(_objectDigest.Digest(), 0);\n\n\t\t\t\tVerifySafeObject(_tempObjectId, type, data);\n\t\t\t\toe = new PackedObjectInfo(pos, crc32, _tempObjectId);\n\t\t\t\taddObjectAndTrack(oe);\n\t\t\t}\n\n\t\t\tResolveChildDeltas(pos, type, data, oe);\n\t\t}\n\n\t\tprivate UnresolvedDelta RemoveBaseById(AnyObjectId id)\n\t\t{\n\t\t\tDeltaChain d = _baseById.Get(id);\n\t\t\treturn d != null ? d.Remove() : null;\n\t\t}\n\n\t\tprivate static UnresolvedDelta Reverse(UnresolvedDelta c)\n\t\t{\n\t\t\tUnresolvedDelta tail = null;\n\t\t\twhile (c != null)\n\t\t\t{\n\t\t\t\tUnresolvedDelta n = c.Next;\n\t\t\t\tc.Next = tail;\n\t\t\t\ttail = c;\n\t\t\t\tc = n;\n\t\t\t}\n\t\t\treturn tail;\n\t\t}\n\n\t\tprivate void ResolveChildDeltas(long pos, int type, byte[] data, AnyObjectId objectId)\n\t\t{\n\t\t\tUnresolvedDelta a = Reverse(RemoveBaseById(objectId));\n\t\t\tUnresolvedDelta b = Reverse(_baseByPos.remove(pos));\n\n\t\t\twhile (a != null && b != null)\n\t\t\t{\n\t\t\t\tif (a.Position < b.Position)\n\t\t\t\t{\n\t\t\t\t\tResolveDeltas(a.Position, a.Crc, type, data, null);\n\t\t\t\t\ta = a.Next;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tResolveDeltas(b.Position, b.Crc, type, data, null);\n\t\t\t\t\tb = b.Next;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tResolveChildDeltaChain(type, data, a);\n\t\t\tResolveChildDeltaChain(type, data, b);\n\t\t}\n\n\t\tprivate void ResolveChildDeltaChain(int type, byte[] data, UnresolvedDelta a)\n\t\t{\n\t\t\twhile (a != null)\n\t\t\t{\n\t\t\t\tResolveDeltas(a.Position, a.Crc, type, data, null);\n\t\t\t\ta = a.Next;\n\t\t\t}\n\t\t}\n\n\t\tprivate void FixThinPack(ProgressMonitor progress)\n\t\t{\n\t\t\tGrowEntries();\n\n\t\t\t_packDigest.Reset();\n\t\t\t_originalEof = _packOut.Length - 20;\n\t\t\tvar def = new Deflater(Deflater.DEFAULT_COMPRESSION, false);\n\t\t\tvar missing = new List<DeltaChain>(64);\n\t\t\tlong end = _originalEof;\n\n\t\t\tforeach (DeltaChain baseId in _baseById)\n\t\t\t{\n\t\t\t\tif (baseId.Head == null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tObjectLoader ldr = _repo.OpenObject(_windowCursor, baseId);\n\t\t\t\tif (ldr == null)\n\t\t\t\t{\n\t\t\t\t\tmissing.Add(baseId);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbyte[] data = ldr.CachedBytes;\n\t\t\t\tint typeCode = ldr.Type;\n\n\t\t\t\t_crc.Reset();\n\t\t\t\t_packOut.Seek(end, SeekOrigin.Begin);\n\t\t\t\tWriteWhole(def, typeCode, data);\n\t\t\t\tvar oe = new PackedObjectInfo(end, (int)_crc.Value, baseId);\n\t\t\t\t_entries[_entryCount++] = oe;\n\t\t\t\tend = _packOut.Position;\n\n\t\t\t\tResolveChildDeltas(oe.Offset, typeCode, data, oe);\n\t\t\t\tif (progress.IsCancelled)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Download cancelled during indexing\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdef.Finish();\n\n\t\t\tforeach (DeltaChain baseDeltaChain in missing)\n\t\t\t{\n\t\t\t\tif (baseDeltaChain.Head != null)\n\t\t\t\t{\n\t\t\t\t\tthrow new MissingObjectException(baseDeltaChain, \"delta base\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFixHeaderFooter(_packcsum, _packDigest.Digest());\n\t\t}\n\n\t\tprivate void WriteWhole(Deflater def, int typeCode, byte[] data)\n\t\t{\n\t\t\tint sz = data.Length;\n\t\t\tint hdrlen = 0;\n\t\t\t_buffer[hdrlen++] = (byte)((typeCode << 4) | sz & 15);\n\t\t\tsz = (int)(((uint)sz) >> 4);\n\n\t\t\twhile (sz > 0)\n\t\t\t{\n\t\t\t\t_buffer[hdrlen - 1] |= 0x80;\n\t\t\t\t_buffer[hdrlen++] = (byte)(sz & 0x7f);\n\t\t\t\tsz = (int)(((uint)sz) >> 7);\n\t\t\t}\n\n\t\t\t_packDigest.Update(_buffer, 0, hdrlen);\n\t\t\t_crc.Update(_buffer, 0, hdrlen);\n\t\t\t_packOut.Write(_buffer, 0, hdrlen);\n\t\t\tdef.Reset();\n\t\t\tdef.SetInput(data);\n\t\t\tdef.Finish();\n\n\t\t\twhile (!def.IsFinished)\n\t\t\t{\n\t\t\t\tint datlen = def.Deflate(_buffer);\n\t\t\t\t_packDigest.Update(_buffer, 0, datlen);\n\t\t\t\t_crc.Update(_buffer, 0, datlen);\n\t\t\t\t_packOut.Write(_buffer, 0, datlen);\n\t\t\t}\n\t\t}\n\n\t\tprivate void FixHeaderFooter(IEnumerable<byte> origcsum, IEnumerable<byte> tailcsum)\n\t\t{\n\t\t\tMessageDigest origDigest = Constants.newMessageDigest();\n\t\t\tMessageDigest tailDigest = Constants.newMessageDigest();\n\t\t\tlong origRemaining = _originalEof;\n\n\t\t\t_packOut.Seek(0, SeekOrigin.Begin);\n\t\t\t_bAvail = 0;\n\t\t\t_bOffset = 0;\n\t\t\tFillFromFile(12);\n\n\t\t\t{\n\t\t\t\tvar origCnt = (int)Math.Min(_bAvail, origRemaining);\n\t\t\t\torigDigest.Update(_buffer, 0, origCnt);\n\t\t\t\torigRemaining -= origCnt;\n\t\t\t\tif (origRemaining == 0)\n\t\t\t\t{\n\t\t\t\t\ttailDigest.Update(_buffer, origCnt, _bAvail - origCnt);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tNB.encodeInt32(_buffer, 8, _entryCount);\n\t\t\t_packOut.Seek(0, SeekOrigin.Begin);\n\t\t\t_packOut.Write(_buffer, 0, 12);\n\t\t\t_packOut.Seek(_bAvail, SeekOrigin.Begin);\n\n\t\t\t_packDigest.Reset();\n\t\t\t_packDigest.Update(_buffer, 0, _bAvail);\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tint n = _packOut.Read(_buffer, 0, _buffer.Length);\n\t\t\t\tif (n <= 0) break;\n\n\t\t\t\tif (origRemaining != 0)\n\t\t\t\t{\n\t\t\t\t\tvar origCnt = (int)Math.Min(n, origRemaining);\n\t\t\t\t\torigDigest.Update(_buffer, 0, origCnt);\n\t\t\t\t\torigRemaining -= origCnt;\n\t\t\t\t\tif (origRemaining == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\ttailDigest.Update(_buffer, origCnt, n - origCnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttailDigest.Update(_buffer, 0, n);\n\t\t\t\t}\n\n\t\t\t\t_packDigest.Update(_buffer, 0, n);\n\t\t\t}\n\n\t\t\tif (!origDigest.Digest().SequenceEqual(origcsum) || !tailDigest.Digest().SequenceEqual(tailcsum))\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Pack corrupted while writing to filesystem\");\n\t\t\t}\n\n\t\t\t_packcsum = _packDigest.Digest();\n\t\t\t_packOut.Write(_packcsum, 0, _packcsum.Length);\n\t\t}\n\n\t\tprivate void GrowEntries()\n\t\t{\n\t\t\tvar newEntries = new PackedObjectInfo[(int)_objectCount + _baseById.Count];\n\t\t\tArray.Copy(_entries, 0, newEntries, 0, _entryCount);\n\t\t\t_entries = newEntries;\n\t\t}\n\n\t\tprivate void WriteIdx()\n\t\t{\n\t\t\tArray.Sort(_entries, 0, _entryCount);\n\t\t\tvar list = new List<PackedObjectInfo>(_entries);\n\t\t\tif (_entryCount < _entries.Length)\n\t\t\t{\n\t\t\t\tlist.RemoveRange(_entryCount, _entries.Length - _entryCount);\n\t\t\t}\n\n\t\t\tusing (FileStream os = _dstIdx.Create())\n\t\t\t{\n\t\t\t\tPackIndexWriter iw = _outputVersion <= 0 ? PackIndexWriter.CreateOldestPossible(os, list) : PackIndexWriter.CreateVersion(os, _outputVersion);\n\n\t\t\t\tiw.Write(list, _packcsum);\n\t\t\t\tos.Flush();\n\t\t\t}\n\t\t}\n\n\t\tprivate void ReadPackHeader()\n\t\t{\n\t\t\tint hdrln = Constants.PACK_SIGNATURE.Length + 4 + 4;\n\t\t\tint p = FillFromInput(hdrln);\n\t\t\tfor (int k = 0; k < Constants.PACK_SIGNATURE.Length; k++)\n\t\t\t{\n\t\t\t\tif (_buffer[p + k] != Constants.PACK_SIGNATURE[k])\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Not a PACK file.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlong vers = NB.DecodeUInt32(_buffer, p + 4);\n\t\t\tif (vers != 2 && vers != 3)\n\t\t\t{\n\t\t\t\tthrow new IOException(\"Unsupported pack version \" + vers + \".\");\n\t\t\t}\n\n\t\t\t_objectCount = NB.decodeUInt32(_buffer, p + 8);\n\t\t\tUse(hdrln);\n\t\t}\n\n\t\tprivate void ReadPackFooter()\n\t\t{\n\t\t\tSync();\n\t\t\tbyte[] cmpcsum = _packDigest.Digest();\n\t\t\tint c = FillFromInput(20);\n\t\t\t_packcsum = new byte[20];\n\t\t\tArray.Copy(_buffer, c, _packcsum, 0, 20);\n\n\t\t\tUse(20);\n\n\t\t\tif (_packOut != null)\n\t\t\t{\n\t\t\t\t_packOut.Write(_packcsum, 0, _packcsum.Length);\n\t\t\t}\n\n\t\t\tif (!cmpcsum.SequenceEqual(_packcsum))\n\t\t\t{\n\t\t\t\tthrow new CorruptObjectException(\"Packfile checksum incorrect.\");\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Cleanup all resources associated with our input parsing.\n\t\t/// </summary>\n\t\tprivate void EndInput()\n\t\t{\n\t\t\t_stream = null;\n\t\t\t_objectData = null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Read one entire object or delta from the input.\n\t\t/// </summary>\n\t\tprivate void IndexOneObject()\n\t\t{\n\t\t\tlong pos = Position();\n\t\t\t_crc.Reset();\n\t\t\tint c = ReadFromInput();\n\t\t\tint typeCode = (c >> 4) & 7;\n\t\t\tlong sz = c & 15;\n\t\t\tint shift = 4;\n\t\t\twhile ((c & 0x80) != 0)\n\t\t\t{\n\t\t\t\tc = ReadFromInput();\n\t\t\t\tsz += (c & 0x7f) << shift;\n\t\t\t\tshift += 7;\n\t\t\t}\n\n\t\t\tswitch (typeCode)\n\t\t\t{\n\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\tWhole(typeCode, pos, sz);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Constants.OBJ_OFS_DELTA:\n\t\t\t\t\tc = ReadFromInput();\n\t\t\t\t\tlong ofs = c & 127;\n\t\t\t\t\twhile ((c & 128) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tofs += 1;\n\t\t\t\t\t\tc = ReadFromInput();\n\t\t\t\t\t\tofs <<= 7;\n\t\t\t\t\t\tofs += (c & 127);\n\t\t\t\t\t}\n\t\t\t\t\tlong pbase = pos - ofs;\n\t\t\t\t\tSkipInflateFromInput(sz);\n\t\t\t\t\tvar n = new UnresolvedDelta(pos, (int)_crc.Value);\n\t\t\t\t\tn.Next = _baseByPos.put(pbase, n);\n\t\t\t\t\t_deltaCount++;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Constants.OBJ_REF_DELTA:\n\t\t\t\t\tc = FillFromInput(20);\n\t\t\t\t\t_crc.Update(_buffer, c, 20);\n\t\t\t\t\tObjectId baseId = ObjectId.FromRaw(_buffer, c);\n\t\t\t\t\tUse(20);\n\t\t\t\t\tDeltaChain r = _baseById.Get(baseId);\n\t\t\t\t\tif (r == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tr = new DeltaChain(baseId);\n\t\t\t\t\t\t_baseById.Add(r);\n\t\t\t\t\t}\n\t\t\t\t\tSkipInflateFromInput(sz);\n\t\t\t\t\tr.Add(new UnresolvedDelta(pos, (int)_crc.Value));\n\t\t\t\t\t_deltaCount++;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new IOException(\"Unknown object type \" + typeCode + \".\");\n\t\t\t}\n\t\t}\n\n\t\tprivate void Whole(int type, long pos, long sz)\n\t\t{\n\t\t\tbyte[] data = InflateFromInput((int)sz);\n\t\t\t_objectDigest.Update(Constants.encodedTypeString(type));\n\t\t\t_objectDigest.Update((byte)' ');\n\t\t\t_objectDigest.Update(Constants.encodeASCII(sz));\n\t\t\t_objectDigest.Update(0);\n\t\t\t_objectDigest.Update(data);\n\t\t\t_tempObjectId.FromRaw(_objectDigest.Digest(), 0);\n\n\t\t\tVerifySafeObject(_tempObjectId, type, data);\n\t\t\tvar crc32 = (int)_crc.Value;\n\t\t\taddObjectAndTrack(new PackedObjectInfo(pos, crc32, _tempObjectId));\n\t\t}\n\n\t\tprivate void VerifySafeObject(AnyObjectId id, int type, byte[] data)\n\t\t{\n\t\t\tif (_objCheck != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_objCheck.check(type, data);\n\t\t\t\t}\n\t\t\t\tcatch (CorruptObjectException e)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Invalid \" + Constants.typeString(type) + \" \" + id.Name + \": \" + e.Message, e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tObjectLoader ldr = _objectDatabase.openObject(_windowCursor, id);\n\t\t\tif (ldr != null)\n\t\t\t{\n\t\t\t\tbyte[] existingData = ldr.CachedBytes;\n\t\t\t\tif (ldr.Type != type || !data.SequenceEqual(existingData))\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"Collision on \" + id.Name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <returns>Current position of <see cref=\"_bOffset\"/> within the entire file.</returns>\n\t\tprivate long Position()\n\t\t{\n\t\t\treturn _bBase + _bOffset;\n\t\t}\n\n\t\tprivate void Position(long pos)\n\t\t{\n\t\t\t_packOut.Seek(pos, SeekOrigin.Begin);\n\t\t\t_bBase = pos;\n\t\t\t_bOffset = 0;\n\t\t\t_bAvail = 0;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Consume exactly one byte from the buffer and return it.\n\t\t/// </summary>\n\t\tprivate int ReadFromInput()\n\t\t{\n\t\t\tif (_bAvail == 0)\n\t\t\t{\n\t\t\t\tFillFromInput(1);\n\t\t\t}\n\n\t\t\t_bAvail--;\n\t\t\tint b = _buffer[_bOffset++] & 0xff;\n\t\t\t_crc.Update((uint)b);\n\t\t\treturn b;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Consume exactly one byte from the buffer and return it.\n\t\t/// </summary>\n\t\tprivate int ReadFromFile()\n\t\t{\n\t\t\tif (_bAvail == 0)\n\t\t\t{\n\t\t\t\tFillFromFile(1);\n\t\t\t}\n\n\t\t\t_bAvail--;\n\t\t\tint b = _buffer[_bOffset++] & 0xff;\n\t\t\t_crc.Update((uint)b);\n\t\t\treturn b;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Consume cnt byte from the buffer.\n\t\t/// </summary>\n\t\tprivate void Use(int cnt)\n\t\t{\n\t\t\t_bOffset += cnt;\n\t\t\t_bAvail -= cnt;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Ensure at least need bytes are available in in <see cref=\"_buffer\"/>.\n\t\t/// </summary>\n\t\tprivate int FillFromInput(int need)\n\t\t{\n\t\t\twhile (_bAvail < need)\n\t\t\t{\n\t\t\t\tint next = _bOffset + _bAvail;\n\t\t\t\tint free = _buffer.Length - next;\n\t\t\t\tif (free + _bAvail < need)\n\t\t\t\t{\n\t\t\t\t\tSync();\n\t\t\t\t\tnext = _bAvail;\n\t\t\t\t\tfree = _buffer.Length - next;\n\t\t\t\t}\n\n\t\t\t\tnext = _stream.Read(_buffer, next, free);\n\t\t\t\tif (next <= 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new EndOfStreamException(\"Packfile is truncated,\");\n\t\t\t\t}\n\n\t\t\t\t_bAvail += next;\n\t\t\t}\n\t\t\treturn _bOffset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Ensure at least need bytes are available in in <see cref=\"_buffer\"/>.\n\t\t/// </summary>\n\t\tprivate int FillFromFile(int need)\n\t\t{\n\t\t\tif (_bAvail < need)\n\t\t\t{\n\t\t\t\tint next = _bOffset + _bAvail;\n\t\t\t\tint free = _buffer.Length - next;\n\t\t\t\tif (free + _bAvail < need)\n\t\t\t\t{\n\t\t\t\t\tif (_bAvail > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tArray.Copy(_buffer, _bOffset, _buffer, 0, _bAvail);\n\t\t\t\t\t}\n\n\t\t\t\t\t_bOffset = 0;\n\t\t\t\t\tnext = _bAvail;\n\t\t\t\t\tfree = _buffer.Length - next;\n\t\t\t\t}\n\n\t\t\t\tnext = _packOut.Read(_buffer, next, free);\n\t\t\t\tif (next <= 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new EndOfStreamException(\"Packfile is truncated.\");\n\t\t\t\t}\n\n\t\t\t\t_bAvail += next;\n\t\t\t}\n\n\t\t\treturn _bOffset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Store consumed bytes in <see cref=\"_buffer\"/> up to <see cref=\"_bOffset\"/>.\n\t\t/// </summary>\n\t\tprivate void Sync()\n\t\t{\n\t\t\t_packDigest.Update(_buffer, 0, _bOffset);\n\t\t\tif (_packOut != null)\n\t\t\t{\n\t\t\t\t_packOut.Write(_buffer, 0, _bOffset);\n\t\t\t}\n\n\t\t\tif (_bAvail > 0)\n\t\t\t{\n\t\t\t\tArray.Copy(_buffer, _bOffset, _buffer, 0, _bAvail);\n\t\t\t}\n\n\t\t\t_bBase += _bOffset;\n\t\t\t_bOffset = 0;\n\t\t}\n\n\t\tprivate void SkipInflateFromInput(long sz)\n\t\t{\n\t\t\tInflater inf = _inflater;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbyte[] dst = _objectData;\n\t\t\t\tint n = 0;\n\t\t\t\tint p = -1;\n\t\t\t\twhile (!inf.IsFinished)\n\t\t\t\t{\n\t\t\t\t\tif (inf.IsNeedingInput)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (p >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_crc.Update(_buffer, p, _bAvail);\n\t\t\t\t\t\t\tUse(_bAvail);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp = FillFromInput(1);\n\t\t\t\t\t\tinf.SetInput(_buffer, p, _bAvail);\n\t\t\t\t\t}\n\n\t\t\t\t\tint free = dst.Length - n;\n\t\t\t\t\tif (free < 8)\n\t\t\t\t\t{\n\t\t\t\t\t\tsz -= n;\n\t\t\t\t\t\tn = 0;\n\t\t\t\t\t\tfree = dst.Length;\n\t\t\t\t\t}\n\t\t\t\t\tn += inf.Inflate(dst, n, free);\n\t\t\t\t}\n\n\t\t\t\tif (n != sz)\n\t\t\t\t{\n\t\t\t\t\tthrow new IOException(\"wrong decompressed length\");\n\t\t\t\t}\n\n\t\t\t\tn = _bAvail - inf.RemainingInput;\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\t_crc.Update(_buffer, p, n);\n\t\t\t\t\tUse(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow Corrupt(e);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tinf.Reset();\n\t\t\t}\n\t\t}\n\n\t\tprivate byte[] InflateFromInput(int size)\n\t\t{\n\t\t\tvar dst = new byte[size];\n\t\t\tInflater inf = _inflater;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint n = 0;\n\t\t\t\tint p = -1;\n\t\t\t\twhile (!inf.IsFinished)\n\t\t\t\t{\n\t\t\t\t\tif (inf.IsNeedingInput)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (p >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_crc.Update(_buffer, p, _bAvail);\n\t\t\t\t\t\t\tUse(_bAvail);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp = FillFromInput(1);\n\t\t\t\t\t\tinf.SetInput(_buffer, p, _bAvail);\n\t\t\t\t\t}\n\n\t\t\t\t\tn += inf.Inflate(dst, n, dst.Length - n);\n\t\t\t\t}\n\t\t\t\tif (n != size)\n\t\t\t\t\tthrow new IOException(\"Wrong decrompressed length\");\n\t\t\t\tn = _bAvail - inf.RemainingInput;\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\t_crc.Update(_buffer, p, n);\n\t\t\t\t\tUse(n);\n\t\t\t\t}\n\t\t\t\treturn dst;\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow Corrupt(e);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tinf.Reset();\n\t\t\t}\n\t\t}\n\n\t\tprivate byte[] InflateFromFile(int size)\n\t\t{\n\t\t\tvar dst = new byte[(int)size];\n\t\t\tInflater inf = _inflater;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint n = 0;\n\t\t\t\tint p = -1;\n\t\t\t\twhile (!inf.IsFinished)\n\t\t\t\t{\n\t\t\t\t\tif (inf.IsNeedingInput)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (p >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_crc.Update(_buffer, p, _bAvail);\n\t\t\t\t\t\t\tUse(_bAvail);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp = FillFromFile(1);\n\t\t\t\t\t\tinf.SetInput(_buffer, p, _bAvail);\n\t\t\t\t\t}\n\n\t\t\t\t\tn += inf.Inflate(dst, n, size - n);\n\t\t\t\t}\n\n\t\t\t\tn = _bAvail - inf.RemainingInput;\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\t_crc.Update(_buffer, p, n);\n\t\t\t\t\tUse(n);\n\t\t\t\t}\n\t\t\t\treturn dst;\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow Corrupt(e);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tinf.Reset();\n\t\t\t}\n\t\t}\n\n\t\tprivate static CorruptObjectException Corrupt(IOException e)\n\t\t{\n\t\t\treturn new CorruptObjectException(\"Packfile corruption detected: \" + e.Message);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Rename the pack to it's final name and location and open it.\n\t\t/// <para/>\n\t\t/// If the call completes successfully the repository this IndexPack instance\n\t\t/// was created with will have the objects in the pack available for reading\n\t\t/// and use, without needing to scan for packs.\n\t\t/// </summary>\n\t\tpublic void renameAndOpenPack()\n\t\t{\n\t\t\trenameAndOpenPack(null);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Rename the pack to it's final name and location and open it.\n\t\t/// <para/>\n\t\t/// If the call completes successfully the repository this IndexPack instance\n\t\t/// was created with will have the objects in the pack available for reading\n\t\t/// and use, without needing to scan for packs.\n\t\t/// </summary>\n\t\t/// <param name=\"lockMessage\">\n\t\t/// message to place in the pack-*.keep file. If null, no lock\n\t\t/// will be created, and this method returns null.\n\t\t/// </param>\n\t\t/// <returns>the pack lock object, if lockMessage is not null.</returns>\n\t\tpublic PackLock renameAndOpenPack(string lockMessage)\n\t\t{\n\t\t\tif (!_keepEmpty && _entryCount == 0)\n\t\t\t{\n\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tMessageDigest d = Constants.newMessageDigest();\n\t\t\tvar oeBytes = new byte[Constants.OBJECT_ID_LENGTH];\n\t\t\tfor (int i = 0; i < _entryCount; i++)\n\t\t\t{\n\t\t\t\tPackedObjectInfo oe = _entries[i];\n\t\t\t\toe.copyRawTo(oeBytes, 0);\n\t\t\t\td.Update(oeBytes);\n\t\t\t}\n\n\t\t\tstring name = ObjectId.FromRaw(d.Digest()).Name;\n\t\t\tvar packDir = PathUtil.CombineDirectoryPath(_repo.ObjectsDirectory, \"pack\");\n\t\t\tvar finalPack = PathUtil.CombineFilePath(packDir, \"pack-\" + GetPackFileName(name));\n\t\t\tvar finalIdx = PathUtil.CombineFilePath(packDir, \"pack-\" + GetIndexFileName(name));\n\t\t\tvar keep = new PackLock(finalPack);\n\n\t\t\tif (!packDir.Exists && !packDir.Mkdirs() && !packDir.Exists)\n\t\t\t{\n\t\t\t\t// The objects/pack directory isn't present, and we are unable\n\t\t\t\t// to create it. There is no way to move this pack in.\n\t\t\t\t//\n\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\tthrow new IOException(\"Cannot Create \" + packDir);\n\t\t\t}\n\n\t\t\tif (finalPack.Exists)\n\t\t\t{\n\t\t\t\t// If the pack is already present we should never replace it.\n\t\t\t\t//\n\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (lockMessage != null)\n\t\t\t{\n\t\t\t\t// If we have a reason to create a keep file for this pack, do\n\t\t\t\t// so, or fail fast and don't put the pack in place.\n\t\t\t\t//\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (!keep.Lock(lockMessage))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IOException(\"Cannot lock pack in \" + finalPack);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!_dstPack.RenameTo(finalPack.ToString()))\n\t\t\t{\n\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\tkeep.Unlock();\n\t\t\t\tthrow new IOException(\"Cannot move pack to \" + finalPack);\n\t\t\t}\n\n\t\t\tif (!_dstIdx.RenameTo(finalIdx.ToString()))\n\t\t\t{\n\t\t\t\tCleanupTemporaryFiles();\n\t\t\t\tkeep.Unlock();\n\t\t\t\tfinalPack.DeleteFile();\n\t\t\t\t//if (finalPack.Exists)\n\t\t\t\t// TODO: [caytchen]  finalPack.deleteOnExit();\n\t\t\t\tthrow new IOException(\"Cannot move index to \" + finalIdx);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_repo.OpenPack(finalPack, finalIdx);\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\tkeep.Unlock();\n\t\t\t\tfinalPack.DeleteFile();\n\t\t\t\tfinalIdx.DeleteFile();\n\t\t\t\tthrow;\n\t\t\t}\n\n\t\t\treturn lockMessage != null ? keep : null;\n\t\t}\n\n\t\tprivate void CleanupTemporaryFiles()\n\t\t{\n\t\t\t_dstIdx.DeleteFile();\n\t\t\t//if (_dstIdx.Exists)\n\t\t\t//  TODO: [caytchen] _dstIdx.deleteOnExit();\n\t\t\t_dstPack.DeleteFile();\n\t\t\t//if (_dstPack.Exists)\n\t\t\t//  TODO: [caytchen] _dstPack.deleteOnExit();\n\t\t}\n\n\t\tprivate void addObjectAndTrack(PackedObjectInfo oe)\n\t\t{\n\t\t\t_entries[_entryCount++] = oe;\n\t\t\tif (needNewObjectIds())\n\t\t\t\t_newObjectIds.Add(oe);\n\t\t}\n\n\t\tprivate static FileInfo CreateTempFile(string pre, string suf, DirectoryInfo dir)\n\t\t{\n\t\t\tstring p = Path.Combine(dir.FullName, pre + Path.GetRandomFileName() + suf);\n\n\t\t\tusing (var f = File.Create(p))\n\t\t\t{ }\n\t\t\treturn new FileInfo(p);\n\t\t}\n\n\n\t\tinternal static string GetPackFileName(string fileName)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(fileName))\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\t\t\t}\n\t\t\treturn fileName + PackSuffix;\n\t\t}\n\n\t\tinternal static string GetIndexFileName(string fileName)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(fileName))\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\t\t\t}\n\t\t\treturn fileName + IndexSuffix;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_packOut.Dispose();\n\t\t\t_stream.Dispose();\n\t\t\t_objectDigest.Dispose();\n\t\t\t_packDigest.Dispose();\n\t\t}\n\n\n\t\t#region Nested Types\n\n\t\tprivate class DeltaChain : ObjectId\n\t\t{\n\t\t\tpublic UnresolvedDelta Head { get; private set; }\n\n\t\t\tpublic DeltaChain(AnyObjectId id)\n\t\t\t\t: base(id)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic UnresolvedDelta Remove()\n\t\t\t{\n\t\t\t\tUnresolvedDelta r = Head;\n\t\t\t\tif (r != null)\n\t\t\t\t{\n\t\t\t\t\tHead = null;\n\t\t\t\t}\n\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\tpublic void Add(UnresolvedDelta d)\n\t\t\t{\n\t\t\t\td.Next = Head;\n\t\t\t\tHead = d;\n\t\t\t}\n\t\t}\n\n\t\tprivate class UnresolvedDelta\n\t\t{\n\t\t\tprivate readonly long _position;\n\t\t\tprivate readonly int _crc;\n\n\t\t\tpublic UnresolvedDelta(long headerOffset, int crc32)\n\t\t\t{\n\t\t\t\t_position = headerOffset;\n\t\t\t\t_crc = crc32;\n\t\t\t}\n\n\t\t\tpublic long Position\n\t\t\t{\n\t\t\t\tget { return _position; }\n\t\t\t}\n\n\t\t\tpublic int Crc\n\t\t\t{\n\t\t\t\tget { return _crc; }\n\t\t\t}\n\n\t\t\tpublic UnresolvedDelta Next { get; set; }\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Transport/LongMap.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Simple Map&lt;long,Object&gt; helper for <see cref=\"IndexPack\"/>.\n    /// </summary>\n    /// <typeparam name=\"V\">type of the value instance</typeparam>\n    public class LongMap<V>\n    {\n        readonly Dictionary<long, V> _map = new Dictionary<long, V>();\n\n        public bool containsKey(long key)\n        {\n            return _map.ContainsKey(key);\n        }\n\n        public V get(long key)\n        {\n            return _map.get(key);\n        }\n\n        public V remove(long key)\n        {\n            return _map.remove(key);\n        }\n\n        public V put(long key, V value)\n        {\n            return _map.put(key, value);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/OpenSshConfig.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.FnMatch;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Simple configuration parser for the OpenSSH ~/.ssh/config file.\n    /// <para/>\n    /// Since JSch does not (currently) have the ability to parse an OpenSSH\n    /// configuration file this is a simple parser to read that file and make the\n    /// critical options available to {@link SshSessionFactory}.\n    /// </summary>\n    public class OpenSshConfig\n    {\n        /// <summary>\n        /// IANA assigned port number for SSH.\n        /// </summary>\n        public const int SSH_PORT = 22;\n        private readonly Object _locker = new Object();\n\n        /// <summary>\n        /// Obtain the user's configuration data.\n        /// <para/>\n        /// The configuration file is always returned to the caller, even if no file\n        /// exists in the user's home directory at the time the call was made. Lookup\n        /// requests are cached and are automatically updated if the user modifies\n        /// the configuration file since the last time it was cached.\n        /// </summary>\n        /// <returns>a caching reader of the user's configuration file.</returns>\n        public static OpenSshConfig get()\n        {\n            DirectoryInfo home = FS.userHome() ?? new DirectoryInfo(Path.GetFullPath(\".\"));\n\n            FileInfo config = PathUtil.CombineFilePath(home, \".ssh\" + Path.DirectorySeparatorChar + \"config\");\n            var osc = new OpenSshConfig(home, config);\n            osc.refresh();\n            return osc;\n        }\n\n        /// <summary>\n        /// The user's home directory, as key files may be relative to here.\n        /// </summary>\n        private readonly DirectoryInfo _home;\n\n        /// <summary>\n        /// The .ssh/config file we read and monitor for updates.\n        /// </summary>\n        private readonly FileInfo _configFile;\n\n        /// <summary>\n        /// Modification time of <see cref=\"_configFile\"/> when <see cref=\"_hosts\"/> loaded.\n        /// </summary>\n        private long _lastModified;\n\n        /// <summary>\n        /// Cached entries read out of the configuration file.\n        /// </summary>\n        private Dictionary<string, Host> _hosts;\n\n        public OpenSshConfig(DirectoryInfo home, FileInfo cfg)\n        {\n            _home = home;\n            _configFile = cfg;\n            _hosts = new Dictionary<string, Host>();\n        }\n\n        /// <summary>\n        /// Locate the configuration for a specific host request.\n        /// </summary>\n        /// <param name=\"hostName\">\n        /// the name the user has supplied to the SSH tool. This may be a\n        /// real host name, or it may just be a \"Host\" block in the\n        /// configuration file.\n        /// </param>\n        /// <returns>configuration for the requested name. Never null.</returns>\n        public Host lookup(string hostName)\n        {\n            Dictionary<string, Host> cache = refresh();\n            Host h = cache.get(hostName);\n            if (h == null)\n                h = new Host();\n            if (h.patternsApplied)\n                return h;\n\n            foreach (KeyValuePair<string, Host> e in cache)\n            {\n                if (!isHostPattern(e.Key))\n                    continue;\n                if (!isHostMatch(e.Key, hostName))\n                    continue;\n                h.copyFrom(e.Value);\n            }\n\n            if (h.hostName == null)\n                h.hostName = hostName;\n            if (h.user == null)\n                h.user = userName();\n            if (h.port == 0)\n                h.port = SSH_PORT;\n            h.patternsApplied = true;\n            return h;\n        }\n\n        private Dictionary<string, Host> refresh()\n        {\n            lock (_locker)\n            {\n                long mtime = _configFile.lastModified();\n                if (mtime != _lastModified)\n                {\n                    try\n                    {\n                        using (var s = new FileStream(_configFile.FullName, System.IO.FileMode.Open, FileAccess.Read))\n                        {\n                            _hosts = parse(s);\n                        }\n                    }\n                    catch (FileNotFoundException)\n                    {\n                        _hosts = new Dictionary<string, Host>();\n                    }\n                    catch (IOException)\n                    {\n                        _hosts = new Dictionary<string, Host>();\n                    }\n                    _lastModified = mtime;\n                }\n                return _hosts;\n            }\n        }\n\n        private Dictionary<string, Host> parse(Stream stream)\n        {\n            var m = new Dictionary<string, Host>();\n            var sr = new StreamReader(stream);\n            var current = new List<Host>(4);\n            string line;\n\n            while ((line = sr.ReadLine()) != null)\n            {\n                line = line.Trim();\n                if (line.Length == 0 || line.StartsWith(\"#\"))\n                    continue;\n\n                var regex = new Regex(\"[ \\t]*[= \\t]\");\n\n                string[] parts = regex.Split(line, 2);\n                string keyword = parts[0].Trim();\n                string argValue = parts[1].Trim();\n\n                var regex2 = new Regex(\"[ \\t]\");\n                if (StringUtils.equalsIgnoreCase(\"Host\", keyword))\n                {\n                    current.Clear();\n                    foreach (string pattern in regex2.Split(argValue))\n                    {\n                        string name = dequote(pattern);\n                        Host c = m.get(name);\n                        if (c == null)\n                        {\n                            c = new Host();\n                            m.put(name, c);\n                        }\n                        current.Add(c);\n                    }\n                    continue;\n                }\n\n                if (current.isEmpty())\n                {\n                    // We received an option outside of a Host block. We\n                    // don't know who this should match against, so skip.\n                    //\n                    continue;\n                }\n\n                if (StringUtils.equalsIgnoreCase(\"HostName\", keyword))\n                {\n                    foreach (Host c in current)\n                        if (c.hostName == null)\n                            c.hostName = dequote(argValue);\n                }\n                else if (StringUtils.equalsIgnoreCase(\"User\", keyword))\n                {\n                    foreach (Host c in current)\n                        if (c.user == null)\n                            c.user = dequote(argValue);\n                }\n                else if (StringUtils.equalsIgnoreCase(\"Port\", keyword))\n                {\n                    try\n                    {\n                        int port = int.Parse(dequote(argValue));\n                        foreach (Host c in current)\n                            if (c.port == 0)\n                                c.port = port;\n                    }\n                    catch (FormatException)\n                    {\n                        // Bad port number. Don't set it.\n                    }\n                }\n                else if (StringUtils.equalsIgnoreCase(\"IdentityFile\", keyword))\n                {\n                    foreach (Host c in current)\n                        if (c.identityFile == null)\n                            c.identityFile = toFile(dequote(argValue));\n                }\n                else if (StringUtils.equalsIgnoreCase(\"PreferredAuthentications\", keyword))\n                {\n                    foreach (Host c in current)\n                        if (c.preferredAuthentications == null)\n                            c.preferredAuthentications = nows(dequote(argValue));\n                }\n                else if (StringUtils.equalsIgnoreCase(\"BatchMode\", keyword))\n                {\n                    foreach (Host c in current)\n                        if (c.batchMode == null)\n                            c.batchMode = yesno(dequote(argValue));\n                }\n                else if (StringUtils.equalsIgnoreCase(\"StrictHostKeyChecking\", keyword))\n                {\n                    string value = dequote(argValue);\n                    foreach (Host c in current)\n                        if (c.strictHostKeyChecking == null)\n                            c.strictHostKeyChecking = value;\n                }\n            }\n\n            return m;\n        }\n\n        private static bool isHostPattern(string s)\n        {\n            return s.IndexOf('*') >= 0 || s.IndexOf('?') >= 0;\n        }\n\n        private static bool isHostMatch(string pattern, string name)\n        {\n            FileNameMatcher fn;\n            try\n            {\n                fn = new FileNameMatcher(pattern, null);\n            }\n            catch (InvalidPatternException)\n            {\n                return false;\n            }\n            fn.Append(name);\n            return fn.IsMatch();\n        }\n\n        private static string dequote(string value)\n        {\n            if (value.StartsWith(\"\\\"\") && value.EndsWith(\"\\\"\"))\n                return value.Slice(1, value.Length - 1);\n            return value;\n        }\n\n        private static string nows(string value)\n        {\n            var b = new StringBuilder();\n            for (int i = 0; i < value.Length; i++)\n                if (!Char.IsSeparator(value[i]))\n                    b.Append(value[i]);\n            return b.ToString();\n        }\n\n        private static bool yesno(string value)\n        {\n            if (StringUtils.equalsIgnoreCase(\"yes\", value))\n                return true;\n            return false;\n        }\n\n        private FileInfo toFile(string path)\n        {\n            if (path.StartsWith(\"~/\"))\n            {\n                return PathUtil.CombineFilePath(_home, path.Substring(2));\n            }\n\n            if (Path.IsPathRooted(path))\n            {\n                return new FileInfo(path);\n            }\n\n            return PathUtil.CombineFilePath(_home, path);\n        }\n\n        public static string userName()\n        {\n            return Environment.UserName;\n        }\n\n        /// <summary>\n        /// Configuration of one \"Host\" block in the configuration file.\n        /// <para/>\n        /// If returned from <see cref=\"OpenSshConfig.lookup\"/> some or all of the\n        /// properties may not be populated. The properties which are not populated\n        /// should be defaulted by the caller.\n        /// <para/>\n        /// When returned from <see cref=\"OpenSshConfig.lookup\"/> any wildcard\n        /// entries which appear later in the configuration file will have been\n        /// already merged into this block.\n        /// \n        /// </summary>\n        public class Host\n        {\n            public bool patternsApplied;\n            public string hostName;\n            public int port;\n            public FileInfo identityFile;\n            public string user;\n            public string preferredAuthentications;\n            public bool? batchMode;\n            public string strictHostKeyChecking;\n\n            public void copyFrom(Host src)\n            {\n                if (src == null)\n                    throw new ArgumentNullException(\"src\");\n\n                if (hostName == null)\n                    hostName = src.hostName;\n                if (port == 0)\n                    port = src.port;\n                if (identityFile == null)\n                    identityFile = src.identityFile;\n                if (user == null)\n                    user = src.user;\n                if (preferredAuthentications == null)\n                    preferredAuthentications = src.preferredAuthentications;\n                if (batchMode == null)\n                    batchMode = src.batchMode;\n                if (strictHostKeyChecking == null)\n                    strictHostKeyChecking = src.strictHostKeyChecking;\n            }\n\n            /// <returns>\n            /// the value StrictHostKeyChecking property, the valid values\n            /// are \"yes\" (unknown hosts are not accepted), \"no\" (unknown\n            /// hosts are always accepted), and \"ask\" (user should be asked\n            /// before accepting the host)\n            /// </returns>\n            public string getStrictHostKeyChecking()\n            {\n                return strictHostKeyChecking;\n            }\n\n            /// <returns>the real IP address or host name to connect to; never null.</returns>\n            public string getHostName()\n            {\n                return hostName;\n            }\n\n            /// <returns>the real port number to connect to; never 0.</returns>\n            public int getPort()\n            {\n                return port;\n            }\n\n            /// <returns>\n            /// path of the private key file to use for authentication; null\n            /// if the caller should use default authentication strategies.\n            /// </returns>\n            public FileInfo getIdentityFile()\n            {\n                return identityFile;\n            }\n\n            /// <returns>the real user name to connect as; never null.</returns>\n            public string getUser()\n            {\n                return user;\n            }\n\n            /// <returns>\n            /// the preferred authentication methods, separated by commas if\n            /// more than one authentication method is preferred.\n            /// </returns>\n            public string getPreferredAuthentications()\n            {\n                return preferredAuthentications;\n            }\n\n            /// <returns>\n            /// true if batch (non-interactive) mode is preferred for this\n            /// host connection.\n            /// </returns>\n            public bool isBatchMode()\n            {\n                return batchMode != null && batchMode.Value;\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/OperationResult.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Class holding result of operation on remote repository. This includes refs\n    /// advertised by remote repo and local tracking refs updates.\n    /// </summary>\n    public abstract class OperationResult\n    {\n        private IDictionary<string, Ref> _advertisedRefs = new Dictionary<string, Ref>();\n        private URIish _uri;\n        private readonly SortedDictionary<string, TrackingRefUpdate> _updates = new SortedDictionary<string, TrackingRefUpdate>();\n\n        /// <summary>\n        /// Get the URI this result came from.\n        /// <para/>\n        /// Each transport instance connects to at most one URI at any point in time.\n        /// <para/>\n        /// Returns the URI describing the location of the remote repository.\n        /// </summary>\n        public URIish URI\n        {\n            get\n            {\n                return _uri;\n            }\n        }\n\n        /// <summary>\n        /// Get the complete list of refs advertised by the remote.\n        /// <para/>\n        /// The returned refs may appear in any order. If the caller needs these to\n        /// be sorted, they should be copied into a new array or List and then sorted\n        /// by the caller as necessary.\n        /// <para/>\n        /// Returns available/advertised refs. Never null. Not modifiable. The\n        /// collection can be empty if the remote side has no refs (it is an\n        /// empty/newly created repository).\n        /// </summary>\n        public ICollection<Ref> AdvertisedRefs\n        {\n            get\n            {\n                return new ReadOnlyCollection<Ref>(_advertisedRefs.Values.ToList());\n            }\n        }\n\n        /// <summary>\n        /// Get a single advertised ref by name.\n        /// <para/>\n        /// The name supplied should be valid ref name. To get a peeled value for a\n        /// ref (aka <code>refs/tags/v1.0^{}</code>) use the base name (without\n        /// the <code>^{}</code> suffix) and look at the peeled object id.\n        /// </summary>\n        /// <param name=\"name\">name of the ref to obtain.</param>\n        /// <returns>the requested ref; null if the remote did not advertise this ref.</returns>\n        public Ref GetAdvertisedRef(string name)\n        {\n            return _advertisedRefs.get(name);\n        }\n\n        /// <summary>\n        /// Get the status of all local tracking refs that were updated.\n        /// </summary>\n        /// <returns>\n        /// unmodifiable collection of local updates. Never null. Empty if\n        /// there were no local tracking refs updated.\n        /// </returns>\n        public ICollection<TrackingRefUpdate> TrackingRefUpdates\n        {\n            get\n            {\n                return new ReadOnlyCollection<TrackingRefUpdate>(_updates.Values.ToList());\n            }\n        }\n\n        /// <summary>\n        /// Get the status for a specific local tracking ref update.\n        /// </summary>\n        /// <param name=\"localName\">name of the local ref (e.g. \"refs/remotes/origin/master\").</param>\n        /// <returns>\n        /// status of the local ref; null if this local ref was not touched\n        /// during this operation.\n        /// </returns>\n        public TrackingRefUpdate GetTrackingRefUpdate(string localName)\n        {\n            return _updates.get(localName);\n        }\n\n        public void SetAdvertisedRefs(URIish u, IDictionary<string, Ref> ar)\n        {\n            _uri = u;\n            _advertisedRefs = ar;\n        }\n\n        public void Add(TrackingRefUpdate u)\n        {\n            _updates.put(u.LocalName, u);\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/PackedObjectInfo.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Description of an object stored in a pack file, including offset.\n    /// <para>\n    /// When objects are stored in packs Git needs the ObjectId and the offset\n    /// (starting position of the object data) to perform random-access reads of\n    /// objects from the pack. This extension of ObjectId includes the offset.\n    /// </para>\n    /// </summary>\n    public class PackedObjectInfo : ObjectId\n    {\n        public PackedObjectInfo(long headerOffset, int packedCRC, AnyObjectId id)\n            : base(id)\n        {\n            Offset = headerOffset;\n            CRC = packedCRC;\n        }\n\n        /// <summary>\n        /// Create a new structure to remember information about an object.\n        /// </summary>\n        /// <param name=\"id\">\n        /// The identity of the object the new instance tracks.\n        /// </param>\n        public PackedObjectInfo(AnyObjectId id)\n            : base(id)\n        {\n        }\n\n        /// <summary>\n        /// offset in pack when object has been already written, or 0 if it\n        /// has not been written yet\n        /// </summary>\n        public long Offset { get; set; }\n\n        /// <summary>\n        /// the 32 bit CRC checksum for the packed data.\n        /// <para/>\n        /// checksum of all packed data (including object type code,\n        /// inflated length and delta base reference) as computed by\n        /// <see cref=\"Crc32\"/>\n        /// </summary>\n        public int CRC { get; set; }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/PacketLineIn.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    public class PacketLineIn\n    {\n        public static string END = string.Empty;\n\n        [Serializable]\n        public enum AckNackResult\n        {\n            /// <summary>\n            /// NAK\n            /// </summary>\n            NAK,\n\n            /// <summary>\n            /// ACK\n            /// </summary>\n            ACK,\n\n            /// <summary>\n            /// ACK + continue\n            /// </summary>\n            ACK_CONTINUE,\n\n            /// <summary>\n            /// ACK + common\n            /// </summary>\n            ACK_COMMON,\n\n            /// <summary>\n            /// ACK + ready\n            /// </summary>\n            ACK_READY\n        }\n\n        private readonly Stream ins;\n        private readonly byte[] lenbuffer;\n\n        public PacketLineIn(Stream i)\n        {\n            ins = i;\n            lenbuffer = new byte[4];\n        }\n\n        public AckNackResult readACK(MutableObjectId returnedId)\n        {\n            string line = ReadString();\n            if (line.Length == 0)\n                throw new PackProtocolException(\"Expected ACK/NAK, found EOF\");\n            if (\"NAK\".Equals(line))\n                return AckNackResult.NAK;\n            if (line.StartsWith(\"ACK \"))\n            {\n                returnedId.FromString(line.Slice(4, 44));\n\n                if (line.Length == 44)\n                    return AckNackResult.ACK;\n\n                string arg = line.Substring(44);\n                if (arg.Equals(\" continue\"))\n                    return AckNackResult.ACK_CONTINUE;\n                else if (arg.Equals(\" common\"))\n                    return AckNackResult.ACK_COMMON;\n                else if (arg.Equals(\" ready\"))\n                    return AckNackResult.ACK_READY;\n            }\n            throw new PackProtocolException(\"Expected ACK/NAK, got: \" + line);\n        }\n\n        public string ReadString()\n        {\n            int len = ReadLength();\n            if (len == 0)\n                return END;\n\n            len -= 4; // length header (4 bytes)\n\n            if (len == 0)\n                return string.Empty;\n\n            byte[] raw = new byte[len];\n\n            IO.ReadFully(ins, raw, 0, len);\n\n            if (raw[len - 1] == '\\n')\n                len--;\n            return RawParseUtils.decode(Constants.CHARSET, raw, 0, len);\n        }\n\n        public string ReadStringRaw()\n        {\n            int len = ReadLength();\n            if (len == 0)\n                return END;\n\n            len -= 4; // length header (4 bytes)\n\n            byte[] raw = new byte[len];\n\n            IO.ReadFully(ins, raw, 0, len);\n\n            return RawParseUtils.decode(Constants.CHARSET, raw, 0, len);\n        }\n\n        public int ReadLength()\n        {\n            IO.ReadFully(ins, lenbuffer, 0, 4);\n\n            try\n            {\n                int len = RawParseUtils.parseHexInt16(lenbuffer, 0);\n                if (len != 0 && len < 4)\n                    throw new IndexOutOfRangeException();\n                return len;\n            }\n            catch (IndexOutOfRangeException e)\n            {\n                throw new IOException(\"Invalid packet line header: \" + (char)lenbuffer[0] +\n                                      (char)lenbuffer[1] + (char)lenbuffer[2] + (char)lenbuffer[3], e);\n            }\n        }\n    }\n\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/PacketLineOut.cs",
    "content": "﻿/*\n * Copyright (C) 2008-2009, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008-2010, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core.Transport\n{\n\t/// <summary>\n\t/// Write Git style pkt-line formatting to an output stream.\n\t/// <para/>\n\t/// This class is not thread safe and may issue multiple writes to the underlying\n\t/// stream for each method call made.\n\t/// <para/>\n\t/// This class performs no buffering on its own. This makes it suitable to\n\t/// interleave writes performed by this class with writes performed directly\n\t/// against the underlying OutputStream.\n\t/// </summary>\n\tpublic class PacketLineOut\n\t{\n\t\tprivate readonly Stream _out;\n\t\tprivate readonly byte[] _lenbuffer;\n\n\t\t/// <summary>\n\t\t/// Create a new packet line writer.\n\t\t/// </summary>\n\t\t/// <param name=\"outputStream\">stream</param>\n\t\tpublic PacketLineOut(Stream outputStream)\n\t\t{\n\t\t\t_out = outputStream;\n\t\t\t_lenbuffer = new byte[5];\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Write a UTF-8 encoded string as a single length-delimited packet.\n\t\t/// </summary>\n\t\t/// <param name=\"s\">string to write.</param>\n\t\tpublic void WriteString(string s)\n\t\t{\n\t\t\tWritePacket(Constants.encode(s));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Write a binary packet to the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"packet\">\n\t\t/// the packet to write; the length of the packet is equal to the\n\t\t/// size of the byte array.\n\t\t/// </param>\n\t\tpublic void WritePacket(byte[] packet)\n\t\t{\n\t\t\tFormatLength(packet.Length + 4);\n\t\t\t_out.Write(_lenbuffer, 0, 4);\n\t\t\t_out.Write(packet, 0, packet.Length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Write a packet end marker, sometimes referred to as a flush command.\n\t\t/// <para/>\n\t\t/// Technically this is a magical packet type which can be detected\n\t\t/// separately from an empty string or an empty packet.\n\t\t/// <para/>\n\t\t/// Implicitly performs a flush on the underlying OutputStream to ensure the\n\t\t/// peer will receive all data written thus far.\n\t\t/// </summary>\n\t\tpublic void End()\n\t\t{\n\t\t\tFormatLength(0);\n\t\t\t_out.Write(_lenbuffer, 0, 4);\n\t\t\tFlush();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Flush the underlying OutputStream.\n\t\t/// <para/>\n\t\t/// Performs a flush on the underlying OutputStream to ensure the peer will\n\t\t/// receive all data written thus far.\n\t\t/// </summary>\n\t\tpublic void Flush()\n\t\t{\n\t\t\t_out.Flush();\n\t\t}\n\n\t\tprivate static readonly char[] hexchar = new[]\n                                                     {\n                                                         '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c',\n                                                         'd', 'e', 'f'\n                                                     };\n\n\t\tprivate void FormatLength(int w)\n\t\t{\n\t\t\tFormatLength(_lenbuffer, w);\n\t\t}\n\n\t\tpublic static void FormatLength(byte[] lenbuffer, int w)\n\t\t{\n\t\t\tint o = 3;\n\t\t\twhile (o >= 0 && w != 0)\n\t\t\t{\n\t\t\t\tlenbuffer[o--] = (byte)hexchar[w & 0xf];\n\t\t\t\tw = (int)(((uint)w) >> 4);\n\t\t\t}\n\t\t\twhile (o >= 0)\n\t\t\t\tlenbuffer[o--] = (byte)'0';\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/PushProcess.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Class performing push operation on remote repository.\n    /// </summary>\n    /// <seealso cref=\"Transport.push(ProgressMonitor, ICollection{RemoteRefUpdate})\"/>\n    public class PushProcess : IDisposable\n    {\n        /// <summary> Task name for <seealso cref=\"ProgressMonitor\"/> used during opening connection.  </summary>\n        internal const string PROGRESS_OPENING_CONNECTION = \"Opening connection\";\n\n        /// <summary> Transport used to perform this operation.  </summary>\n        private readonly Transport _transport;\n\n        /// <summary> Push operation connection created to perform this operation  </summary>\n        private IPushConnection _connection;\n\n        /// <summary> Refs to update on remote side.  </summary>\n        private readonly IDictionary<string, RemoteRefUpdate> _toPush;\n\n        /// <summary> Revision walker for checking some updates properties.  </summary>\n        private readonly RevWalk.RevWalk _walker;\n\n        /// <summary>\n        /// Create process for specified transport and refs updates specification.\n        /// </summary>\n        /// <param name=\"transport\">\n        /// transport between remote and local repository, used to Create\n        /// connection. </param>\n        /// <param name=\"toPush\">\n        /// specification of refs updates (and local tracking branches).\n        /// </param>\n        /// <exception cref=\"TransportException\"> </exception>\n        public PushProcess(Transport transport, IEnumerable<RemoteRefUpdate> toPush)\n        {\n            if (transport == null)\n                throw new ArgumentNullException(\"transport\");\n            if (toPush == null)\n                throw new ArgumentNullException(\"toPush\");\n\n            _walker = new RevWalk.RevWalk(transport.Local);\n            _transport = transport;\n            _toPush = new Dictionary<string, RemoteRefUpdate>();\n            foreach (RemoteRefUpdate rru in toPush)\n            {\n                if (_toPush.put(rru.RemoteName, rru) != null)\n                {\n                    throw new TransportException(\"Duplicate remote ref update is illegal. Affected remote name: \" + rru.RemoteName);\n                }\n            }\n        }\n\n        ///\t<summary>\n        /// Perform push operation between local and remote repository - set remote\n        /// refs appropriately, send needed objects and update local tracking refs.\n        /// <para />\n        /// When <seealso cref=\"Transport.DryRun\"/> is true, result of this operation is\n        /// just estimation of real operation result, no real action is performed.\n        /// </summary>\n        /// <param name=\"monitor\">\n        /// Progress monitor used for feedback about operation.\n        /// </param>\n        /// <returns> result of push operation with complete status description. </returns>\n        /// <exception cref=\"NotSupportedException\">\n        /// When push operation is not supported by provided transport.\n        /// </exception>\n        /// <exception cref=\"TransportException\">\n        /// When some error occurred during operation, like I/O, protocol\n        /// error, or local database consistency error.\n        /// </exception>\n        public PushResult execute(ProgressMonitor monitor)\n        {\n            if (monitor == null)\n                throw new ArgumentNullException(\"monitor\");\n\n            monitor.BeginTask(PROGRESS_OPENING_CONNECTION, ProgressMonitor.UNKNOWN);\n            _connection = _transport.openPush();\n\n            try\n            {\n                monitor.EndTask();\n\n                IDictionary<string, RemoteRefUpdate> preprocessed = PrepareRemoteUpdates();\n                if (_transport.DryRun)\n                {\n                    ModifyUpdatesForDryRun();\n                }\n                else if (preprocessed.Count != 0)\n                {\n                    _connection.Push(monitor, preprocessed);\n                }\n            }\n            finally\n            {\n                _connection.Close();\n            }\n\n            if (!_transport.DryRun)\n            {\n                UpdateTrackingRefs();\n            }\n\n            return PrepareOperationResult();\n        }\n\n        private IDictionary<string, RemoteRefUpdate> PrepareRemoteUpdates()\n        {\n            IDictionary<string, RemoteRefUpdate> result = new Dictionary<string, RemoteRefUpdate>();\n            foreach (RemoteRefUpdate rru in _toPush.Values)\n            {\n                Ref advertisedRef = _connection.GetRef(rru.RemoteName);\n                ObjectId advertisedOld = (advertisedRef == null ? ObjectId.ZeroId : advertisedRef.ObjectId);\n\n                if (rru.NewObjectId.Equals(advertisedOld))\n                {\n                    if (rru.IsDelete)\n                    {\n                        // ref does exist neither locally nor remotely\n                        rru.Status = RemoteRefUpdate.UpdateStatus.NON_EXISTING;\n                    }\n                    else\n                    {\n                        // same object - nothing to do\n                        rru.Status = RemoteRefUpdate.UpdateStatus.UP_TO_DATE;\n                    }\n                    continue;\n                }\n\n                // caller has explicitly specified expected old object id, while it\n                // has been changed in the mean time - reject\n                if (rru.IsExpectingOldObjectId && !rru.ExpectedOldObjectId.Equals(advertisedOld))\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.REJECTED_REMOTE_CHANGED;\n                    continue;\n                }\n\n                // Create ref (hasn't existed on remote side) and delete ref\n                // are always fast-forward commands, feasible at this level\n                if (advertisedOld.Equals(ObjectId.ZeroId) || rru.IsDelete)\n                {\n                    rru.FastForward = true;\n                    result.put(rru.RemoteName, rru);\n                    continue;\n                }\n\n                // check for fast-forward:\n                // - both old and new ref must point to commits, AND\n                // - both of them must be known for us, exist in repository, AND\n                // - old commit must be ancestor of new commit\n                bool fastForward = true;\n                try\n                {\n                    RevCommit oldRev = (_walker.parseAny(advertisedOld) as RevCommit);\n                    RevCommit newRev = (_walker.parseAny(rru.NewObjectId) as RevCommit);\n                    if (oldRev == null || newRev == null || !_walker.isMergedInto(oldRev, newRev))\n                        fastForward = false;\n                }\n                catch (MissingObjectException)\n                {\n                    fastForward = false;\n                }\n                catch (Exception x)\n                {\n                    throw new TransportException(_transport.Uri, \"reading objects from local repository failed: \" + x.Message, x);\n                }\n                rru.FastForward = fastForward;\n                if (!fastForward && !rru.ForceUpdate)\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD;\n                }\n                else\n                {\n                    result.put(rru.RemoteName, rru);\n                }\n            }\n            return result;\n        }\n\n        private void ModifyUpdatesForDryRun()\n        {\n            foreach (RemoteRefUpdate rru in _toPush.Values)\n            {\n                if (rru.Status == RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED)\n                {\n                    rru.Status = RemoteRefUpdate.UpdateStatus.OK;\n                }\n            }\n        }\n\n        private void UpdateTrackingRefs()\n        {\n            foreach (RemoteRefUpdate rru in _toPush.Values)\n            {\n                RemoteRefUpdate.UpdateStatus status = rru.Status;\n                if (rru.HasTrackingRefUpdate && (status == RemoteRefUpdate.UpdateStatus.UP_TO_DATE || status == RemoteRefUpdate.UpdateStatus.OK))\n                {\n                    // update local tracking branch only when there is a chance that\n                    // it has changed; this is possible for:\n                    // -updated (OK) status,\n                    // -up to date (UP_TO_DATE) status\n                    try\n                    {\n                        rru.updateTrackingRef(_walker);\n                    }\n                    catch (System.IO.IOException)\n                    {\n                        // ignore as RefUpdate has stored I/O error status\n                    }\n                }\n            }\n        }\n\n        private PushResult PrepareOperationResult()\n        {\n            var result = new PushResult();\n            result.SetAdvertisedRefs(_transport.Uri, _connection.RefsMap);\n            result.SetRemoteUpdates(_toPush);\n\n            foreach (RemoteRefUpdate rru in _toPush.Values)\n            {\n                TrackingRefUpdate tru = rru.TrackingRefUpdate;\n                if (tru != null)\n                {\n                    result.Add(tru);\n                }\n            }\n            return result;\n        }\n\n        public void Dispose()\n        {\n            _walker.Dispose();\n            _transport.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/PushResult.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Result of push operation to the remote repository. Holding information of\n    /// <see cref=\"OperationResult\"/> and remote refs updates status.\n    /// <para/>\n    /// see <see cref=\"Transport.push\"/>\n    /// </summary>\n    public class PushResult : OperationResult\n    {\n        private IDictionary<string, RemoteRefUpdate> _remoteUpdates = new Dictionary<string, RemoteRefUpdate>();\n\n        public ICollection<RemoteRefUpdate> RemoteUpdates\n        {\n            get { return new ReadOnlyCollection<RemoteRefUpdate>(_remoteUpdates.Values.ToList()); }\n        }\n\n        /// <summary>\n        /// Get status of specific remote ref update by remote ref name. Together\n        /// with <see cref=\"OperationResult.GetAdvertisedRef\"/> it provide full description/status\n        /// of this ref update.\n        /// </summary>\n        /// <param name=\"refName\">remote ref name</param>\n        /// <returns>status of remote ref update</returns>\n        public RemoteRefUpdate GetRemoteUpdate(string refName)\n        {\n            return _remoteUpdates.get(refName);\n        }\n\n        public void SetRemoteUpdates(IDictionary<string, RemoteRefUpdate> remoteUpdates)\n        {\n            _remoteUpdates = remoteUpdates;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/ReceiveCommand.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// A command being processed by <see cref=\"ReceivePack\"/>.\n    /// <para/>\n    /// This command instance roughly translates to the server side representation of\n    /// the <see cref=\"RemoteRefUpdate\"/> created by the client.\n    /// </summary>\n    public class ReceiveCommand\n    {\n        /// <summary>\n        /// Type of operation requested.\n        /// </summary>\n        [Serializable]\n        public enum Type\n        {\n            /// <summary>\n            /// Create a new ref; the ref must not already exist.\n            /// </summary>\n            CREATE,\n\n            /// <summary>\n            /// Update an existing ref with a fast-forward update.\n            /// <para/>\n            /// During a fast-forward update no changes will be lost; only new\n            /// commits are inserted into the ref.\n            /// </summary>\n            UPDATE,\n\n            /// <summary>\n            /// Update an existing ref by potentially discarding objects.\n            /// <para/>\n            /// The current value of the ref is not fully reachable from the new\n            /// value of the ref, so a successful command may result in one or more\n            /// objects becoming unreachable.\n            /// </summary>\n            UPDATE_NONFASTFORWARD,\n\n            /// <summary>\n            /// Delete an existing ref; the ref should already exist.\n            /// </summary>\n            DELETE\n        }\n\n        /// <summary>\n        /// Result of the update command.\n        /// </summary>\n        [Serializable]\n        public enum Result\n        {\n            /// <summary>\n            /// The command has not yet been attempted by the server.\n            /// </summary>\n            NOT_ATTEMPTED,\n\n            /// <summary>\n            /// The server is configured to deny creation of this ref.\n            /// </summary>\n            REJECTED_NOCREATE,\n\n            /// <summary>\n            /// The server is configured to deny deletion of this ref.\n            /// </summary>\n            REJECTED_NODELETE,\n\n            /// <summary>\n            /// The update is a non-fast-forward update and isn't permitted.\n            /// </summary>\n            REJECTED_NONFASTFORWARD,\n\n            /// <summary>\n            /// The update affects <code>HEAD</code> and cannot be permitted.\n            /// </summary>\n            REJECTED_CURRENT_BRANCH,\n\n            /// <summary>\n            /// One or more objects aren't in the repository.\n            /// <para/>\n            /// This is severe indication of either repository corruption on the\n            /// server side, or a bug in the client wherein the client did not supply\n            /// all required objects during the pack transfer.\n            /// </summary>\n            REJECTED_MISSING_OBJECT,\n\n            /// <summary>\n            /// Other failure; see <see cref=\"ReceiveCommand.getMessage\"/>.\n            /// </summary>\n            REJECTED_OTHER_REASON,\n\n            /// <summary>\n            /// The ref could not be locked and updated atomically; try again.\n            /// </summary>\n            LOCK_FAILURE,\n\n            /// <summary>\n            /// The change was completed successfully.\n            /// </summary>\n            OK\n        }\n\n        private readonly ObjectId _oldId;\n        private readonly ObjectId _newId;\n        private readonly string _name;\n        private Type _type;\n        private Ref _refc;\n        private Result _status;\n        private string _message;\n\n        /// <summary>\n        /// Create a new command for <see cref=\"ReceivePack\"/>.\n        /// </summary>\n        /// <param name=\"oldId\">\n        /// the old object id; must not be null. Use\n        /// <see cref=\"ObjectId.ZeroId\"/> to indicate a ref creation.\n        /// </param>\n        /// <param name=\"newId\">\n        /// the new object id; must not be null. Use\n        /// <see cref=\"ObjectId.ZeroId\"/> to indicate a ref deletion.\n        /// </param>\n        /// <param name=\"name\">name of the ref being affected.</param>\n        public ReceiveCommand(ObjectId oldId, ObjectId newId, string name)\n        {\n            _oldId = oldId;\n            _newId = newId;\n            _name = name;\n\n            _type = Type.UPDATE;\n            if (ObjectId.ZeroId.Equals(oldId))\n                _type = Type.CREATE;\n            if (ObjectId.ZeroId.Equals(newId))\n                _type = Type.DELETE;\n            _status = Result.NOT_ATTEMPTED;\n        }\n\n        /// <returns>the old value the client thinks the ref has.</returns>\n        public ObjectId getOldId()\n        {\n            return _oldId;\n        }\n\n        /// <returns>the requested new value for this ref.</returns>\n        public ObjectId getNewId()\n        {\n            return _newId;\n        }\n\n        /// <returns>the name of the ref being updated.</returns>\n        public string getRefName()\n        {\n            return _name;\n        }\n\n        /// <returns>the type of this command; see <see cref=\"Type\"/>.</returns>\n        public Type getType()\n        {\n            return _type;\n        }\n\n        /// <returns>the ref, if this was advertised by the connection.</returns>\n        public Ref getRef()\n        {\n            return _refc;\n        }\n\n        /// <returns>the current status code of this command.</returns>\n        public Result getResult()\n        {\n            return _status;\n        }\n\n        /// <returns>the message associated with a failure status.</returns>\n        public string getMessage()\n        {\n            return _message;\n        }\n\n        /// <summary>\n        /// Set the status of this command.\n        /// </summary>\n        /// <param name=\"s\">the new status code for this command.</param>\n        public void setResult(Result s)\n        {\n            setResult(s, null);\n        }\n\n        /// <summary>\n        /// Set the status of this command.\n        /// </summary>\n        /// <param name=\"s\">the new status code for this command.</param>\n        /// <param name=\"m\">optional message explaining the new status.</param>\n        public void setResult(Result s, string m)\n        {\n            _status = s;\n            _message = m;\n        }\n\n        public void setRef(Ref r)\n        {\n            _refc = r;\n        }\n\n        public void setType(Type t)\n        {\n            _type = t;\n        }\n\n        public override string ToString()\n        {\n            return Enum.GetName(typeof(Type), getType()) + \": \" + getOldId().Name + \" \" + getNewId().Name + \" \" + getRefName();\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/ReceivePack.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n\n\t/// <summary>\n\t/// Implements the server side of a push connection, receiving objects.\n\t/// </summary>\n\tpublic class ReceivePack : IDisposable\n\t{\n\n\t\t/// <summary>\n\t\t/// Database we write the stored objects into.\n\t\t/// </summary>\n\t\tprivate readonly Repository db;\n\n\t\t/// <summary>\n\t\t/// Revision traversal support over <see cref=\"db\"/>.\n\t\t/// </summary>\n\t\tprivate readonly RevWalk.RevWalk walk;\n\n\t\t/// <summary>\n\t\t/// Is the client connection a bi-directional socket or pipe?\n\t\t/// <para/>\n\t\t/// If true, this class assumes it can perform multiple read and write cycles\n\t\t/// with the client over the input and output streams. This matches the\n\t\t/// functionality available with a standard TCP/IP connection, or a local\n\t\t/// operating system or in-memory pipe.\n\t\t/// <para/>\n\t\t/// If false, this class runs in a read everything then output results mode,\n\t\t/// making it suitable for single round-trip systems RPCs such as HTTP.\n\t\t/// </summary>\n\t\tprivate bool biDirectionalPipe = true;\n\n\t\t/// <summary>\n\t\t/// Should an incoming transfer validate objects?\n\t\t/// </summary>\n\t\tprivate bool checkReceivedObjects;\n\n\t\t/// <summary>\n\t\t/// Should an incoming transfer permit create requests?\n\t\t/// </summary>\n\t\tprivate bool allowCreates;\n\n\t\t/// <summary>\n\t\t/// Should an incoming transfer permit delete requests?\n\t\t/// </summary>\n\t\tprivate bool allowDeletes;\n\n\t\t/// <summary>\n\t\t/// Should an incoming transfer permit non-fast-forward requests?\n\t\t/// </summary>\n\t\tprivate bool allowNonFastForwards;\n\n\t\tprivate bool allowOfsDelta;\n\n\t\t/// <summary>\n\t\t/// Identity to record action as within the reflog.\n\t\t/// </summary>\n\t\tprivate PersonIdent refLogIdent;\n\n\t\t/// <summary>\n\t\t/// Filter used while advertising the refs to the client.\n\t\t/// </summary>\n\t\tprivate RefFilter refFilter;\n\n\t\t/// <summary>\n\t\t/// Hook to validate the update commands before execution.\n\t\t/// </summary>\n\t\tprivate IPreReceiveHook preReceive;\n\n\t\t/// <summary>\n\t\t/// Hook to report on the commands after execution.\n\t\t/// </summary>\n\t\tprivate IPostReceiveHook postReceive;\n\n\t\tprivate Stream rawInput;\n\t\tprivate Stream rawOutput;\n\n\t\tprivate PacketLineIn pckIn;\n\t\tprivate PacketLineOut pckOut;\n\t\tprivate StreamWriter msgs;\n\n\t\tprivate IndexPack indexPack;\n\n\t\t/// <summary>\n\t\t/// The refs we advertised as existing at the start of the connection.\n\t\t/// </summary>\n\t\tprivate IDictionary<string, Ref> refs;\n\n\t\t/// <summary>\n\t\t/// Capabilities requested by the client.\n\t\t/// </summary>\n\t\tprivate List<string> enabledCapabilities;\n\n\t\t/// <summary>\n\t\t/// Commands to execute, as received by the client.\n\t\t/// </summary>\n\t\tprivate List<ReceiveCommand> commands;\n\n\t\t/// <summary>\n\t\t/// An exception caught while unpacking and fsck'ing the objects.\n\t\t/// </summary>\n\t\tprivate Exception unpackError;\n\n\t\t/// <summary>\n\t\t/// If <see cref=\"BasePackPushConnection.CAPABILITY_REPORT_STATUS\"/> is enabled./>\n\t\t/// </summary>\n\t\tprivate bool reportStatus;\n\n\t\t/// <summary>\n\t\t/// If <see cref=\"BasePackPushConnection.CAPABILITY_SIDE_BAND_64K\"/> is enabled./>\n\t\t/// </summary>\n\t\tprivate bool sideBand;\n\n\t\t/// <summary>\n\t\t/// Lock around the received pack file, while updating refs.\n\t\t/// </summary>\n\t\tprivate PackLock packLock;\n\n\t\tprivate bool needNewObjectIds;\n\n\t\tprivate bool needBaseObjectIds;\n\n\t\t/// <summary>\n\t\t/// Create a new pack receive for an open repository.\n\t\t/// </summary>\n\t\t/// <param name=\"into\">the destination repository.</param>\n\t\tpublic ReceivePack(Repository into)\n\t\t{\n\t\t\tdb = into;\n\t\t\twalk = new RevWalk.RevWalk(db);\n\n\t\t\tReceiveConfig cfg = db.Config.get(ReceiveConfig.KEY);\n\t\t\tcheckReceivedObjects = cfg._checkReceivedObjects;\n\t\t\tallowCreates = cfg._allowCreates;\n\t\t\tallowDeletes = cfg._allowDeletes;\n\t\t\tallowNonFastForwards = cfg._allowNonFastForwards;\n\t\t\tallowOfsDelta = cfg._allowOfsDelta;\n\t\t\trefFilter = RefFilterContants.DEFAULT;\n\t\t\tpreReceive = PreReceiveHook.NULL;\n\t\t\tpostReceive = PostReceiveHook.NULL;\n\t\t}\n\n\t\tprivate class ReceiveConfig\n\t\t{\n\t\t\tpublic static Config.SectionParser<ReceiveConfig> KEY = new SectionParser();\n\n\t\t\tprivate class SectionParser : Config.SectionParser<ReceiveConfig>\n\t\t\t{\n\t\t\t\tpublic ReceiveConfig parse(Config cfg)\n\t\t\t\t{\n\t\t\t\t\treturn new ReceiveConfig(cfg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic readonly bool _checkReceivedObjects;\n\t\t\tpublic readonly bool _allowCreates;\n\t\t\tpublic readonly bool _allowDeletes;\n\t\t\tpublic readonly bool _allowNonFastForwards;\n\t\t\tpublic readonly bool _allowOfsDelta;\n\n\t\t\tReceiveConfig(Config config)\n\t\t\t{\n\t\t\t\t_checkReceivedObjects = config.getBoolean(\"receive\", \"fsckobjects\",\n\t\t\t\t\t\t  false);\n\t\t\t\t_allowCreates = true;\n\t\t\t\t_allowDeletes = !config.getBoolean(\"receive\", \"denydeletes\", false);\n\t\t\t\t_allowNonFastForwards = !config.getBoolean(\"receive\",\n\t\t\t\t\t\t  \"denynonfastforwards\", false);\n\t\t\t\t_allowOfsDelta = config.getBoolean(\"repack\", \"usedeltabaseoffset\",\n\t\t\t\t\t\t  true);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the repository this receive completes into.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic Repository getRepository()\n\t\t{\n\t\t\treturn db;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the RevWalk instance used by this connection.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic RevWalk.RevWalk getRevWalk()\n\t\t{\n\t\t\treturn walk;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all refs which were advertised to the client.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic IDictionary<string, Ref> getAdvertisedRefs()\n\t\t{\n\t\t\treturn refs;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this receive pack instance to keep track of the objects assumed\n\t\t/// for delta bases.\n\t\t/// <para/>\n\t\t/// By default a receive pack doesn't save the objects that were used as\n\t\t/// delta bases. Setting this flag to {@code true} will allow the caller to\n\t\t/// use <see cref=\"getBaseObjectIds\"/> to retrieve that list.\n\t\t/// </summary>\n\t\t/// <param name=\"b\"> <code>true</code> to enable keeping track of delta bases.</param>\n\t\tpublic void setNeedBaseObjectIds(bool b)\n\t\t{\n\t\t\tthis.needBaseObjectIds = b;\n\t\t}\n\n\t\t///  <returns> the set of objects the incoming pack assumed for delta purposes</returns>\n\t\tpublic HashSet<ObjectId> getBaseObjectIds()\n\t\t{\n\t\t\treturn indexPack.getBaseObjectIds();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Configure this receive pack instance to keep track of new objects.\n\t\t/// <para/>\n\t\t/// By default a receive pack doesn't save the new objects that were created\n\t\t/// when it was instantiated. Setting this flag to {@code true} allows the\n\t\t/// caller to use {@link #getNewObjectIds()} to retrieve that list.\n\t\t/// </summary>\n\t\t/// <param name=\"b\"><code>true</code> to enable keeping track of new objects.</param> \n\t\tpublic void setNeedNewObjectIds(bool b)\n\t\t{\n\t\t\tthis.needNewObjectIds = b;\n\t\t}\n\n\n\t\t/// <returns>the new objects that were sent by the user</returns>  \n\t\tpublic HashSet<ObjectId> getNewObjectIds()\n\t\t{\n\t\t\treturn indexPack.getNewObjectIds();\n\t\t}\n\n\t\t/// <returns>\n\t\t/// true if this class expects a bi-directional pipe opened between\n\t\t/// the client and itself. The default is true.\n\t\t/// </returns>\n\t\tpublic bool isBiDirectionalPipe()\n\t\t{\n\t\t\treturn biDirectionalPipe;\n\t\t}\n\n\t\t/// <param name=\"twoWay\">\n\t\t/// if true, this class will assume the socket is a fully\n\t\t/// bidirectional pipe between the two peers and takes advantage\n\t\t/// of that by first transmitting the known refs, then waiting to\n\t\t/// read commands. If false, this class assumes it must read the\n\t\t/// commands before writing output and does not perform the\n\t\t/// initial advertising.\n\t\t/// </param>\n\t\tpublic void setBiDirectionalPipe(bool twoWay)\n\t\t{\n\t\t\tbiDirectionalPipe = twoWay;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if this instance will verify received objects are formatted correctly. \n\t\t/// Validating objects requires more CPU time on this side of the connection.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic bool isCheckReceivedObjects()\n\t\t{\n\t\t\treturn checkReceivedObjects;\n\t\t}\n\n\t\t/// <param name=\"check\">true to enable checking received objects; false to assume all received objects are valid.</param>\n\t\tpublic void setCheckReceivedObjects(bool check)\n\t\t{\n\t\t\tcheckReceivedObjects = check;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if the client can request refs to be created.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic bool isAllowCreates()\n\t\t{\n\t\t\treturn allowCreates;\n\t\t}\n\n\t\t/// <param name=\"canCreate\">true to permit create ref commands to be processed.</param>\n\t\tpublic void setAllowCreates(bool canCreate)\n\t\t{\n\t\t\tallowCreates = canCreate;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if the client can request refs to be deleted.\n\t\t/// </summary>\n\t\tpublic bool isAllowDeletes()\n\t\t{\n\t\t\treturn allowDeletes;\n\t\t}\n\n\t\t/// <param name=\"canDelete\">true to permit delete ref commands to be processed.</param>\n\t\tpublic void setAllowDeletes(bool canDelete)\n\t\t{\n\t\t\tallowDeletes = canDelete;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if the client can request non-fast-forward updates of a ref, possibly making objects unreachable.\n\t\t/// </summary>\n\t\tpublic bool isAllowNonFastForwards()\n\t\t{\n\t\t\treturn allowNonFastForwards;\n\t\t}\n\n\t\t/// <param name=\"canRewind\">true to permit the client to ask for non-fast-forward updates of an existing ref.</param>\n\t\tpublic void setAllowNonFastForwards(bool canRewind)\n\t\t{\n\t\t\tallowNonFastForwards = canRewind;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns identity of the user making the changes in the reflog.\n\t\t/// </summary>\n\t\tpublic PersonIdent getRefLogIdent()\n\t\t{\n\t\t\treturn refLogIdent;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the identity of the user appearing in the affected reflogs.\n\t\t/// <para>\n\t\t/// The timestamp portion of the identity is ignored. A new identity with the\n\t\t/// current timestamp will be created automatically when the updates occur\n\t\t/// and the log records are written.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <param name=\"pi\">identity of the user. If null the identity will be\n\t\t/// automatically determined based on the repository\n\t\t///configuration.</param>\n\t\tpublic void setRefLogIdent(PersonIdent pi)\n\t\t{\n\t\t\trefLogIdent = pi;\n\t\t}\n\n\t\t/// <returns>the filter used while advertising the refs to the client</returns>\n\t\tpublic RefFilter getRefFilter()\n\t\t{\n\t\t\treturn refFilter;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the filter used while advertising the refs to the client.\n\t\t/// <para/>\n\t\t/// Only refs allowed by this filter will be shown to the client.\n\t\t/// Clients may still attempt to create or update a reference hidden\n\t\t/// by the configured <see cref=\"RefFilter\"/>. These attempts should be\n\t\t/// rejected by a matching <see cref=\"PreReceiveHook\"/>.\n\t\t/// </summary>\n\t\t/// <param name=\"refFilter\">the filter; may be null to show all refs.</param>\n\t\tpublic void setRefFilter(RefFilter refFilter)\n\t\t{\n\t\t\tthis.refFilter = refFilter ?? RefFilterContants.DEFAULT;\n\t\t}\n\n\t\t/// <returns>the hook invoked before updates occur.</returns>\n\t\tpublic IPreReceiveHook getPreReceiveHook()\n\t\t{\n\t\t\treturn preReceive;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set the hook which is invoked prior to commands being executed.\n\t\t/// <para>\n\t\t/// Only valid commands (those which have no obvious errors according to the\n\t\t/// received input and this instance's configuration) are passed into the\n\t\t/// hook. The hook may mark a command with a result of any value other than\n\t\t/// <see cref=\"ReceiveCommand.Result.NOT_ATTEMPTED\"/> to block its execution.\n\t\t/// </para><para>\n\t\t/// The hook may be called with an empty command collection if the current\n\t\t/// set is completely invalid.</para>\n\t\t/// </summary>\n\t\t/// <param name=\"h\">the hook instance; may be null to disable the hook.</param>\n\t\tpublic void setPreReceiveHook(IPreReceiveHook h)\n\t\t{\n\t\t\tpreReceive = h ?? PreReceiveHook.NULL;\n\t\t}\n\n\t\t/// <returns>the hook invoked after updates occur.</returns>\n\t\tpublic IPostReceiveHook getPostReceiveHook()\n\t\t{\n\t\t\treturn postReceive;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// <para>\n\t\t/// Only successful commands (type is <see cref=\"ReceiveCommand.Result.OK\"/>) are passed into the\n\t\t/// Set the hook which is invoked after commands are executed.\n\t\t/// hook. The hook may be called with an empty command collection if the\n\t\t/// current set all resulted in an error.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <param name=\"h\">the hook instance; may be null to disable the hook.</param>\n\t\tpublic void setPostReceiveHook(IPostReceiveHook h)\n\t\t{\n\t\t\tpostReceive = h ?? PostReceiveHook.NULL;\n\t\t}\n\n\t\t/// <returns>all of the command received by the current request.</returns>\n\t\tpublic IList<ReceiveCommand> getAllCommands()\n\t\t{\n\t\t\treturn commands.AsReadOnly();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Send an error message to the client, if it supports receiving them.\n\t\t/// <para>\n\t\t/// If the client doesn't support receiving messages, the message will be\n\t\t/// discarded, with no other indication to the caller or to the client.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// <see cref=\"PreReceiveHook\"/>s should always try to use\n\t\t/// <see cref=\"ReceiveCommand.setResult(GitSharp.Core.Transport.ReceiveCommand.Result,string)\"/> with a result status of\n\t\t/// <see cref=\"ReceiveCommand.Result.REJECTED_OTHER_REASON\"/> to indicate any reasons for\n\t\t/// rejecting an update. Messages attached to a command are much more likely\n\t\t/// to be returned to the client.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <param name=\"what\">string describing the problem identified by the hook. The string must not end with an LF, and must not contain an LF.</param>\n\t\tpublic void sendError(string what)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (msgs != null)\n\t\t\t\t\tmsgs.Write(\"error: \" + what + \"\\n\");\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\t// Ignore write failures.\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Send a message to the client, if it supports receiving them.\n\t\t/// <para>\n\t\t/// If the client doesn't support receiving messages, the message will be\n\t\t/// discarded, with no other indication to the caller or to the client.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <param name=\"what\">string describing the problem identified by the hook. The string must not end with an LF, and must not contain an LF.</param>\n\t\tpublic void sendMessage(string what)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (msgs != null)\n\t\t\t\t\tmsgs.Write(what + \"\\n\");\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\t// Ignore write failures.\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Execute the receive task on the socket.\n\t\t/// </summary>\n\t\t/// <param name=\"input\">Raw input to read client commands and pack data from. Caller must ensure the input is buffered, otherwise read performance may suffer. Response back to the Git network client. Caller must ensure the output is buffered, otherwise write performance may suffer.</param>\n\t\t/// <param name=\"messages\">Secondary \"notice\" channel to send additional messages out through. When run over SSH this should be tied back to the standard error channel of the command execution. For most other network connections this should be null.</param>\n\t\tpublic void receive(Stream input, Stream output, Stream messages)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\trawInput = input;\n\t\t\t\trawOutput = output;\n\n\t\t\t\tpckIn = new PacketLineIn(rawInput);\n\t\t\t\tpckOut = new PacketLineOut(rawOutput);\n\n\t\t\t\t// TODO: [henon] port jgit's timeout behavior which is obviously missing here\n\n\t\t\t\tif (messages != null)\n\t\t\t\t\tmsgs = new StreamWriter(messages, Constants.CHARSET);\n\n\t\t\t\tenabledCapabilities = new List<string>();\n\t\t\t\tcommands = new List<ReceiveCommand>();\n\n\t\t\t\tService();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (pckOut != null)\n\t\t\t\t\t\tpckOut.Flush();\n\t\t\t\t\tif (msgs != null)\n\t\t\t\t\t\tmsgs.Flush();\n\t\t\t\t\tif (sideBand)\n\t\t\t\t\t\t\t\t\t\t\t// If we are using side band, we need to send a final\n\t\t\t\t\t\t\t\t\t\t\t// flush-pkt to tell the remote peer the side band is\n\t\t\t\t\t\t\t\t\t\t\t// complete and it should stop decoding. We need to\n\t\t\t\t\t\t\t\t\t\t\t// use the original output stream as rawOut is now the\n\t\t\t\t\t\t\t\t\t\t\t// side band data channel.\n\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\tnew PacketLineOut(output).End();\n\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\t// TODO : [nulltoken] Aren't we missing some Dispose() love, here ?\n\t\t\t\t\tUnlockPack();\n\t\t\t\t\trawInput = null;\n\t\t\t\t\trawOutput = null;\n\t\t\t\t\tpckIn = null;\n\t\t\t\t\tpckOut = null;\n\t\t\t\t\tmsgs = null;\n\t\t\t\t\trefs = null;\n\t\t\t\t\tenabledCapabilities = null;\n\t\t\t\t\tcommands = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void Service()\n\t\t{\n\t\t\tif (biDirectionalPipe)\n\t\t\t\tSendAdvertisedRefs(new RefAdvertiser.PacketLineOutRefAdvertiser(pckOut));\n\t\t\telse\n\t\t\t\trefs = refFilter.filter(db.getAllRefs());\n\n\t\t\tRecvCommands();\n\t\t\tif (commands.isEmpty()) return;\n\t\t\tEnableCapabilities();\n\n\t\t\tif (NeedPack())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treceivePack();\n\t\t\t\t\tif (isCheckReceivedObjects())\n\t\t\t\t\t{\n\t\t\t\t\t\tCheckConnectivity();\n\t\t\t\t\t}\n\t\t\t\t\tunpackError = null;\n\t\t\t\t}\n\t\t\t\tcatch (IOException err)\n\t\t\t\t{\n\t\t\t\t\tunpackError = err;\n\t\t\t\t}\n\t\t\t\tcatch (Exception err)\n\t\t\t\t{\n\t\t\t\t\tunpackError = err;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unpackError == null)\n\t\t\t{\n\t\t\t\tValidateCommands();\n\t\t\t\tExecuteCommands();\n\t\t\t}\n\t\t\tUnlockPack();\n\n\t\t\tif (reportStatus)\n\t\t\t{\n\t\t\t\tSendStatusReport(true, new ServiceReporter(pckOut));\n\t\t\t\tpckOut.End();\n\t\t\t}\n\t\t\telse if (msgs != null)\n\t\t\t{\n\t\t\t\tSendStatusReport(false, new MessagesReporter(msgs.BaseStream));\n\t\t\t}\n\n\t\t\tpostReceive.OnPostReceive(this, FilterCommands(ReceiveCommand.Result.OK));\n\t\t}\n\n\t\tprivate void UnlockPack()\n\t\t{\n\t\t\tif (packLock != null)\n\t\t\t{\n\t\t\t\tpackLock.Unlock();\n\t\t\t\tpackLock = null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generate an advertisement of available refs and capabilities.\n\t\t/// </summary>\n\t\t/// <param name=\"adv\">the advertisement formatter.</param>\n\t\tpublic void SendAdvertisedRefs(RefAdvertiser adv)\n\t\t{\n\t\t\tRevFlag advertised = walk.newFlag(\"ADVERTISED\");\n\t\t\tadv.init(walk, advertised);\n\t\t\tadv.advertiseCapability(BasePackPushConnection.CAPABILITY_SIDE_BAND_64K);\n\t\t\tadv.advertiseCapability(BasePackPushConnection.CAPABILITY_DELETE_REFS);\n\t\t\tadv.advertiseCapability(BasePackPushConnection.CAPABILITY_REPORT_STATUS);\n\t\t\tif (allowOfsDelta)\n\t\t\t\tadv.advertiseCapability(BasePackPushConnection.CAPABILITY_OFS_DELTA);\n\t\t\trefs = refFilter.filter(db.getAllRefs());\n\t\t\tRef head = refs.remove(Constants.HEAD);\n\t\t\tadv.send(refs);\n\t\t\tif (head != null && !head.isSymbolic())\n\t\t\t\tadv.advertiseHave(head.ObjectId);\n\t\t\tadv.includeAdditionalHaves();\n\t\t\tif (adv.isEmpty())\n\t\t\t\tadv.advertiseId(ObjectId.ZeroId, \"capabilities^{}\");\n\t\t\tadv.end();\n\t\t}\n\n\n\t\tprivate void RecvCommands()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tstring line;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tline = pckIn.ReadStringRaw();\n\t\t\t\t}\n\t\t\t\tcatch (EndOfStreamException)\n\t\t\t\t{\n\t\t\t\t\tif (commands.isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\n\t\t\t\tif (line == PacketLineIn.END)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (commands.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tint nul = line.IndexOf('\\0');\n\t\t\t\t\tif (nul >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (string c in line.Substring(nul + 1).Split(' '))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tenabledCapabilities.Add(c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tline = line.Slice(0, nul);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (line.Length < 83)\n\t\t\t\t{\n\t\t\t\t\tstring m = \"error: invalid protocol: wanted 'old new ref'\";\n\t\t\t\t\tsendError(m);\n\t\t\t\t\tthrow new PackProtocolException(m);\n\t\t\t\t}\n\n\t\t\t\tObjectId oldId = ObjectId.FromString(line.Slice(0, 40));\n\t\t\t\tObjectId newId = ObjectId.FromString(line.Slice(41, 81));\n\t\t\t\tstring name = line.Substring(82);\n\t\t\t\tvar cmd = new ReceiveCommand(oldId, newId, name);\n\n\t\t\t\tif (name.Equals(Constants.HEAD))\n\t\t\t\t{\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_CURRENT_BRANCH);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcmd.setRef(refs.get(cmd.getRefName()));\n\t\t\t\t}\n\n\t\t\t\tcommands.Add(cmd);\n\t\t\t}\n\t\t}\n\n\t\tprivate void EnableCapabilities()\n\t\t{\n\t\t\treportStatus = enabledCapabilities.Contains(BasePackPushConnection.CAPABILITY_REPORT_STATUS);\n\n\t\t\tsideBand = enabledCapabilities.Contains(BasePackPushConnection.CAPABILITY_SIDE_BAND_64K);\n\t\t\tif (sideBand)\n\t\t\t{\n\t\t\t\tStream @out = rawOutput;\n\n\t\t\t\trawOutput = new SideBandOutputStream(SideBandOutputStream.CH_DATA, SideBandOutputStream.MAX_BUF, @out);\n\t\t\t\tpckOut = new PacketLineOut(rawOutput);\n\t\t\t\tmsgs = new StreamWriter(new SideBandOutputStream(SideBandOutputStream.CH_PROGRESS,\n\t\t\t\t\tSideBandOutputStream.MAX_BUF, @out), Constants.CHARSET);\n\t\t\t}\n\t\t}\n\n\t\tprivate bool NeedPack()\n\t\t{\n\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t{\n\t\t\t\tif (cmd.getType() != ReceiveCommand.Type.DELETE) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate void receivePack()\n\t\t{\n\t\t\tindexPack = IndexPack.Create(db, rawInput);\n\t\t\tindexPack.setFixThin(true);\n\t\t\tindexPack.setNeedNewObjectIds(needNewObjectIds);\n\t\t\tindexPack.setNeedBaseObjectIds(needBaseObjectIds);\n\t\t\tindexPack.setObjectChecking(isCheckReceivedObjects());\n\t\t\tindexPack.index(NullProgressMonitor.Instance);\n\n\t\t\t//  TODO: [caytchen] reflect gitsharp\n\t\t\tstring lockMsg = \"jgit receive-pack\";\n\t\t\tif (getRefLogIdent() != null)\n\t\t\t\tlockMsg += \" from \" + getRefLogIdent().ToExternalString();\n\t\t\tpackLock = indexPack.renameAndOpenPack(lockMsg);\n\t\t}\n\n\t\tprivate void CheckConnectivity()\n\t\t{\n\t\t\tusing (var ow = new ObjectWalk(db))\n\t\t\t{\n\t\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t\t{\n\t\t\t\t\tif (cmd.getResult() != ReceiveCommand.Result.NOT_ATTEMPTED) continue;\n\t\t\t\t\tif (cmd.getType() == ReceiveCommand.Type.DELETE) continue;\n\t\t\t\t\tow.markStart(ow.parseAny(cmd.getNewId()));\n\t\t\t\t}\n\t\t\t\tforeach (Ref @ref in refs.Values)\n\t\t\t\t{\n\t\t\t\t\tow.markUninteresting(ow.parseAny(@ref.ObjectId));\n\t\t\t\t}\n\t\t\t\tow.checkConnectivity();\n\t\t\t}\n\t\t}\n\n\t\tprivate void ValidateCommands()\n\t\t{\n\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t{\n\t\t\t\tRef @ref = cmd.getRef();\n\t\t\t\tif (cmd.getResult() != ReceiveCommand.Result.NOT_ATTEMPTED)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (cmd.getType() == ReceiveCommand.Type.DELETE && !isAllowDeletes())\n\t\t\t\t{\n\t\t\t\t\t// Deletes are not supported on this repository.\n\t\t\t\t\t//\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_NODELETE);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (cmd.getType() == ReceiveCommand.Type.CREATE)\n\t\t\t\t{\n\t\t\t\t\tif (!isAllowCreates())\n\t\t\t\t\t{\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_NOCREATE);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (@ref != null && !isAllowNonFastForwards())\n\t\t\t\t\t{\n\t\t\t\t\t\t// Creation over an existing ref is certainly not going\n\t\t\t\t\t\t// to be a fast-forward update. We can reject it early.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_NONFASTFORWARD);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (@ref != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// A well behaved client shouldn't have sent us a\n\t\t\t\t\t\t// create command for a ref we advertised to it.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"ref exists\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cmd.getType() == ReceiveCommand.Type.DELETE && @ref != null && !ObjectId.ZeroId.Equals(cmd.getOldId()) && !@ref.ObjectId.Equals(cmd.getOldId()))\n\t\t\t\t{\n\t\t\t\t\t// Delete commands can be sent with the old id matching our\n\t\t\t\t\t// advertised value, *OR* with the old id being 0{40}. Any\n\t\t\t\t\t// other requested old id is invalid.\n\t\t\t\t\t//\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"invalid old id sent\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (cmd.getType() == ReceiveCommand.Type.UPDATE)\n\t\t\t\t{\n\t\t\t\t\tif (@ref == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// The ref must have been advertised in order to be updated.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"no such ref\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!@ref.ObjectId.Equals(cmd.getOldId()))\n\t\t\t\t\t{\n\t\t\t\t\t\t// A properly functioning client will send the same\n\t\t\t\t\t\t// object id we advertised.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"invalid old id sent\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Is this possibly a non-fast-forward style update?\n\t\t\t\t\t//\n\t\t\t\t\tRevObject oldObj, newObj;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\toldObj = walk.parseAny(cmd.getOldId());\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_MISSING_OBJECT, cmd.getOldId().Name);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tnewObj = walk.parseAny(cmd.getNewId());\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_MISSING_OBJECT, cmd.getNewId().Name);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar oldComm = (oldObj as RevCommit);\n\t\t\t\t\tvar newComm = (newObj as RevCommit);\n\t\t\t\t\tif (oldComm != null && newComm != null)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!walk.isMergedInto(oldComm, newComm))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcmd.setType(ReceiveCommand.Type.UPDATE_NONFASTFORWARD);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (MissingObjectException e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_MISSING_OBJECT, e.Message);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcmd.setType(ReceiveCommand.Type.UPDATE_NONFASTFORWARD);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!cmd.getRefName().StartsWith(Constants.R_REFS) || !Repository.IsValidRefName(cmd.getRefName()))\n\t\t\t\t{\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"funny refname\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void ExecuteCommands()\n\t\t{\n\t\t\tpreReceive.onPreReceive(this, FilterCommands(ReceiveCommand.Result.NOT_ATTEMPTED));\n\t\t\tforeach (ReceiveCommand cmd in FilterCommands(ReceiveCommand.Result.NOT_ATTEMPTED))\n\t\t\t{\n\t\t\t\tExecute(cmd);\n\t\t\t}\n\t\t}\n\n\t\tprivate void Execute(ReceiveCommand cmd)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tRefUpdate ru = db.UpdateRef(cmd.getRefName());\n\t\t\t\tru.setRefLogIdent(getRefLogIdent());\n\t\t\t\tswitch (cmd.getType())\n\t\t\t\t{\n\t\t\t\t\tcase ReceiveCommand.Type.DELETE:\n\t\t\t\t\t\tif (!ObjectId.ZeroId.Equals(cmd.getOldId()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// We can only do a CAS style delete if the client\n\t\t\t\t\t\t\t// didn't bork its delete request by sending the\n\t\t\t\t\t\t\t// wrong zero id rather than the advertised one.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tru.setExpectedOldObjectId(cmd.getOldId());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tru.setForceUpdate(true);\n\t\t\t\t\t\tStatus(cmd, ru.delete(walk));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Type.CREATE:\n\t\t\t\t\tcase ReceiveCommand.Type.UPDATE:\n\t\t\t\t\tcase ReceiveCommand.Type.UPDATE_NONFASTFORWARD:\n\t\t\t\t\t\tru.setForceUpdate(isAllowNonFastForwards());\n\t\t\t\t\t\tru.setExpectedOldObjectId(cmd.getOldId());\n\t\t\t\t\t\tru.setNewObjectId(cmd.getNewId());\n\t\t\t\t\t\tru.setRefLogMessage(\"push\", true);\n\t\t\t\t\t\tStatus(cmd, ru.update(walk));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException err)\n\t\t\t{\n\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, \"lock error: \" + err.Message);\n\t\t\t}\n\t\t}\n\n\n\t\tprivate static void Status(ReceiveCommand cmd, RefUpdate.RefUpdateResult result)\n\t\t{\n\t\t\tswitch (result)\n\t\t\t{\n\t\t\t\tcase RefUpdate.RefUpdateResult.NOT_ATTEMPTED:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.NOT_ATTEMPTED);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase RefUpdate.RefUpdateResult.LOCK_FAILURE:\n\t\t\t\tcase RefUpdate.RefUpdateResult.IO_FAILURE:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.LOCK_FAILURE);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase RefUpdate.RefUpdateResult.NO_CHANGE:\n\t\t\t\tcase RefUpdate.RefUpdateResult.NEW:\n\t\t\t\tcase RefUpdate.RefUpdateResult.FORCED:\n\t\t\t\tcase RefUpdate.RefUpdateResult.FAST_FORWARD:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.OK);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase RefUpdate.RefUpdateResult.REJECTED:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_NONFASTFORWARD);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase RefUpdate.RefUpdateResult.REJECTED_CURRENT_BRANCH:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_CURRENT_BRANCH);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcmd.setResult(ReceiveCommand.Result.REJECTED_OTHER_REASON, Enum.GetName(typeof(RefUpdate.RefUpdateResult), result));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprivate List<ReceiveCommand> FilterCommands(ReceiveCommand.Result want)\n\t\t{\n\t\t\tvar r = new List<ReceiveCommand>(commands.Count);\n\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t{\n\t\t\t\tif (cmd.getResult() == want)\n\t\t\t\t\tr.Add(cmd);\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\tprivate void SendStatusReport(bool forClient, Reporter rout)\n\t\t{\n\t\t\tif (unpackError != null)\n\t\t\t{\n\t\t\t\trout.SendString(\"unpack error \" + unpackError.Message);\n\t\t\t\tif (forClient)\n\t\t\t\t{\n\t\t\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t\t\t{\n\t\t\t\t\t\trout.SendString(\"ng \" + cmd.getRefName() + \" n/a (unpacker error)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (forClient)\n\t\t\t{\n\t\t\t\trout.SendString(\"unpack ok\");\n\t\t\t}\n\t\t\tforeach (ReceiveCommand cmd in commands)\n\t\t\t{\n\t\t\t\tif (cmd.getResult() == ReceiveCommand.Result.OK)\n\t\t\t\t{\n\t\t\t\t\tif (forClient)\n\t\t\t\t\t\trout.SendString(\"ok \" + cmd.getRefName());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar r = new StringBuilder();\n\t\t\t\tr.Append(\"ng \");\n\t\t\t\tr.Append(cmd.getRefName());\n\t\t\t\tr.Append(\" \");\n\n\t\t\t\tswitch (cmd.getResult())\n\t\t\t\t{\n\t\t\t\t\tcase ReceiveCommand.Result.NOT_ATTEMPTED:\n\t\t\t\t\t\tr.Append(\"server bug; ref not processed\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_NOCREATE:\n\t\t\t\t\t\tr.Append(\"creation prohibited\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_NODELETE:\n\t\t\t\t\t\tr.Append(\"deletion prohibited\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_NONFASTFORWARD:\n\t\t\t\t\t\tr.Append(\"non-fast forward\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_CURRENT_BRANCH:\n\t\t\t\t\t\tr.Append(\"branch is currently checked out\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_MISSING_OBJECT:\n\t\t\t\t\t\tif (cmd.getMessage() == null)\n\t\t\t\t\t\t\tr.Append(\"missing object(s)\");\n\t\t\t\t\t\telse if (cmd.getMessage().Length == Constants.OBJECT_ID_STRING_LENGTH)\n\t\t\t\t\t\t\tr.Append(\"object \" + cmd.getMessage() + \" missing\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tr.Append(cmd.getMessage());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.REJECTED_OTHER_REASON:\n\t\t\t\t\t\tif (cmd.getMessage() == null)\n\t\t\t\t\t\t\tr.Append(\"unspecified reason\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tr.Append(cmd.getMessage());\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.LOCK_FAILURE:\n\t\t\t\t\t\tr.Append(\"failed to lock\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ReceiveCommand.Result.OK:\n\t\t\t\t\t\t// We shouldn't have reached this case (see 'ok' case above).\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\trout.SendString(r.ToString());\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\twalk.Dispose();\n\t\t\trawInput.Dispose();\n\t\t\trawOutput.Dispose();\n\t\t\tmsgs.Dispose();\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate abstract class Reporter\n\t\t{\n\t\t\tpublic abstract void SendString(string s);\n\t\t}\n\n\t\tprivate class ServiceReporter : Reporter\n\t\t{\n\t\t\tprivate readonly PacketLineOut _pckOut;\n\n\t\t\tpublic ServiceReporter(PacketLineOut pck)\n\t\t\t{\n\t\t\t\t_pckOut = pck;\n\t\t\t}\n\n\t\t\tpublic override void SendString(string s)\n\t\t\t{\n\t\t\t\t_pckOut.WriteString(s + \"\\n\");\n\t\t\t}\n\t\t}\n\n\t\tprivate class MessagesReporter : Reporter\n\t\t{\n\t\t\tprivate readonly Stream _stream;\n\n\t\t\tpublic MessagesReporter(Stream ms)\n\t\t\t{\n\t\t\t\t_stream = ms;\n\t\t\t}\n\n\t\t\tpublic override void SendString(string s)\n\t\t\t{\n\t\t\t\tbyte[] data = Constants.encode(s+\"\\n\");\n\t\t\t\t_stream.Write(data, 0, data.Length); \n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Transport/RefAdvertiser.cs",
    "content": "/*\n * Copyright (C) 2008, 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Support for the start of <see cref=\"UploadPack\"/> and <see cref=\"ReceivePack\"/>.\n    /// </summary>\n    public abstract class RefAdvertiser : IDisposable\n    {\n        /// <summary>\n        /// Advertiser which frames lines in a {@link PacketLineOut} format.\n        /// </summary>\n        public class PacketLineOutRefAdvertiser : RefAdvertiser\n        {\n            private PacketLineOut pckOut;\n\n            /// <summary>\n            /// Create a new advertiser for the supplied stream.\n            /// </summary>\n            /// <param name=\"out\">the output stream.</param>\n            public PacketLineOutRefAdvertiser(PacketLineOut @out)\n            {\n                pckOut = @out;\n            }\n\n            protected override void writeOne(string line)\n            {\n                pckOut.WriteString(line.ToString());\n            }\n\n            public override void end()\n            {\n                pckOut.End();\n            }\n        }\n        private RevWalk.RevWalk _walk;\n        private RevFlag ADVERTISED;\n        private readonly StringBuilder _tmpLine = new StringBuilder(100);\n        private readonly char[] _tmpId = new char[Constants.OBJECT_ID_STRING_LENGTH];\n        private readonly List<string> _capabilities = new List<string>();\n        private bool _derefTags;\n        private bool _first = true;\n\n        /// <summary>\n        /// Initialize a new advertisement formatter.\n        /// </summary>\n        /// <param name=\"protoWalk\">the RevWalk used to parse objects that are advertised.</param>\n        /// <param name=\"advertisedFlag\">\n        /// flag marked on any advertised objects parsed out of the\n        /// <paramref name=\"protoWalk\"/>'s object pool, permitting the caller to\n        /// later quickly determine if an object was advertised (or not).\n        /// </param>\n        public void init(RevWalk.RevWalk protoWalk, RevFlag advertisedFlag)\n        {\n            _walk = protoWalk;\n            ADVERTISED = advertisedFlag;\n        }\n\n        /// <summary>\n        /// Toggle tag peeling.\n        /// <para/>\n        /// This method must be invoked prior to any of the following:\n        /// <see cref=\"send\"/>, <see cref=\"advertiseHave\"/>, <see cref=\"includeAdditionalHaves\"/>.\n        /// </summary>\n        /// <param name=\"deref\">\n        /// true to show the dereferenced value of a tag as the special\n        /// ref <code>$tag^{}</code> ; false to omit it from the output.\n        /// </param>\n        public void setDerefTags(bool deref)\n        {\n            _derefTags = deref;\n        }\n\n        /// <summary>\n        /// Add one protocol capability to the initial advertisement.\n        /// <para/>\n        /// This method must be invoked prior to any of the following:\n        /// <see cref=\"send\"/>, <see cref=\"advertiseHave\"/>, <see cref=\"includeAdditionalHaves\"/>.\n        /// </summary>\n        /// <param name=\"name\">\n        /// the name of a single protocol capability supported by the\n        /// caller. The set of capabilities are sent to the client in the\n        /// advertisement, allowing the client to later selectively enable\n        /// features it recognizes.\n        /// </param>\n        public void advertiseCapability(string name)\n        {\n            _capabilities.Add(name);\n        }\n\n        /// <summary>\n        /// Format an advertisement for the supplied refs.\n        /// </summary>\n        /// <param name=\"refs\">\n        /// zero or more refs to format for the client. The collection is\n        /// sorted before display if necessary, and therefore may appear\n        /// in any order.\n        /// </param>\n        public void send(IDictionary<string, Ref> refs)\n        {\n            foreach (Ref r in getSortedRefs(refs))\n            {\n                RevObject obj = parseAnyOrNull(r.ObjectId);\n                if (obj != null)\n                {\n                    advertiseAny(obj, r.Name);\n                    RevTag rt = (obj as RevTag);\n                    if (_derefTags && rt != null)\n                    {\n                        advertiseTag(rt, r.Name + \"^{}\");\n                    }\n                }\n            }\n        }\n\n        private IEnumerable<Ref> getSortedRefs(IDictionary<string, Ref> all)\n        {\n            if (all is RefMap\n                    || (all is SortedDictionary<string, Ref>))\n                return all.Values;\n            return RefComparator.Sort(all.Values);\n        }\n        \n        /// <summary>\n        /// Advertise one object is available using the magic <code>.have</code>.\n        /// <para/>\n        /// The magic <code>.have</code> advertisement is not available for fetching by a\n        /// client, but can be used by a client when considering a delta base\n        /// candidate before transferring data in a push. Within the record created\n        /// by this method the ref name is simply the invalid string <code>.have</code>.\n        /// </summary>\n        /// <param name=\"id\">\n        /// identity of the object that is assumed to exist.\n        /// </param>\n        public void advertiseHave(AnyObjectId id)\n        {\n            RevObject obj = parseAnyOrNull(id);\n            if (obj != null)\n            {\n                advertiseAnyOnce(obj, \".have\");\n            }\n\n            RevTag rt = (obj as RevTag);\n            if (rt != null)\n            {\n                advertiseAnyOnce(rt.getObject(), \".have\");\n            }\n        }\n\n        /// <summary>\n        /// Include references of alternate repositories as {@code .have} lines.\n        /// </summary>\n        public void includeAdditionalHaves()\n        {\n            additionalHaves(_walk.Repository.ObjectDatabase);\n        }\n\n        private void additionalHaves(ObjectDatabase db)\n        {\n            AlternateRepositoryDatabase b = (db as AlternateRepositoryDatabase);\n            if (b != null)\n            {\n                additionalHaves(b.getRepository());\n            }\n\n            foreach (ObjectDatabase alt in db.getAlternates())\n            {\n                additionalHaves(alt);\n            }\n        }\n\n        private void additionalHaves(Repository alt)\n        {\n            foreach (Ref r in alt.getAllRefs().Values)\n            {\n                advertiseHave(r.ObjectId);\n            }\n        }\n\n        /// <returns>true if no advertisements have been sent yet.</returns>\n        public bool isEmpty()\n        {\n            return _first;\n        }\n\n        private RevObject parseAnyOrNull(AnyObjectId id)\n        {\n            if (id == null) return null;\n\n            try\n            {\n                return _walk.parseAny(id);\n            }\n            catch (IOException)\n            {\n                return null;\n            }\n        }\n\n        private void advertiseAnyOnce(RevObject obj, string refName)\n        {\n            if (!obj.has(ADVERTISED))\n            {\n                advertiseAny(obj, refName);\n            }\n        }\n\n        private void advertiseAny(RevObject obj, string refName)\n        {\n            obj.add(ADVERTISED);\n            advertiseId(obj, refName);\n        }\n\n        private void advertiseTag(RevTag tag, string refName)\n        {\n            RevObject o = tag;\n            do\n            {\n                // Fully unwrap here so later on we have these already parsed.\n                RevObject target = (((RevTag)o).getObject());\n                try\n                {\n                    _walk.parseHeaders(target);\n                }\n                catch (IOException)\n                {\n                    return;\n                }\n                target.add(ADVERTISED);\n                o = target;\n            } while (o is RevTag);\n\n            advertiseAny(tag.getObject(), refName);\n        }\n\n        /// <summary>\n        /// Advertise one object under a specific name.\n        /// <para/>\n        /// If the advertised object is a tag, this method does not advertise the\n        /// peeled version of it.\n        /// </summary>\n        /// <param name=\"id\">\n        /// the object to advertise.\n        /// </param>\n        /// <param name=\"refName\">\n        /// name of the reference to advertise the object as, can be any\n        /// string not including the NUL byte.\n        /// </param>\n        public void advertiseId(AnyObjectId id, string refName)\n        {\n            _tmpLine.Length = 0;\n            id.CopyTo(_tmpId, _tmpLine);\n            _tmpLine.Append(' ');\n            _tmpLine.Append(refName);\n\n            if (_first)\n            {\n                _first = false;\n                if (_capabilities.Count > 0)\n                {\n                    _tmpLine.Append('\\0');\n                    foreach (string capName in _capabilities)\n                    {\n                        _tmpLine.Append(' ');\n                        _tmpLine.Append(capName);\n                    }\n                    _tmpLine.Append(' ');\n                }\n            }\n\n            _tmpLine.Append('\\n');\n            writeOne(_tmpLine.ToString());\n        }\n\n        public void Dispose()\n        {\n            _walk.Dispose();\n            ADVERTISED.Dispose();\n        }\n\n        /// <summary>\n        /// Write a single advertisement line.\n        /// </summary>\n        /// <param name=\"line\">\n        /// the advertisement line to be written. The line always ends\n        /// with LF. Never null or the empty string.\n        /// </param>\n        protected abstract void writeOne(string line);\n\n        /// <summary>\n        /// Mark the end of the advertisements.\n        /// </summary>\n        public abstract void end();\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/RefFilter.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n    public static class RefFilterContants\n    {\n        /// <summary>\n        /// The default filter, allows all refs to be shown.\n        /// </summary>\n        public static RefFilter DEFAULT = new DefaultRefFilter();\n\n        private class DefaultRefFilter : RefFilter\n        {\n            public IDictionary<string, Ref> filter(IDictionary<string, Ref> refs)\n            {\n                return refs;\n            }\n        }\n    }\n\n    /// <summary>\n    /// Filters the list of refs that are advertised to the client.\n    /// <para/>\n    /// The filter is called by {@link ReceivePack} and {@link UploadPack} to ensure\n    /// that the refs are filtered before they are advertised to the client.\n    /// <para/>\n    /// This can be used by applications to control visibility of certain refs based\n    /// on a custom set of rules.\n    /// </summary>\n    public interface RefFilter\n    {\n        /// <summary>\n        /// Filters a {@code Map} of refs before it is advertised to the client.\n        /// </summary>\n        /// <param name=\"refs\">the refs which this method need to consider.</param>\n        /// <returns>the filtered map of refs.</returns>\n        IDictionary<string, Ref> filter(IDictionary<string, Ref> refs);\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/RefSpec.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Describes how refs in one repository copy into another repository.\n    /// <para />\n    /// A ref specification provides matching support and limited rules to rewrite a\n    /// reference in one repository to another reference in another repository.\n    /// </summary>\n    public class RefSpec\n    {\n        /// <summary>\n        /// Suffix for wildcard ref spec component, that indicate matching all refs\n        /// with specified prefix.                                                 \n        /// </summary>\n        public const string WILDCARD_SUFFIX = \"/*\";\n\n        /// <summary>\n        /// Check whether provided string is a wildcard ref spec component.\n        /// </summary>\n        /// <param name=\"s\">ref spec component - string to test. Can be null.</param>\n        /// <returns>true if provided string is a wildcard ref spec component.</returns>\n        public static bool IsWildcard(string s)\n        {\n            return s != null && s.EndsWith(WILDCARD_SUFFIX);\n        }\n\n        /// <summary>\n        /// Check if this specification wants to forcefully update the destination.\n        /// <para/>\n        /// Returns true if this specification asks for updates without merge tests.\n        /// </summary>\n        public bool Force { get; private set; }\n\n        /// <summary>\n        /// Check if this specification is actually a wildcard pattern.\n        /// <para/>\n        /// If this is a wildcard pattern then the source and destination names\n        /// returned by <see cref=\"Source\"/> and <see cref=\"Destination\"/> will not\n        /// be actual ref names, but instead will be patterns.\n        /// <para/>\n        /// Returns true if this specification could match more than one ref.</summary>\n        public bool Wildcard { get; private set; }\n\n        /// <summary>\n        /// Get the source ref description.\n        /// <para/>\n        /// During a fetch this is the name of the ref on the remote repository we\n        /// are fetching from. During a push this is the name of the ref on the local\n        /// repository we are pushing out from.\n        /// <para/>\n        /// Returns name (or wildcard pattern) to match the source ref.\n        /// </summary>\n        public string Source { get; private set; }\n\n        /// <summary>\n        /// Get the destination ref description.\n        /// <para/>\n        /// During a fetch this is the local tracking branch that will be updated\n        /// with the new ObjectId after fetching is complete. During a push this is\n        /// the remote ref that will be updated by the remote's receive-pack process.\n        /// <para/>\n        /// If null during a fetch no tracking branch should be updated and the\n        /// ObjectId should be stored transiently in order to prepare a merge.\n        /// <para/>\n        /// If null during a push, use <see cref=\"Source\"/> instead.\n        /// <para/>\n        /// Returns name (or wildcard) pattern to match the destination ref.\n        /// </summary>\n        public string Destination { get; private set; }\n\n        /// <summary>\n        /// Construct an empty RefSpec.\n        /// <para/>\n        /// A newly created empty RefSpec is not suitable for use in most\n        /// applications, as at least one field must be set to match a source name.\n        /// </summary>\n        public RefSpec()\n        {\n            Force = false;\n            Wildcard = false;\n            Source = Constants.HEAD;\n            Destination = null;\n        }\n\n        public RefSpec(string source, string destination)\n            : this()\n        {\n            Source = source;\n            Destination = destination;\n        }\n\n        /// <summary>\n        /// Parse a ref specification for use during transport operations.\n        /// <para/>\n        /// Specifications are typically one of the following forms:\n        /// <ul>\n        /// <li><code>refs/head/master</code></li>\n        /// <li><code>refs/head/master:refs/remotes/origin/master</code></li>\n        /// <li><code>refs/head/*:refs/remotes/origin/*</code></li>\n        /// <li><code>+refs/head/master</code></li>\n        /// <li><code>+refs/head/master:refs/remotes/origin/master</code></li>\n        /// <li><code>+refs/head/*:refs/remotes/origin/*</code></li>\n        /// <li><code>:refs/head/master</code></li>\n        /// </ul>\n        /// </summary>\n        /// <param name=\"spec\">string describing the specification.</param>\n        public RefSpec(string spec)\n        {\n            string s = spec;\n            if (s.StartsWith(\"+\"))\n            {\n                Force = true;\n                s = s.Substring(1);\n            }\n\n            int c = s.LastIndexOf(':');\n            if (c == 0)\n            {\n                s = s.Substring(1);\n                if (IsWildcard(s))\n                {\n                    throw new ArgumentException(\"Invalid Wildcards \" + spec);\n                }\n                Destination = s;\n            }\n            else if (c > 0)\n            {\n                Source = s.Slice(0, c);\n                Destination = s.Substring(c + 1);\n                if (IsWildcard(Source) && IsWildcard(Destination))\n                {\n                    Wildcard = true;\n                }\n                else if (IsWildcard(Source) || IsWildcard(Destination))\n                {\n                    throw new ArgumentException(\"Invalid Wildcards \" + spec);\n                }\n            }\n            else\n            {\n                if (IsWildcard(s))\n                {\n                    throw new ArgumentException(\"Invalid Wildcards \" + spec);\n                }\n                Source = s;\n            }\n        }\n\n        private RefSpec(RefSpec p)\n        {\n            Force = p.Force;\n            Wildcard = p.Wildcard;\n            Source = p.Source;\n            Destination = p.Destination;\n        }\n\n        /// <summary>\n        /// Create a new RefSpec with a different force update setting.\n        /// </summary>\n        /// <param name=\"force\">new value for force update in the returned instance.</param>\n        /// <returns>a new RefSpec with force update as specified.</returns>\n        public RefSpec SetForce(bool force)\n        {\n            return new RefSpec(this) { Force = force };\n        }\n\n        /// <summary>\n        /// Create a new RefSpec with a different source name setting.\n        /// </summary>\n        /// <param name=\"source\">new value for source in the returned instance.</param>\n        /// <returns>a new RefSpec with source as specified.</returns>\n        public RefSpec SetSource(string source)\n        {\n            var r = new RefSpec(this);\n            r.Source = source;\n            if (IsWildcard(r.Source) && r.Destination == null)\n                throw new InvalidOperationException(\"Destination is not a wildcard.\");\n            if (IsWildcard(r.Source) != IsWildcard(r.Destination))\n                throw new InvalidOperationException(\"Source/Destination must match.\");\n            return r;\n        }\n\n        /// <summary>\n        /// Create a new RefSpec with a different destination name setting.\n        /// </summary>\n        /// <param name=\"destination\">new value for destination in the returned instance.</param>\n        /// <returns>a new RefSpec with destination as specified.</returns>\n        public RefSpec SetDestination(string destination)\n        {\n            RefSpec r = new RefSpec(this);\n            r.Destination = destination;\n\n            if (IsWildcard(r.Destination) && r.Source == null)\n            {\n                throw new InvalidOperationException(\"Source is not a wildcard.\");\n            }\n            if (IsWildcard(r.Source) != IsWildcard(r.Destination))\n            {\n                throw new InvalidOperationException(\"Source/Destination must match.\");\n            }\n            return r;\n        }\n\n        /// <summary>\n        /// Create a new RefSpec with a different source/destination name setting.\n        /// </summary>\n        /// <param name=\"source\">new value for source in the returned instance.</param>\n        /// <param name=\"destination\">new value for destination in the returned instance.</param>\n        /// <returns>a new RefSpec with destination as specified.</returns>\n        public RefSpec SetSourceDestination(string source, string destination)\n        {\n            if (IsWildcard(source) != IsWildcard(destination))\n            {\n                throw new ArgumentException(\"Source/Destination must match.\");\n            }\n\n            return new RefSpec(this) { Wildcard = IsWildcard(source), Source = source, Destination = destination };\n        }\n\n        /// <summary>\n        /// Does this specification's source description match the ref name?\n        /// </summary>\n        /// <param name=\"r\">ref name that should be tested.</param>\n        /// <returns>true if the names match; false otherwise.</returns>\n        public bool MatchSource(string r)\n        {\n            return match(r, Source);\n        }\n\n        /// <summary>\n        /// Does this specification's source description match the ref?\n        /// </summary>\n        /// <param name=\"r\">ref whose name should be tested.</param>\n        /// <returns>true if the names match; false otherwise.</returns>\n        public bool MatchSource(Ref r)\n        {\n            return match(r.Name, Source);\n        }\n\n        /// <summary>\n        /// Does this specification's destination description match the ref name?\n        /// </summary>\n        /// <param name=\"r\">ref name that should be tested.</param>\n        /// <returns>true if the names match; false otherwise.</returns>\n        public bool MatchDestination(string r)\n        {\n            return match(r, Destination);\n        }\n\n        /// <summary>\n        /// Does this specification's destination description match the ref?\n        /// </summary>\n        /// <param name=\"r\">ref whose name should be tested.</param>\n        /// <returns>true if the names match; false otherwise.</returns>\n        public bool MatchDestination(Ref r)\n        {\n            return match(r.Name, Destination);\n        }\n\n        /// <summary>\n        /// Expand this specification to exactly match a ref name.\n        /// <para/>\n        /// Callers must first verify the passed ref name matches this specification,\n        /// otherwise expansion results may be unpredictable.\n        /// </summary>\n        /// <param name=\"r\">\n        /// a ref name that matched our source specification. Could be a\n        /// wildcard also.\n        /// </param>\n        /// <returns>\n        /// a new specification expanded from provided ref name. Result\n        /// specification is wildcard if and only if provided ref name is\n        /// wildcard.\n        /// </returns>\n        public RefSpec ExpandFromSource(string r)\n        {\n            return Wildcard ? new RefSpec(this).expandFromSourceImp(r) : this;\n        }\n\n        private RefSpec expandFromSourceImp(string name)\n        {\n            string psrc = Source, pdst = Destination;\n            Wildcard = false;\n            Source = name;\n            Destination = pdst.Slice(0, pdst.Length - 1) + name.Substring(psrc.Length - 1);\n            return this;\n        }\n\n        /// <summary>\n        /// Expand this specification to exactly match a ref.\n        /// <para/>\n        /// Callers must first verify the passed ref matches this specification,\n        /// otherwise expansion results may be unpredictable.\n        /// </summary>\n        /// <param name=\"r\">\n        /// a ref that matched our source specification. Could be a\n        /// wildcard also.\n        /// </param>\n        /// <returns>\n        /// a new specification expanded from provided ref name. Result\n        /// specification is wildcard if and only if provided ref name is\n        /// wildcard.\n        /// </returns>\n        public RefSpec ExpandFromSource(Ref r)\n        {\n            return ExpandFromSource(r.Name);\n        }\n\n        /// <summary>\n        /// Expand this specification to exactly match a ref name.\n        /// <para/>\n        /// Callers must first verify the passed ref name matches this specification,\n        /// otherwise expansion results may be unpredictable.\n        /// </summary>\n        /// <param name=\"r\">\n        /// a ref name that matched our destination specification. Could\n        /// be a wildcard also.\n        /// </param>\n        /// <returns>\n        /// a new specification expanded from provided ref name. Result\n        /// specification is wildcard if and only if provided ref name is\n        /// wildcard.\n        /// </returns>\n        public RefSpec ExpandFromDestination(string r)\n        {\n            return Wildcard ? new RefSpec(this).expandFromDstImp(r) : this;\n        }\n\n        private RefSpec expandFromDstImp(string name)\n        {\n            string psrc = Source, pdst = Destination;\n            Wildcard = false;\n            Source = psrc.Slice(0, psrc.Length - 1) + name.Substring(pdst.Length - 1);\n            Destination = name;\n            return this;\n        }\n\n        /// <summary>\n        /// Expand this specification to exactly match a ref.\n        /// <para/>\n        /// Callers must first verify the passed ref matches this specification,\n        /// otherwise expansion results may be unpredictable.\n        /// </summary>\n        /// <param name=\"r\">a ref that matched our destination specification.</param>\n        /// <returns>\n        /// a new specification expanded from provided ref name. Result\n        /// specification is wildcard if and only if provided ref name is\n        /// wildcard.\n        /// </returns>\n        public RefSpec ExpandFromDestination(Ref r)\n        {\n            return ExpandFromDestination(r.Name);\n        }\n\n        private bool match(string refName, string s)\n        {\n            if (s == null)\n            {\n                return false;\n            }\n\n            if (Wildcard)\n            {\n                return refName.StartsWith(s.Slice(0, s.Length - 1));\n            }\n\n            return refName.Equals(s);\n        }\n\n        public override int GetHashCode()\n        {\n            int hc = 0;\n            if (Source != null)\n                hc = hc * 31 + Source.GetHashCode();\n            if (Destination != null)\n                hc = hc * 31 + Destination.GetHashCode();\n            return hc;\n        }\n\n        public override bool Equals(object obj)\n        {\n            var b = (obj as RefSpec);\n            if (b == null)\n                return false;\n\n            if (Force != b.Force) return false;\n            if (Wildcard != b.Wildcard) return false;\n            if (!eq(Source, b.Source)) return false;\n            if (!eq(Destination, b.Destination)) return false;\n            return true;\n        }\n        \n        private static bool eq(string a, string b)\n        {\n            if (a == b) return true;\n            if (a == null || b == null) return false;\n            return a.Equals(b);\n        }\n        \n        public override string ToString()\n        {\n            var r = new StringBuilder();\n            if (Force)\n                r.Append('+');\n            if (Source != null)\n                r.Append(Source);\n            if (Destination != null)\n            {\n                r.Append(':');\n                r.Append(Destination);\n            }\n            return r.ToString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/RemoteConfig.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Transport\n{\n\t/// <summary>\n\t/// A remembered remote repository, including URLs and RefSpecs.\n\t/// <para />\n\t/// A remote configuration remembers one or more URLs for a frequently accessed\n\t/// remote repository as well as zero or more fetch and push specifications\n\t/// describing how refs should be transferred between this repository and the\n\t/// remote repository.\n\t/// </summary>\n\tpublic class RemoteConfig\n\t{\n\t\tprivate const string Section = \"remote\";\n\t\tprivate const string KeyUrl = \"url\";\n\t\tprivate const string KeyPushurl = \"pushurl\";\n\t\tprivate const string KeyFetch = \"fetch\";\n\t\tprivate const string KeyPush = \"push\";\n\t\tprivate const string KeyUploadpack = \"uploadpack\";\n\t\tprivate const string KeyReceivepack = \"receivepack\";\n\t\tprivate const string KeyTagopt = \"tagopt\";\n\t\tprivate const string KeyMirror = \"mirror\";\n\t\tprivate const string KeyTimeout = \"timeout\";\n\t\tprivate const bool DefaultMirror = false;\n\n\t\t/// <summary>\n\t\t/// Default value for <see cref=\"UploadPack\"/> if not specified.\n\t\t/// </summary>\n\t\tpublic const string DEFAULT_UPLOAD_PACK = \"git-upload-pack\";\n\n\t\t/// <summary>\n\t\t/// Default value for <see cref=\"ReceivePack\"/> if not specified.\n\t\t/// </summary>\n\t\tpublic const string DEFAULT_RECEIVE_PACK = \"git-receive-pack\";\n\t\t\n\t\tstring oldName;\n\n\t\t/// <summary>\n\t\t/// Parse all remote blocks in an existing configuration file, looking for\n\t\t/// remotes configuration.\n\t\t/// </summary>\n\t\t/// <param name=\"rc\">\n\t\t/// The existing configuration to get the remote settings from.\n\t\t/// The configuration must already be loaded into memory.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// All remotes configurations existing in provided repository\n\t\t/// configuration. Returned configurations are ordered\n\t\t/// lexicographically by names.\n\t\t/// </returns>\n\t\tpublic static List<RemoteConfig> GetAllRemoteConfigs(RepositoryConfig rc)\n\t\t{\n\t\t\tif (rc == null)\n\t\t\t\tthrow new ArgumentNullException (\"rc\");\n\t\t\tvar names = new List<string>(rc.getSubsections(Section));\n\t\t\tnames.Sort();\n\n\t\t\tvar result = new List<RemoteConfig>(names.Count);\n\t\t\tforeach (string name in names)\n\t\t\t{\n\t\t\t\tresult.Add(new RemoteConfig(rc, name));\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n        /// <summary>\n        /// local name this remote configuration is recognized as\n        /// </summary>\n\t\tpublic string Name { get; set; }\n\n        /// <summary>\n        /// all configured URIs under this remote\n        /// </summary>\n\t\tpublic List<URIish> URIs { get; private set; }\n\n        /// <summary>\n        /// all configured push-only URIs under this remote.\n        /// </summary>\n\t\tpublic List<URIish> PushURIs { get; private set; }\n\n        /// <summary>\n        /// Remembered specifications for fetching from a repository.\n        /// </summary>\n\t\tpublic List<RefSpec> Fetch { get; private set; }\n\n        /// <summary>\n        /// Remembered specifications for pushing to a repository.\n        /// </summary>\n\t\tpublic List<RefSpec> Push { get; private set; }\n\n        /// <summary>\n        /// Override for the location of 'git-upload-pack' on the remote system.\n        /// <para/>\n        /// This value is only useful for an SSH style connection, where Git is\n        /// asking the remote system to execute a program that provides the necessary\n        /// network protocol.\n        /// <para/>\n        /// returns location of 'git-upload-pack' on the remote system. If no\n        /// location has been configured the default of 'git-upload-pack' is\n        /// returned instead.\n        /// </summary>\n\t\tpublic string UploadPack { get; private set; }\n\n        /// <summary>\n        /// Override for the location of 'git-receive-pack' on the remote system.\n        /// <para/>\n        /// This value is only useful for an SSH style connection, where Git is\n        /// asking the remote system to execute a program that provides the necessary\n        /// network protocol.\n        /// <para/>\n        /// returns location of 'git-receive-pack' on the remote system. If no\n        /// location has been configured the default of 'git-receive-pack' is\n        /// returned instead.\n        /// </summary>\n\t\tpublic string ReceivePack { get; private set; }\n\n        /// <summary>\n        /// Get the description of how annotated tags should be treated during fetch.\n        /// <para/>\n        /// returns option indicating the behavior of annotated tags in fetch.\n        /// </summary>\n\t\tpublic TagOpt TagOpt { get; private set; }\n\n        /// <summary>\n        /// mirror flag to automatically delete remote refs.\n        /// <para/>\n        /// true if pushing to the remote automatically deletes remote refs\n        /// </summary>\n\t\tpublic bool Mirror { get; set; }\n\n        /// <summary>\n        /// Parse a remote block from an existing configuration file.\n        /// <para/>\n        /// This constructor succeeds even if the requested remote is not defined\n        /// within the supplied configuration file. If that occurs then there will be\n        /// no URIs and no ref specifications known to the new instance.\n        /// </summary>\n        /// <param name=\"rc\">\n        /// the existing configuration to get the remote settings from.\n        /// The configuration must already be loaded into memory.\n        /// </param>\n        /// <param name=\"remoteName\">subsection key indicating the name of this remote.</param>\n\t\tpublic RemoteConfig(Config rc, string remoteName)\n\t\t{\n\t\t\tif (rc == null)\n\t\t\t\tthrow new ArgumentNullException (\"rc\");\n\t\t\tName = remoteName;\n\t\t\toldName = Name;\n\n\t\t\tstring[] vlst = rc.getStringList(Section, Name, KeyUrl);\n\t\t\tURIs = new List<URIish>(vlst.Length);\n\t\t\tforeach (string s in vlst)\n\t\t\t{\n\t\t\t\tURIs.Add(new URIish(s));\n\t\t\t}\n\n\t\t\tvlst = rc.getStringList(Section, Name, KeyPushurl);\n\t\t\tPushURIs = new List<URIish>(vlst.Length);\n\t\t\tforeach (string s in vlst)\n\t\t\t{\n\t\t\t\tPushURIs.Add(new URIish(s));\n\t\t\t}\n\n\t\t\tvlst = rc.getStringList(Section, Name, KeyFetch);\n\t\t\tFetch = new List<RefSpec>(vlst.Length);\n\t\t\tforeach (string s in vlst)\n\t\t\t{\n\t\t\t\tFetch.Add(new RefSpec(s));\n\t\t\t}\n\n\t\t\tvlst = rc.getStringList(Section, Name, KeyPush);\n\t\t\tPush = new List<RefSpec>(vlst.Length);\n\t\t\tforeach (string s in vlst)\n\t\t\t{\n\t\t\t\tPush.Add(new RefSpec(s));\n\t\t\t}\n\n\t\t\tstring val = rc.getString(Section, Name, KeyUploadpack) ?? DEFAULT_UPLOAD_PACK;\n\t\t\tUploadPack = val;\n\n\t\t\tval = rc.getString(Section, Name, KeyReceivepack) ?? DEFAULT_RECEIVE_PACK;\n\t\t\tReceivePack = val;\n\n\t\t\tval = rc.getString(Section, Name, KeyTagopt);\n\t\t\tTagOpt = TagOpt.fromOption(val);\n\t\t\tMirror = rc.getBoolean(Section, Name, KeyMirror, DefaultMirror);\n\n\t\t\tTimeout = rc.getInt(Section, Name, KeyTimeout, 0);\n\t\t}\n\n        /// <summary>\n        /// Update this remote's definition within the configuration.\n        /// </summary>\n        /// <param name=\"rc\">the configuration file to store ourselves into.</param>\n\t\tpublic void Update(Config rc)\n\t\t{\n\t\t\tif (rc == null)\n\t\t\t\tthrow new ArgumentNullException (\"rc\");\n\t\t\tvar vlst = new List<string>();\n\n\t\t\tvlst.Clear();\n\t\t\tforeach (URIish u in URIs)\n\t\t\t{\n\t\t\t\tvlst.Add(u.ToPrivateString());\n\t\t\t}\n\t\t\trc.setStringList(Section, Name, KeyUrl, vlst);\n\n\t\t\tvlst.Clear();\n\t\t\tforeach (URIish u in PushURIs)\n\t\t\t\tvlst.Add(u.ToPrivateString());\n\t\t\trc.setStringList(Section, Name, KeyPushurl, vlst);\n\n\t\t\tvlst.Clear();\n\t\t\tforeach (RefSpec u in Fetch)\n\t\t\t{\n\t\t\t\tvlst.Add(u.ToString());\n\t\t\t}\n\t\t\trc.setStringList(Section, Name, KeyFetch, vlst);\n\n\t\t\tvlst.Clear();\n\t\t\tforeach (RefSpec u in Push)\n\t\t\t{\n\t\t\t\tvlst.Add(u.ToString());\n\t\t\t}\n\t\t\trc.setStringList(Section, Name, KeyPush, vlst);\n\n\t\t\tSet(rc, KeyUploadpack, UploadPack, DEFAULT_UPLOAD_PACK);\n\t\t\tSet(rc, KeyReceivepack, ReceivePack, DEFAULT_RECEIVE_PACK);\n\t\t\tSet(rc, KeyTagopt, TagOpt.Option, TagOpt.AUTO_FOLLOW.Option);\n\t\t\tSet(rc, KeyMirror, Mirror, DefaultMirror);\n\t\t\tSet(rc, KeyTimeout, Timeout, 0);\n\t\t\t\n\t\t\tif (oldName != Name) {\n\t\t\t\trc.unsetSection (Section, oldName);\n\t\t\t\toldName = Name;\n\t\t\t}\n\t\t}\n\t\t\n        /// <summary>\n        /// Remove this remote's definition from the configuration.\n        /// </summary>\n        /// <param name=\"rc\">the configuration from which to remove ourselves.</param>\n\t\tpublic void Delete (Config rc)\n\t\t{\n\t\t\tif (rc == null)\n\t\t\t\tthrow new ArgumentNullException (\"rc\");\n\t\t\trc.unsetSection (Section, Name);\n\t\t}\n\n\t\tprivate void Set(Config rc, string key, string currentValue, IEquatable<string> defaultValue)\n\t\t{\n\t\t\tif (defaultValue.Equals(currentValue))\n\t\t\t{\n\t\t\t\tUnset(rc, key);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trc.setString(Section, Name, key, currentValue);\n\t\t\t}\n\t\t}\n\n        private void Set(Config rc, string key, bool currentValue, bool defaultValue)\n        {\n            if (defaultValue == currentValue)\n            {\n                Unset(rc, key);\n            }\n            else\n            {\n                rc.setBoolean(Section, Name, key, currentValue);\n            }\n        }\n        \n        private void Set(Config rc, string key, int currentValue, IEquatable<int> defaultValue)\n\t\t{\n\t\t\tif (defaultValue.Equals(currentValue))\n\t\t\t{\n\t\t\t\tUnset(rc, key);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trc.setInt(Section, Name, key, currentValue);\n\t\t\t}\n\t\t}\n\n\t\tprivate void Unset(Config rc, string key)\n\t\t{\n\t\t\trc.unset(Section, Name, key);\n\t\t}\n\n        /// <summary>\n        /// Add a new URI to the end of the list of URIs.\n        /// </summary>\n        /// <param name=\"toAdd\">the new URI to add to this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool AddURI(URIish toAdd)\n\t\t{\n\t\t\tif (URIs.Contains(toAdd)) return false;\n\n\t\t\tURIs.Add(toAdd);\n\t\t\treturn true;\n\t\t}\n\n        /// <summary>\n        /// Remove a URI from the list of URIs.\n        /// </summary>\n        /// <param name=\"toRemove\">the URI to remove from this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool RemoveURI(URIish toRemove)\n\t\t{\n\t\t\treturn URIs.Remove(toRemove);\n\t\t}\n\n        /// <summary>\n        /// Add a new push-only URI to the end of the list of URIs.\n        /// </summary>\n        /// <param name=\"toAdd\">the new URI to add to this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n\t\tpublic bool AddPushURI(URIish toAdd)\n\t\t{\n\t\t\tif (PushURIs.Contains(toAdd)) return false;\n\n\t\t\tPushURIs.Add(toAdd);\n\t\t\treturn true;\n\t\t}\n\n        /// <summary>\n        /// Remove a push-only URI from the list of URIs.\n        /// </summary>\n        /// <param name=\"toRemove\">the URI to remove from this remote.</param>\n        /// <returns>true if the URI was added; false if it already exists.</returns>\n        public bool RemovePushURI(URIish toRemove)\n        {\n            return PushURIs.Remove(toRemove);\n        }\n\n        /// <summary>\n        /// Add a new fetch RefSpec to this remote.\n        /// </summary>\n        /// <param name=\"s\">the new specification to add.</param>\n        /// <returns>true if the specification was added; false if it already exists.</returns>\n        public bool AddFetchRefSpec(RefSpec s)\n        {\n            if (Fetch.Contains(s))\n            {\n                return false;\n            }\n\n            Fetch.Add(s);\n\n            return true;\n        }\n\n        /// <summary>\n        /// Override existing fetch specifications with new ones.\n        /// </summary>\n        /// <param name=\"specs\">\n        /// list of fetch specifications to set. List is copied, it can be\n        /// modified after this call.\n        /// </param>\n\t\tpublic void SetFetchRefSpecs(List<RefSpec> specs)\n\t\t{\n\t\t\tFetch.Clear();\n\t\t\tFetch.AddRange(specs);\n\t\t}\n\n        /// <summary>\n        /// Override existing push specifications with new ones.\n        /// </summary>\n        /// <param name=\"specs\">\n        /// list of push specifications to set. List is copied, it can be\n        /// modified after this call.\n        /// </param>\n\t\tpublic void SetPushRefSpecs(List<RefSpec> specs)\n\t\t{\n\t\t\tPush.Clear();\n\t\t\tPush.AddRange(specs);\n\t\t}\n\n\t\t/// <summary>\n        /// Remove a fetch RefSpec from this remote.\n\t\t/// </summary>\n        /// <param name=\"s\">the specification to remove.</param>\n        /// <returns>true if the specification existed and was removed.</returns>\n        public bool RemoveFetchRefSpec(RefSpec s)\n\t\t{\n\t\t\treturn Fetch.Remove(s);\n\t\t}\n\n        /// <summary>\n        /// Add a new push RefSpec to this remote.\n        /// </summary>\n        /// <param name=\"s\">the new specification to add.</param>\n        /// <returns>true if the specification was added; false if it already exists.</returns>\n\t\tpublic bool AddPushRefSpec(RefSpec s)\n\t\t{\n\t\t\tif (Push.Contains(s)) return false;\n\n\t\t\tPush.Add(s);\n\t\t\treturn true;\n\t\t}\n\n        /// <summary>\n        /// Remove a push RefSpec from this remote.\n        /// </summary>\n        /// <param name=\"s\">the specification to remove.</param>\n        /// <returns>true if the specification existed and was removed.</returns>\n\t\tpublic bool RemovePushRefSpec(RefSpec s)\n\t\t{\n\t\t\treturn Push.Remove(s);\n\t\t}\n\n        /// <summary>\n        /// Set the description of how annotated tags should be treated on fetch.\n        /// </summary>\n        /// <param name=\"option\">method to use when handling annotated tags.</param>\n\t\tpublic void SetTagOpt(TagOpt option)\n\t\t{\n\t\t\tTagOpt = option ?? TagOpt.AUTO_FOLLOW;\n\t\t}\n\n        /// <summary>\n        /// timeout before willing to abort an IO call.\n        /// <para/>\n        /// number of seconds to wait (with no data transfer occurring)\n        /// before aborting an IO read or write operation with this\n        /// remote.  A timeout of 0 will block indefinitely.\n        /// </summary>\n\t\tpublic int Timeout { get; set; }\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Transport/RemoteRefUpdate.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the remoteName of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Represent request and status of a remote ref update. Specification is\n    /// provided by client, while status is handled by <see cref=\"PushProcess\"/> class,\n    /// being read-only for client.\n    /// <para/>\n    /// Client can create instances of this class directly, basing on user\n    /// specification and advertised refs ({@link Connection} or through\n    /// <see cref=\"Transport\"/> helper methods. Apply this specification on remote\n    /// repository using <see cref=\"Transport.push\"/>\n    /// method.</summary>\n    public class RemoteRefUpdate\n    {\n        /// <summary>\n        /// Represent current status of a remote ref update.\n        /// </summary>\n        [Serializable]\n        public enum UpdateStatus\n        {\n            /// <summary>\n            /// Push process hasn't yet attempted to update this ref. This is the\n            /// default status, prior to push process execution.\n            /// </summary>\n            NOT_ATTEMPTED,\n\n            /// <summary>\n            /// Remote ref was up to date, there was no need to update anything.\n            /// </summary>\n            UP_TO_DATE,\n\n            /// <summary>\n            /// Remote ref update was rejected, as it would cause non fast-forward\n            /// update.\n            /// </summary>\n            REJECTED_NONFASTFORWARD,\n\n            /// <summary>\n            /// Remote ref update was rejected, because remote side doesn't\n            /// support/allow deleting refs.\n            /// </summary>\n            REJECTED_NODELETE,\n\n            /// <summary>\n            /// Remote ref update was rejected, because old object id on remote\n            /// repository wasn't the same as defined expected old object.\n            /// </summary>\n            REJECTED_REMOTE_CHANGED,\n\n            /// <summary>\n            /// Remote ref update was rejected for other reason, possibly described\n            /// in <see cref=\"RemoteRefUpdate.get_Message\"/>.\n            /// </summary>\n            REJECTED_OTHER_REASON,\n\n            /// <summary>\n            /// Remote ref didn't exist. Can occur on delete request of a non\n            /// existing ref.\n            /// </summary>\n            NON_EXISTING,\n\n            /// <summary>\n            /// Push process is awaiting update report from remote repository. This\n            /// is a temporary state or state after critical error in push process.\n            /// </summary>\n            AWAITING_REPORT,\n\n            /// <summary>\n            /// Remote ref was successfully updated.\n            /// </summary>\n            OK\n        }\n\n        private readonly Repository _localDb;\n\n        /// <summary>\n        /// Construct remote ref update request by providing an update specification.\n        /// Object is created with default {@link Status#NOT_ATTEMPTED} status and no\n        /// message.\n        /// </summary>\n        /// <param name=\"localDb\">local repository to push from.</param>\n        /// <param name=\"srcRef\">\n        /// source revision - any string resolvable by\n        /// <see cref=\"Repository.Resolve\"/>. This resolves to the new\n        /// object that the caller want remote ref to be after update. Use\n        /// null or <see cref=\"ObjectId.ZeroId\"/> string for delete request.\n        /// </param>\n        /// <param name=\"remoteName\">\n        /// full name of a remote ref to update, e.g. \"refs/heads/master\"\n        /// (no wildcard, no short name).\n        /// </param>\n        /// <param name=\"forceUpdate\">\n        /// true when caller want remote ref to be updated regardless\n        /// whether it is fast-forward update (old object is ancestor of\n        /// new object).\n        /// </param>\n        /// <param name=\"localName\">\n        /// optional full name of a local stored tracking branch, to\n        /// update after push, e.g. \"refs/remotes/zawir/dirty\" (no\n        /// wildcard, no short name); null if no local tracking branch\n        /// should be updated.\n        /// </param>\n        /// <param name=\"expectedOldObjectId\">\n        /// optional object id that caller is expecting, requiring to be\n        /// advertised by remote side before update; update will take\n        /// place ONLY if remote side advertise exactly this expected id;\n        /// null if caller doesn't care what object id remote side\n        /// advertise. Use {@link ObjectId#zeroId()} when expecting no\n        /// remote ref with this name.\n        /// </param>\n        public RemoteRefUpdate(Repository localDb, string srcRef, string remoteName, bool forceUpdate, string localName, ObjectId expectedOldObjectId)\n        {\n            if (remoteName == null)\n                throw new ArgumentNullException(\"remoteName\", \"Remote name can't be null.\");\n\n            SourceRef = srcRef;\n            NewObjectId = (srcRef == null ? ObjectId.ZeroId : localDb.Resolve(srcRef));\n            if (NewObjectId == null)\n            {\n                throw new IOException(\"Source ref \" + srcRef + \" doesn't resolve to any object.\");\n            }\n            RemoteName = remoteName;\n            ForceUpdate = forceUpdate;\n            if (localName != null && localDb != null)\n            {\n                TrackingRefUpdate = new TrackingRefUpdate(localDb, localName, remoteName, true, NewObjectId, \"push\");\n            }\n            else\n            {\n                TrackingRefUpdate = null;\n            }\n            _localDb = localDb;\n            ExpectedOldObjectId = expectedOldObjectId;\n            Status = UpdateStatus.NOT_ATTEMPTED;\n        }\n\n        /// <summary>\n        /// Create a new instance of this object basing on existing instance for\n        /// configuration. State (like <see cref=\"get_Message\"/>, <see cref=\"get_Status\"/>)\n        /// of base object is not shared. Expected old object id is set up from\n        /// scratch, as this constructor may be used for 2-stage push: first one\n        /// being dry run, second one being actual push.\n        /// </summary>\n        /// <param name=\"baseUpdate\">configuration base.</param>\n        /// <param name=\"newExpectedOldObjectId\">new expected object id value.</param>\n        public RemoteRefUpdate(RemoteRefUpdate baseUpdate, ObjectId newExpectedOldObjectId)\n            : this(baseUpdate._localDb, baseUpdate.SourceRef, baseUpdate.RemoteName, baseUpdate.ForceUpdate, (baseUpdate.TrackingRefUpdate == null ? null : baseUpdate.TrackingRefUpdate.LocalName), newExpectedOldObjectId)\n        {\n\n        }\n\n        /// <summary>\n        /// expectedOldObjectId required to be advertised by remote side, as\n        /// set in constructor; may be null.\n        /// </summary>\n        public ObjectId ExpectedOldObjectId { get; private set; }\n\n        /// <summary>\n        /// true if some object is required to be advertised by remote side,\n        /// as set in constructor; false otherwise.\n        /// </summary>\n        public bool IsExpectingOldObjectId\n        {\n            get\n            {\n                return ExpectedOldObjectId != null;\n            }\n        }\n\n        /// <summary>\n        /// newObjectId for remote ref, as set in constructor.\n        /// </summary>\n        public ObjectId NewObjectId { get; private set; }\n\n        /// <summary>\n        /// true if this update is deleting update; false otherwise.\n        /// </summary>\n        public bool IsDelete\n        {\n            get\n            {\n                return ObjectId.ZeroId.Equals(NewObjectId);\n            }\n        }\n\n        /// <summary>\n        /// name of remote ref to update, as set in constructor.\n        /// </summary>\n        public string RemoteName { get; private set; }\n\n        /// <summary>\n        /// local tracking branch update if localName was set in constructor.\n        /// </summary>\n        public TrackingRefUpdate TrackingRefUpdate { get; private set; }\n\n        /// <summary>\n        /// source revision as specified by user (in constructor), could be\n        /// any string parseable by <see cref=\"Repository.Resolve\"/>; can\n        /// be null if specified that way in constructor - this stands for\n        /// delete request.\n        /// </summary>\n        public string SourceRef { get; private set; }\n\n        /// <summary>\n        /// true if user specified a local tracking branch for remote update;\n        /// false otherwise.\n        /// </summary>\n        public bool HasTrackingRefUpdate\n        {\n            get\n            {\n                return TrackingRefUpdate != null;\n            }\n        }\n\n        /// <summary>\n        /// true if user specified a local tracking branch for remote update;\n        /// false otherwise.\n        /// </summary>\n        public bool ForceUpdate { get; private set; }\n\n        /// <summary>\n        /// status of remote ref update operation.\n        /// </summary>\n        public UpdateStatus Status { get; set; }\n\n        /// <summary>\n        /// Check whether update was fast-forward. Note that this result is\n        /// meaningful only after successful update (when status is <see cref=\"UpdateStatus.OK\"/>.\n        /// <para/>\n        /// true if update was fast-forward; false otherwise.\n        /// </summary>\n        public bool FastForward { get; set; }\n\n        /// <summary>\n        /// message describing reasons of status when needed/possible; may be null.\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Update locally stored tracking branch with the new object.\n        /// </summary>\n        /// <param name=\"walk\">walker used for checking update properties.</param>\n        protected internal void updateTrackingRef(RevWalk.RevWalk walk)\n        {\n            if (IsDelete)\n                TrackingRefUpdate.Delete(walk);\n            else\n                TrackingRefUpdate.Update(walk);\n        }\n\n        public override string ToString()\n        {\n            return \"RemoteRefUpdate[remoteName=\" + RemoteName + \", \" + Status\n                   + \", \" + (ExpectedOldObjectId != null ? ExpectedOldObjectId.Abbreviate(_localDb).name() : \"(null)\")\n                   + \"...\" + (NewObjectId != null ? NewObjectId.Abbreviate(_localDb).name() : \"(null)\")\n                   + (FastForward ? \", fastForward\" : string.Empty)\n                   + \", srcRef=\" + SourceRef + (ForceUpdate ? \", forceUpdate\" : string.Empty) + \", message=\" +\n                   (Message != null\n                        ? \"\\\"\"\n                          + Message + \"\\\"\"\n                        : \"null\") + \", \" + _localDb.Directory + \"]\";\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SideBandInputStream.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n\n\t/// <summary>\n\t/// Unmultiplexes the data portion of a side-band channel.\n\t/// <para/>\n\t/// Reading from this input stream obtains data from channel 1, which is\n\t/// typically the bulk data stream.\n\t/// <para/>\n\t/// Channel 2 is transparently unpacked and \"scraped\" to update a progress\n\t/// monitor. The scraping is performed behind the scenes as part of any of the\n\t/// read methods offered by this stream.\n\t/// <para/>\n\t/// Channel 3 results in an exception being thrown, as the remote side has issued\n\t/// an unrecoverable error.\n\t///\n\t/// <see cref=\"SideBandOutputStream\"/>\n\t///</summary>\n\tpublic class SideBandInputStream : Stream\n\t{\n\t\tprivate const string PFX_REMOTE = \"remote: \";\n\t\tpublic const int CH_DATA = 1;\n\t\tpublic const int CH_PROGRESS = 2;\n\t\tpublic const int CH_ERROR = 3;\n\n\t\tprivate static readonly Regex P_UNBOUNDED = new Regex(\"^([\\\\w ]+): +(\\\\d+)(?:, done\\\\.)? *$\", RegexOptions.Singleline);\n\t\tprivate static readonly Regex P_BOUNDED = new Regex(\"^([\\\\w ]+): +\\\\d+% +\\\\( *(\\\\d+)/ *(\\\\d+)\\\\)(?:, done\\\\.)? *$\", RegexOptions.Singleline);\n\n\t\tprivate readonly Stream rawIn;\n\t\tprivate readonly PacketLineIn pckIn;\n\t\tprivate readonly ProgressMonitor monitor;\n\t\tprivate string progressBuffer;\n\t\tprivate string currentTask;\n\t\tprivate int lastCnt;\n\t\tprivate bool eof;\n\t\tprivate int channel;\n\t\tprivate int available;\n\n\t\tpublic SideBandInputStream(Stream @in, ProgressMonitor progress)\n\t\t{\n\t\t\trawIn = @in;\n\t\t\tpckIn = new PacketLineIn(rawIn);\n\t\t\tmonitor = progress;\n\t\t\tcurrentTask = string.Empty;\n\t\t\tprogressBuffer = string.Empty;\n\t\t}\n\n\t\t#region --> Not supported stream interface members\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override void Flush()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override long Seek(long offset, SeekOrigin origin)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override void SetLength(long value)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override void Write(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override bool CanRead\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override bool CanSeek\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override bool CanWrite\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override long Length\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This is not needed, but we are forced to implement the interface\n\t\t/// </summary>\n\t\tpublic override long Position\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\n#endregion\n\n\t\tpublic override int ReadByte()\n\t\t{\n\t\t\tneedDataPacket();\n\t\t\tif (eof)\n\t\t\t\treturn -1;\n\t\t\tavailable--;\n\t\t\treturn rawIn.ReadByte();\n\t\t}\n\n\t\tpublic override int Read(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tint r = 0;\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tneedDataPacket();\n\t\t\t\tif (eof)\n\t\t\t\t\tbreak;\n\t\t\t\tint n = rawIn.Read(buffer, offset, Math.Min(count, available));\n\t\t\t\tif (n < 0)\n\t\t\t\t\tbreak;\n\t\t\t\tr += n;\n\t\t\t\toffset += n;\n\t\t\t\tcount -= n;\n\t\t\t\tavailable -= n;\n\t\t\t}\n\t\t\treturn eof && r == 0 ? -1 : r;\n\t\t}\n\n\t\tprivate void needDataPacket()\n\t\t{\n\t\t\tif (eof || (channel == CH_DATA && available > 0))\n\t\t\t\treturn;\n\t\t\tfor (; ; )\n\t\t\t{\n\t\t\t\tavailable = pckIn.ReadLength();\n\t\t\t\tif (available == 0)\n\t\t\t\t{\n\t\t\t\t\teof = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tchannel = rawIn.ReadByte() & 0xff;\n\t\t\t\tavailable -= SideBandOutputStream.HDR_SIZE; // length header plus channel indicator\n\t\t\t\tif (available == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tswitch (channel)\n\t\t\t\t{\n\t\t\t\t\tcase CH_DATA:\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase CH_PROGRESS:\n\t\t\t\t\t\tprogress(readString(available));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase CH_ERROR:\n\t\t\t\t\t\teof = true;\n\t\t\t\t\t\tthrow new TransportException(PFX_REMOTE + readString(available));\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new TransportException(\"Invalid channel \" + channel);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void progress(string pkt)\n\t\t{\n\t\t\tpkt = progressBuffer + pkt;\n\t\t\tfor (; ; )\n\t\t\t{\n\t\t\t\tint lf = pkt.IndexOf('\\n');\n\t\t\t\tint cr = pkt.IndexOf('\\r');\n\t\t\t\tint s;\n\t\t\t\tif (0 <= lf && 0 <= cr)\n\t\t\t\t\ts = Math.Min(lf, cr);\n\t\t\t\telse if (0 <= lf)\n\t\t\t\t\ts = lf;\n\t\t\t\telse if (0 <= cr)\n\t\t\t\t\ts = cr;\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\n\t\t\t\tstring msg = pkt.Slice(0, s);\n\t\t\t\tif (doProgressLine(msg))\n\t\t\t\t\tpkt = pkt.Substring(s + 1);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tprogressBuffer = pkt;\n\t\t}\n\n\t\tprivate bool doProgressLine(string msg)\n\t\t{\n\t\t\tMatch matcher = P_BOUNDED.Match(msg);\n\t\t\tif (matcher.Success)\n\t\t\t{\n\t\t\t\tstring taskname = matcher.Groups[1].Value;\n\t\t\t\tif (!currentTask.Equals(taskname))\n\t\t\t\t{\n\t\t\t\t\tcurrentTask = taskname;\n\t\t\t\t\tlastCnt = 0;\n\t\t\t\t\tbeginTask(int.Parse(matcher.Groups[3].Value));\n\t\t\t\t}\n\t\t\t\tint cnt = int.Parse(matcher.Groups[2].Value);\n\t\t\t\tmonitor.Update(cnt - lastCnt);\n\t\t\t\tlastCnt = cnt;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tmatcher = P_UNBOUNDED.Match(msg);\n\t\t\tif (matcher.Success)\n\t\t\t{\n\t\t\t\tstring taskname = matcher.Groups[1].Value;\n\t\t\t\tif (!currentTask.Equals(taskname))\n\t\t\t\t{\n\t\t\t\t\tcurrentTask = taskname;\n\t\t\t\t\tlastCnt = 0;\n\t\t\t\t\tbeginTask(ProgressMonitor.UNKNOWN);\n\t\t\t\t}\n\t\t\t\tint cnt = int.Parse(matcher.Groups[2].Value);\n\t\t\t\tmonitor.Update(cnt - lastCnt);\n\t\t\t\tlastCnt = cnt;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate void beginTask(int totalWorkUnits)\n\t\t{\n\t\t\tmonitor.BeginTask(PFX_REMOTE + currentTask, totalWorkUnits);\n\t\t}\n\n\t\tprivate string readString(int len)\n\t\t{\n\t\t\tbyte[] raw = new byte[len];\n\t\t\tIO.ReadFully(rawIn, raw, 0, len);\n\t\t\treturn RawParseUtils.decode(Constants.CHARSET, raw, 0, len);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SideBandOutputStream.cs",
    "content": "﻿/*\n * Copyright (C) 2008-2010, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core.Transport\n{\n\n\t/// <summary>\n\t/// Multiplexes data and progress messages.\n\t/// <para/>\n\t/// This stream is buffered at packet sizes, so the caller doesn't need to wrap\n\t/// it in yet another buffered stream.\n\t/// </summary>\n\tpublic class SideBandOutputStream : Stream\n\t{\n\t\tpublic const int CH_DATA = SideBandInputStream.CH_DATA;\n\t\tpublic const int CH_PROGRESS = SideBandInputStream.CH_PROGRESS;\n\t\tpublic const int CH_ERROR = SideBandInputStream.CH_ERROR;\n\t\tpublic const int SMALL_BUF = 1000;\n\t\tpublic const int MAX_BUF = 65520;\n\t\tpublic const int HDR_SIZE = 5;\n\n\t\tprivate readonly Stream _out;\n\t\tprivate readonly byte[] _buffer;\n\n\t\t/// <summary>\n\t\t/// Number of bytes in <see cref=\"_buffer\"/> that are valid data.\n\t\t/// <para/>\n\t\t/// Initialized to <see cref=\"HDR_SIZE\"/> if there is no application data in the\n\t\t/// buffer, as the packet header always appears at the start of the buffer.\n\t\t/// </summary>\n\t\tprivate int cnt;\n\n\t\t/// <summary>\n\t\t/// Create a new stream to write side band packets.\n\t\t/// </summary>\n\t\t/// <param name=\"chan\">channel number to prefix all packets with, so the remote side\n\t\t/// can demultiplex the stream and get back the original data.\n\t\t/// Must be in the range [0, 255].</param>\n\t\t/// <param name=\"sz\">maximum size of a data packet within the stream. The remote\n\t\t/// side needs to agree to the packet size to prevent buffer\n\t\t/// overflows. Must be in the range [HDR_SIZE + 1, MAX_BUF).</param>\n\t\t/// <param name=\"os\">stream that the packets are written onto. This stream should\n\t\t/// be attached to a SideBandInputStream on the remote side.</param>\n\t\tpublic SideBandOutputStream(int chan, int sz, Stream os)\n\t\t{\n\t\t\tif (chan <= 0 || chan > 255)\n\t\t\t\tthrow new ArgumentException(\"channel \" + chan\n\t\t\t\t\t\t+ \" must be in range [0, 255]\");\n\t\t\tif (sz <= HDR_SIZE)\n\t\t\t\tthrow new ArgumentException(\"packet size \" + sz\n\t\t\t\t\t\t+ \" must be >= \" + HDR_SIZE);\n\t\t\telse if (MAX_BUF < sz)\n\t\t\t\tthrow new ArgumentException(\"packet size \" + sz\n\t\t\t\t\t\t+ \" must be <= \" + MAX_BUF);\n\n\t\t\t_out = os;\n\t\t\t_buffer = new byte[sz];\n\t\t\t_buffer[4] = (byte)chan;\n\t\t\tcnt = HDR_SIZE;\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t\tif (HDR_SIZE < cnt)\n\t\t\t\tWriteBuffer();\n\t\t\t_out.Flush();\n\t\t}\n\n\t\tpublic override void Write(byte[] b, int off, int len)\n\t\t{\n\t\t\twhile (0 < len)\n\t\t\t{\n\t\t\t\tint capacity = _buffer.Length - cnt;\n\t\t\t\tif (cnt == HDR_SIZE && capacity < len)\n\t\t\t\t{\n\t\t\t\t\t// Our block to write is bigger than the packet size,\n\t\t\t\t\t// stream it out as-is to avoid unnecessary copies.\n\t\t\t\t\tPacketLineOut.FormatLength(_buffer, _buffer.Length);\n\t\t\t\t\t_out.Write(_buffer, 0, HDR_SIZE);\n\t\t\t\t\t_out.Write(b, off, capacity);\n\t\t\t\t\toff += capacity;\n\t\t\t\t\tlen -= capacity;\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (capacity == 0)\n\t\t\t\t\t\tWriteBuffer();\n\n\t\t\t\t\tint n = Math.Min(len, capacity);\n\t\t\t\t\tArray.Copy(b, off, _buffer, cnt, n);\n\t\t\t\t\tcnt += n;\n\t\t\t\t\toff += n;\n\t\t\t\t\tlen -= n;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Write(int b)\n\t\t{\n\t\t\tif (cnt == _buffer.Length)\n\t\t\t\tWriteBuffer();\n\t\t\t_buffer[cnt++] = (byte)b;\n\t\t}\n\n\t\tprivate void WriteBuffer()\n\t\t{\n\t\t\tPacketLineOut.FormatLength(_buffer, cnt);\n\t\t\t_out.Write(_buffer, 0, cnt);\n\t\t\tcnt = HDR_SIZE;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override long Seek(long offset, SeekOrigin origin)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override void SetLength(long value)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override bool CanRead\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override bool CanWrite\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override bool CanSeek\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override long Length\n\t\t{\n\t\t\tget { throw new NotSupportedException(); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// We are forced to implement this interface member even though we don't need it\n\t\t/// </summary>\n\t\tpublic override long Position\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Read(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\treturn \t_out.Read(buffer, offset, count);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SideBandProgressMonitor.cs",
    "content": "/*\n * Copyright (C) 2008-2010, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Write progress messages out to the sideband channel.\n    /// </summary>\n    public class SideBandProgressMonitor : ProgressMonitor, IDisposable\n    {\n        private readonly StreamWriter _writer;\n        private bool _output;\n        private long _taskBeganAt;\n        private long _lastOutput;\n        private string _msg;\n        private int _lastWorked;\n        private int _totalWork;\n\n\t\t  public SideBandProgressMonitor(Stream os)\n        {\n\t\t\t\t_writer = new StreamWriter(os, Constants.CHARSET);\n\t\t  }\n\n        public override void Start(int totalTasks)\n        {\n            _taskBeganAt = SystemReader.getInstance().getCurrentTime();\n            _lastOutput = _taskBeganAt;\n        }\n\n        public override void BeginTask(string title, int totalWork)\n        {\n            EndTask();\n            _msg = title;\n            _lastWorked = 0;\n            _totalWork = totalWork;\n        }\n\n        public override void Update(int completed)\n        {\n            if (_msg == null)\n                return;\n\n            int cmp = _lastWorked + completed;\n            long now = SystemReader.getInstance().getCurrentTime();\n            if (!_output && now - _taskBeganAt < 500)\n                return;\n            if (_totalWork == UNKNOWN)\n            {\n                if (now - _lastOutput >= 500)\n                {\n                    display(cmp, null);\n                    _lastOutput = now;\n                }\n            }\n            else\n            {\n                if ((cmp * 100 / _totalWork) != (_lastWorked * 100) / _totalWork || now - _lastOutput >= 500)\n                {\n                    display(cmp, null);\n                    _lastOutput = now;\n                }\n            }\n            _lastWorked = cmp;\n            _output = true;\n        }\n\n        private void display(int cmp, string eol)\n        {\n            var m = new StringBuilder();\n            m.Append(_msg);\n            m.Append(\": \");\n\n            if (_totalWork == UNKNOWN)\n            {\n                m.Append(cmp);\n            }\n            else\n            {\n                int pcnt = (cmp * 100 / _totalWork);\n                if (pcnt < 100)\n                    m.Append(' ');\n                if (pcnt < 10)\n                    m.Append(' ');\n                m.Append(pcnt);\n                m.Append(\"% (\");\n                m.Append(cmp);\n                m.Append(\"/\");\n                m.Append(_totalWork);\n                m.Append(\")\");\n            }\n            if (eol != null)\n                m.Append(eol);\n            else\n            {\n                m.Append(\"   \\r\");\n            }\n            _writer.Write(m.ToString());\n            _writer.Flush();\n        }\n\n        public override bool IsCancelled\n        {\n            get { return false; }\n        }\n\n        public override void EndTask()\n        {\n            if (_output)\n            {\n                if (_totalWork == UNKNOWN)\n                    display(_lastWorked, \", done\\n\");\n                else\n                    display(_totalWork, \"\\n\");\n            }\n            _output = false;\n            _msg = null;\n        }\n\n        public void Dispose()\n        {\n            _writer.Dispose();\n        }\n\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SshConfigSessionFactory.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n * Copyright (C) 2009, Google, Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing Tamir.SharpSsh.java.util;\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// The base session factory that loads known hosts and private keys from\n    /// <code>$HOME/.ssh</code>.\n    /// <para/>\n    /// This is the default implementation used by JGit and provides most of the\n    /// compatibility necessary to match OpenSSH, a popular implementation of SSH\n    /// used by C Git.\n    /// <para/>\n    /// The factory does not provide UI behavior. Override the method\n    /// <see cref=\"configure\"/>\n    /// to supply appropriate {@link UserInfo} to the session.\n    /// </summary>\n    public abstract class SshConfigSessionFactory : SshSessionFactory\n    {\n        private OpenSshConfig _config;\n        private readonly Dictionary<string, JSch> _byIdentityFile = new Dictionary<string, JSch>();\n        private JSch _defaultJSch;\n\n        public override Session getSession(string user, string pass, string host, int port)\n        {\n            OpenSshConfig.Host hc = getConfig().lookup(host);\n            host = hc.getHostName();\n            if (port <= 0)\n                port = hc.getPort();\n            if (user == null)\n                user = hc.getUser();\n\n            Session session = createSession(hc, user, host, port);\n            if (pass != null)\n                session.setPassword(pass);\n            string strictHostKeyCheckingPolicy = hc.getStrictHostKeyChecking();\n            if (strictHostKeyCheckingPolicy != null)\n            {\n                var ht = new Hashtable();\n                ht.put(\"StrictHostKeyChecking\", strictHostKeyCheckingPolicy);\n                session.setConfig(ht);\n            }\n            string pauth = hc.getPreferredAuthentications();\n            if (pauth != null)\n            {\n                var ht = new Hashtable();\n                ht.put(\"PreferredAuthentications\", pauth);\n                session.setConfig(ht);\n            }\n            configure(hc, session);\n            return session;\n        }\n\n        /// <summary>\n        /// Create a new JSch session for the requested address.\n        /// </summary>\n        /// <param name=\"hc\">host configuration</param>\n        /// <param name=\"user\">login to authenticate as.</param>\n        /// <param name=\"host\">server name to connect to.</param>\n        /// <param name=\"port\">port number of the SSH daemon (typically 22).</param>\n        /// <returns>new session instance, but otherwise unconfigured.</returns>\n        protected Session createSession(OpenSshConfig.Host hc, string user, string host, int port)\n        {\n            return getJSch(hc).getSession(user, host, port);\n        }\n\n        /// <summary>\n        /// Provide additional configuration for the session based on the host\n        /// information. This method could be used to supply {@link UserInfo}.\n        /// </summary>\n        /// <param name=\"hc\">host configuration</param>\n        /// <param name=\"session\">session to configure</param>\n        protected abstract void configure(OpenSshConfig.Host hc, Session session);\n\n        /// <summary>\n        /// Obtain the JSch used to create new sessions.\n        /// </summary>\n        /// <param name=\"hc\">host configuration</param>\n        /// <returns>the JSch instance to use.</returns>\n        protected JSch getJSch(OpenSshConfig.Host hc)\n        {\n            if (hc == null)\n                throw new System.ArgumentNullException(\"hc\");\n\n            JSch def = getDefaultJSch();\n            FileInfo identityFile = hc.getIdentityFile();\n            if (identityFile == null)\n                return def;\n\n            string identityKey = identityFile.FullName;\n            JSch jsch;\n            if(!_byIdentityFile.TryGetValue(identityKey, out jsch))\n            {\n                jsch = new JSch();\n                jsch.setHostKeyRepository(def.getHostKeyRepository());\n                jsch.addIdentity(identityKey);\n                _byIdentityFile.Add(identityKey, jsch);\n            }\n            return jsch;\n        }\n\n        private JSch getDefaultJSch()\n        {\n            if (_defaultJSch == null)\n            {\n                _defaultJSch = createDefaultJSch();\n                foreach (object name in _defaultJSch.getIdentityNames())\n                {\n                    _byIdentityFile.put((string)name, _defaultJSch);\n                }\n            }\n            return _defaultJSch;\n        }\n\n        /// <summary>\n        /// Returns the new default JSch implementation\n        /// </summary>\n        /// <returns>the new default JSch implementation</returns>\n        protected static JSch createDefaultJSch()\n        {\n            JSch jsch = new JSch();\n            knownHosts(jsch);\n            identities(jsch);\n            return jsch;\n        }\n\n        private OpenSshConfig getConfig()\n        {\n            if (_config == null)\n                _config = OpenSshConfig.get();\n            return _config;\n        }\n\n\n        private static void knownHosts(JSch sch)\n        {\n            DirectoryInfo home = FS.userHome();\n            if (home == null)\n                return;\n            var known_hosts = new FileInfo(Path.Combine(home.ToString(), \".ssh/known_hosts\"));\n            try\n            {\n                using (var s = new StreamReader(known_hosts.FullName))\n                {\n                    sch.setKnownHosts(s);\n                }\n            }\n            catch (FileNotFoundException)\n            {\n                // Oh well. They don't have a known hosts in home.\n            }\n            catch (IOException)\n            {\n                // Oh well. They don't have a known hosts in home.\n            }\n        }\n\n        private static void identities(JSch sch)\n        {\n            DirectoryInfo home = FS.userHome();\n            if (home == null)\n                return;\n            var sshdir = PathUtil.CombineDirectoryPath(home, \".ssh\");\n            if (sshdir.IsDirectory())\n            {\n                loadIdentity(sch, PathUtil.CombineFilePath(sshdir, \"identity\"));\n                loadIdentity(sch, PathUtil.CombineFilePath(sshdir, \"id_rsa\"));\n                loadIdentity(sch, PathUtil.CombineFilePath(sshdir, \"id_dsa\"));\n            }\n        }\n\n        private static void loadIdentity(JSch sch, FileInfo priv)\n        {\n            if (!priv.IsFile()) return;\n            try\n            {\n                sch.addIdentity(priv.FullName);\n            }\n            catch (JSchException)\n            {\n                // Instead, pretend the key doesn't exist.\n            }\n        }\n    }\n\n    public static class JSchExtensions\n    {\n        public static IEnumerable<object> getIdentityNames(this JSch jSch)\n        {\n            //TODO: [nulltoken] Implement JSch.getIdentityNames with the help of reflection.\n            return new string[]{};\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SshSessionFactory.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Creates and destroys SSH connections to a remote system.\n    /// <para/>\n    /// Different implementations of the session factory may be used to control\n    /// communicating with the end-user as well as reading their personal SSH\n    /// configuration settings, such as known hosts and private keys.\n    /// <para/>\n    /// A <see cref=\"Session\"/> must be returned to the factory that created it. Callers\n    /// are encouraged to retain the SshSessionFactory for the duration of the period\n    /// they are using the Session.\n    /// </summary>\n    public abstract class SshSessionFactory\n    {\n        /// <summary>\n        /// Get the currently configured factory.\n        /// <para/>\n        /// A factory is always available. By default the factory will read from the\n        /// user's <code>$HOME/.ssh</code> and assume OpenSSH compatibility.\n        /// </summary>\n        public static SshSessionFactory Instance = new DefaultSshSessionFactory();\n\n        /// <summary>\n        /// Change the JVM-wide factory to a different implementation.\n        /// </summary>\n        /// <param name=\"newFactory\">\n        /// factory for future sessions to be created through. If null the\n        /// default factory will be restored.\n        /// </param>\n        public static void setInstance(SshSessionFactory newFactory)\n        {\n            if (newFactory != null)\n                Instance = newFactory;\n            else\n            {\n                Instance = new DefaultSshSessionFactory();\n            }\n        }\n\n        /// <summary>\n        /// Open (or reuse) a session to a host.\n        /// <para/>\n        /// A reasonable UserInfo that can interact with the end-user (if necessary)\n        /// is installed on the returned session by this method.\n        /// <para/>\n        /// The caller must connect the session by invoking <code>connect()</code>\n        /// if it has not already been connected.\n        /// </summary>\n        /// <param name=\"user\">\n        /// username to authenticate as. If null a reasonable default must\n        /// be selected by the implementation. This may be\n        /// <code>System.getProperty(\"user.name\")</code>.\n        /// </param>\n        /// <param name=\"pass\">\n        /// optional user account password or passphrase. If not null a\n        /// UserInfo that supplies this value to the SSH library will be\n        /// configured.\n        /// </param>\n        /// <param name=\"host\">hostname (or IP address) to connect to. Must not be null.</param>\n        /// <param name=\"port\">\n        /// port number the server is listening for connections on. May be &lt;=\n        /// 0 to indicate the IANA registered port of 22 should be used.\n        /// </param>\n        /// <returns>a session that can contact the remote host.</returns>\n        public abstract Session getSession(string user, string pass, string host, int port);\n\n        /// <summary>\n        /// Close (or recycle) a session to a host.\n        /// </summary>\n        /// <param name=\"session\">\n        /// a session previously obtained from this factory's\n        /// <see cref=\"getSession\"/> method.\n        /// </param>\n        public void releaseSession(Session session)\n        {\n            if (session == null)\n                throw new System.ArgumentNullException(\"session\");\n\n            if (session.isConnected())\n                session.disconnect();\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/SshTransport.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Net.Sockets;\nusing GitSharp.Core.Exceptions;\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// The base class for transports that use SSH protocol. This class allows\n    /// customizing SSH connection settings.\n    /// </summary>\n    public abstract class SshTransport : TcpTransport\n    {\n        private SshSessionFactory _sch;\n        private Session _sock;\n\n        /// <summary>\n        /// The open SSH session\n        /// </summary>\n        public Session Sock\n        {\n            get { return _sock; }\n        }\n\n        /// <summary>\n        /// Create a new transport instance.\n        /// </summary>\n        /// <param name=\"local\">\n        /// the repository this instance will fetch into, or push out of.\n        /// This must be the repository passed to\n        /// <see cref=\"Transport.open(GitSharp.Core.Repository,GitSharp.Core.Transport.URIish)\"/>.\n        /// </param>\n        /// <param name=\"uri\">\n        /// the URI used to access the remote repository. This must be the\n        /// URI passed to {@link #open(Repository, URIish)}.\n        /// </param>\n        protected SshTransport(Repository local, URIish uri)\n            : base(local, uri)\n        {\n            _sch = SshSessionFactory.Instance;\n        }\n\n        /// <summary>\n        /// the SSH session factory that will be used for creating SSH sessions\n        /// </summary>\n        public SshSessionFactory SshSessionFactory\n        {\n            get { return _sch; }\n            set\n            {\n                if (value == null)\n                {\n                    throw new ArgumentException(\"The factory must not be null\");\n                }\n\n                if (_sock != null)\n                {\n                    throw new ApplicationException(\"An SSH session has already been created\");\n                }\n\n                _sch = value;\n            }\n        }\n\n        /// <summary>\n        /// Initialize SSH session\n        /// </summary>\n        protected void InitSession()\n        {\n            if (_sock != null) return;\n\n            int tms = Timeout > 0 ? Timeout * 1000 : 0;\n            string user = Uri.User;\n            string pass = Uri.Pass;\n            string host = Uri.Host;\n            int port = Uri.Port;\n            try\n            {\n                _sock = _sch.getSession(user, pass, host, port);\n                if (!_sock.isConnected())\n                {\n                    _sock.connect(tms);\n                }\n            }\n            catch (JSchException je)\n            {\n                throw new TransportException(Uri, je.Message, je.InnerException);\n            }\n            catch (SocketException e)\n            {\n                throw new TransportException(e.Message, e.InnerException ?? e);\n            }\n        }\n\n        public override void close()\n        {\n            if (_sock == null) return;\n\n            try\n            {\n                _sch.releaseSession(_sock);\n            }\n            finally\n            {\n                _sock = null;\n            }\n\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~SshTransport()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: {\" + Local.Directory + \"}/{\" + Uri + \"}\");\n        }\n#endif\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TagOpt.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Transport\n{\n\n    /// <summary>\n    /// Specification of annotated tag behavior during fetch.\n    /// </summary>\n    public class TagOpt\n    {\n        /// <summary>\n        /// Automatically follow tags if we fetch the thing they point at.\n        /// <para />\n        /// This is the default behavior and tries to balance the benefit of having\n        /// an annotated tag against the cost of possibly objects that are only on\n        /// branches we care nothing about. Annotated tags are fetched only if we can\n        /// prove that we already have (or will have when the fetch completes) the\n        /// object the annotated tag peels (dereferences) to.\n        /// </summary>\n        public static readonly TagOpt AUTO_FOLLOW = new TagOpt(string.Empty);\n\n        /// <summary>\n        /// Never fetch tags, even if we have the thing it points at.\n        /// <para />\n        /// This option must be requested by the user and always avoids fetching\n        /// annotated tags. It is most useful if the location you are fetching from\n        /// publishes annotated tags, but you are not interested in the tags and only\n        /// want their branches.\n        /// </summary>\n        public static readonly TagOpt NO_TAGS = new TagOpt(\"--no-tags\");\n\n        /// <summary>\n        /// Always fetch tags, even if we do not have the thing it points at.\n        /// <para />\n        /// Unlike {@link #AUTO_FOLLOW} the tag is always obtained. This may cause\n        /// hundreds of megabytes of objects to be fetched if the receiving\n        /// repository does not yet have the necessary dependencies.\n        /// \n        /// </summary>\n        public static readonly TagOpt FETCH_TAGS = new TagOpt(\"--tags\");\n\n        private static readonly TagOpt[] values = new[] { AUTO_FOLLOW, NO_TAGS, FETCH_TAGS };\n\n        /// <summary>\n        /// Command line/configuration file text for this value.\n        /// </summary>\n        public string Option { get; private set; }\n\n        private TagOpt(string o)\n        {\n            Option = o;\n        }\n\n        /// <summary>\n        /// Convert a command line/configuration file text into a value instance.\n        /// </summary>\n        /// <param name=\"o\">the configuration file text value.</param>\n        /// <returns>the option that matches the passed parameter.</returns>\n        public static TagOpt fromOption(string o)\n        {\n            if (string.IsNullOrEmpty(o))\n            {\n                return AUTO_FOLLOW;\n            }\n\n            foreach (TagOpt tagopt in values)\n            {\n                if (tagopt.Option.Equals(o))\n                    return tagopt;\n            }\n            throw new ArgumentException(\"Invalid tag option: \" + o);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TcpTransport.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, JetBrains s.r.o.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// The base class for transports based on TCP sockets. This class\n    /// holds settings common for all TCP based transports.\n    /// </summary>\n    public abstract class TcpTransport : Transport\n    {\n        /// <summary>\n        /// Create a new transport instance.\n        /// </summary>\n        /// <param name=\"local\">\n        /// The repository this instance will fetch into, or push out of.\n        /// This must be the repository passed to <see cref=\"Transport.open(Repository, URIish)\"/>.\n        /// </param>\n        /// <param name=\"uri\">\n        /// the URI used to access the remote repository. This must be the\n        /// URI passed to <see cref=\"Transport.open(Repository, URIish)\"/>.\n        /// </param>\n        protected TcpTransport(Repository local, URIish uri)\n            : base(local, uri)\n        {\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TrackingRefUpdate.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Update of a locally stored tracking branch.\n    /// </summary>\n    public class TrackingRefUpdate\n    {\n        private readonly RefUpdate update;\n\n        public TrackingRefUpdate(Repository db, RefSpec spec, AnyObjectId nv, string msg)\n            : this(db, spec.Destination, spec.Source, spec.Force, nv, msg)\n        {\n            if (spec == null)\n                throw new System.ArgumentNullException(\"spec\");\n        }\n\n        public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)\n        {\n            if (db == null)\n                throw new System.ArgumentNullException(\"db\");\n            if (nv == null)\n                throw new System.ArgumentNullException(\"nv\");\n            RemoteName = remoteName;\n            update = db.UpdateRef(localName);\n            update.IsForceUpdate = forceUpdate;\n            update.NewObjectId = nv.Copy();\n            update.setRefLogMessage(msg, true);\n        }\n\n        /// <summary>\n        /// the name of the remote ref.\n        /// <para/>\n        /// Usually this is of the form \"refs/heads/master\".\n        /// </summary>\n        public string RemoteName { get; private set; }\n\n        /// <summary>\n        /// Get the name of the local tracking ref.\n        /// <para/>\n        /// Usually this is of the form \"refs/remotes/origin/master\".\n        /// </summary>\n        public string LocalName\n        {\n            get\n            {\n                return update.Name;\n            }\n        }\n\n        /// <summary>\n        /// Get the new value the ref will be (or was) updated to. Null if the caller has not configured it.\n        /// </summary>\n        public ObjectId NewObjectId\n        {\n            get\n            {\n                return update.NewObjectId;\n            }\n        }\n\n        /// <summary>\n        /// The old value of the ref, prior to the update being attempted.\n        /// <para/>\n        /// This value may differ before and after the update method. Initially it is\n        /// populated with the value of the ref before the lock is taken, but the old\n        /// value may change if someone else modified the ref between the time we\n        /// last read it and when the ref was locked for update.\n        /// <para/>\n        /// Returns the value of the ref prior to the update being attempted; null if\n        /// the updated has not been attempted yet.\n        /// </summary>\n        public ObjectId OldObjectId\n        {\n            get\n            {\n                return update.OldObjectId;\n            }\n        }\n\n        /// <summary>\n        /// the status of this update.\n        /// </summary>\n        public RefUpdate.RefUpdateResult Result\n        {\n            get\n            {\n                return update.Result;\n            }\n        }\n\n        public void Update(RevWalk.RevWalk walk)\n        {\n            update.update(walk);\n        }\n\n        public void Delete(RevWalk.RevWalk walk)\n        {\n            update.delete(walk);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/Transport.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Connects two Git repositories together and copies objects between them.\n    /// <para />\n    /// A transport can be used for either fetching (copying objects into the\n    /// caller's repository from the remote repository) or pushing (copying objects\n    /// into the remote repository from the caller's repository). Each transport\n    /// implementation is responsible for the details associated with establishing\n    /// the network connection(s) necessary for the copy, as well as actually\n    /// shuffling data back and forth.\n    /// <para />\n    /// Transport instances and the connections they Create are not thread-safe.\n    /// Callers must ensure a transport is accessed by only one thread at a time.\n    /// </summary>\n    public abstract class Transport : IDisposable\n    {\n        /// <summary>\n        /// Type of operation a Transport is being opened for.\n        /// </summary>\n        public enum Operation\n        {\n            /// <summary>\n            /// Transport is to fetch objects locally.\n            /// </summary>\n            FETCH,\n\n            /// <summary>\n            /// Transport is to push objects remotely.\n            /// </summary>\n            PUSH\n        }\n\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// <para/>\n        /// This method assumes <see cref=\"Operation.FETCH\"/>.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"remote\">\n        /// location of the remote repository - may be URI or remote\n        /// configuration name.\n        /// </param>\n        /// <returns>\n        /// the new transport instance. Never null. In case of multiple URIs\n        /// in remote configuration, only the first is chosen.\n        /// </returns>\n        public static Transport open(Repository local, string remote)\n        {\n            return open(local, remote, Operation.FETCH);\n        }\n\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"remote\">location of the remote repository - may be URI or remote configuration name.</param>\n        /// <param name=\"op\">\n        /// planned use of the returned Transport; the URI may differ\n        /// based on the type of connection desired.\n        /// </param>\n        /// <returns>\n        /// the new transport instance. Never null. In case of multiple URIs\n        /// in remote configuration, only the first is chosen.\n        /// </returns>\n        public static Transport open(Repository local, string remote,\n                Operation op)\n        {\n            var cfg = new RemoteConfig(local.Config, remote);\n            if (doesNotExist(cfg))\n                return open(local, new URIish(remote));\n            return open(local, cfg, op);\n        }\n\n        /// <summary>\n        /// Open new transport instances to connect two repositories.\n        /// <para/>\n        /// This method assumes <see cref=\"Operation.FETCH\"/>.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"remote\">\n        /// location of the remote repository - may be URI or remote\n        /// configuration name.\n        /// </param>\n        /// <returns>\n        /// the list of new transport instances for every URI in remote\n        /// configuration.\n        /// </returns>\n        public static List<Transport> openAll(Repository local, string remote)\n        {\n            return openAll(local, remote, Operation.FETCH);\n        }\n\n        /// <summary>\n        /// Open new transport instances to connect two repositories.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"remote\">\n        /// location of the remote repository - may be URI or remote\n        /// configuration name.\n        /// </param>\n        /// <param name=\"op\">\n        /// planned use of the returned Transport; the URI may differ\n        /// based on the type of connection desired.\n        /// </param>\n        /// <returns>\n        /// the list of new transport instances for every URI in remote\n        /// configuration.\n        /// </returns>\n        public static List<Transport> openAll(Repository local,\n                string remote, Operation op)\n        {\n            var cfg = new RemoteConfig(local.Config, remote);\n            if (doesNotExist(cfg))\n            {\n                var transports = new List<Transport>(1);\n                transports.Add(open(local, new URIish(remote)));\n                return transports;\n            }\n            return openAll(local, cfg, op);\n        }\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// <para/>\n        /// This method assumes <see cref=\"Operation.FETCH\"/>.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"cfg\">\n        /// configuration describing how to connect to the remote\n        /// repository.\n        /// </param>\n        /// <returns>\n        /// the new transport instance. Never null. In case of multiple URIs\n        /// in remote configuration, only the first is chosen.\n        /// </returns>\n        public static Transport open(Repository local, RemoteConfig cfg)\n        {\n            return open(local, cfg, Operation.FETCH);\n        }\n\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"cfg\">\n        /// configuration describing how to connect to the remote\n        /// repository.\n        /// </param>\n        /// <param name=\"op\">\n        /// planned use of the returned Transport; the URI may differ\n        /// based on the type of connection desired.\n        /// </param>\n        /// <returns></returns>\n        public static Transport open(Repository local,\n                RemoteConfig cfg, Operation op)\n        {\n            List<URIish> uris = getURIs(cfg, op);\n            if (uris.isEmpty())\n                throw new ArgumentException(\n                        \"Remote config \\\"\"\n                        + cfg.Name + \"\\\" has no URIs associated\");\n            Transport tn = open(local, uris[0]);\n            tn.ApplyConfig(cfg);\n            return tn;\n        }\n\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// <para/>\n        /// This method assumes <see cref=\"Operation.FETCH\"/>.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"cfg\">\n        /// configuration describing how to connect to the remote\n        /// repository.\n        /// </param>\n        /// <returns>\n        /// the list of new transport instances for every URI in remote\n        /// configuration.\n        /// </returns>\n        public static List<Transport> openAll(Repository local, RemoteConfig cfg)\n        {\n            return openAll(local, cfg, Operation.FETCH);\n        }\n\n        /// <summary>\n        /// Open new transport instances to connect two repositories.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"cfg\">\n        /// configuration describing how to connect to the remote\n        /// repository.\n        /// </param>\n        /// <param name=\"op\">\n        /// planned use of the returned Transport; the URI may differ\n        /// based on the type of connection desired.\n        /// </param>\n        /// <returns>\n        /// the list of new transport instances for every URI in remote\n        /// configuration.\n        /// </returns>\n        public static List<Transport> openAll(Repository local,\n                RemoteConfig cfg, Operation op)\n        {\n            List<URIish> uris = getURIs(cfg, op);\n            var transports = new List<Transport>(uris.Count);\n            foreach (URIish uri in uris)\n            {\n                Transport tn = open(local, uri);\n                tn.ApplyConfig(cfg);\n                transports.Add(tn);\n            }\n            return transports;\n        }\n\n        private static List<URIish> getURIs(RemoteConfig cfg, Operation op)\n        {\n            switch (op)\n            {\n                case Operation.FETCH:\n                    return cfg.URIs;\n\n                case Operation.PUSH:\n                    List<URIish> uris = cfg.PushURIs;\n                    if (uris.isEmpty())\n                    {\n                        uris = cfg.URIs;\n                    }\n                    return uris;\n\n                default:\n                    throw new ArgumentException(op.ToString());\n            }\n        }\n\n        private static bool doesNotExist(RemoteConfig cfg)\n        {\n            return cfg.URIs.isEmpty() && cfg.PushURIs.isEmpty();\n        }\n\n        /// <summary>\n        /// Open a new transport instance to connect two repositories.\n        /// </summary>\n        /// <param name=\"local\">existing local repository.</param>\n        /// <param name=\"remote\">location of the remote repository.</param>\n        /// <returns>the new transport instance. Never null.</returns>\n        public static Transport open(Repository local, URIish remote)\n        {\n            if (TransportGitSsh.canHandle(remote))\n                return new TransportGitSsh(local, remote);\n\n            if (TransportHttp.canHandle(remote))\n                return new TransportHttp(local, remote);\n\n            if (TransportSftp.canHandle(remote))\n                return new TransportSftp(local, remote);\n\n            if (TransportGitAnon.canHandle(remote))\n                return new TransportGitAnon(local, remote);\n\n            if (TransportAmazonS3.canHandle(remote))\n                return new TransportAmazonS3(local, remote);\n\n            if (TransportBundleFile.canHandle(remote))\n                return new TransportBundleFile(local, remote);\n\n            if (TransportLocal.canHandle(remote))\n                return new TransportLocal(local, remote);\n\n            throw new NotSupportedException(\"URI not supported: \" + remote);\n        }\n\n        /// <summary>\n        /// Convert push remote refs update specification from <see cref=\"RefSpec\"/> form\n        /// to <see cref=\"RemoteRefUpdate\"/>. Conversion expands wildcards by matching\n        /// source part to local refs. expectedOldObjectId in RemoteRefUpdate is\n        /// always set as null. Tracking branch is configured if RefSpec destination\n        /// matches source of any fetch ref spec for this transport remote\n        /// configuration.\n        /// </summary>\n        /// <param name=\"db\">local database.</param>\n        /// <param name=\"specs\">collection of RefSpec to convert.</param>\n        /// <param name=\"fetchSpecs\">\n        /// fetch specifications used for finding localtracking refs. May\n        /// be null or empty collection.\n        /// </param>\n        /// <returns>collection of set up <see cref=\"RemoteRefUpdate\"/>.</returns>\n        public static ICollection<RemoteRefUpdate> findRemoteRefUpdatesFor(Repository db, List<RefSpec> specs, List<RefSpec> fetchSpecs)\n        {\n            if (fetchSpecs == null)\n            {\n                fetchSpecs = new List<RefSpec>();\n            }\n\n            ICollection<RemoteRefUpdate> result = new List<RemoteRefUpdate>();\n            ICollection<RefSpec> procRefs = ExpandPushWildcardsFor(db, specs);\n\n            foreach (RefSpec spec in procRefs)\n            {\n                string srcSpec = spec.Source;\n                Ref srcRef = db.getRef(srcSpec);\n                if (srcRef != null)\n                {\n                    srcSpec = srcRef.Name;\n                }\n\n                String destSpec = spec.Destination;\n                if (destSpec == null)\n                {\n                    // No destination (no-colon in ref-spec), DWIMery assumes src\n                    //\n                    destSpec = srcSpec;\n                }\n\n                if (srcRef != null && !destSpec.StartsWith(Constants.R_REFS))\n                {\n                    // Assume the same kind of ref at the destination, e.g.\n                    // \"refs/heads/foo:master\", DWIMery assumes master is also\n                    // under \"refs/heads/\".\n                    //\n                    string n = srcRef.Name;\n                    int kindEnd = n.IndexOf('/', Constants.R_REFS.Length);\n                    destSpec = n.Slice(0, kindEnd + 1) + destSpec;\n                }\n\n                bool forceUpdate = spec.Force;\n                string localName = FindTrackingRefName(destSpec, fetchSpecs);\n                var rru = new RemoteRefUpdate(db, srcSpec, destSpec, forceUpdate, localName, null);\n                result.Add(rru);\n            }\n            return result;\n        }\n\n        private static ICollection<RefSpec> ExpandPushWildcardsFor(Repository db, IEnumerable<RefSpec> specs)\n        {\n            IDictionary<string, Ref> localRefs = db.getAllRefs();\n            var procRefs = new HashSet<RefSpec>();\n\n            foreach (RefSpec spec in specs)\n            {\n                if (spec.Wildcard)\n                {\n                    foreach (Ref localRef in localRefs.Values)\n                    {\n                        if (spec.MatchSource(localRef))\n                        {\n                            procRefs.Add(spec.ExpandFromSource(localRef));\n                        }\n                    }\n                }\n                else\n                {\n                    procRefs.Add(spec);\n                }\n            }\n\n            return procRefs;\n        }\n\n        private static string FindTrackingRefName(string remoteName, IEnumerable<RefSpec> fetchSpecs)\n        {\n            // try to find matching tracking refs\n            foreach (RefSpec fetchSpec in fetchSpecs)\n            {\n                if (fetchSpec.MatchSource(remoteName))\n                {\n                    if (fetchSpec.Wildcard)\n                        return fetchSpec.ExpandFromSource(remoteName).Destination;\n\n                    return fetchSpec.Destination;\n                }\n            }\n            return null;\n        }\n\n        /// <summary>\n        /// Default setting for <see cref=\"get_FetchThin\"/> option.\n        /// </summary>\n        public const bool DEFAULT_FETCH_THIN = true;\n\n        /// <summary>\n        /// Default setting for <see cref=\"get_PushThin\"/> option.\n        /// </summary>\n        public const bool DEFAULT_PUSH_THIN = false;\n\n        /// <summary>\n        /// Specification for fetch or push operations, to fetch or push all tags.\n        /// Acts as --tags.\n        /// </summary>\n        public static readonly RefSpec REFSPEC_TAGS = new RefSpec(\"refs/tags/*:refs/tags/*\");\n\n        /// <summary>\n        /// Specification for push operation, to push all refs under refs/heads. Acts\n        /// as --all\n        /// </summary>\n        public static readonly RefSpec REFSPEC_PUSH_ALL = new RefSpec(\"refs/heads/*:refs/heads/*\");\n\n        /// <summary>\n        /// The repository this transport fetches into, or pushes out of.\n        /// </summary>\n        private readonly Repository _local;\n\n        /// <summary>\n        /// The URI used to create this transport. \n        /// </summary>\n        protected readonly URIish _uri;\n\n        /// <summary>\n        /// Name of the upload pack program, if it must be executed.\n        /// </summary>\n        private string _optionUploadPack = RemoteConfig.DEFAULT_UPLOAD_PACK;\n\n        /// <summary>\n        /// Specifications to apply during fetch.\n        /// </summary>\n        private List<RefSpec> _fetch = new List<RefSpec>();\n\n        /// <summary>\n        /// How <see cref=\"fetch\"/> should handle tags.\n        /// <para/>\n        /// We default to <see cref=\"Core.Transport.TagOpt.NO_TAGS\"/> so as to avoid fetching annotated\n        /// tags during one-shot fetches used for later merges. This prevents\n        /// dragging down tags from repositories that we do not have established\n        /// tracking branches for. If we do not track the source repository, we most\n        /// likely do not care about any tags it publishes.\n        /// </summary>\n        private TagOpt _tagopt = TagOpt.NO_TAGS;\n\n        /// <summary>\n        /// Should fetch request thin-pack if remote repository can produce it.\n        /// </summary>\n        private bool _fetchThin = DEFAULT_FETCH_THIN;\n\n        /// <summary>\n        /// Name of the receive pack program, if it must be executed.\n        /// </summary>\n        private string _optionReceivePack = RemoteConfig.DEFAULT_RECEIVE_PACK;\n\n        /// <summary>\n        /// Specifications to apply during push.\n        /// </summary>\n        private List<RefSpec> _push = new List<RefSpec>();\n\n        /// <summary>\n        /// Should push produce thin-pack when sending objects to remote repository.\n        /// </summary>\n        private bool _pushThin = DEFAULT_PUSH_THIN;\n\n        /// <summary>\n        /// Should push just check for operation result, not really push.\n        /// </summary>\n        private bool _dryRun;\n\n        /// <summary>\n        /// Should an incoming (fetch) transfer validate objects?\n        /// </summary>\n        private bool _checkFetchedObjects;\n\n        /// <summary>\n        /// Should refs no longer on the source be pruned from the destination?\n        /// </summary>\n        private bool _removeDeletedRefs;\n\n        /// <summary>\n        /// Timeout in seconds to wait before aborting an IO read or write.\n        /// </summary>\n        private int _timeout;\n\n        public Repository Local { get { return _local; } }\n\n        /// <summary>\n        /// Create a new transport instance.\n        /// </summary>\n        /// <param name=\"local\">\n        /// the repository this instance will fetch into, or push out of.\n        /// This must be the repository passed to\n        /// <see cref=\"open(GitSharp.Core.Repository,GitSharp.Core.Transport.URIish)\"/>.\n        /// </param>\n        /// <param name=\"uri\">\n        /// the URI used to access the remote repository. This must be the\n        /// URI passed to <see cref=\"open(GitSharp.Core.Repository,GitSharp.Core.Transport.URIish)\"/>.\n        /// </param>\n        protected Transport(Repository local, URIish uri)\n        {\n            TransferConfig tc = local.Config.getTransfer();\n            _local = local;\n            _uri = uri;\n            _checkFetchedObjects = tc.isFsckObjects();\n        }\n\n        /// <summary>\n        /// Get the URI this transport connects to.\n        /// <para/>\n        /// Each transport instance connects to at most one URI at any point in time.\n        /// <para/>\n        /// Returns the URI describing the location of the remote repository.\n        /// </summary>\n        public URIish Uri\n        {\n            get { return _uri; }\n        }\n\n        /// <summary>\n        /// name of the remote executable providing upload-pack service (typically \"git-upload-pack\").\n        /// </summary>\n        public string OptionUploadPack\n        {\n            get { return _optionUploadPack; }\n            set { _optionUploadPack = string.IsNullOrEmpty(value) ? RemoteConfig.DEFAULT_UPLOAD_PACK : value; }\n        }\n\n        /// <summary>\n        /// description of how annotated tags should be treated during fetch.\n        /// </summary>\n        public TagOpt TagOpt\n        {\n            get { return _tagopt; }\n            set { _tagopt = value ?? TagOpt.AUTO_FOLLOW; }\n        }\n\n        /// <summary>\n        /// thin-pack preference for fetch operation. Default setting is: <see cref=\"DEFAULT_FETCH_THIN\"/>.\n        /// </summary>\n        public bool FetchThin\n        {\n            get { return _fetchThin; }\n            set { _fetchThin = value; }\n        }\n\n        /// <summary>\n        /// true to enable checking received objects; false to assume all received objects are valid.\n        /// </summary>\n        public bool CheckFetchedObjects\n        {\n            get { return _checkFetchedObjects; }\n            set { _checkFetchedObjects = value; }\n        }\n\n        /// <summary>\n        /// remote executable providing receive-pack service for pack transports.\n        /// Default setting is: <see cref=\"RemoteConfig.DEFAULT_RECEIVE_PACK\"/>\n        /// </summary>\n        public string OptionReceivePack\n        {\n            get { return _optionReceivePack; }\n            set { _optionReceivePack = string.IsNullOrEmpty(value) ? RemoteConfig.DEFAULT_RECEIVE_PACK : value; }\n        }\n\n        /// <summary>\n        /// thin-pack preference for push operation. Default setting is: <see cref=\"DEFAULT_PUSH_THIN\"/>.\n        /// true when push should produce thin-pack in pack transports; false when it shouldn't.\n        /// </summary>\n        public bool PushThin\n        {\n            get { return _pushThin; }\n            set { _pushThin = value; }\n        }\n\n        /// <summary>\n        /// Whether or not to remove refs which no longer exist in the source.\n        /// <para/>\n        /// If true, refs at the destination repository (local for fetch, remote for\n        /// push) are deleted if they no longer exist on the source side (remote for\n        /// fetch, local for push).\n        /// <para/>\n        /// False by default, as this may cause data to become unreachable, and\n        /// eventually be deleted on the next GC.\n        /// </summary>\n        public bool RemoveDeletedRefs\n        {\n            get { return _removeDeletedRefs; }\n            set { _removeDeletedRefs = value; }\n        }\n\n        /// <summary>\n        /// Apply provided remote configuration on this transport.\n        /// </summary>\n        /// <param name=\"cfg\">configuration to apply on this transport.</param>\n        public void ApplyConfig(RemoteConfig cfg)\n        {\n            if (cfg == null)\n                throw new ArgumentNullException(\"cfg\");\n            OptionUploadPack = cfg.UploadPack;\n            OptionReceivePack = cfg.ReceivePack;\n            TagOpt = cfg.TagOpt;\n            _fetch = cfg.Fetch;\n            _push = cfg.Push;\n            _timeout = cfg.Timeout;\n        }\n\n        /// <summary>\n        /// true if push operation should just check for possible result and\n        /// not really update remote refs, false otherwise - when push should\n        /// act normally.\n        /// </summary>\n        public bool DryRun\n        {\n            get { return _dryRun; }\n            set { _dryRun = value; }\n        }\n\n        /// <summary>\n        /// number of seconds to wait (with no data transfer occurring) \n        /// before aborting an IO read or write operation with this \n        /// remote. \n        /// </summary>\n        public int Timeout\n        {\n            get { return _timeout; }\n            set { _timeout = value; }\n        }\n\n        /// <summary>\n        /// Fetch objects and refs from the remote repository to the local one.\n        /// <para/>\n        /// This is a utility function providing standard fetch behavior. Local\n        /// tracking refs associated with the remote repository are automatically\n        /// updated if this transport was created from a <see cref=\"RemoteConfig\"/> with\n        /// fetch RefSpecs defined.\n        /// </summary>\n        /// <param name=\"monitor\">\n        /// progress monitor to inform the user about our processing\n        /// activity. Must not be null. Use <see cref=\"NullProgressMonitor\"/> if\n        /// progress updates are not interesting or necessary.\n        /// </param>\n        /// <param name=\"toFetch\">\n        /// specification of refs to fetch locally. May be null or the\n        /// empty collection to use the specifications from the\n        /// RemoteConfig. Source for each RefSpec can't be null.\n        /// </param>\n        /// <returns>information describing the tracking refs updated.</returns>\n        public FetchResult fetch(ProgressMonitor monitor, List<RefSpec> toFetch)\n        {\n            if (toFetch == null || toFetch.isEmpty())\n            {\n                // If the caller did not ask for anything use the defaults.\n                //\n                if (_fetch.isEmpty())\n                {\n                    throw new TransportException(\"Nothing to fetch.\");\n                }\n                toFetch = _fetch;\n            }\n            else if (!_fetch.isEmpty())\n            {\n                // If the caller asked for something specific without giving\n                // us the local tracking branch see if we can update any of\n                // the local tracking branches without incurring additional\n                // object transfer overheads.\n                //\n                var tmp = new List<RefSpec>(toFetch);\n                foreach (RefSpec requested in toFetch)\n                {\n                    string reqSrc = requested.Source;\n                    foreach (RefSpec configured in _fetch)\n                    {\n                        string cfgSrc = configured.Source;\n                        string cfgDst = configured.Destination;\n                        if (cfgSrc.Equals(reqSrc) && cfgDst != null)\n                        {\n                            tmp.Add(configured);\n                            break;\n                        }\n                    }\n                }\n                toFetch = tmp;\n            }\n\n            var result = new FetchResult();\n            new FetchProcess(this, toFetch).execute(monitor, result);\n            return result;\n        }\n\n        /// <summary>\n        /// Push objects and refs from the local repository to the remote one.\n        /// <para/>\n        /// This is a utility function providing standard push behavior. It updates\n        /// remote refs and send there necessary objects according to remote ref\n        /// update specification. After successful remote ref update, associated\n        /// locally stored tracking branch is updated if set up accordingly. Detailed\n        /// operation result is provided after execution.\n        /// <para/>\n        /// For setting up remote ref update specification from ref spec, see helper\n        /// method <see cref=\"findRemoteRefUpdatesFor(System.Collections.Generic.List{GitSharp.Core.Transport.RefSpec})\"/>, predefined refspecs\n        /// (<see cref=\"REFSPEC_TAGS\"/>, <see cref=\"REFSPEC_PUSH_ALL\"/>) or consider using\n        /// directly <see cref=\"RemoteRefUpdate\"/> for more possibilities.\n        /// <para/>\n        /// When <see cref=\"get_DryRun\"/> is true, result of this operation is just\n        /// estimation of real operation result, no real action is performed.\n        /// </summary>\n        /// <param name=\"monitor\">\n        /// progress monitor to inform the user about our processing\n        /// activity. Must not be null. Use <see cref=\"NullProgressMonitor\"/> if\n        /// progress updates are not interesting or necessary.\n        /// </param>\n        /// <param name=\"toPush\">\n        /// specification of refs to push. May be null or the empty\n        /// collection to use the specifications from the RemoteConfig\n        /// converted by <see cref=\"findRemoteRefUpdatesFor(System.Collections.Generic.List{GitSharp.Core.Transport.RefSpec})\"/>. No\n        /// more than 1 RemoteRefUpdate with the same remoteName is\n        /// allowed. These objects are modified during this call.\n        /// </param>\n        /// <returns>\n        /// information about results of remote refs updates, tracking refs\n        /// updates and refs advertised by remote repository.\n        /// </returns>\n        public PushResult push(ProgressMonitor monitor, ICollection<RemoteRefUpdate> toPush)\n        {\n            if (toPush == null || toPush.isEmpty())\n            {\n                // If the caller did not ask for anything use the defaults.\n                try\n                {\n                    toPush = findRemoteRefUpdatesFor(_push);\n                }\n                catch (IOException e)\n                {\n                    throw new TransportException(\"Problem with resolving push ref specs locally: \" + e.Message, e);\n                }\n\n                if (toPush.isEmpty())\n                {\n                    throw new TransportException(\"Nothing to push\");\n                }\n            }\n\n            var pushProcess = new PushProcess(this, toPush);\n            return pushProcess.execute(monitor);\n        }\n\n        /// <summary>\n        /// Convert push remote refs update specification from <see cref=\"RefSpec\"/> form\n        /// to <see cref=\"RemoteRefUpdate\"/>. Conversion expands wildcards by matching\n        /// source part to local refs. expectedOldObjectId in RemoteRefUpdate is\n        /// always set as null. Tracking branch is configured if RefSpec destination\n        /// matches source of any fetch ref spec for this transport remote\n        /// configuration.\n        /// <para/>\n        /// Conversion is performed for context of this transport (database, fetch\n        /// specifications).                                                        \n        /// </summary>\n        /// <param name=\"specs\">collection of RefSpec to convert.</param>\n        /// <returns>collection of set up <see cref=\"RemoteRefUpdate\"/>.</returns>\n        public ICollection<RemoteRefUpdate> findRemoteRefUpdatesFor(List<RefSpec> specs)\n        {\n            return findRemoteRefUpdatesFor(_local, specs, _fetch);\n        }\n\n        /// <summary>\n        /// Begins a new connection for fetching from the remote repository.\n        /// </summary>\n        /// <returns>a fresh connection to fetch from the remote repository.</returns>\n        public abstract IFetchConnection openFetch();\n\n        /// <summary>\n        /// Begins a new connection for pushing into the remote repository.\n        /// </summary>\n        /// <returns>a fresh connection to push into the remote repository.</returns>\n        public abstract IPushConnection openPush();\n\n        /// <summary>\n        /// Close any resources used by this transport.\n        /// <para/>\n        /// If the remote repository is contacted by a network socket this method\n        /// must close that network socket, disconnecting the two peers. If the\n        /// remote repository is actually local (same system) this method must close\n        /// any open file handles used to read the \"remote\" repository.\n        /// </summary>\n        public abstract void close();\n\n        public virtual void Dispose()\n        {\n            close();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TransportAmazonS3.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Transport\n{\n    public class TransportAmazonS3 : HttpTransport\n    {\n        private const string S3_SCHEME = \"amazon-s3\";\n\n\t    public static bool canHandle(URIish uri)\n        {\n\t\t\tif (uri == null)\n\t\t\t\tthrow new ArgumentNullException (\"uri\");\n\t\t\t\n\t\t    if (!uri.IsRemote)\n\t\t    {\n\t\t        return false;\n\t\t    }\n\n\t\t    return S3_SCHEME == uri.Scheme;\n\t    }\n\n        public TransportAmazonS3(Repository local, URIish uri) : base(local, uri)\n        {\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override IPushConnection openPush()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void close()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/TransportBundleFile.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    public class TransportBundleFile : Transport, ITransportBundle\n    {\n        private readonly FileInfo _bundle;\n\n        public static bool canHandle(URIish uri)\n        {\n            if (uri == null)\n                throw new ArgumentNullException(\"uri\");\n            if (uri.Host != null || uri.Port > 0 || uri.User != null || uri.Pass != null || uri.Path == null)\n                return false;\n\n            if (\"file\".Equals(uri.Scheme) || uri.Scheme == null)\n            {\n                FileInfo f = PathUtil.CombineFilePath(new DirectoryInfo(\".\"), uri.Path);\n                return f.IsFile() || f.Name.EndsWith(\".bundle\");\n            }\n\n            return false;\n        }\n\n        public TransportBundleFile(Repository local, URIish uri)\n            : base(local, uri)\n        {\n            _bundle = PathUtil.CombineFilePath(new DirectoryInfo(\".\"), uri.Path);\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            Stream src;\n            try\n            {\n                src = _bundle.Open(System.IO.FileMode.Open, FileAccess.Read);\n            }\n            catch (FileNotFoundException)\n            {\n                throw new TransportException(Uri, \"not found\");\n            }\n\n            return new BundleFetchConnection(this, src);\n        }\n\n        public override IPushConnection openPush()\n        {\n            throw new NotSupportedException(\"Push is not supported for bundle transport\");\n        }\n\n        public override void close()\n        {\n            // Resources must be established per-connection.\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TransportBundleStream.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Single shot fetch from a streamed Git bundle.\n    /// <para/>\n    /// The bundle is Read from an unbuffered input stream, which limits the\n    /// transport to opening at most one FetchConnection before needing to recreate\n    /// the transport instance.\n    /// </summary>\n    public class TransportBundleStream : Transport, ITransportBundle\n    {\n        private Stream _inputStream;\n\n        /// <summary>\n        /// Create a new transport to fetch objects from a streamed bundle.\n        /// <para/>\n        /// The stream can be unbuffered (buffering is automatically provided\n        /// internally to smooth out short reads) and unpositionable (the stream is\n        /// Read from only once, sequentially).\n        /// <para/>\n        /// When the FetchConnection or the this instance is closed the supplied\n        /// input stream is also automatically closed. This frees callers from\n        /// needing to keep track of the supplied stream.\n        /// </summary>\n        /// <param name=\"local\">repository the fetched objects will be loaded into.</param>\n        /// <param name=\"uri\">\n        /// symbolic name of the source of the stream. The URI can\n        /// reference a non-existent resource. It is used only for\n        /// exception reporting.\n        /// </param>\n        /// <param name=\"inputStream\">the stream to Read the bundle from.</param>\n        public TransportBundleStream(Repository local, URIish uri, Stream inputStream)\n            : base(local, uri)\n        {\n            _inputStream = inputStream;\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            if (_inputStream == null)\n                throw new TransportException(Uri, \"Only one fetch supported\");\n            try\n            {\n                return new BundleFetchConnection(this, _inputStream);\n            }\n            finally\n            {\n                _inputStream = null;\n            }\n        }\n\n        public override IPushConnection openPush()\n        {\n            throw new NotSupportedException(\"Push is not supported for bundle transport\");\n        }\n\n        public override void close()\n        {\n            if (_inputStream != null)\n            {\n                try\n                {\n                    _inputStream.Dispose();\n                }\n                catch (IOException)\n                {\n                    // Ignore a close error.\n                }\n                finally\n                {\n                    _inputStream = null;\n                }\n            }\n\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n\n        }\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~TransportBundleStream()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: {\" + Local.Directory + \"}/{\" + Uri + \"}\");\n        }\n#endif\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/TransportGitAnon.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Net.Sockets;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Transport through a git-daemon waiting for anonymous TCP connections.\n    /// <para/>\n    /// This transport supports the <code>git://</code> protocol, usually run on\n    /// the IANA registered port 9418. It is a popular means for distributing open\n    /// source projects, as there are no authentication or authorization overheads.\n    /// </summary>\n    public class TransportGitAnon : TcpTransport, IPackTransport\n    {\n        public const int GIT_PORT = Daemon.DEFAULT_PORT;\n\n        public static bool canHandle(URIish uri)\n        {\n            if (uri == null)\n                throw new System.ArgumentNullException(\"uri\");\n\n            return \"git\".Equals(uri.Scheme);\n        }\n\n        public TransportGitAnon(Repository local, URIish uri)\n            : base(local, uri)\n        {\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            return new TcpFetchConnection(this);\n        }\n\n        public override IPushConnection openPush()\n        {\n            return new TcpPushConnection(this);\n        }\n\n        public override void close()\n        {\n            // Resources must be established per-connection.\n        }\n\n        private Socket OpenConnection()\n        {\n            int port = Uri.Port > 0 ? Uri.Port : GIT_PORT;\n            Socket ret = null;\n            try\n            {\n                ret = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n                ret.Connect(Uri.Host, port);\n                return ret;\n            }\n            catch (SocketException e)\n            {\n                try\n                {\n                    if (ret != null) ret.Close();\n                }\n                catch (Exception)\n                {\n                    // ignore a failure during close, we're already failing\n                }\n                throw new TransportException(Uri, e.Message, e);\n            }\n        }\n\n        private void Service(string name, PacketLineOut pckOut)\n        {\n            var cmd = new StringBuilder();\n            cmd.Append(name);\n            cmd.Append(' ');\n            cmd.Append(Uri.Path);\n            cmd.Append('\\0');\n            cmd.Append(\"host=\");\n            cmd.Append(Uri.Host);\n            if (Uri.Port > 0 && Uri.Port != GIT_PORT)\n            {\n                cmd.Append(\":\");\n                cmd.Append(Uri.Port);\n            }\n            cmd.Append('\\0');\n            pckOut.WriteString(cmd.ToString());\n            pckOut.Flush();\n        }\n\n        #region Nested Types\n\n        private class TcpFetchConnection : BasePackFetchConnection\n        {\n            private Socket _sock;\n\n            public TcpFetchConnection(TransportGitAnon instance)\n                : base(instance)\n            {\n                _sock = instance.OpenConnection();\n                try\n                {\n                    init(new NetworkStream(_sock));\n                    instance.Service(\"git-upload-pack\", pckOut);\n                }\n                catch (SocketException err)\n                {\n                    Close();\n                    throw new TransportException(uri, \"remote hung up unexpectedly\", err);\n                }\n                readAdvertisedRefs();\n            }\n\n            public override void Close()\n            {\n                base.Close();\n\n                if (_sock == null) return;\n\n                try\n                {\n                    _sock.Close();\n                }\n                catch (Exception)\n                {\n                    // Ignore errors during close.\n                }\n                finally\n                {\n                    _sock = null;\n                }\n            }\n        }\n\n        private class TcpPushConnection : BasePackPushConnection\n        {\n            private Socket _sock;\n\n            public TcpPushConnection(TransportGitAnon instance)\n                : base(instance)\n            {\n                _sock = instance.OpenConnection();\n                try\n                {\n                    init(new NetworkStream(_sock));\n                    instance.Service(\"git-receive-pack\", pckOut);\n                }\n                catch (SocketException err)\n                {\n                    Close();\n                    throw new TransportException(uri, \"remote hung up unexpectedly\", err);\n                }\n                readAdvertisedRefs();\n            }\n\n            public override void Close()\n            {\n                base.Close();\n\n                if (_sock == null) return;\n\n                try\n                {\n                    _sock.Close();\n                }\n                catch (Exception)\n                {\n                    // Ignore errors during close.\n                }\n                finally\n                {\n                    _sock = null;\n                }\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/TransportGitSsh.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Net.Sockets;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Transport through an SSH tunnel.\n    /// <para/>\n    /// The SSH transport requires the remote side to have Git installed, as the\n    /// transport logs into the remote system and executes a Git helper program on\n    /// the remote side to read (or write) the remote repository's files.\n    /// <para/>\n    /// This transport does not support direct SCP style of copying files, as it\n    /// assumes there are Git specific smarts on the remote side to perform object\n    /// enumeration, save file modification and hook execution.\n    /// </summary>\n    public class TransportGitSsh : SshTransport, IPackTransport, IDisposable\n    {\n        public static bool canHandle(URIish uri)\n        {\n            if (uri == null)\n                throw new ArgumentNullException(\"uri\");\n            if (!uri.IsRemote)\n            {\n                return false;\n            }\n\n            string scheme = uri.Scheme;\n\n            if (\"ssh\".Equals(scheme))\n            {\n                return true;\n            }\n\n            if (\"ssh+git\".Equals(scheme))\n            {\n                return true;\n            }\n\n            if (\"git+ssh\".Equals(scheme))\n            {\n                return true;\n            }\n\n            if (scheme == null && uri.Host != null && uri.Path != null)\n            {\n                return true;\n            }\n\n            return false;\n        }\n\n        private Stream _errStream;\n\n        public TransportGitSsh(Repository local, URIish uri)\n            : base(local, uri)\n        {\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            return new SshFetchConnection(this);\n        }\n\n        public override IPushConnection openPush()\n        {\n            return new SshPushConnection(this);\n        }\n\n        private static void SqMinimal(StringBuilder cmd, string val)\n        {\n            if (Regex.Matches(val, \"^[a-zA-Z0-9._/-]*$\").Count > 0)\n            {\n                // If the string matches only generally safe characters\n                // that the shell is not going to evaluate specially we\n                // should leave the string unquoted. Not all systems\n                // actually run a shell and over-quoting confuses them\n                // when it comes to the command name.\n                //\n                cmd.Append(val);\n            }\n            else\n            {\n                Sq(cmd, val);\n            }\n        }\n\n        private static void SqAlways(StringBuilder cmd, string val)\n        {\n            Sq(cmd, val);\n        }\n\n        private static void Sq(StringBuilder cmd, string val)\n        {\n            if (val.Length > 0)\n            {\n                cmd.Append(QuotedString.BOURNE.quote(val));\n            }\n        }\n\n        private String commandFor(string exe)\n        {\n            string path = Uri.Path;\n            if (Uri.Scheme != null && Uri.Path.StartsWith(\"/~\"))\n                path = (Uri.Path.Substring(1));\n\n            var cmd = new StringBuilder();\n            int gitspace = exe.IndexOf(\"git \");\n            if (gitspace >= 0)\n            {\n                SqMinimal(cmd, exe.Slice(0, gitspace + 3));\n                cmd.Append(' ');\n                SqMinimal(cmd, exe.Substring(gitspace + 4));\n            }\n            else\n                SqMinimal(cmd, exe);\n            cmd.Append(' ');\n            SqAlways(cmd, path);\n            return cmd.ToString();\n        }\n\n        private ChannelExec Exec(string exe)\n        {\n            InitSession();\n            \n            try\n            {\n                var channel = (ChannelExec)Sock.openChannel(\"exec\");\n                channel.setCommand(commandFor(exe));\n                _errStream = CreateErrorStream();\n                channel.setErrStream(_errStream);\n                channel.connect();\n                return channel;\n            }\n            catch (JSchException e)\n            {\n                throw new TransportException(Uri, e.Message, e);\n            }\n        }\n\n        void checkExecFailure(int status, string exe)\n        {\n            if (status == 127)\n            {\n                String why = _errStream.ToString();\n                IOException cause = null;\n                if (why != null && why.Length > 0)\n                    cause = new IOException(why);\n                throw new TransportException(Uri, \"cannot execute: \"\n                        + commandFor(exe), cause);\n            }\n        }\n\n        /// <returns>\n        /// the error stream for the channel, the stream is used to detect\n        /// specific error reasons for exceptions.\n        /// </returns>\n        private static Stream CreateErrorStream()\n        {\n            return new GitSshErrorStream();\n        }\n\n        public NoRemoteRepositoryException cleanNotFound(NoRemoteRepositoryException nf)\n        {\n            string why = _errStream.ToString();\n            if (string.IsNullOrEmpty(why))\n            {\n                return nf;\n            }\n\n            string path = Uri.Path;\n            if (Uri.Scheme != null && Uri.Path.StartsWith(\"/~\"))\n            {\n                path = Uri.Path.Substring(1);\n            }\n\n            var pfx = new StringBuilder();\n            pfx.Append(\"fatal: \");\n            SqAlways(pfx, path);\n            pfx.Append(\":\");\n            if (why.StartsWith(pfx.ToString()))\n            {\n                why = why.Substring(pfx.Length);\n            }\n\n            return new NoRemoteRepositoryException(Uri, why);\n        }\n\n        #region Nested Types\n\n        private class GitSshErrorStream : MemoryStream\n        {\n            private readonly StringBuilder _all = new StringBuilder();\n\n            public override void Write(byte[] buffer, int offset, int count)\n            {\n                //TODO: [nulltoken] Do we need this override ? Or is WriteByte sufficient ?\n                throw new NotImplementedException(); \n\n                /*\n                for (int i = offset; i < count + offset; i++)\n                {\n                    if (buffer[i] == '\\n')\n                    {\n                        string line = Constants.CHARSET.GetString(ToArray());\n                        _all.AppendLine(line);\n                        SetLength(0);\n                        Write(buffer, offset + (i - offset), count - (i - offset));\n                        return;\n                    }\n                    WriteByte(buffer[i]);\n                }\n                base.Write(buffer, offset, count);\n                */ \n            }\n\n            public override void WriteByte(byte b)\n            {\n                if (b == '\\r')\n                {\n                    return;\n                }\n\n                base.WriteByte(b);\n\n                if (b == '\\n')\n                {\n                    _all.Append(ToArray());\n                    SetLength(0);\n                }\n            }\n\n            public override string ToString()\n            {\n                string r = _all.ToString();\n                while (r.EndsWith(\"\\n\"))\n                    r = r.Slice(0, r.Length - 1);\n                return r;\n            }\n        }\n\n        private class SshFetchConnection : BasePackFetchConnection\n        {\n            private ChannelExec _channel;\n\n            private int _exitStatus;\n\n            public SshFetchConnection(TransportGitSsh instance)\n                : base(instance)\n            {\n                try\n                {\n                    _channel = instance.Exec(instance.OptionUploadPack);\n\n                    if (_channel.isConnected())\n                        init(_channel.getInputStream(), _channel.getOutputStream());\n                    else\n                        throw new TransportException(uri, instance._errStream.ToString());\n                }\n                catch (TransportException)\n                {\n                    Close();\n                    throw;\n                }\n                catch (SocketException err)\n                {\n                    Close();\n                    throw new TransportException(uri, \"remote hung up unexpectedly\", err);\n                }\n\n                try\n                {\n                    readAdvertisedRefs();\n                }\n                catch (NoRemoteRepositoryException notFound)\n                {\n                    Close();\n                    instance.checkExecFailure(_exitStatus, instance.OptionUploadPack);\n                    throw instance.cleanNotFound(notFound);\n                }\n            }\n\n            public override void Close()\n            {\n                base.Close();\n\n                if (_channel == null) return;\n\n                try\n                {\n                    _exitStatus = _channel.getExitStatus();\n                    if (_channel.isConnected())\n                    {\n                        _channel.disconnect();\n                    }\n                }\n                finally\n                {\n                    _channel = null;\n                }\n            }\n        }\n\n        private class SshPushConnection : BasePackPushConnection\n        {\n            private ChannelExec _channel;\n\n            private int _exitStatus;\n\n            public SshPushConnection(TransportGitSsh instance)\n                : base(instance)\n            {\n                try\n                {\n                    _channel = instance.Exec(instance.OptionReceivePack);\n\n                    if (_channel.isConnected())\n                    {\n                        init(_channel.getInputStream(), _channel.getOutputStream());\n                    }\n                    else\n                    {\n                        throw new TransportException(uri, instance._errStream.ToString());\n                    }\n                }\n                catch (TransportException)\n                {\n                    Close();\n                    throw;\n                }\n                catch (SocketException err)\n                {\n                    Close();\n                    throw new TransportException(uri, \"remote hung up unexpectedly\", err);\n                }\n\n                try\n                {\n                    readAdvertisedRefs();\n                }\n                catch (NoRemoteRepositoryException notFound)\n                {\n                    Close();\n                    instance.checkExecFailure(_exitStatus, instance.OptionReceivePack);\n                    throw instance.cleanNotFound(notFound);\n                }\n            }\n\n            public override void Close()\n            {\n                base.Close();\n\n                if (_channel != null)\n                {\n                    try\n                    {\n                        _exitStatus = _channel.getExitStatus();\n\n                        if (_channel.isConnected())\n                        {\n                            _channel.disconnect();\n                        }\n                    }\n                    finally\n                    {\n                        _channel = null;\n                    }\n                }\n            }\n        }\n\n        #endregion\n\n        public override void Dispose()\n        {\n            if (_errStream != null)\n            {\n                _errStream.Dispose();\n            }\n\n            base.Dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/TransportHttp.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Transport over HTTP and FTP protocols.\n    /// <para/>\n    /// If the transport is using HTTP and the remote HTTP service is Git-aware\n    /// (speaks the \"smart-http protocol\") this client will automatically take\n    /// advantage of the additional Git-specific HTTP extensions. If the remote\n    /// service does not support these extensions, the client will degrade to direct\n    /// file fetching.\n    /// <para/>\n    /// If the remote (server side) repository does not have the specialized Git\n    /// support, object files are retrieved directly through standard HTTP GET (or\n    /// binary FTP GET) requests. This make it easy to serve a Git repository through\n    /// a standard web host provider that does not offer specific support for Git.\n    /// </summary>\n    public class TransportHttp : HttpTransport, IWalkTransport\n    {\n        public static bool canHandle(URIish uri)\n        {\n            if (uri == null)\n                throw new ArgumentNullException(\"uri\");\n\n            if (!uri.IsRemote)\n            {\n                return false;\n            }\n            string s = uri.Scheme;\n            return \"http\".Equals(s) || \"https\".Equals(s) || \"ftp\".Equals(s);\n        }\n\n        private readonly Uri _baseUrl;\n        private readonly Uri _objectsUrl;\n\n        public TransportHttp(Repository local, URIish uri)\n            : base(local, uri)\n        {\n            try\n            {\n                string uriString = uri.ToString();\n                if (!uriString.EndsWith(\"/\"))\n                {\n                    uriString += \"/\";\n                }\n                _baseUrl = new Uri(uriString);\n                _objectsUrl = new Uri(_baseUrl, \"objects/\");\n            }\n            catch (UriFormatException e)\n            {\n                throw new NotSupportedException(\"Invalid URL \" + uri, e);\n            }\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            var c = new HttpObjectDatabase(_objectsUrl);\n            var r = new WalkFetchConnection(this, c);\n            r.available(c.ReadAdvertisedRefs());\n            return r;\n        }\n\n        public override IPushConnection openPush()\n        {\n            string s = Uri.Scheme;\n            throw new NotSupportedException(\"Push not supported over \" + s + \".\");\n        }\n\n        public override void close()\n        {\n            // No explicit connections are maintained.\n        }\n\n        #region Nested Types\n\n        private class HttpObjectDatabase : WalkRemoteObjectDatabase\n        {\n            private readonly Uri _objectsUrl;\n\n            public HttpObjectDatabase(Uri b)\n            {\n                _objectsUrl = b;\n            }\n\n            public override URIish getURI()\n            {\n                return new URIish(_objectsUrl);\n            }\n\n            public override ICollection<WalkRemoteObjectDatabase> getAlternates()\n            {\n                try\n                {\n                    return readAlternates(INFO_HTTP_ALTERNATES);\n                }\n                catch (FileNotFoundException)\n                {\n                    // Fall through.\n                }\n\n                try\n                {\n                    return readAlternates(INFO_ALTERNATES);\n                }\n                catch (FileNotFoundException)\n                {\n                    // Fall through.\n                }\n\n                return null;\n            }\n\n            public override WalkRemoteObjectDatabase openAlternate(string location)\n            {\n                return new HttpObjectDatabase(new Uri(_objectsUrl, location));\n            }\n\n            public override ICollection<string> getPackNames()\n            {\n                var packs = new List<string>();\n                try\n                {\n                    using (StreamReader br = openReader(INFO_PACKS))\n                    {\n                        while (true)\n                        {\n                            string s = br.ReadLine();\n                            if (string.IsNullOrEmpty(s)) break;\n\n                            if (!s.StartsWith(\"P pack-\") || !s.EndsWith(IndexPack.PackSuffix))\n                            {\n                                throw InvalidAdvertisement(s);\n                            }\n                            packs.Add(s.Substring(2));\n                        }\n\n                        return packs;\n                    }\n                }\n                catch (FileNotFoundException)\n                {\n                    return packs;\n                }\n            }\n\n            public override Stream open(string path)\n            {\n                Uri @base = _objectsUrl;\n                var u = new Uri(@base, path);\n\n                var c = (HttpWebRequest)WebRequest.Create(u);\n\n                try\n                {\n                    var response = (HttpWebResponse)c.GetResponse();\n                    switch (response.StatusCode)\n                    {\n                        case HttpStatusCode.OK:\n                            return response.GetResponseStream();\n\n                        default:\n                            throw new IOException(u + \": \" + response.StatusDescription);\n                    }\n                }\n                catch (WebException e)\n                {\n                    var response2 = ((HttpWebResponse)(e.Response));\n                    if (response2.StatusCode == HttpStatusCode.NotFound)\n                    {\n                        throw new FileNotFoundException(u.ToString());\n                    }\n\n                    throw new IOException(u + \": \" + response2.StatusDescription, e);\n                }\n\n            }\n\n            public IDictionary<string, Ref> ReadAdvertisedRefs()\n            {\n                try\n                {\n                    using (StreamReader br = openReader(INFO_REFS))\n                    {\n                        return ReadAdvertisedImpl(br);\n                    }\n                }\n                catch (IOException err)\n                {\n                    try\n                    {\n                        throw new TransportException(new Uri(_objectsUrl, INFO_REFS) + \": cannot Read available refs\", err);\n                    }\n                    catch (UriFormatException)\n                    {\n                        throw new TransportException(_objectsUrl + INFO_REFS + \": cannot Read available refs\", err);\n                    }\n                }\n            }\n\n            private static IDictionary<string, Ref> ReadAdvertisedImpl(TextReader br)\n            {\n                var avail = new SortedDictionary<string, Ref>();\n\n                while (true)\n                {\n                    string line = br.ReadLine();\n                    if (line == null) break;\n\n                    int tab = line.IndexOf('\\t');\n                    if (tab < 0)\n                    {\n                        throw InvalidAdvertisement(line);\n                    }\n\n                    string name = line.Substring(tab + 1);\n                    ObjectId id = ObjectId.FromString(line.Slice(0, tab));\n                    if (name.EndsWith(\"^{}\"))\n                    {\n                        name = name.Slice(0, name.Length - 3);\n                        Ref prior = avail.get(name);\n                        if (prior == null)\n                        {\n                            throw OutOfOrderAdvertisement(name);\n                        }\n\n                        if (prior.PeeledObjectId != null)\n                        {\n                            throw DuplicateAdvertisement(name + \"^{}\");\n                        }\n\n                        avail.put(name, new PeeledTag(Storage.Network, name, prior.ObjectId, id));\n                    }\n                    else\n                    {\n                        Ref prior = avail.put(name, new PeeledNonTag(Storage.Network, name, id));\n\n                        if (prior != null)\n                        {\n                            throw DuplicateAdvertisement(name);\n                        }\n                    }\n                }\n                return avail;\n            }\n\n            private static PackProtocolException OutOfOrderAdvertisement(string n)\n            {\n                return new PackProtocolException(\"advertisement of \" + n + \"^{} came before \" + n);\n            }\n\n            private static PackProtocolException InvalidAdvertisement(string n)\n            {\n                return new PackProtocolException(\"invalid advertisement of \" + n);\n            }\n\n            private static PackProtocolException DuplicateAdvertisement(string n)\n            {\n                return new PackProtocolException(\"duplicate advertisements of \" + n);\n            }\n\n            public override void close()\n            {\n                // We do not maintain persistent connections.\n            }\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/TransportLocal.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    public class TransportLocal : Transport, IPackTransport\n    {\n        private const string PWD = \".\";\n\n        public TransportLocal(Repository local, URIish uri) : base(local, uri)\n        {\n        }\n\n        public static bool canHandle(URIish uri)\n        {\n\t\t\tif (uri == null)\n\t\t\t\tthrow new ArgumentNullException (\"uri\");\n\t\t\t\n            if (uri.Host != null || uri.Port > 0 || uri.User != null || uri.Pass != null || uri.Path == null)\n            {\n                return false;\n            }\n\n            if (\"file\".Equals(uri.Scheme) || uri.Scheme == null)\n            {\n                return FS.resolve(new DirectoryInfo(PWD), uri.Path).Exists;\n            }\n\n            return false;\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override IPushConnection openPush()\n        {\n            throw new NotImplementedException();\n        }\n\n        public override void close()\n        {\n            throw new NotImplementedException();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/TransportSftp.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core.Transport\n{\n    public class TransportSftp : SshTransport, IWalkTransport\n    {\n        public static bool canHandle(URIish uri)\n        {\n            if (uri == null)\n                throw new ArgumentNullException(\"uri\");\n\n            return uri.IsRemote && \"sftp\".Equals(uri.Scheme);\n        }\n\n        public TransportSftp(Repository local, URIish uri)\n            : base(local, uri)\n        {\n        }\n\n        public override IFetchConnection openFetch()\n        {\n            var c = new SftpObjectDatabase(Uri.Path, this);\n            var r = new WalkFetchConnection(this, c);\n            r.available(c.ReadAdvertisedRefs());\n            return r;\n        }\n\n        public override IPushConnection openPush()\n        {\n            var c = new SftpObjectDatabase(Uri.Path, this);\n            var r = new WalkPushConnection(this, c);\n            r.available(c.ReadAdvertisedRefs());\n            return r;\n        }\n\n        private ChannelSftp NewSftp()\n        {\n            InitSession();\n\n            // No timeout support in our JSch\n            try\n            {\n                Channel channel = Sock.openChannel(\"sftp\");\n                channel.connect();\n                return (ChannelSftp)channel;\n            }\n            catch (JSchException je)\n            {\n                throw new TransportException(Uri, je.Message, je);\n            }\n        }\n\n        #region Nested Types\n\n        private class SftpObjectDatabase : WalkRemoteObjectDatabase\n        {\n            private readonly TransportSftp _instance;\n            private readonly string _objectsPath;\n            private ChannelSftp _ftp;\n\n            public SftpObjectDatabase(string path, TransportSftp instance)\n            {\n                this._instance = instance;\n\n                if (path.StartsWith(\"/~\"))\n                {\n                    path = path.Substring(1);\n                }\n\n                if (path.StartsWith(\"~/\"))\n                {\n                    path = path.Substring(2);\n                }\n\n                try\n                {\n                    _ftp = instance.NewSftp();\n                    _ftp.cd(path);\n                    _ftp.cd(\"objects\");\n                    _objectsPath = _ftp.pwd();\n                }\n                catch (TransportException)\n                {\n                    CleanUp();\n                    throw;\n                }\n                catch (SftpException je)\n                {\n                    throw new TransportException(\"Can't enter \" + path + \"/objects: \" + je.message, je);\n                }\n            }\n\n            private SftpObjectDatabase(SftpObjectDatabase parent, string p, TransportSftp instance)\n            {\n                this._instance = instance;\n                try\n                {\n                    _ftp = instance.NewSftp();\n                    _ftp.cd(parent._objectsPath);\n                    _ftp.cd(p);\n                    _objectsPath = _ftp.pwd();\n                }\n                catch (TransportException)\n                {\n                    CleanUp();\n                    throw;\n                }\n                catch (SftpException je)\n                {\n                    throw new TransportException(\"Can't enter \" + p + \" from \" + parent._objectsPath + \": \" + je.message, je);\n                }\n            }\n\n            public override ICollection<string> getPackNames()\n            {\n                var packs = new List<string>();\n                try\n                {\n                    var list = new List<ChannelSftp.LsEntry>();\n                    foreach (object o in _ftp.ls(\"pack\")) list.Add((ChannelSftp.LsEntry)o);\n\n                    var files = new Dictionary<string, ChannelSftp.LsEntry>();\n                    var mtimes = new Dictionary<string, int>();\n\n                    foreach (ChannelSftp.LsEntry ent in list)\n                    {\n                        files.Add(ent.getFilename(), ent);\n                    }\n\n                    foreach (ChannelSftp.LsEntry ent in list)\n                    {\n                        string n = ent.getFilename();\n                        if (!n.StartsWith(\"pack-\") || n.EndsWith(IndexPack.PackSuffix)) continue;\n\n                        string @in = IndexPack.GetIndexFileName(n.Slice(0, n.Length - 5));\n                        if (!files.ContainsKey(@in)) continue;\n\n                        mtimes.Add(n, ent.getAttrs().getMTime());\n                        packs.Add(n);\n                    }\n\n                    packs.Sort((a, b) => mtimes[a] - mtimes[b]);\n                }\n                catch (SftpException je)\n                {\n                    throw new TransportException(\"Can't ls \" + _objectsPath + \"/pack: \" + je.message, je);\n                }\n                return packs;\n            }\n\n            public override Stream open(string path)\n            {\n                try\n                {\n                    return _ftp.get(path);\n                }\n                catch (SftpException je)\n                {\n                    if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)\n                    {\n                        throw new FileNotFoundException(path);\n                    }\n                    throw new TransportException(\"Can't get \" + _objectsPath + \"/\" + path + \": \" + je.message, je);\n                }\n            }\n\n            public override Stream writeFile(string path, ProgressMonitor monitor, string monitorTask)\n            {\n                try\n                {\n                    return _ftp.put(path);\n                }\n                catch (SftpException je)\n                {\n                    if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)\n                    {\n                        MkdirP(path);\n                        try\n                        {\n                            return _ftp.put(path);\n                        }\n                        catch (SftpException je2)\n                        {\n                            je = je2;\n                        }\n                    }\n\n                    throw new TransportException(\"Can't write \" + _objectsPath + \"/\" + path + \": \" + je.message, je);\n                }\n            }\n\n            public override void writeFile(string path, byte[] data)\n            {\n                string @lock = path + \".lock\";\n                try\n                {\n                    base.writeFile(@lock, data);\n                    try\n                    {\n                        _ftp.rename(@lock, path);\n                    }\n                    catch (SftpException je)\n                    {\n                        throw new TransportException(\"Can't write \" + _objectsPath + \"/\" + path + \": \" + je.message, je);\n                    }\n                }\n                catch (IOException)\n                {\n                    try\n                    {\n                        _ftp.rm(@lock);\n                    }\n                    catch (SftpException)\n                    {\n                    }\n                    throw;\n                }\n            }\n\n            public override void deleteFile(string path)\n            {\n                try\n                {\n                    _ftp.rm(path);\n                }\n                catch (SftpException je)\n                {\n                    if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)\n                    {\n                        throw new FileNotFoundException(path);\n                    }\n                    throw new TransportException(\"Can't delete \" + _objectsPath + \"/\" + path + \": \" + je.message, je);\n                }\n\n                string dir = path;\n                int s = dir.LastIndexOf('/');\n                while (s > 0)\n                {\n                    try\n                    {\n                        dir = dir.Slice(0, s);\n                        _ftp.rmdir(dir);\n                        s = dir.LastIndexOf('/');\n                    }\n                    catch (SftpException)\n                    {\n                        break;\n                    }\n                }\n            }\n\n            private void MkdirP(string path)\n            {\n                int s = path.LastIndexOf('/');\n                if (s <= 0) return;\n\n                path = path.Slice(0, s);\n                try\n                {\n                    _ftp.mkdir(path);\n                }\n                catch (SftpException je)\n                {\n                    if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)\n                    {\n                        MkdirP(path);\n                        try\n                        {\n                            _ftp.mkdir(path);\n                            return;\n                        }\n                        catch (SftpException je2)\n                        {\n                            je = je2;\n                        }\n                    }\n\n                    throw new TransportException(\"Can't mkdir \" + _objectsPath + \"/\" + path + \": \" + je.message, je);\n                }\n            }\n\n            public override URIish getURI()\n            {\n                return _instance.Uri.SetPath(_objectsPath);\n            }\n\n            public Dictionary<string, Ref> ReadAdvertisedRefs()\n            {\n                var avail = new Dictionary<string, Ref>();\n                readPackedRefs(avail);\n                ReadRef(avail, ROOT_DIR + Constants.HEAD, Constants.HEAD);\n                ReadLooseRefs(avail, ROOT_DIR + \"refs\", \"refs/\");\n                return avail;\n            }\n\n            public override ICollection<WalkRemoteObjectDatabase> getAlternates()\n            {\n                try\n                {\n                    return readAlternates(INFO_ALTERNATES);\n                }\n                catch (FileNotFoundException)\n                {\n                    return null;\n                }\n            }\n\n            public override WalkRemoteObjectDatabase openAlternate(string location)\n            {\n                return new SftpObjectDatabase(this, location, _instance);\n            }\n\n            private static Storage Loose(Ref r)\n            {\n                if (r != null && r.StorageFormat == Storage.Packed)\n                    return Storage.LoosePacked;\n                return Storage.Loose;\n            }\n\n            private void ReadLooseRefs(IDictionary<string, Ref> avail, string dir, string prefix)\n            {\n                var list = new List<ChannelSftp.LsEntry>();\n                try\n                {\n                    foreach (object o in _ftp.ls(dir))\n                    {\n                        list.Add((ChannelSftp.LsEntry)o);\n                    }\n                }\n                catch (SftpException je)\n                {\n                    throw new TransportException(\"Can't ls \" + _objectsPath + \"/\" + dir + \": \" + je.message, je);\n                }\n\n                foreach (ChannelSftp.LsEntry ent in list)\n                {\n                    string n = ent.getFilename();\n                    if (\".\".Equals(n) || \"..\".Equals(n)) continue;\n\n                    string nPath = dir + \"/\" + n;\n                    if (ent.getAttrs().isDir())\n                    {\n                        ReadLooseRefs(avail, nPath, prefix + n + \"/\");\n                    }\n                    else\n                    {\n                        ReadRef(avail, nPath, prefix + n);\n                    }\n                }\n            }\n\n            private Ref ReadRef(IDictionary<string, Ref> avail, string path, string name)\n            {\n                string line;\n                try\n                {\n                    using (StreamReader br = openReader(path))\n                    {\n                        line = br.ReadLine();\n                    }\n                }\n                catch (FileNotFoundException)\n                {\n                    return null;\n                }\n                catch (IOException err)\n                {\n                    throw new TransportException(\"Cannot Read \" + _objectsPath + \"/\" + path + \": \" + err.Message, err);\n                }\n\n                if (line == null)\n                    throw new TransportException(\"Empty ref: \" + name);\n\n                if (line.StartsWith(\"ref: \"))\n                {\n                    string target = line.Substring(\"ref: \".Length);\n                    Ref r = avail.GetValue(target);\n                    if (r == null)\n                        r = ReadRef(avail, ROOT_DIR + target, target);\n                    if (r == null)\n                        r = new Unpeeled(Storage.New, target, null);\n                    r = new SymbolicRef(name, r);\n                    avail.put(r.getName(), r);\n                    return r;\n                }\n\n                if (ObjectId.IsId(line))\n                {\n                    Ref r = new Unpeeled(Loose(avail.GetValue(name)),\n                            name, ObjectId.FromString(line));\n                    avail.put(r.getName(), r);\n                    return r;\n                }\n\n                throw new TransportException(\"Bad ref: \" + name + \": \" + line);\n            }\n\n            private void CleanUp()\n            {\n                if (_ftp != null)\n                {\n                    try\n                    {\n                        if (_ftp.isConnected())\n                            _ftp.disconnect();\n                    }\n                    finally\n                    {\n                        _ftp = null;\n                    }\n                }\n#if DEBUG\n                GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n            }\n            public override void close()\n            {\n                CleanUp();\n            }\n\n#if DEBUG\n            // A debug mode warning if the type has not been disposed properly\n            ~SftpObjectDatabase()\n            {\n                Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: \" + this.getURI());\n            }\n#endif\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/URIish.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n\t/// <summary>\n\t/// This URI like construct used for referencing Git archives over the net, as\n\t/// well as locally stored archives. The most important difference compared to\n\t/// RFC 2396 URI's is that no URI encoding/decoding ever takes place. A space or\n\t/// any special character is written as-is.\n\t/// </summary>\n\tpublic class URIish\n\t{\n\t\tprivate static readonly Regex FullUri =\n\t\t\tnew Regex(\"^(?:([a-z][a-z0-9+-]+)://(?:([^/]+?)(?::([^/]+?))?@)?(?:([^/]+?))?(?::(\\\\d+))?)?((?:[A-Za-z]:)?/.+)$\");\n\n\t\tprivate static readonly Regex ScpUri = new Regex(\"^(?:([^@]+?)@)?([^:]+?):(.+)$\");\n\n\t\tpublic string Scheme { get; private set; }\n\t\tpublic string Path { get; protected set; }\n\t\tpublic string User { get; private set; }\n\t\tpublic string Pass { get; private set; }\n\t\tpublic int Port { get; private set; }\n\t\tpublic string Host { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Construct a URIish from a standard URL.\n\t\t/// </summary>\n\t\t/// <param name=\"u\">The source URL to convert from.</param>\n\t\tpublic URIish(Uri u)\n\t\t{\n\t\t\tif (u == null)\n\t\t\t\tthrow new ArgumentNullException (\"u\");\n\t\t\tScheme = u.Scheme;\n\t\t\tPath = u.AbsolutePath;\n\t\t\tPort = u.Port;\n\t\t\tHost = u.Host;\n\n\t\t\tstring ui = u.UserInfo;\n\t\t\tif (ui != null)\n\t\t\t{\n\t\t\t\tint d = ui.IndexOf(':');\n\t\t\t\tUser = d < 0 ? ui : ui.Slice(0, d);\n\t\t\t\tPass = d < 0 ? null : ui.Substring(d + 1);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse and construct an <see cref=\"URIish\"/> from a string\n\t\t/// </summary>\n\t\t/// <param name=\"s\"></param>\n\t\tpublic URIish(string s)\n\t\t{\n\n            // If the string passes relative paths such as .\\dir1 or ..\\dir1,\n            // get the absolute path for future processing.\n            if (system().getOperatingSystem() == GitSharp.Core.PlatformType.Windows)\n            {\n                try\n                {\n                    if (!System.IO.Path.IsPathRooted(s))\n                        s = System.IO.Path.GetFullPath(s);\n                } \n\t\t\t    catch (NotSupportedException) {}\n\t\t\t    catch (ArgumentException) {}\n            }\n\n\t\t\ts = s.Replace('\\\\', '/');\n\t\t\tMatch matcher = FullUri.Match(s);\n\t\t\tPort = -1;\n\t\t\tif (matcher.Success)\n\t\t\t{\n\t\t\t\tScheme = matcher.Groups[1].Value;\n\t\t\t\tScheme = Scheme.Length == 0 ? null : Scheme;\n\t\t\t\tUser = matcher.Groups[2].Value;\n\t\t\t\tUser = User.Length == 0 ? null : User;\n\t\t\t\tPass = matcher.Groups[3].Value;\n\t\t\t\tPass = Pass.Length == 0 ? null : Pass;\n\t\t\t\tHost = matcher.Groups[4].Value;\n\t\t\t\tHost = Host.Length == 0 ? null : Host;\n\t\t\t\tif (matcher.Groups[5].Success)\n\t\t\t\t{\n\t\t\t\t\tPort = int.Parse(matcher.Groups[5].Value);\n\t\t\t\t}\n\t\t\t\tPath = matcher.Groups[6].Value;\n\t\t\t\tif (Path.Length >= 3 && Path[0] == '/' && Path[2] == ':' && (Path[1] >= 'A' && Path[1] <= 'Z' || Path[1] >= 'a' && Path[1] <= 'z'))\n\t\t\t\t{\n\t\t\t\t\tPath = Path.Substring(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmatcher = ScpUri.Match(s);\n\t\t\t\tif (matcher.Success)\n\t\t\t\t{\n\t\t\t\t\tUser = matcher.Groups[1].Value;\n\t\t\t\t\tUser = User.Length == 0 ? null : User;\n\t\t\t\t\tHost = matcher.Groups[2].Value;\n\t\t\t\t\tHost = Host.Length == 0 ? null : Host;\n\t\t\t\t\tPath = matcher.Groups[3].Value;\n\t\t\t\t\tPath = Path.Length == 0 ? null : Path;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new UriFormatException(\"Cannot parse Git URI-ish (\" + s + \")\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create an empty, non-configured URI.\n\t\t/// </summary>\n\t\tpublic URIish()\n\t\t{\n\t\t\tPort = -1;\n\t\t}\n\n\t\tprivate URIish(URIish u)\n\t\t{\n\t\t\tScheme = u.Scheme;\n\t\t\tPath = u.Path;\n\t\t\tUser = u.User;\n\t\t\tPass = u.Pass;\n\t\t\tPort = u.Port;\n\t\t\tHost = u.Host;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if this URI references a repository on another system.\n\t\t/// </summary>\n\t\tpublic bool IsRemote\n\t\t{\n\t\t\tget { return Host != null; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different host.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">the new value for host.</param>\n\t\t/// <returns>a new URI with the updated value.</returns>\n\t\tpublic URIish SetHost(string n)\n\t\t{\n\t\t\treturn new URIish(this) { Host = n };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different scheme.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">the new value for scheme.</param>\n\t\t/// <returns>a new URI with the updated value.</returns>\n\t\tpublic URIish SetScheme(string n)\n\t\t{\n\t\t\treturn new URIish(this) { Scheme = n };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different path.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">the new value for path.</param>\n\t\t/// <returns>a new URI with the updated value.</returns>\n\t\tpublic URIish SetPath(string n)\n\t\t{\n\t\t\treturn new URIish(this) { Path = n };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different user.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">the new value for user.</param>\n\t\t/// <returns>a new URI with the updated value.</returns>\n\t\tpublic URIish SetUser(string n)\n\t\t{\n\t\t\treturn new URIish(this) { User = n };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different password.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">the new value for password.</param>\n\t\t/// <returns>A new URI with the updated value.</returns>\n\t\tpublic URIish SetPass(string n)\n\t\t{\n\t\t\treturn new URIish(this) { Pass = n };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new URI matching this one, but with a different port.\n\t\t/// </summary>\n\t\t/// <param name=\"n\">The new value for port.</param>\n\t\t/// <returns>A new URI with the updated value.</returns>\n\t\tpublic URIish SetPort(int n)\n\t\t{\n\t\t\treturn new URIish(this) { Port = (n > 0 ? n : -1) };\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint hc = 0;\n\n\t\t\tif (Scheme != null)\n\t\t\t{\n\t\t\t\thc = hc * 31 + Scheme.GetHashCode();\n\t\t\t}\n\n\t\t\tif (User != null)\n\t\t\t{\n\t\t\t\thc = hc * 31 + User.GetHashCode();\n\t\t\t}\n\n\t\t\tif (Pass != null)\n\t\t\t{\n\t\t\t\thc = hc * 31 + Pass.GetHashCode();\n\t\t\t}\n\n\t\t\tif (Host != null)\n\t\t\t{\n\t\t\t\thc = hc * 31 + Host.GetHashCode();\n\t\t\t}\n\n\t\t\tif (Port > 0)\n\t\t\t{\n\t\t\t\thc = hc * 31 + Port;\n\t\t\t}\n\n\t\t\tif (Path != null)\n\t\t\t{\n\t\t\t\thc = hc * 31 + Path.GetHashCode();\n\t\t\t}\n\n\t\t\treturn hc;\n\t\t}\n\n\t\tprivate static bool Eq(string a, string b)\n\t\t{\n\t\t\tif (a == b) return true;\n\t\t\tif (a == null || b == null) return false;\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tURIish b = (obj as URIish);\n\t\t\tif (b == null) return false;\n\n\t\t\tif (!Eq(Scheme, b.Scheme)) return false;\n\t\t\tif (!Eq(User, b.User)) return false;\n\t\t\tif (!Eq(Pass, b.Pass)) return false;\n\t\t\tif (!Eq(Host, b.Host)) return false;\n\t\t\tif (Port != b.Port) return false;\n\t\t\tif (!Eq(Path, b.Path)) return false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Obtain the string form of the URI, with the password included.\n\t\t/// </summary>\n\t\t/// <returns>The URI, including its password field, if any.</returns>\n\t\tpublic string ToPrivateString()\n\t\t{\n\t\t\treturn Format(true);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Format(false);\n\t\t}\n\n\t\tprivate string Format(bool includePassword)\n\t\t{\n\t\t\tvar r = new StringBuilder();\n\t\t\tif (Scheme != null)\n\t\t\t{\n\t\t\t\tr.Append(Scheme);\n\t\t\t\tr.Append(\"://\");\n\t\t\t}\n\n\t\t\tif (User != null)\n\t\t\t{\n\t\t\t\tr.Append(User);\n\t\t\t\tif (includePassword && Pass != null)\n\t\t\t\t{\n\t\t\t\t\tr.Append(':');\n\t\t\t\t\tr.Append(Pass);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Host != null)\n\t\t\t{\n\t\t\t\tif (User != null)\n\t\t\t\t{\n\t\t\t\t\tr.Append('@');\n\t\t\t\t}\n\n\t\t\t\tr.Append(Host);\n\n\t\t\t\tif (Scheme != null && Port > 0)\n\t\t\t\t{\n\t\t\t\t\tr.Append(':');\n\t\t\t\t\tr.Append(Port);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Path != null)\n\t\t\t{\n\t\t\t\tif (Scheme != null)\n\t\t\t\t{\n\t\t\t\t\tif (!Path.StartsWith(\"/\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tr.Append('/');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (Host != null)\n\t\t\t\t{\n\t\t\t\t\tr.Append(':');\n\t\t\t\t}\n\t\t\t\tr.Append(Path);\n\t\t\t}\n\n\t\t\treturn r.ToString();\n\t\t}\n\n\t    /// <summary>\n\t    ///   Get the \"humanish\" part of the path. Some examples of a 'humanish' part for a full path:\n\t    /// </summary>\n\t    /// <example>\n\t    ///   /path/to/repo.git -> repo\n\t    /// </example>\n\t    /// <example>\n\t    ///   /path/to/repo.git/ -> repo\n\t    /// </example>\n\t    /// <example>\n\t    ///   /path/to/repo/.git -> repo\n\t    /// </example>\n\t    /// <example>\n\t    ///   /path/to/repo/ -> repo\n\t    /// </example>\n\t    /// <example>\n\t    ///   /path//to -> an empty string\n\t    /// </example>\n\t    /// <returns>\n\t    ///   the \"humanish\" part of the path. May be an empty string. Never null.</returns>\n\t    public string getHumanishName()\n\t    {\n\t        if (string.IsNullOrEmpty(Path))\n\t        {\n\t            throw new InvalidOperationException(\"Path is either null or empty.\");\n\t        }\n\n\t        string[] elements = Path.Split('/');\n\t        if (elements.Length == 0)\n\t        {\n\t            throw new InvalidOperationException();\n\t        }\n\n            // In order to match Java Split behavior (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#split(java.lang.String)\n\t        string[] elements2 = RemoveTrailingEmptyStringElements(elements);\n\n            if (elements2.Length == 0)\n            {\n                throw new InvalidOperationException();\n            }\n            \n            string result = elements2[elements2.Length - 1];\n            if (Constants.DOT_GIT.Equals(result))\n\t        {\n\t            result = elements2[elements2.Length - 2];\n\t        }\n\t        else if (result.EndsWith(Constants.DOT_GIT_EXT))\n\t        {\n                result = result.Slice(0, result.Length - Constants.DOT_GIT_EXT.Length);\n\t        }\n\n\t        return result;\n\t    }\n\n\t    private static string[] RemoveTrailingEmptyStringElements(string[] elements)\n\t    {\n\t        var trimmedElements = new List<string>();\n\n\t        for (int i = elements.Length - 1; i > -1; i--)\n\t        {\n                if (elements[i] == string.Empty)\n\t            {\n\t                continue;\n\t            }\n\t        \n                trimmedElements.AddRange(elements.Take(i + 1));\n                break;\n            }\n\n\t        return trimmedElements.ToArray();\n\t    }\n\n\t    private SystemReader system()\n        {\n            return SystemReader.getInstance();\n        }\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Transport/UploadPack.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Implements the server side of a fetch connection, transmitting objects.\n    /// </summary>\n    public class UploadPack : IDisposable\n    {\n        private const string OptionIncludeTag = BasePackFetchConnection.OPTION_INCLUDE_TAG;\n        private const string OptionMultiAck = BasePackFetchConnection.OPTION_MULTI_ACK;\n        private const string OPTION_MULTI_ACK_DETAILED = BasePackFetchConnection.OPTION_MULTI_ACK_DETAILED;\n\n        private const string OptionThinPack = BasePackFetchConnection.OPTION_THIN_PACK;\n        private const string OptionSideBand = BasePackFetchConnection.OPTION_SIDE_BAND;\n        private const string OptionSideBand64K = BasePackFetchConnection.OPTION_SIDE_BAND_64K;\n        private const string OptionOfsDelta = BasePackFetchConnection.OPTION_OFS_DELTA;\n        private const string OptionNoProgress = BasePackFetchConnection.OPTION_NO_PROGRESS;\n\n        /// <summary>\n        /// Database we read the objects from.\n        /// </summary>\n        private readonly Repository _db;\n\n        /// <summary>\n        /// Revision traversal support over <see cref=\"_db\"/>.\n        /// </summary>\n        private readonly RevWalk.RevWalk _walk;\n\n        /// <summary>\n        /// Timeout in seconds to wait for client interaction.\n        /// </summary>\n        private int _timeout;\n\n        /// <summary>\n        /// Is the client connection a bi-directional socket or pipe?\n        /// <para/>\n        /// If true, this class assumes it can perform multiple read and write cycles\n        /// with the client over the input and output streams. This matches the\n        /// functionality available with a standard TCP/IP connection, or a local\n        /// operating system or in-memory pipe.\n        /// <para/>\n        /// If false, this class runs in a read everything then output results mode,\n        /// making it suitable for single round-trip systems RPCs such as HTTP.\n        /// </summary>\n        private bool biDirectionalPipe = true;\n\n        private Stream _rawIn;\n        private Stream _rawOut;\n\n        private PacketLineIn _pckIn;\n        private PacketLineOut _pckOut;\n\n        /// <summary>\n        /// The refs we advertised as existing at the start of the connection.\n        /// </summary>\n        private IDictionary<string, Ref> _refs;\n\n        /// <summary>\n        /// Filter used while advertising the refs to the client.\n        /// </summary>\n        private RefFilter _refFilter;\n\n        /// <summary>\n        /// Capabilities requested by the client.\n        /// </summary>\n        private readonly List<string> _options = new List<string>();\n\n        /// <summary>\n        /// Objects the client wants to obtain.\n        /// </summary>\n        private readonly IList<RevObject> _wantAll = new List<RevObject>();\n\n        /// <summary>\n        /// Objects the client wants to obtain.\n        /// </summary>\n        private readonly List<RevCommit> _wantCommits = new List<RevCommit>();\n\n        /// <summary>\n        /// Objects on both sides, these don't have to be sent.\n        /// </summary>\n        private readonly IList<RevObject> _commonBase = new List<RevObject>();\n\n        /// <summary>\n        /// null if <see cref=\"_commonBase\"/> should be examined again.\n        /// </summary>\n        private bool? okToGiveUp;\n\n        /// <summary>\n        /// Marked on objects we sent in our advertisement list.\n        /// </summary>\n        private readonly RevFlag ADVERTISED;\n\n        /// <summary>\n        /// Marked on objects the client has asked us to give them.\n        /// </summary>\n        private readonly RevFlag WANT;\n\n        /// <summary>\n        /// Marked on objects both we and the client have.\n        /// </summary>\n        private readonly RevFlag PEER_HAS;\n\n        /// <summary>\n        /// Marked on objects in <see cref=\"_commonBase\"/>.\n        /// </summary>\n        private readonly RevFlag COMMON;\n        private readonly RevFlagSet SAVE;\n\n        private BasePackFetchConnection.MultiAck _multiAck = BasePackFetchConnection.MultiAck.OFF;\n\n        ///\t<summary>\n        /// Create a new pack upload for an open repository.\n        /// </summary>\n        /// <param name=\"copyFrom\">the source repository.</param>\n        public UploadPack(Repository copyFrom)\n        {\n            _db = copyFrom;\n            _walk = new RevWalk.RevWalk(_db);\n            _walk.setRetainBody(false);\n\n            ADVERTISED = _walk.newFlag(\"ADVERTISED\");\n            WANT = _walk.newFlag(\"WANT\");\n            PEER_HAS = _walk.newFlag(\"PEER_HAS\");\n            COMMON = _walk.newFlag(\"COMMON\");\n            _walk.carry(PEER_HAS);\n\n            SAVE = new RevFlagSet { ADVERTISED, WANT, PEER_HAS };\n            _refFilter = RefFilterContants.DEFAULT;\n        }\n\n        /// <summary>\n        /// the repository this upload is reading from.\n        /// </summary>\n        public Repository Repository\n        {\n            get { return _db; }\n        }\n\n        /// <summary>\n        /// the RevWalk instance used by this connection.\n        /// </summary>\n        public RevWalk.RevWalk RevWalk\n        {\n            get { return _walk; }\n        }\n\n        /// <summary>\n        /// number of seconds to wait (with no data transfer occurring)\n        /// before aborting an IO read or write operation with the\n        /// connected client.\n        /// </summary>\n        public int Timeout\n        {\n            get { return _timeout; }\n            set { _timeout = value; }\n        }\n\n        /// <returns>\n        /// true if this class expects a bi-directional pipe opened between\n        /// the client and itself. The default is true.\n        /// </returns>\n        public bool isBiDirectionalPipe()\n        {\n            return biDirectionalPipe;\n        }\n\n        /// <summary>\n        /// if true, this class will assume the socket is a fully\n        /// bidirectional pipe between the two peers and takes advantage\n        /// of that by first transmitting the known refs, then waiting to\n        /// read commands. If false, this class assumes it must read the\n        /// commands before writing output and does not perform the\n        /// initial advertising.\n        /// </summary>\n        /// <param name=\"twoWay\"></param>\n        public void setBiDirectionalPipe(bool twoWay)\n        {\n            biDirectionalPipe = twoWay;\n        }\n\n        /// <returns>the filter used while advertising the refs to the client</returns>\n        public RefFilter getRefFilter()\n        {\n            return _refFilter;\n        }\n\n        /// <summary>\n        /// Set the filter used while advertising the refs to the client.\n        /// <para/>\n        /// Only refs allowed by this filter will be sent to the client. This can\n        /// be used by a server to restrict the list of references the client can\n        /// obtain through clone or fetch, effectively limiting the access to only\n        /// certain refs.\n        /// </summary>\n        /// <param name=\"refFilter\">the filter; may be null to show all refs.</param>\n        public void setRefFilter(RefFilter refFilter)\n        {\n            _refFilter = refFilter ?? RefFilterContants.DEFAULT;\n        }\n\n        /// <summary>\n        /// Execute the upload task on the socket.\n        /// </summary>\n        /// <param name=\"input\">\n        /// raw input to read client commands from. Caller must ensure the\n        /// input is buffered, otherwise read performance may suffer.\n        /// </param>\n        /// <param name=\"output\">\n        /// response back to the Git network client, to write the pack\n        /// data onto. Caller must ensure the output is buffered,\n        /// otherwise write performance may suffer.\n        /// </param>\n        /// <param name=\"messages\">\n        /// secondary \"notice\" channel to send additional messages out\n        /// through. When run over SSH this should be tied back to the\n        /// standard error channel of the command execution. For most\n        /// other network connections this should be null.\n        /// </param>\n        /// <exception cref=\"IOException\"></exception>\n        public void Upload(Stream input, Stream output, Stream messages)\n        {\n            _rawIn = input;\n            _rawOut = output;\n\n            if (_timeout > 0)\n            {\n                var i = new TimeoutStream(_rawIn);\n\t\t\t\t\ti.setTimeout(_timeout * 1000);\n                var o = new TimeoutStream(_rawOut );\n\t\t\t\t\t o.setTimeout(_timeout * 1000);\n                _rawIn = i;\n                _rawOut = o;\n            }\n\n            _pckIn = new PacketLineIn(_rawIn);\n            _pckOut = new PacketLineOut(_rawOut);\n            Service();\n        }\n\n        private void Service()\n        {\n            if (biDirectionalPipe)\n                sendAdvertisedRefs(new RefAdvertiser.PacketLineOutRefAdvertiser(_pckOut));\n            else\n            {\n                _refs = _refFilter.filter(_db.getAllRefs());\n                foreach (Ref r in _refs.Values)\n                {\n                    try\n                    {\n                        _walk.parseAny(r.ObjectId).add(ADVERTISED);\n                    }\n                    catch (IOException)\n                    {\n                        // Skip missing/corrupt objects\n                    }\n                }\n            }\n\n            RecvWants();\n            if (_wantAll.Count == 0) return;\n            if (_options.Contains(OPTION_MULTI_ACK_DETAILED))\n                _multiAck = BasePackFetchConnection.MultiAck.DETAILED;\n            else if (_options.Contains(OptionMultiAck))\n                _multiAck = BasePackFetchConnection.MultiAck.CONTINUE;\n            else\n                _multiAck = BasePackFetchConnection.MultiAck.OFF;\n\n            if (Negotiate())\n                SendPack();\n        }\n\n        /// <summary>\n        /// Generate an advertisement of available refs and capabilities.\n        /// </summary>\n        /// <param name=\"adv\">the advertisement formatter.</param>\n        public void sendAdvertisedRefs(RefAdvertiser adv)\n        {\n            adv.init(_walk, ADVERTISED);\n            adv.advertiseCapability(OptionIncludeTag);\n            adv.advertiseCapability(OPTION_MULTI_ACK_DETAILED);\n            adv.advertiseCapability(OptionMultiAck);\n            adv.advertiseCapability(OptionOfsDelta);\n            adv.advertiseCapability(OptionSideBand);\n            adv.advertiseCapability(OptionSideBand64K);\n            adv.advertiseCapability(OptionThinPack);\n            adv.advertiseCapability(OptionNoProgress);\n            adv.setDerefTags(true);\n            _refs = _refFilter.filter(_db.getAllRefs());\n            adv.send(_refs);\n            adv.end();\n        }\n\n        private void RecvWants()\n        {\n            bool isFirst = true;\n            for (; ; isFirst = false)\n            {\n                string line;\n                try\n                {\n                    line = _pckIn.ReadString();\n                }\n                catch (EndOfStreamException)\n                {\n                    if (isFirst) break;\n                    throw;\n                }\n\n                if (line == PacketLineIn.END) break;\n                if (!line.StartsWith(\"want \") || line.Length < 45)\n                {\n                    throw new PackProtocolException(\"expected want; got \" + line);\n                }\n\n                if (isFirst && line.Length > 45)\n                {\n                    string opt = line.Substring(45);\n                    if (opt.StartsWith(\" \"))\n                        opt = opt.Substring(1);\n                    foreach (string c in opt.Split(' '))\n                        _options.Add(c);\n                    line = line.Slice(0, 45);\n                }\n\n                ObjectId id = ObjectId.FromString(line.Substring(5));\n                RevObject o;\n                try\n                {\n                    o = _walk.parseAny(id);\n                }\n                catch (IOException e)\n                {\n                    throw new PackProtocolException(id.Name + \" not valid\", e);\n                }\n                if (!o.has(ADVERTISED))\n                {\n                    throw new PackProtocolException(id.Name + \" not valid\");\n                }\n\n                Want(o);\n            }\n        }\n\n        private void Want(RevObject o)\n        {\n            if (o.has(WANT)) return;\n\n            o.add(WANT);\n            _wantAll.Add(o);\n\n            if (o is RevCommit)\n                _wantCommits.Add((RevCommit)o);\n\n            else if (o is RevTag)\n            {\n                do\n                {\n                    o = ((RevTag)o).getObject();\n                } while (o is RevTag);\n                if (o is RevCommit)\n                    Want(o);\n            }\n\n        }\n\n        private bool Negotiate()\n        {\n            ObjectId last = ObjectId.ZeroId;\n\n            while (true)\n            {\n                string line = _pckIn.ReadString();\n\n                if (line == PacketLineIn.END)\n                {\n                    if (_commonBase.Count == 0 || _multiAck != BasePackFetchConnection.MultiAck.OFF)\n                    {\n                        _pckOut.WriteString(\"NAK\\n\");\n                    }\n                    _pckOut.Flush();\n\n                    if (!biDirectionalPipe)\n                        return false;\n                }\n                else if (line.StartsWith(\"have \") && line.Length == 45)\n                {\n                    ObjectId id = ObjectId.FromString(line.Substring(5));\n                    if (MatchHave(id))\n                    {\n                        // Both sides have the same object; let the client know.\n                        //\n                        last = id;\n                        switch (_multiAck)\n                        {\n                            case BasePackFetchConnection.MultiAck.OFF:\n                                if (_commonBase.Count == 1)\n                                    _pckOut.WriteString(\"ACK \" + id.Name + \"\\n\");\n                                break;\n                            case BasePackFetchConnection.MultiAck.CONTINUE:\n\n                                _pckOut.WriteString(\"ACK \" + id.Name + \" continue\\n\");\n                                break;\n                            case BasePackFetchConnection.MultiAck.DETAILED:\n                                _pckOut.WriteString(\"ACK \" + id.Name + \" common\\n\");\n                                break;\n                        }\n                    }\n                    else if (OkToGiveUp())\n                    {\n                        // They have this object; we don't.\n                        //\n                        switch (_multiAck)\n                        {\n                            case BasePackFetchConnection.MultiAck.OFF:\n                                break;\n                            case BasePackFetchConnection.MultiAck.CONTINUE:\n                                _pckOut.WriteString(\"ACK \" + id.Name + \" continue\\n\");\n                                break;\n                            case BasePackFetchConnection.MultiAck.DETAILED:\n                                _pckOut.WriteString(\"ACK \" + id.Name + \" ready\\n\");\n                                break;\n                        }\n                    }\n                }\n                else if (line.Equals(\"done\"))\n                {\n                    if (_commonBase.Count == 0)\n                    {\n                        _pckOut.WriteString(\"NAK\\n\");\n                    }\n                    else if (_multiAck != BasePackFetchConnection.MultiAck.OFF)\n                    {\n                        _pckOut.WriteString(\"ACK \" + last.Name + \"\\n\");\n                    }\n\n                    return true;\n                }\n                else\n                {\n                    throw new PackProtocolException(\"expected have; got \" + line);\n                }\n            }\n        }\n\n        private bool MatchHave(AnyObjectId id)\n        {\n            RevObject o;\n            try\n            {\n                o = _walk.parseAny(id);\n            }\n            catch (IOException)\n            {\n                return false;\n            }\n\n            if (!o.has(PEER_HAS))\n            {\n                o.add(PEER_HAS);\n                RevCommit oComm = (o as RevCommit);\n                if (oComm != null)\n                {\n                    oComm.carry(PEER_HAS);\n                }\n                AddCommonBase(o);\n            }\n            return true;\n        }\n\n        private void AddCommonBase(RevObject o)\n        {\n            if (o.has(COMMON)) return;\n            o.add(COMMON);\n            _commonBase.Add(o);\n            okToGiveUp = null;\n        }\n\n        private bool OkToGiveUp()\n        {\n            if (okToGiveUp == null)\n            {\n                okToGiveUp = OkToGiveUpImp();\n            }\n            return okToGiveUp.Value;\n        }\n        private bool OkToGiveUpImp()\n        {\n            if (_commonBase.Count == 0) return false;\n\n            try\n            {\n                _wantCommits.RemoveAll(WantSatisfied);\n            }\n            catch (IOException e)\n            {\n                throw new PackProtocolException(\"internal revision error\", e);\n            }\n\n            return _wantCommits.Count == 0;\n        }\n\n        private bool WantSatisfied(RevCommit want)\n        {\n            _walk.resetRetain(SAVE);\n            _walk.markStart(want);\n\n            while (true)\n            {\n                RevCommit c = _walk.next();\n                if (c == null) break;\n                if (c.has(PEER_HAS))\n                {\n                    AddCommonBase(c);\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        private void SendPack()\n        {\n            bool thin = _options.Contains(OptionThinPack);\n            bool progress = !_options.Contains(OptionNoProgress);\n            bool sideband = _options.Contains(OptionSideBand) || _options.Contains(OptionSideBand64K);\n\n            ProgressMonitor pm = NullProgressMonitor.Instance;\n            Stream _packOut = _rawOut;\n\n            if (sideband)\n            {\n                int bufsz = SideBandOutputStream.SMALL_BUF;\n                if (_options.Contains(OptionSideBand64K))\n                {\n                    bufsz = SideBandOutputStream.MAX_BUF;\n                }\n\n                _packOut = new SideBandOutputStream(SideBandOutputStream.CH_DATA, bufsz, _rawOut);\n\n                if (progress)\n                    pm = new SideBandProgressMonitor(new SideBandOutputStream(SideBandOutputStream.CH_PROGRESS, bufsz, _rawOut));\n            }\n\n            var pw = new PackWriter(_db, pm, NullProgressMonitor.Instance)\n                        {\n                            DeltaBaseAsOffset = _options.Contains(OptionOfsDelta),\n                            Thin = thin\n                        };\n\n            pw.preparePack(_wantAll, _commonBase);\n            if (_options.Contains(OptionIncludeTag))\n            {\n                foreach (Ref r in _refs.Values)\n                {\n                    RevObject o;\n                    try\n                    {\n                        o = _walk.parseAny(r.ObjectId);\n                    }\n                    catch (IOException)\n                    {\n                        continue;\n                    }\n                    RevTag t = (o as RevTag);\n                    if (o.has(WANT) || (t == null)) continue;\n\n                    if (!pw.willInclude(t) && pw.willInclude(t.getObject()))\n                        pw.addObject(t);\n                }\n            }\n\n            pw.writePack(_packOut);\n\n            if (sideband)\n            {\n                _packOut.Flush();\n                _pckOut.End();\n            }\n            else\n            {\n                _rawOut.Flush();\n            }\n        }\n\n        public void Dispose()\n        {\n            _walk.Dispose();\n            ADVERTISED.Dispose();\n            WANT.Dispose();\n            PEER_HAS.Dispose();\n            COMMON.Dispose();\n            _rawIn.Dispose();\n            _rawOut.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/WalkEncryption.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Net;\n\nnamespace GitSharp.Core.Transport\n{\n\n    public abstract class WalkEncryption\n    {\n        public static WalkEncryption NONE = new NoEncryption();\n\n        public const string JETS3T_CRYPTO_VER = \"jets3t-crypto-ver\";\n        public const string JETS3T_CRYPTO_ALG = \"jets3t-crypto-alg\";\n\n        public abstract Stream encrypt(Stream stream);\n        public abstract Stream decrypt(Stream stream);\n\n        public abstract void request(HttpWebRequest u, string prefix);\n        public abstract void validate(HttpWebRequest u, string p);\n\n        protected void validateImpl(HttpWebRequest u, string p, string version, string name)\n        {\n\t\t\tif (u == null)\n\t\t\t\tthrow new ArgumentNullException (\"u\");\n        \tif (version == null)\n\t\t\t\tthrow new ArgumentNullException (\"version\");\n        \tif (name == null)\n\t\t\t\tthrow new ArgumentNullException (\"name\");\n\t\t\t\n            string v = u.Headers.Get(p + JETS3T_CRYPTO_VER) ?? string.Empty;\n            if (!version.Equals(v))\n                throw new IOException(\"Unsupported encryption version: \" + v);\n\n            v = u.Headers.Get(p + JETS3T_CRYPTO_ALG) ?? string.Empty;\n            if (!name.Equals(v))\n                throw new IOException(\"Unsupported encryption algorithm: \" + v);\n        }\n\n        public IOException error(Exception why)\n        {\n\t\t\tif (why == null)\n\t\t\t\tthrow new ArgumentNullException (\"why\");\n\t\t\t\n            IOException e;\n            e = new IOException(\"Encryption error: \" + why.Message, why);\n            return e;\n        }\n\n        private class NoEncryption : WalkEncryption\n        {\n            public override void request(HttpWebRequest u, string prefix)\n            {\n            }\n\n            public override void validate(HttpWebRequest u, string p)\n            {\n                validateImpl(u, p, string.Empty, string.Empty);\n            }\n\n            public override Stream decrypt(Stream stream)\n            {\n                return stream;\n            }\n\n            public override Stream encrypt(Stream stream)\n            {\n                return stream;\n            }\n        }\n\n        // TODO: [caytchen] add ObjectEncryptionV2\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Transport/WalkFetchConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Generic fetch support for dumb transport protocols.\n    /// <para/>\n    /// Since there are no Git-specific smarts on the remote side of the connection\n    /// the client side must determine which objects it needs to copy in order to\n    /// completely fetch the requested refs and their history. The generic walk\n    /// support in this class parses each individual object (once it has been copied\n    /// to the local repository) and examines the list of objects that must also be\n    /// copied to create a complete history. Objects which are already available\n    /// locally are retained (and not copied), saving bandwidth for incremental\n    /// fetches. Pack files are copied from the remote repository only as a last\n    /// resort, as the entire pack must be copied locally in order to access any\n    /// single object.\n    /// <para/>\n    /// This fetch connection does not actually perform the object data transfer.\n    /// Instead it delegates the transfer to a <see cref=\"WalkRemoteObjectDatabase\"/>,\n    /// which knows how to read individual files from the remote repository and\n    /// supply the data as a standard Java InputStream.\n    /// </summary>\n    public class WalkFetchConnection : BaseFetchConnection, IDisposable\n    {\n        /// <summary>\n        /// The repository this transport fetches into, or pushes out of.\n        /// </summary>\n        private readonly Repository _local;\n\n        /// <summary>\n        /// If not null the validator for received objects.\n        /// </summary>\n        private readonly ObjectChecker _objCheck;\n\n        /// <summary>\n        /// List of all remote repositories we may need to get objects out of.\n        /// <para/>\n        /// The first repository in the list is the one we were asked to fetch from;\n        /// the remaining repositories point to the alternate locations we can fetch\n        /// objects through.\n        /// </summary>\n        private readonly List<WalkRemoteObjectDatabase> _remotes;\n\n        /// <summary>\n        /// Most recently used item in <see cref=\"_remotes\"/>.\n        /// </summary>\n        private int _lastRemoteIdx;\n\n        private readonly RevWalk.RevWalk _revWalk;\n        private readonly TreeWalk.TreeWalk _treeWalk;\n\n        /// <summary>\n        /// Objects whose direct dependents we know we have (or will have).\n        /// </summary>\n        private readonly RevFlag COMPLETE;\n\n        /// <summary>\n        /// Objects that have already entered <see cref=\"_workQueue\"/>.\n        /// </summary>\n        private readonly RevFlag IN_WORK_QUEUE;\n\n        /// <summary>\n        /// Commits that have already entered <see cref=\"_localCommitQueue\"/>.\n        /// </summary>\n        private readonly RevFlag LOCALLY_SEEN;\n\n        /// <summary>\n        /// Commits already reachable from all local refs.\n        /// </summary>\n        private readonly DateRevQueue _localCommitQueue;\n\n        /// <summary>\n        /// Objects we need to copy from the remote repository.\n        /// </summary>\n        private LinkedList<ObjectId> _workQueue;\n\n        /// <summary>\n        /// Databases we have not yet obtained the list of packs from.\n        /// </summary>\n        private readonly LinkedList<WalkRemoteObjectDatabase> _noPacksYet;\n\n        /// <summary>\n        /// Databases we have not yet obtained the alternates from.\n        /// </summary>\n        private readonly LinkedList<WalkRemoteObjectDatabase> _noAlternatesYet;\n\n        /// <summary>\n        /// Packs we have discovered, but have not yet fetched locally.\n        /// </summary>\n        private readonly LinkedList<RemotePack> _unfetchedPacks;\n\n        /// <summary>\n        /// Packs whose indexes we have looked at in <see cref=\"_unfetchedPacks\"/>.\n        /// <para/>\n        /// We try to avoid getting duplicate copies of the same pack through\n        /// multiple alternates by only looking at packs whose names are not yet in\n        /// this collection.\n        /// </summary>\n        private readonly List<string> _packsConsidered;\n\n        private readonly MutableObjectId _idBuffer = new MutableObjectId();\n\n        private readonly MessageDigest _objectDigest = Constants.newMessageDigest();\n\n        /// <summary>\n        /// Errors received while trying to obtain an object.\n        /// <para/>\n        /// If the fetch winds up failing because we cannot locate a specific object\n        /// then we need to report all errors related to that object back to the\n        /// caller as there may be cascading failures.\n        /// </summary>\n        private readonly Dictionary<ObjectId, List<Exception>> _fetchErrors;\n\n        private string _lockMessage;\n\n        private readonly List<PackLock> _packLocks;\n\n        public WalkFetchConnection(IWalkTransport t, WalkRemoteObjectDatabase w)\n        {\n            var wt = (Transport)t;\n            _local = wt.Local;\n            _objCheck = wt.CheckFetchedObjects ? new ObjectChecker() : null;\n\n            _remotes = new List<WalkRemoteObjectDatabase> { w };\n\n            _unfetchedPacks = new LinkedList<RemotePack>();\n            _packsConsidered = new List<string>();\n\n            _noPacksYet = new LinkedList<WalkRemoteObjectDatabase>();\n            _noPacksYet.AddLast(w);\n\n            _noAlternatesYet = new LinkedList<WalkRemoteObjectDatabase>();\n            _noAlternatesYet.AddLast(w);\n\n            _fetchErrors = new Dictionary<ObjectId, List<Exception>>();\n            _packLocks = new List<PackLock>(4);\n\n            _revWalk = new RevWalk.RevWalk(_local);\n            _revWalk.setRetainBody(false);\n            _treeWalk = new TreeWalk.TreeWalk(_local);\n\n            COMPLETE = _revWalk.newFlag(\"COMPLETE\");\n            IN_WORK_QUEUE = _revWalk.newFlag(\"IN_WORK_QUEUE\");\n            LOCALLY_SEEN = _revWalk.newFlag(\"LOCALLY_SEEN\");\n\n            _localCommitQueue = new DateRevQueue();\n            _workQueue = new LinkedList<ObjectId>();\n        }\n\n        public override bool DidFetchTestConnectivity\n        {\n            get\n            {\n                return true;\n            }\n        }\n\n        protected override void doFetch(ProgressMonitor monitor, ICollection<Ref> want, IList<ObjectId> have)\n        {\n            MarkLocalRefsComplete(have);\n            QueueWants(want);\n\n            while (!monitor.IsCancelled && _workQueue.Count > 0)\n            {\n                ObjectId id = _workQueue.First.Value;\n                _workQueue.RemoveFirst();\n                var ro = (id as RevObject);\n                if (ro == null || !ro.has(COMPLETE))\n                {\n                    DownloadObject(monitor, id);\n                }\n                Process(id);\n            }\n        }\n\n        public override List<PackLock> PackLocks\n        {\n            get { return _packLocks; }\n        }\n\n        public override void SetPackLockMessage(string message)\n        {\n            _lockMessage = message;\n        }\n\n        public override void Close()\n        {\n            foreach (RemotePack p in _unfetchedPacks)\n            {\n                p.TmpIdx.DeleteFile();\n            }\n            foreach (WalkRemoteObjectDatabase r in _remotes)\n            {\n                r.Dispose();\n            }\n        }\n\n        private void QueueWants(IEnumerable<Ref> want)\n        {\n            var inWorkQueue = new List<ObjectId>();\n            foreach (Ref r in want)\n            {\n                ObjectId id = r.ObjectId;\n                try\n                {\n                    RevObject obj = _revWalk.parseAny(id);\n                    if (obj.has(COMPLETE))\n                        continue;\n                    bool contains = inWorkQueue.Contains(id);\n                    inWorkQueue.Add(id);\n                    if (!contains)\n                    {\n                        obj.add(IN_WORK_QUEUE);\n                        _workQueue.AddLast(obj);\n                    }\n                }\n                catch (MissingObjectException)\n                {\n                    bool contains = inWorkQueue.Contains(id);\n                    inWorkQueue.Add(id);\n                    if (!contains)\n                        _workQueue.AddLast(id);\n                }\n                catch (IOException e)\n                {\n                    throw new TransportException(\"Cannot Read \" + id.Name, e);\n                }\n            }\n        }\n\n        private void Process(ObjectId id)\n        {\n            RevObject obj;\n            try\n            {\n                if (id is RevObject)\n                {\n                    obj = (RevObject)id;\n                    if (obj.has(COMPLETE))\n                        return;\n                    _revWalk.parseHeaders(obj);\n                }\n                else\n                {\n                    obj = _revWalk.parseAny(id);\n                    if (obj.has(COMPLETE))\n                        return;\n                }\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(\"Cannot Read \" + id.Name, e);\n            }\n\n            switch (obj.Type)\n            {\n                case Constants.OBJ_BLOB:\n                    ProcessBlob(obj);\n                    break;\n\n                case Constants.OBJ_TREE:\n                    ProcessTree(obj);\n                    break;\n\n                case Constants.OBJ_COMMIT:\n                    ProcessCommit(obj);\n                    break;\n\n                case Constants.OBJ_TAG:\n                    ProcessTag(obj);\n                    break;\n\n                default:\n                    throw new TransportException(\"Unknown object type \" + id.Name + \" (\" + obj.Type + \")\");\n            }\n\n            // If we had any prior errors fetching this object they are\n            // now resolved, as the object was parsed successfully.\n            //\n            _fetchErrors.Remove(id.Copy());\n        }\n\n        private void ProcessBlob(RevObject obj)\n        {\n            if (!_local.HasObject(obj))\n            {\n                throw new TransportException(\"Cannot Read blob \" + obj.Name, new MissingObjectException(obj, Constants.TYPE_BLOB));\n            }\n            obj.add(COMPLETE);\n        }\n\n        private void ProcessTree(RevObject obj)\n        {\n            try\n            {\n                _treeWalk.reset(obj);\n                while (_treeWalk.next())\n                {\n                    FileMode mode = _treeWalk.getFileMode(0);\n                    int sType = (int)mode.ObjectType;\n\n                    switch (sType)\n                    {\n                        case Constants.OBJ_BLOB:\n                        case Constants.OBJ_TREE:\n                            _treeWalk.getObjectId(_idBuffer, 0);\n                            Needs(_revWalk.lookupAny(_idBuffer, sType));\n                            continue;\n\n                        default:\n                            if (FileMode.GitLink.Equals(sType))\n                                continue;\n                            _treeWalk.getObjectId(_idBuffer, 0);\n                            throw new CorruptObjectException(\"Invalid mode \" + mode.ObjectType + \" for \" + _idBuffer.Name + \" \" +\n                                                             _treeWalk.getPathString() + \" in \" + obj.getId().Name + \".\");\n                    }\n                }\n            }\n            catch (IOException ioe)\n            {\n                throw new TransportException(\"Cannot Read tree \" + obj.Name, ioe);\n            }\n            obj.add(COMPLETE);\n        }\n\n        private void ProcessCommit(RevObject obj)\n        {\n            var commit = (RevCommit)obj;\n            MarkLocalCommitsComplete(commit.CommitTime);\n            Needs(commit.Tree);\n            foreach (RevCommit p in commit.Parents)\n            {\n                Needs(p);\n            }\n            obj.add(COMPLETE);\n        }\n\n        private void ProcessTag(RevObject obj)\n        {\n            var tag = (RevTag)obj;\n            Needs(tag.getObject());\n            obj.add(COMPLETE);\n        }\n\n        private void Needs(RevObject obj)\n        {\n            if (obj.has(COMPLETE)) return;\n\n            if (!obj.has(IN_WORK_QUEUE))\n            {\n                obj.add(IN_WORK_QUEUE);\n                _workQueue.AddLast(obj);\n            }\n        }\n\n        private void DownloadObject(ProgressMonitor pm, AnyObjectId id)\n        {\n            if (_local.HasObject(id)) return;\n\n            while (true)\n            {\n                // Try a pack file we know about, but don't have yet. Odds are\n                // that if it has this object, it has others related to it so\n                // getting the pack is a good bet.\n                //\n                if (DownloadPackedObject(pm, id))\n                    return;\n\n                // Search for a loose object over all alternates, starting\n                // from the one we last successfully located an object through.\n                //\n                string idStr = id.Name;\n                string subdir = idStr.Slice(0, 2);\n                string file = idStr.Substring(2);\n                string looseName = subdir + \"/\" + file;\n\n                for (int i = _lastRemoteIdx; i < _remotes.Count; i++)\n                {\n                    if (DownloadLooseObject(id, looseName, _remotes[i]))\n                    {\n                        _lastRemoteIdx = i;\n                        return;\n                    }\n                }\n\n                for (int i = 0; i < _lastRemoteIdx; i++)\n                {\n                    if (DownloadLooseObject(id, looseName, _remotes[i]))\n                    {\n                        _lastRemoteIdx = i;\n                        return;\n                    }\n                }\n\n                // Try to obtain more pack information and search those.\n                //\n                while (_noPacksYet.Count > 0)\n                {\n                    WalkRemoteObjectDatabase wrr = _noPacksYet.First.Value;\n                    _noPacksYet.RemoveFirst();\n                    ICollection<string> packNameList;\n                    try\n                    {\n                        pm.BeginTask(\"Listing packs\", ProgressMonitor.UNKNOWN);\n                        packNameList = wrr.getPackNames();\n                    }\n                    catch (IOException e)\n                    {\n                        // Try another repository.\n                        //\n                        RecordError(id, e);\n                        continue;\n                    }\n                    finally\n                    {\n                        pm.EndTask();\n                    }\n\n                    if (packNameList == null || packNameList.Count == 0)\n                        continue;\n                    foreach (string packName in packNameList)\n                    {\n                        bool contains = _packsConsidered.Contains(packName);\n                        _packsConsidered.Add(packName);\n                        if (!contains)\n                        {\n                            _unfetchedPacks.AddLast(new RemotePack(_lockMessage, _packLocks, _objCheck, _local, wrr, packName));\n                        }\n                    }\n                    if (DownloadPackedObject(pm, id))\n                        return;\n                }\n\n                // Try to expand the first alternate we haven't expanded yet.\n                //\n                ICollection<WalkRemoteObjectDatabase> al = ExpandOneAlternate(id, pm);\n                if (al != null && al.Count > 0)\n                {\n                    foreach (WalkRemoteObjectDatabase alt in al)\n                    {\n                        _remotes.Add(alt);\n                        _noPacksYet.AddLast(alt);\n                        _noAlternatesYet.AddLast(alt);\n                    }\n                    continue;\n                }\n\n                // We could not obtain the object. There may be reasons why.\n                //\n                List<Exception> failures = _fetchErrors.get(id.Copy());\n\n                var te = new TransportException(\"Cannot get \" + id.Name + \".\");\n\n                if (failures != null && failures.Count > 0)\n                {\n                    te = failures.Count == 1 ?\n                        new TransportException(\"Cannot get \" + id.Name + \".\", failures[0]) :\n                        new TransportException(\"Cannot get \" + id.Name + \".\", new CompoundException(failures));\n                }\n\n                throw te;\n            }\n        }\n\n        private bool DownloadPackedObject(ProgressMonitor monitor, AnyObjectId id)\n        {\n            // Search for the object in a remote pack whose index we have,\n            // but whose pack we do not yet have.\n            //\n            var iter = new LinkedListIterator<RemotePack>(_unfetchedPacks);\n            \n            while (iter.hasNext() && !monitor.IsCancelled)\n            {\n                RemotePack pack = iter.next();\n                try\n                {\n                    pack.OpenIndex(monitor);\n                }\n                catch (IOException err)\n                {\n                    // If the index won't open its either not found or\n                    // its a format we don't recognize. In either case\n                    // we may still be able to obtain the object from\n                    // another source, so don't consider it a failure.\n                    //                    \n                    RecordError(id, err);\n                    iter.remove();\n                    continue;\n                }\n\n                if (monitor.IsCancelled)\n                {\n                    // If we were cancelled while the index was opening\n                    // the open may have aborted. We can't search an\n                    // unopen index.\n                    //\n                    return false;\n                }\n\n                if (!pack.Index.HasObject(id))\n                {\t\n                    // Not in this pack? Try another.\n                    //\n                    continue;\n                }\n\n                // It should be in the associated pack. Download that\n                // and attach it to the local repository so we can use\n                // all of the contained objects.\n                //\n                try\n                {\n                    pack.DownloadPack(monitor);\n                }\n                catch (IOException err)\n                {\n                    // If the pack failed to download, index correctly,\n                    // or open in the local repository we may still be\n                    // able to obtain this object from another pack or\n                    // an alternate.\n                    //\n                    RecordError(id, err);\n                    continue;\n                }\n                finally\n                {\n                    // If the pack was good its in the local repository\n                    // and Repository.hasObject(id) will succeed in the\n                    // future, so we do not need this data anymore. If\n                    // it failed the index and pack are unusable and we\n                    // shouldn't consult them again.\n                    //\n                    pack.TmpIdx.DeleteFile();\n                    iter.remove();\n                }\n\n                if (!_local.HasObject(id))\n                {\n                    // What the hell? This pack claimed to have\n                    // the object, but after indexing we didn't\n                    // actually find it in the pack.\n                    //\n                    RecordError(id,\n                                new FileNotFoundException(\"Object \" + id.Name + \" not found in \" + pack.PackName + \".\"));\n                    continue;\n                }\n\n                // Complete any other objects that we can.\n                //\n                IIterator<ObjectId> pending = SwapFetchQueue();\n                while (pending.hasNext())\n                {\n                    ObjectId p = pending.next();\n                    if (pack.Index.HasObject(p))\n                    {\n                        pending.remove();\n                        Process(p);\n                    }\n                    else\n                        _workQueue.AddLast(p);\n                }\n                return true;\n            }\n            return false;\n        }\n\n        private IIterator<ObjectId> SwapFetchQueue()\n        {\n            var r = new LinkedListIterator<ObjectId>(_workQueue);\n            _workQueue = new LinkedList<ObjectId>();\n            return r;\n        }\n\n        private bool DownloadLooseObject(AnyObjectId id, string looseName, WalkRemoteObjectDatabase remote)\n        {\n            try\n            {\n                byte[] compressed = remote.open(looseName).toArray();\n                VerifyLooseObject(id, compressed);\n                SaveLooseObject(id, compressed);\n                return true;\n            }\n            catch (FileNotFoundException e)\n            {\n                // Not available in a loose format from this alternate?\n                // Try another strategy to get the object.\n                //\n                RecordError(id, e);\n                return false;\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(\"Cannot download \" + id.Name, e);\n            }\n        }\n\n        private void VerifyLooseObject(AnyObjectId id, byte[] compressed)\n        {\n            UnpackedObjectLoader uol;\n            try\n            {\n                uol = new UnpackedObjectLoader(compressed);\n            }\n            catch (CorruptObjectException parsingError)\n            {\n                // Some HTTP servers send back a \"200 OK\" status with an HTML\n                // page that explains the requested file could not be found.\n                // These servers are most certainly misconfigured, but many\n                // of them exist in the world, and many of those are hosting\n                // Git repositories.\n                //\n                // Since an HTML page is unlikely to hash to one of our loose\n                // objects we treat this condition as a FileNotFoundException\n                // and attempt to recover by getting the object from another\n                // source.\n                //\n                var e = new FileNotFoundException(id.Name, parsingError);\n                throw e;\n            }\n\n            _objectDigest.Reset();\n            _objectDigest.Update(Constants.encodedTypeString(uol.Type));\n            _objectDigest.Update((byte)' ');\n            _objectDigest.Update(Constants.encodeASCII(uol.Size));\n            _objectDigest.Update(0);\n            _objectDigest.Update(uol.CachedBytes);\n            _idBuffer.FromRaw(_objectDigest.Digest(), 0);\n\n            if (!AnyObjectId.equals(id, _idBuffer)) \n            {\n                throw new TransportException(\"Incorrect hash for \" + id.Name + \"; computed \" + _idBuffer.Name + \" as a \" +\n                                             Constants.typeString(uol.Type) + \" from \" + compressed.Length +\n                                             \" bytes.\");\n            }\n            if (_objCheck != null)\n            {\n                try\n                {\n                    _objCheck.check(uol.Type, uol.CachedBytes);\n                }\n                catch (CorruptObjectException e)\n                {\n                    throw new TransportException(\"Invalid \" + Constants.typeString(uol.Type) + \" \" + id.Name + \": \" + e.Message);\n                }\n            }\n        }\n\n        private void SaveLooseObject(AnyObjectId id, byte[] compressed)\n        {\n            var tmpPath = Path.Combine(_local.ObjectsDirectory.FullName, Path.GetTempFileName());\n\n            try\n            {\n                File.WriteAllBytes(tmpPath, compressed);\n\n                var tmp = new FileInfo(tmpPath);\n                tmp.Attributes |= FileAttributes.ReadOnly;\n            }\n            catch (IOException)\n            {\n                File.Delete(tmpPath);\n                throw;\n            }\n\n            FileInfo o = _local.ToFile(id);\n            if (new FileInfo(tmpPath).RenameTo(o.FullName))\n                return;\n\n            // Maybe the directory doesn't exist yet as the object\n            // directories are always lazily created. Note that we\n            // try the rename first as the directory likely does exist.\n            //\n            o.Directory.Mkdirs();\n            if (new FileInfo(tmpPath).RenameTo(o.FullName))\n                return;\n\n            new FileInfo(tmpPath).DeleteFile();\n            if (_local.HasObject(id))\n                return;\n\n            throw new ObjectWritingException(\"Unable to store \" + id.Name + \".\");\n        }\n\n        private ICollection<WalkRemoteObjectDatabase> ExpandOneAlternate(AnyObjectId id, ProgressMonitor pm)\n        {\n            while (_noAlternatesYet.Count > 0)\n            {\n                WalkRemoteObjectDatabase wrr = _noAlternatesYet.First.Value;\n                _noAlternatesYet.RemoveFirst();\n                try\n                {\n                    pm.BeginTask(\"Listing alternates\", ProgressMonitor.UNKNOWN);\n                    ICollection<WalkRemoteObjectDatabase> altList = wrr.getAlternates();\n                    if (altList != null && altList.Count > 0)\n                        return altList;\n                }\n                catch (IOException e)\n                {\n                    // Try another repository.\n                    //\n                    RecordError(id, e);\n                }\n                finally\n                {\n                    pm.EndTask();\n                }\n            }\n            return null;\n        }\n\n        private void MarkLocalRefsComplete(IEnumerable<ObjectId> have)\n        {\n            foreach (Ref r in _local.getAllRefs().Values)\n            {\n                try\n                {\n                    MarkLocalObjComplete(_revWalk.parseAny(r.ObjectId));\n                }\n                catch (IOException readError)\n                {\n                    throw new TransportException(\"Local ref \" + r.Name + \" is missing object(s).\", readError);\n                }\n            }\n\n            foreach (ObjectId id in have)\n            {\n                try\n                {\n                    MarkLocalObjComplete(_revWalk.parseAny(id));\n                }\n                catch (IOException readError)\n                {\n                    throw new TransportException(\"Missing assumed \" + id.Name, readError);\n                }\n            }\n        }\n\n        private void MarkLocalObjComplete(RevObject obj)\n        {\n            while (obj.Type == Constants.OBJ_TAG)\n            {\n                obj.add(COMPLETE);\n                obj = ((RevTag)obj).getObject();\n                _revWalk.parseHeaders(obj);\n            }\n\n            switch (obj.Type)\n            {\n                case Constants.OBJ_BLOB:\n                    obj.add(COMPLETE);\n                    break;\n\n                case Constants.OBJ_COMMIT:\n                    PushLocalCommit((RevCommit)obj);\n                    break;\n\n                case Constants.OBJ_TREE:\n                    MarkTreeComplete((RevTree)obj);\n                    break;\n            }\n        }\n\n        private void MarkLocalCommitsComplete(int until)\n        {\n            try\n            {\n                while (true)\n                {\n                    RevCommit c = _localCommitQueue.peek();\n                    if (c == null || c.CommitTime < until) return;\n                    _localCommitQueue.next();\n\n                    MarkTreeComplete(c.Tree);\n                    foreach (RevCommit p in c.Parents)\n                    {\n                        PushLocalCommit(p);\n                    }\n                }\n            }\n            catch (IOException err)\n            {\n                throw new TransportException(\"Local objects incomplete.\", err);\n            }\n        }\n\n        private void PushLocalCommit(RevCommit p)\n        {\n            if (p.has(LOCALLY_SEEN)) return;\n            _revWalk.parseHeaders(p);\n            p.add(LOCALLY_SEEN);\n            p.add(COMPLETE);\n            p.carry(COMPLETE);\n            _localCommitQueue.add(p);\n        }\n\n        private void MarkTreeComplete(RevTree tree)\n        {\n            if (tree.has(COMPLETE)) return;\n\n            tree.add(COMPLETE);\n            _treeWalk.reset(tree);\n            while (_treeWalk.next())\n            {\n                FileMode mode = _treeWalk.getFileMode(0);\n                int sType = (int)mode.ObjectType;\n\n                switch (sType)\n                {\n                    case Constants.OBJ_BLOB:\n                        _treeWalk.getObjectId(_idBuffer, 0);\n                        _revWalk.lookupAny(_idBuffer, sType).add(COMPLETE);\n                        continue;\n\n                    case Constants.OBJ_TREE:\n                        {\n                            _treeWalk.getObjectId(_idBuffer, 0);\n                            RevObject o = _revWalk.lookupAny(_idBuffer, sType);\n                            if (!o.has(COMPLETE))\n                            {\n                                o.add(COMPLETE);\n                                _treeWalk.enterSubtree();\n                            }\n                            continue;\n                        }\n\n                    default:\n                        if (FileMode.GitLink.Equals(sType))\n                            continue;\n                        _treeWalk.getObjectId(_idBuffer, 0);\n                        throw new CorruptObjectException(\"Invalid mode \" + mode.ObjectType + \" for \" + _idBuffer.Name + \" \" +\n                                                         _treeWalk.getPathString() + \" in \" + tree.Name);\n                }\n            }\n        }\n\n        private void RecordError(AnyObjectId id, Exception what)\n        {\n            ObjectId objId = id.Copy();\n            List<Exception> errors = _fetchErrors.get(objId);\n            if (errors == null)\n            {\n                errors = new List<Exception>(2);\n                _fetchErrors.put(objId, errors);\n            }\n            errors.Add(what);\n        }\n\n        #region Nested Types\n\n        private class RemotePack\n        {\n            private readonly WalkRemoteObjectDatabase _connection;\n            private readonly string _idxName;\n            private readonly Repository _local;\n            private readonly ObjectChecker _objCheck;\n            private readonly string _lockMessage;\n            private readonly List<PackLock> _packLocks;\n\n            public string PackName { get; private set; }\n            public FileInfo TmpIdx { get; private set; }\n            public PackIndex Index { get; private set; }\n\n            public RemotePack(string lockMessage, List<PackLock> packLocks, ObjectChecker oC, Repository r, WalkRemoteObjectDatabase c, string pn)\n            {\n                _lockMessage = lockMessage;\n                _packLocks = packLocks;\n                _objCheck = oC;\n                _local = r;\n                DirectoryInfo objdir = _local.ObjectsDirectory;\n                _connection = c;\n                PackName = pn;\n                _idxName = IndexPack.GetIndexFileName(PackName.Slice(0, PackName.Length - 5));\n\n                string tn = _idxName;\n                if (tn.StartsWith(\"pack-\"))\n                {\n                    tn = tn.Substring(5);\n                }\n\n                if (tn.EndsWith(IndexPack.IndexSuffix))\n                {\n                    tn = tn.Slice(0, tn.Length - 4);\n                }\n\n                TmpIdx = new FileInfo(Path.Combine(objdir.ToString(), \"walk-\" + tn + \".walkidx\"));\n            }\n\n            public void OpenIndex(ProgressMonitor pm)\n            {\n                if (Index != null) return;\n\n                if (TmpIdx.IsFile())\n                {\n                    try\n                    {\n                        Index = PackIndex.Open(TmpIdx);\n                        return;\n                    }\n                    catch (FileNotFoundException)\n                    {\n                        // Fall through and get the file.\n                    }\n                }\n\n                using (Stream s = _connection.open(\"pack/\" + _idxName))\n                {\n                    pm.BeginTask(\"Get \" + _idxName.Slice(0, 12) + \"..idx\", !s.CanSeek ? ProgressMonitor.UNKNOWN : (int)(s.Length / 1024));\n\n                    try\n                    {\n                        using (var fos = new FileStream(TmpIdx.FullName, System.IO.FileMode.CreateNew, FileAccess.Write))\n                        {\n                            var buf = new byte[2048];\n                            int cnt;\n                            while (!pm.IsCancelled && (cnt = s.Read(buf, 0, buf.Length)) > 0)\n                            {\n                                fos.Write(buf, 0, cnt);\n                                pm.Update(cnt / 1024);\n                            }\n                        }\n                    }\n                    catch (IOException)\n                    {\n                        TmpIdx.DeleteFile();\n                        throw;\n                    }\n                }\n\n                pm.EndTask();\n\n                if (pm.IsCancelled)\n                {\n                    TmpIdx.DeleteFile();\n                    return;\n                }\n\n                try\n                {\n                    Index = PackIndex.Open(TmpIdx);\n                }\n                catch (IOException)\n                {\n                    TmpIdx.DeleteFile();\n                    throw;\n                }\n            }\n\n            public void DownloadPack(ProgressMonitor monitor)\n            {\n                Stream s = _connection.open(\"pack/\" + PackName);\n                IndexPack ip = IndexPack.Create(_local, s);\n                ip.setFixThin(false);\n                ip.setObjectChecker(_objCheck);\n                ip.index(monitor);\n                PackLock keep = ip.renameAndOpenPack(_lockMessage);\n                if (keep != null)\n                {\n                    _packLocks.Add(keep);\n                }\n            }\n        }\n\n        #endregion\n\n        public override void Dispose()\n        {\n            _revWalk.Dispose();\n            COMPLETE.Dispose();\n            IN_WORK_QUEUE.Dispose();\n            LOCALLY_SEEN.Dispose();\n            _objectDigest.Dispose();\n\n            base.Dispose();\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/WalkPushConnection.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Generic push support for dumb transport protocols.\n    /// <para/>\n    /// Since there are no Git-specific smarts on the remote side of the connection\n    /// the client side must handle everything on its own. The generic push support\n    /// requires being able to delete, create and overwrite files on the remote side,\n    /// as well as create any missing directories (if necessary). Typically this can\n    /// be handled through an FTP style protocol.\n    /// <para/>\n    /// Objects not on the remote side are uploaded as pack files, using one pack\n    /// file per invocation. This simplifies the implementation as only two data\n    /// files need to be written to the remote repository.\n    /// <para/>\n    /// Push support supplied by this class is not multiuser safe. Concurrent pushes\n    /// to the same repository may yield an inconsistent reference database which may\n    /// confuse fetch clients.\n    /// <para/>\n    /// A single push is concurrently safe with multiple fetch requests, due to the\n    /// careful order of operations used to update the repository. Clients fetching\n    /// may receive transient failures due to short reads on certain files if the\n    /// protocol does not support atomic file replacement.\n    /// \n    /// see <see cref=\"WalkRemoteObjectDatabase\"/>.\n    /// </summary>\n    public class WalkPushConnection : BaseConnection, IPushConnection\n    {\n        /// <summary>\n        /// The repository this transport pushes out of.\n        /// </summary>\n        private readonly Repository _local;\n\n        /// <summary>\n        /// Location of the remote repository we are writing to.\n        /// </summary>\n        private readonly URIish _uri;\n\n        /// <summary>\n        /// Database connection to the remote repository.\n        /// </summary>\n        private readonly WalkRemoteObjectDatabase _dest;\n\n        /// <summary>\n        /// Packs already known to reside in the remote repository.\n        /// </summary>\n        private IDictionary<string, string> _packNames;\n\n        /// <summary>\n        /// Complete listing of refs the remote will have after our push.\n        /// </summary>\n        private IDictionary<string, Ref> _newRefs;\n\n        /// <summary>\n        /// Updates which require altering the packed-refs file to complete.\n        /// <para/>\n        /// If this collection is non-empty then any refs listed in <see cref=\"_newRefs\"/>\n        /// with a storage class of <see cref=\"Storage.Packed\"/> will be written.\n        /// </summary>\n        private ICollection<RemoteRefUpdate> _packedRefUpdates;\n\n        public WalkPushConnection(IWalkTransport walkTransport, WalkRemoteObjectDatabase w)\n        {\n            var t = (Transport)walkTransport;\n            _local = t.Local;\n            _uri = t.Uri;\n            _dest = w;\n        }\n\n        public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)\n        {\n            if (refUpdates == null)\n                throw new ArgumentNullException(\"refUpdates\");\n\n            markStartedOperation();\n            _packNames = null;\n            _newRefs = new Dictionary<string, Ref>(RefsMap);\n            _packedRefUpdates = new List<RemoteRefUpdate>(refUpdates.Count);\n\n            // Filter the commands and issue all deletes first. This way we\n            // can correctly handle a directory being cleared out and a new\n            // ref using the directory name being created.\n            //\n            var updates = new List<RemoteRefUpdate>();\n            foreach (RemoteRefUpdate u in refUpdates.Values)\n            {\n                string n = u.RemoteName;\n                if (!n.StartsWith(\"refs/\") || !Repository.IsValidRefName(n))\n                {\n                    u.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                    u.Message = \"funny refname\";\n                    continue;\n                }\n\n                if (AnyObjectId.equals(ObjectId.ZeroId, u.NewObjectId))\n                {\n                    DeleteCommand(u);\n                }\n                else\n                {\n                    updates.Add(u);\n                }\n            }\n\n            // If we have any updates we need to upload the objects first, to\n            // prevent creating refs pointing at non-existent data. Then we\n            // can update the refs, and the info-refs file for dumb transports.\n            //\n            if (!updates.isEmpty())\n            {\n                Sendpack(updates, monitor);\n            }\n            foreach (RemoteRefUpdate u in updates)\n            {\n                UpdateCommand(u);\n            }\n\n            // Is this a new repository? If so we should create additional\n            // metadata files so it is properly initialized during the push.\n            //\n            if (!updates.isEmpty() && IsNewRepository)\n            {\n                CreateNewRepository(updates);\n            }\n\n            RefWriter refWriter = new PushRefWriter(_newRefs.Values, _dest);\n            if (_packedRefUpdates.Count > 0)\n            {\n                try\n                {\n                    refWriter.writePackedRefs();\n                    foreach (RemoteRefUpdate u in _packedRefUpdates)\n                    {\n                        u.Status = RemoteRefUpdate.UpdateStatus.OK;\n                    }\n                }\n                catch (IOException e)\n                {\n                    foreach (RemoteRefUpdate u in _packedRefUpdates)\n                    {\n                        u.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                        u.Message = e.Message;\n                    }\n                    throw new TransportException(_uri, \"failed updating refs\", e);\n                }\n            }\n\n            try\n            {\n                refWriter.writeInfoRefs();\n            }\n            catch (IOException err)\n            {\n                throw new TransportException(_uri, \"failed updating refs\", err);\n            }\n        }\n\n        public override void Close()\n        {\n            _dest.Dispose();\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~WalkPushConnection()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed: \" + this._uri);\n        }\n#endif\n\n\n        private void Sendpack(IEnumerable<RemoteRefUpdate> updates, ProgressMonitor monitor)\n        {\n            string pathPack = null;\n            string pathIdx = null;\n\n            try\n            {\n                var pw = new PackWriter(_local, monitor);\n                var need = new List<ObjectId>();\n                var have = new List<ObjectId>();\n\n                foreach (RemoteRefUpdate r in updates)\n                {\n                    need.Add(r.NewObjectId);\n                }\n\n                foreach (Ref r in Refs)\n                {\n                    have.Add(r.ObjectId);\n                    if (r.PeeledObjectId != null)\n                    {\n                        have.Add(r.PeeledObjectId);\n                    }\n                }\n                pw.preparePack(need, have);\n\n                // We don't have to continue further if the pack will\n                // be an empty pack, as the remote has all objects it\n                // needs to complete this change.\n                //\n                if (pw.getObjectsNumber() == 0) return;\n\n                _packNames = new Dictionary<string, string>();\n                foreach (string n in _dest.getPackNames())\n                {\n                    _packNames.put(n, n);\n                }\n\n                string b = \"pack-\" + pw.computeName().Name;\n                string packName = b + IndexPack.PackSuffix;\n                pathPack = \"pack/\" + packName;\n                pathIdx = \"pack/\" + b + IndexPack.IndexSuffix;\n\n                if (_packNames.remove(packName) != null)\n                {\n                    // The remote already contains this pack. We should\n                    // remove the index before overwriting to prevent bad\n                    // offsets from appearing to clients.\n                    //\n                    _dest.writeInfoPacks(_packNames.Keys);\n                    _dest.deleteFile(pathIdx);\n                }\n\n                // Write the pack file, then the index, as readers look the\n                // other direction (index, then pack file).\n                //\n                string wt = \"Put \" + b.Slice(0, 12);\n                using (Stream os = _dest.writeFile(pathPack, monitor, wt + \".\" + IndexPack.PackSuffix))\n                {\n                    pw.writePack(os);\n                }\n\n                using (Stream os = _dest.writeFile(pathIdx, monitor, wt + \".\" + IndexPack.IndexSuffix))\n                {\n                    pw.writeIndex(os);\n                }\n\n                // Record the pack at the start of the pack info list. This\n                // way clients are likely to consult the newest pack first,\n                // and discover the most recent objects there.\n                //\n                var infoPacks = new List<string> { packName };\n                infoPacks.AddRange(_packNames.Keys);\n                _dest.writeInfoPacks(infoPacks);\n            }\n            catch (IOException err)\n            {\n                SafeDelete(pathIdx);\n                SafeDelete(pathPack);\n\n                throw new TransportException(_uri, \"cannot store objects\", err);\n            }\n        }\n\n        private void SafeDelete(string path)\n        {\n            if (path != null)\n            {\n                try\n                {\n                    _dest.deleteFile(path);\n                }\n                catch (IOException)\n                {\n                    // Ignore the deletion failure. We probably are\n                    // already failing and were just trying to pick\n                    // up after ourselves.\n                }\n            }\n        }\n\n        private void DeleteCommand(RemoteRefUpdate u)\n        {\n            Ref r = _newRefs.remove(u.RemoteName);\n\n            if (r == null)\n            {\n                // Already gone.\n                //\n                u.Status = RemoteRefUpdate.UpdateStatus.OK;\n                return;\n            }\n\n            if (r.StorageFormat.IsPacked)\n            {\n                _packedRefUpdates.Add(u);\n            }\n\n            if (r.StorageFormat.IsLoose)\n            {\n                try\n                {\n                    _dest.deleteRef(u.RemoteName);\n                    u.Status = RemoteRefUpdate.UpdateStatus.OK;\n                }\n                catch (IOException e)\n                {\n                    u.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                    u.Message = e.Message;\n                }\n            }\n\n            try\n            {\n                _dest.deleteRefLog(u.RemoteName);\n            }\n            catch (IOException e)\n            {\n                u.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                u.Message = e.Message;\n            }\n        }\n\n        private void UpdateCommand(RemoteRefUpdate u)\n        {\n            try\n            {\n                _dest.writeRef(u.RemoteName, u.NewObjectId);\n                _newRefs.put(u.RemoteName, new Unpeeled(Storage.Loose, u.RemoteName, u.NewObjectId));\n                u.Status = RemoteRefUpdate.UpdateStatus.OK;\n            }\n            catch (IOException e)\n            {\n                u.Status = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n                u.Message = e.Message;\n            }\n        }\n\n        private bool IsNewRepository\n        {\n            get { return RefsMap.Count == 0 && _packNames != null && _packNames.Count == 0; }\n        }\n\n        private void CreateNewRepository(IList<RemoteRefUpdate> updates)\n        {\n            try\n            {\n                string @ref = \"ref: \" + PickHead(updates) + \"\\n\";\n                byte[] bytes = Constants.encode(@ref);\n                _dest.writeFile(WalkRemoteObjectDatabase.ROOT_DIR + Constants.HEAD, bytes);\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(_uri, \"Cannot Create HEAD\", e);\n            }\n\n            try\n            {\n                const string config = \"[core]\\n\\trepositoryformatversion = 0\\n\";\n                byte[] bytes = Constants.encode(config);\n                _dest.writeFile(WalkRemoteObjectDatabase.ROOT_DIR + \"config\", bytes);\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(_uri, \"Cannot Create config\", e);\n            }\n        }\n\n        private static string PickHead(IList<RemoteRefUpdate> updates)\n        {\n            // Try to use master if the user is pushing that, it is the\n            // default branch and is likely what they want to remain as\n            // the default on the new remote.\n            //\n            foreach (RemoteRefUpdate u in updates)\n            {\n                string n = u.RemoteName;\n                if (n.Equals(Constants.R_HEADS + Constants.MASTER))\n                {\n                    return n;\n                }\n            }\n\n            // Pick any branch, under the assumption the user pushed only\n            // one to the remote side.\n            //\n            foreach (RemoteRefUpdate u in updates)\n            {\n                string n = u.RemoteName;\n                if (n.StartsWith(Constants.R_HEADS))\n                {\n                    return n;\n                }\n            }\n\n            return updates[0].RemoteName;\n        }\n\n        #region Nested Types\n\n        private class PushRefWriter : RefWriter\n        {\n            private readonly WalkRemoteObjectDatabase _dest;\n\n            public PushRefWriter(IEnumerable<Ref> refs, WalkRemoteObjectDatabase dest)\n                : base(refs)\n            {\n                _dest = dest;\n            }\n\n            protected override void writeFile(string file, byte[] content)\n            {\n                _dest.writeFile(WalkRemoteObjectDatabase.ROOT_DIR + file, content);\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Transport/WalkRemoteObjectDatabase.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Transport\n{\n    /// <summary>\n    /// Transfers object data through a dumb transport.\n    /// <para/>\n    /// Implementations are responsible for resolving path names relative to the\n    /// <code>objects/</code> subdirectory of a single remote Git repository or\n    /// naked object database and make the content available as a Java input stream\n    /// for reading during fetch. The actual object traversal logic to determine the\n    /// names of files to retrieve is handled through the generic, protocol\n    /// independent <see cref=\"WalkFetchConnection\"/>.\n    /// </summary>\n    public abstract class WalkRemoteObjectDatabase : IDisposable\n    {\n        public const string ROOT_DIR = \"../\";\n        public const string INFO_PACKS = \"info/packs\";\n        public const string INFO_ALTERNATES = \"info/alternates\";\n        public const string INFO_HTTP_ALTERNATES = \"info/http-alternates\";\n        public static string INFO_REFS = ROOT_DIR + Constants.INFO_REFS;\n\n        public abstract URIish getURI();\n\n        /// <summary>\n        /// Obtain the list of available packs (if any).\n        /// <para/>\n        /// Pack names should be the file name in the packs directory, that is\n        /// <code>pack-035760ab452d6eebd123add421f253ce7682355a.pack</code>. Index\n        /// names should not be included in the returned collection.\n        /// </summary>\n        /// <returns>list of pack names; null or empty list if none are available.</returns>\n        public abstract ICollection<string> getPackNames();\n\n        /// <summary>\n        /// Obtain alternate connections to alternate object databases (if any).\n        /// <para/>\n        /// Alternates are typically read from the file <see cref=\"INFO_ALTERNATES\"/> or\n        /// <see cref=\"INFO_HTTP_ALTERNATES\"/>. The content of each line must be resolved\n        /// by the implementation and a new database reference should be returned to\n        /// represent the additional location.\n        /// <para/>\n        /// Alternates may reuse the same network connection handle, however the\n        /// fetch connection will <see cref=\"close\"/> each created alternate.\n        /// </summary>\n        /// <returns>\n        /// list of additional object databases the caller could fetch from;\n        /// null or empty list if none are configured.\n        /// </returns>\n        public abstract ICollection<WalkRemoteObjectDatabase> getAlternates();\n\n        /// <summary>\n        /// Open a single file for reading.\n        /// <para/>\n        /// Implementors should make every attempt possible to ensure\n        /// {@link FileNotFoundException} is used when the remote object does not\n        /// exist. However when fetching over HTTP some misconfigured servers may\n        /// generate a 200 OK status message (rather than a 404 Not Found) with an\n        /// HTML formatted message explaining the requested resource does not exist.\n        /// Callers such as <see cref=\"WalkFetchConnection\"/> are prepared to handle this\n        /// by validating the content received, and assuming content that fails to\n        /// match its hash is an incorrectly phrased FileNotFoundException.\n        /// </summary>\n        /// <param name=\"path\">\n        /// location of the file to read, relative to this objects\n        /// directory (e.g.\n        /// <code>cb/95df6ab7ae9e57571511ef451cf33767c26dd2</code> or\n        /// <code>pack/pack-035760ab452d6eebd123add421f253ce7682355a.pack</code>).\n        /// </param>\n        /// <returns>a stream to read from the file. Never null.</returns>\n        public abstract Stream open(string path);\n\n        /// <summary>\n        /// Create a new connection for a discovered alternate object database\n        /// <para/>\n        /// This method is typically called by <see cref=\"readAlternates\"/> when\n        /// subclasses us the generic alternate parsing logic for their\n        /// implementation of <see cref=\"getAlternates\"/>.\n        /// </summary>\n        /// <param name=\"location\">\n        /// the location of the new alternate, relative to the current\n        /// object database.\n        /// </param>\n        /// <returns>\n        /// a new database connection that can read from the specified\n        /// alternate.\n        /// </returns>\n        public abstract WalkRemoteObjectDatabase openAlternate(string location);\n\n        /// <summary>\n        /// Close any resources used by this connection.\n        /// <para/>\n        /// If the remote repository is contacted by a network socket this method\n        /// must close that network socket, disconnecting the two peers. If the\n        /// remote repository is actually local (same system) this method must close\n        /// any open file handles used to read the \"remote\" repository.\n        /// </summary>\n        public abstract void close();\n\n        public virtual void Dispose()\n        {\n            close();\n        }\n\n        /// <summary>\n        /// Delete a file from the object database.\n        /// <para/>\n        /// Path may start with <code>../</code> to request deletion of a file that\n        /// resides in the repository itself.\n        /// <para/>\n        /// When possible empty directories must be removed, up to but not includin\n        /// the current object database directory itself.\n        /// <para/>\n        /// This method does not support deletion of directories.\n        /// </summary>\n        /// <param name=\"path\">\n        /// name of the item to be removed, relative to the current object\n        /// database.\n        /// </param>\n        public virtual void deleteFile(string path)\n        {\n            throw new IOException(\"Deleting '\" + path + \"' not supported\");\n        }\n\n        /// <summary>\n        /// Open a remote file for writing.\n        /// <para/>\n        /// Path may start with <code>../</code> to request writing of a file that\n        /// resides in the repository itself.\n        /// <para/>\n        /// The requested path may or may not exist. If the path already exists as a\n        /// file the file should be truncated and completely replaced.\n        /// <para/>\n        /// This method creates any missing parent directories, if necessary.\n        /// </summary>\n        /// <param name=\"path\">\n        /// name of the file to write, relative to the current object\n        /// database.\n        /// </param>\n        /// <param name=\"monitor\">\n        /// (optional) progress monitor to post write completion to during\n        /// the stream's close method.\n        /// </param>\n        /// <param name=\"monitorTask\">\n        /// (optional) task name to display during the close method.\n        /// </param>\n        /// <returns>\n        /// stream to write into this file. Caller must close the stream to\n        /// complete the write request. The stream is not buffered and each\n        /// write may cause a network request/response so callers should\n        /// buffer to smooth out small writes.\n        /// </returns>\n        public virtual Stream writeFile(string path, ProgressMonitor monitor, string monitorTask)\n        {\n            throw new IOException(\"Writing of '\" + path + \"' not supported.\");\n        }\n\n        /// <summary>\n        /// Atomically write a remote file.\n        /// <para/>\n        /// This method attempts to perform as atomic of an update as it can,\n        /// reducing (or eliminating) the time that clients might be able to see\n        /// partial file content. This method is not suitable for very large\n        /// transfers as the complete content must be passed as an argument.\n        /// <para/>\n        /// Path may start with <code>../</code> to request writing of a file that\n        /// resides in the repository itself.\n        /// <para/>\n        /// The requested path may or may not exist. If the path already exists as a\n        /// file the file should be truncated and completely replaced.\n        /// <para/>\n        /// This method creates any missing parent directories, if necessary.\n        /// </summary>\n        /// <param name=\"path\">\n        /// name of the file to write, relative to the current object\n        /// database.\n        /// </param>\n        /// <param name=\"data\">complete new content of the file.</param>\n        public virtual void writeFile(string path, byte[] data)\n        {\n            if (data == null)\n                throw new ArgumentNullException(\"data\");\n\n            using (Stream fs = writeFile(path, null, null))\n            {\n                fs.Write(data, 0, data.Length);\n            }\n        }\n\n        /// <summary>\n        /// Delete a loose ref from the remote repository.\n        /// </summary>\n        /// <param name=\"name\">\n        /// name of the ref within the ref space, for example\n        /// <code>refs/heads/pu</code>.\n        /// </param>\n        public void deleteRef(string name)\n        {\n            deleteFile(ROOT_DIR + name);\n        }\n\n        /// <summary>\n        /// Delete a reflog from the remote repository.\n        /// </summary>\n        /// <param name=\"name\">\n        /// name of the ref within the ref space, for example\n        /// <code>refs/heads/pu</code>.\n        /// </param>\n        public void deleteRefLog(string name)\n        {\n            deleteFile(ROOT_DIR + Constants.LOGS + \"/\" + name);\n        }\n\n        /// <summary>\n        /// Overwrite (or create) a loose ref in the remote repository.\n        /// <para/>\n        /// This method creates any missing parent directories, if necessary. \n        /// </summary>\n        /// <param name=\"name\">\n        /// name of the ref within the ref space, for example\n        /// <code>refs/heads/pu</code>.\n        /// </param>\n        /// <param name=\"value\">new value to store in this ref. Must not be null.</param>\n        public void writeRef(string name, ObjectId value)\n        {\n            if (value == null)\n                throw new ArgumentNullException(\"value\");\n\n            using (var m = new MemoryStream(Constants.OBJECT_ID_STRING_LENGTH + 1))\n            using (var b = new BinaryWriter(m))\n            {\n                value.CopyTo(b);\n                b.Write('\\n');\n                b.Flush();\n\n                writeFile(ROOT_DIR + name, m.ToArray());\n            }\n        }\n\n        /// <summary>\n        /// Rebuild the <see cref=\"INFO_PACKS\"/> for dumb transport clients.\n        /// <para/>\n        /// This method rebuilds the contents of the <see cref=\"INFO_PACKS\"/> file to\n        /// match the passed list of pack names.\n        /// </summary>\n        /// <param name=\"packNames\">\n        /// names of available pack files, in the order they should appear\n        /// in the file. Valid pack name strings are of the form\n        /// <code>pack-035760ab452d6eebd123add421f253ce7682355a.pack</code>.\n        /// </param>\n        public void writeInfoPacks(ICollection<string> packNames)\n        {\n            if (packNames == null)\n                throw new ArgumentNullException(\"packNames\");\n\n            var w = new StringBuilder();\n            foreach (string n in packNames)\n            {\n                w.Append(\"P \");\n                w.Append(n);\n                w.Append('\\n');\n            }\n\n            writeFile(INFO_PACKS, Constants.encodeASCII(w.ToString()));\n        }\n\n        /// <summary>\n        /// Open a buffered reader around a file.\n        /// <para/>\n        /// This is shorthand for calling <see cref=\"open\"/> and then wrapping it\n        /// in a reader suitable for line oriented files like the alternates list.\n        /// </summary>\n        /// <param name=\"path\">\n        /// location of the file to read, relative to this objects\n        /// directory (e.g. <code>info/packs</code>).\n        /// </param>\n        /// <returns>a stream to read from the file. Never null.</returns>\n        public StreamReader openReader(string path)\n        {\n            Stream s = open(path);\n            // StreamReader buffers itself\n            return new StreamReader(s, Constants.CHARSET);\n        }\n\n        /// <summary>\n        /// Read a standard Git alternates file to discover other object databases.\n        /// <para/>\n        /// This method is suitable for reading the standard formats of the\n        /// alternates file, such as found in <code>objects/info/alternates</code>\n        /// or <code>objects/info/http-alternates</code> within a Git repository.\n        /// <para/>\n        /// Alternates appear one per line, with paths expressed relative to this\n        /// object database.\n        /// </summary>\n        /// <param name=\"listPath\">\n        /// location of the alternate file to read, relative to this\n        /// object database (e.g. <code>info/alternates</code>).\n        /// </param>\n        /// <returns>\n        /// the list of discovered alternates. Empty list if the file exists,\n        /// but no entries were discovered.\n        /// </returns>\n        public ICollection<WalkRemoteObjectDatabase> readAlternates(string listPath)\n        {\n            using (StreamReader sr = openReader(listPath))\n            {\n                var alts = new List<WalkRemoteObjectDatabase>();\n                for (; ; )\n                {\n                    string line = sr.ReadLine();\n                    if (line == null) break;\n                    if (!line.EndsWith(\"/\"))\n                        line += \"/\";\n                    alts.Add(openAlternate(line));\n                }\n                return alts;\n            }\n        }\n\n        /// <summary>\n        /// Read a standard Git packed-refs file to discover known references.\n        /// </summary>\n        /// <param name=\"avail\">\n        /// return collection of references. Any existing entries will be\n        /// replaced if they are found in the packed-refs file.\n        /// </param>\n        public void readPackedRefs(Dictionary<string, Ref> avail)\n        {\n            try\n            {\n                using (StreamReader sr = openReader(ROOT_DIR + Constants.PACKED_REFS))\n                {\n                    readPackedRefsImpl(avail, sr);\n                }\n            }\n            catch (FileNotFoundException)\n            {\n                // Perhaps it wasn't worthwhile, or is just an older repository.\n            }\n            catch (IOException e)\n            {\n                throw new TransportException(getURI(), \"error in packed-refs\", e);\n            }\n        }\n\n        private static void readPackedRefsImpl(Dictionary<string, Ref> avail, StreamReader sr)\n        {\n            Ref last = null;\n            bool peeled = false;\n            for (; ; )\n            {\n                string line = sr.ReadLine();\n\n                if (line == null)\n                    break;\n                if (line[0] == '#')\n                {\n                    if (line.StartsWith(RefDirectory.PACKED_REFS_HEADER))\n                    {\n                        line = line.Substring(RefDirectory.PACKED_REFS_HEADER.Length);\n                        peeled = line.Contains(RefDirectory.PACKED_REFS_PEELED);\n                    }\n                    continue;\n                }\n\n                if (line[0] == '^')\n                {\n                    if (last == null)\n                        throw new TransportException(\"Peeled line before ref\");\n                    ObjectId pid = ObjectId.FromString(line.Substring(1));\n                    last = new PeeledTag(Storage.Packed, last.Name, last.ObjectId, pid);\n                    avail.put(last.Name, last);\n                    continue;\n                }\n\n                int sp = line.IndexOf(' ');\n                if (sp < 0)\n                    throw new TransportException(\"Unrecognized ref: \" + line);\n                ObjectId id = ObjectId.FromString(line.Slice(0, sp));\n                string name = line.Substring(sp + 1);\n                if (peeled)\n                    last = new PeeledNonTag(Storage.Packed, name, id);\n                else\n                    last = new Unpeeled(Storage.Packed, name, id);\n\n                avail.put(last.Name, last);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Tree.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <me@lathund.dewire.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A representation of a Git tree entry. A Tree is a directory in Git.\n\t/// </summary>\n\tpublic class Tree : TreeEntry, Treeish\n\t{\n\t\tprivate static readonly TreeEntry[] EmptyTree = new TreeEntry[0];\n\n\t\tprivate readonly Repository _db;\n\t\tprivate TreeEntry[] _contents;\n\n\t\t///\t<summary>\n\t\t/// Compare two names represented as bytes. Since git treats names of trees and\n\t\t///\tblobs differently we have one parameter that represents a '/' for trees. For\n\t\t///\tother objects the value should be NUL. The names are compare by their positive\n\t\t///\tbyte value (0..255).\n\t\t/// <para />\n\t\t/// A blob and a tree with the same name will not compare equal.\n\t\t/// </summary>\n\t\t/// <param name=\"a\"> name </param>\n\t\t/// <param name=\"b\"> name </param>\n\t\t/// <param name=\"lastA\"> '/' if a is a tree, else NULL.</param>\n\t\t/// <param name=\"lastB\"> '/' if b is a tree, else NULL.</param>\n\t\t/// <returns> &lt; 0 if a is sorted before b, 0 if they are the same, else b </returns>\n\t\tpublic static int CompareNames(byte[] a, byte[] b, int lastA, int lastB)\n\t\t{\n\t\t\treturn CompareNames(a, b, 0, b.Length, lastA, lastB);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compare two names represented as bytes. Since git treats names of trees and\n\t\t/// blobs differently we have one parameter that represents a '/' for trees. For\n\t\t/// other objects the value should be NUL. The names are compare by their positive\n\t\t/// byte value (0..255).\n\t\t/// <para />\n\t\t/// A blob and a tree with the same name will not compare equal.\n\t\t/// </summary>\n\t\t/// <param name=\"a\"></param>\n\t\t/// <param name=\"nameUTF8\"></param>\n\t\t/// <param name=\"nameStart\"></param>\n\t\t/// <param name=\"nameEnd\"></param>\n\t\t/// <param name=\"lastA\"> '/' if a is a tree, else NULL.</param>\n\t\t/// <param name=\"lastB\"> '/' if b is a tree, else NULL.</param>\n\t\t/// <returns>Return &lt; 0 if a is sorted before b, 0 if they are the same, else b</returns>\n\t\tprivate static int CompareNames(byte[] a, byte[] nameUTF8, int nameStart, int nameEnd, int lastA, int lastB)\n\t\t{\n\t\t\t// There must be a .NET way of doing this! I assume there are both UTF8 names,\n\t\t\t// perhaps Constants.CHARSET.GetString on both then .Compare on the strings?\n\t\t\t// I'm pretty sure this is just doing that but the long way round, however\n\t\t\t// I could be wrong so we'll leave it at this for now. - NR\n\t\t\tint j;\n\t\t\tint k;\n\n\t\t\tfor (j = 0, k = nameStart; j < a.Length && k < nameEnd; j++, k++)\n\t\t\t{\n\t\t\t\tint aj = a[j] & 0xff;\n\t\t\t\tint bk = nameUTF8[k] & 0xff;\n\n\t\t\t\tif (aj < bk) return -1;\n\t\t\t\tif (aj > bk) return 1;\n\t\t\t}\n\n\t\t\tif (j < a.Length)\n\t\t\t{\n\t\t\t\tint aj = a[j] & 0xff;\n\n\t\t\t\tif (aj < lastB) return -1;\n\t\t\t\tif (aj > lastB) return 1;\n\t\t\t\tif (j == a.Length - 1) return 0;\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif (k < nameEnd)\n\t\t\t{\n\t\t\t\tint bk = nameUTF8[k] & 0xff;\n\n\t\t\t\tif (lastA < bk) return -1;\n\t\t\t\tif (lastA > bk) return 1;\n\t\t\t\tif (k == nameEnd - 1) return 0;\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (lastA < lastB) return -1;\n\t\t\tif (lastA > lastB) return 1;\n\n\t\t\tint nameLength = nameEnd - nameStart;\n\t\t\tif (a.Length == nameLength) return 0;\n\t\t\treturn a.Length < nameLength ? -1 : 1;\n\t\t}\n\n\t\tprivate static byte[] SubString(byte[] s, int nameStart, int nameEnd)\n\t\t{\n\t\t\tif (nameStart == 0 && nameStart == s.Length)\n\t\t\t{\n\t\t\t\treturn s;\n\t\t\t}\n\n\t\t\tvar n = new byte[nameEnd - nameStart];\n\t\t\tArray.Copy(s, nameStart, n, 0, n.Length);\n\t\t\treturn n;\n\t\t}\n\n\t\tprivate static int BinarySearch(TreeEntry[] entries, byte[] nameUTF8, int nameUTF8Last, int nameStart, int nameEnd)\n\t\t{\n\t\t\tif (entries.Length == 0) return -1;\n\n\t\t\tint high = entries.Length;\n\t\t\tint low = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t    int mid = (int) (((uint) (low + high)) >> 1);\n\t\t\t\tint cmp = CompareNames(entries[mid].NameUTF8, nameUTF8,\n\t\t\t\t\tnameStart, nameEnd, GitSharp.Core.TreeEntry.LastChar(entries[mid]), nameUTF8Last);\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t{\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\t}\n\t\t\t\telse if (cmp == 0)\n\t\t\t\t{\n\t\t\t\t\treturn mid;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\thigh = mid;\n\t\t\t\t}\n\n\t\t\t} while (low < high);\n\t\t\treturn -(low + 1);\n\t\t}\n\n\t\tpublic override Repository Repository\n\t\t{\n\t\t\tget { return _db; }\n\t\t}\n\n\t\tpublic bool IsRoot\n\t\t{\n\t\t\tget { return Parent == null; }\n\t\t}\n\n\t\tpublic override FileMode Mode\n\t\t{\n\t\t\tget { return FileMode.Tree; }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Constructor for a new Tree\n\t\t///\t</summary>\n\t\t///\t<param name=\"repo\">The repository that owns the Tree.</param>\n\t\tpublic Tree(Repository repo)\n\t\t\t: base(null, null, null)\n\t\t{\n\t\t\t_db = repo;\n\t\t\t_contents = EmptyTree;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Construct a Tree object with known content and hash value\n\t\t///\t</summary>\n\t\t///\t<param name=\"repo\"></param>\n\t\t///\t<param name=\"id\"></param>\n\t\t///\t<param name=\"raw\"></param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic Tree(Repository repo, ObjectId id, byte[] raw)\n\t\t\t: base(null, id, null)\n\t\t{\n\t\t\t_db = repo;\n\t\t\tReadTree(raw);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Construct a new Tree under another Tree\n\t\t/// </summary>\n\t\t/// <param name=\"parent\"></param>\n\t\t/// <param name=\"nameUTF8\"></param>\n\t\tpublic Tree(Tree parent, byte[] nameUTF8)\n\t\t\t: base(parent, null, nameUTF8)\n\t\t{\n\t\t\t_db = parent.Repository;\n\t\t\t_contents = EmptyTree;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Construct a Tree with a known SHA-1 under another tree. Data is not yet\n\t\t///\tspecified and will have to be loaded on demand.\n\t\t///\t</summary>\n\t\t///\t<param name=\"parent\"></param>\n\t\t///\t<param name=\"id\"></param>\n\t\t///\t<param name=\"nameUTF8\"></param>\n\t\tpublic Tree(Tree parent, ObjectId id, byte[] nameUTF8)\n\t\t\t: base(parent, id, nameUTF8)\n\t\t{\n\t\t\t_db = parent.Repository;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true of the data of this Tree is loaded.\n\t\t/// </summary>\n\t\tpublic bool IsLoaded\n\t\t{\n\t\t\tget { return _contents != null; }\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Forget the in-memory data for this tree.\n\t\t/// </summary>\n\t\tpublic void Unload()\n\t\t{\n\t\t\tif (IsModified)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Cannot unload a modified tree.\");\n\t\t\t}\n\n\t\t\t_contents = null;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Adds a new or existing file with the specified name to this tree.\n\t\t///\tTrees are added if necessary as the name may contain '/':s.\n\t\t///\t</summary>\n\t\t///\t<param name=\"name\"> Name </param>\n\t\t///\t<returns>A <seealso cref=\"FileTreeEntry\"/> for the added file.</returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\n\t\tpublic FileTreeEntry AddFile(string name)\n\t\t{\n\t\t\treturn AddFile(Repository.GitInternalSlash(Constants.encode(name)), 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds a new or existing file with the specified name to this tree.\n\t\t///\tTrees are added if necessary as the name may contain '/':s.\n\t\t///\t</summary>\n\t\t///\t<param name=\"s\"> an array containing the name </param>\n\t\t///\t<param name=\"offset\"> when the name starts in the tree.\n\t\t///\t</param>\n\t\t///\t<returns>A <seealso cref=\"FileTreeEntry\"/> for the added file.</returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic FileTreeEntry AddFile(byte[] s, int offset)\n\t\t{\n\t\t\tint slash;\n\n\t\t\tfor (slash = offset; slash < s.Length && s[slash] != '/'; slash++)\n\t\t\t{\n\t\t\t\t// search for path component terminator\n\t\t\t\t// [henon] body is empty by intention!\n\t\t\t}\n\n\t\t\tEnsureLoaded();\n            byte xlast = slash < s.Length ? (byte)'/' : (byte)0;\n\t\t\tint p = BinarySearch(_contents, s, xlast, offset, slash);\n\t\t\tif (p >= 0 && slash < s.Length && _contents[p] is Tree)\n\t\t\t{\n\t\t\t\treturn ((Tree)_contents[p]).AddFile(s, slash + 1);\n\t\t\t}\n\n\t\t\tbyte[] newName = SubString(s, offset, slash);\n\t\t\tif (p >= 0)\n\t\t\t{\n\t\t\t\tthrow new EntryExistsException(RawParseUtils.decode(newName));\n\t\t\t}\n\n\t\t\tif (slash < s.Length)\n\t\t\t{\n                Tree t = new Tree(this, newName);\n\t\t\t\tInsertEntry(p, t);\n\t\t\t\treturn t.AddFile(s, slash + 1);\n\t\t\t}\n\n            FileTreeEntry f = new FileTreeEntry(this, null, newName, false);\n\t\t\tInsertEntry(p, f);\n\t\t\treturn f;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Adds a new or existing Tree with the specified name to this tree.\n\t\t///\tTrees are added if necessary as the name may contain '/':s.\n\t\t///\t</summary>\n\t\t///\t<param name=\"name\"></param>\n\t\t///\t<returns>A <seealso cref=\"FileTreeEntry\"/> for the added tree.</returns>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\tpublic Tree AddTree(string name)\n\t\t{\n\t\t\treturn AddTree(Repository.GitInternalSlash(Constants.encode(name)), 0);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Adds a new or existing Tree with the specified name to this tree.\n\t\t///\tTrees are added if necessary as the name may contain '/':s.\n\t\t///\t</summary>\n\t\t///\t<param name=\"s\"> an array containing the name </param>\n\t\t///\t<param name=\"offset\"> when the name starts in the tree.</param>\n\t\t///\t<returns>A <seealso cref=\"FileTreeEntry\"/> for the added tree.</returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic Tree AddTree(byte[] s, int offset)\n\t\t{\n\t\t\tint slash;\n\n\t\t\tfor (slash = offset; slash < s.Length && s[slash] != '/'; slash++)\n\t\t\t{\n\t\t\t\t// search for path component terminator\n\t\t\t}\n\n\t\t\tEnsureLoaded();\n\t\t\tint p = BinarySearch(_contents, s, (byte)'/', offset, slash);\n\t\t\tif (p >= 0 && slash < s.Length && _contents[p] is Tree)\n\t\t\t{\n\t\t\t\treturn ((Tree)_contents[p]).AddTree(s, slash + 1);\n\t\t\t}\n\n\t\t\tbyte[] newName = SubString(s, offset, slash);\n\t\t\tif (p >= 0)\n\t\t\t{\n\t\t\t\tthrow new EntryExistsException(RawParseUtils.decode(newName));\n\t\t\t}\n\n            Tree t = new Tree(this, newName);\n\t\t\tInsertEntry(p, t);\n\t\t\treturn slash == s.Length ? t : t.AddTree(s, slash + 1);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Add the specified tree entry to this tree.\n\t\t///\t</summary>\n\t\t///\t<param name=\"e\"> </param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic void AddEntry(TreeEntry e)\n\t\t{\n\t\t\tEnsureLoaded();\n\t\t\tint p = BinarySearch(_contents, e.NameUTF8, GitSharp.Core.TreeEntry.LastChar(e), 0, e.NameUTF8.Length);\n\t\t\tif (p < 0)\n\t\t\t{\n\t\t\t\te.AttachParent(this);\n\t\t\t\tInsertEntry(p, e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new EntryExistsException(e.Name);\n\t\t\t}\n\t\t}\n\n\t\tprivate void InsertEntry(int p, TreeEntry e)\n\t\t{\n\t\t\tTreeEntry[] c = _contents;\n\t\t\tvar n = new TreeEntry[c.Length + 1];\n\n\t\t\tp = -(p + 1);\n\t\t\tfor (int k = c.Length - 1; k >= p; k--)\n\t\t\t{\n\t\t\t\tn[k + 1] = c[k];\n\t\t\t}\n\n\t\t\tn[p] = e;\n\t\t\tfor (int k = p - 1; k >= 0; k--)\n\t\t\t{\n\t\t\t\tn[k] = c[k];\n\t\t\t}\n\n\t\t\t_contents = n;\n\n\t\t\tSetModified();\n\t\t}\n\n\t\tinternal void RemoveEntry(TreeEntry e)\n\t\t{\n\t\t\tTreeEntry[] c = _contents;\n\t\t\tint p = BinarySearch(c, e.NameUTF8, GitSharp.Core.TreeEntry.LastChar(e), 0, e.NameUTF8.Length);\n\t\t\tif (p >= 0)\n\t\t\t{\n\t\t\t\tvar n = new TreeEntry[c.Length - 1];\n\t\t\t\tfor (int k = c.Length - 1; k > p; k--)\n\t\t\t\t{\n\t\t\t\t\tn[k - 1] = c[k];\n\t\t\t\t}\n\n\t\t\t\tfor (int k = p - 1; k >= 0; k--)\n\t\t\t\t{\n\t\t\t\t\tn[k] = c[k];\n\t\t\t\t}\n\n\t\t\t\t_contents = n;\n\t\t\t\tSetModified();\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Gets the number of members in this tree.\n\t\t/// </summary>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic virtual  int MemberCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tEnsureLoaded();\n\t\t\t\treturn _contents.Length;\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Return all members of the tree sorted in Git order.\n\t\t///\t<para />\n\t\t///\tEntries are sorted by the numerical unsigned byte\n\t\t///\tvalues with (sub)trees having an implicit '/'. An\n\t\t///\texample of a tree with three entries. a:b is an\n\t\t///\tactual file name here.\n\t\t///\t<para />\n\t\t///\t100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a.b\n\t\t///\t040000 tree 4277b6e69d25e5efa77c455340557b384a4c018a    a\n\t\t///\t100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a:b\n\t\t///\t</summary>\n\t\t///\t<returns>All entries in this Tree, sorted.</returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic virtual TreeEntry[] Members\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tEnsureLoaded();\n\t\t\t\tTreeEntry[] c = _contents;\n\t\t\t\tif (c.Length != 0)\n\t\t\t\t{\n\t\t\t\t\tvar r = new TreeEntry[c.Length];\n\t\t\t\t\tfor (int k = c.Length - 1; k >= 0; k--)\n\t\t\t\t\t{\n\t\t\t\t\t\tr[k] = c[k];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn r;\n\t\t\t\t}\n\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool Exists(string s, byte slast)\n\t\t{\n\t\t\treturn FindMember(s, slast) != null;\n\t\t}\n\n\t\t///\t<param name=\"path\">Path to the tree.</param>\n\t\t///\t<returns>\n\t\t///\tTrue if a tree with the specified path can be found under this\n\t\t///\ttree. </returns>\n\t\t///\t<exception cref=\"IOException\"></exception>\n\t\tpublic bool ExistsTree(string path)\n\t\t{\n\t\t\treturn Exists(path, (byte)'/');\n\t\t}\n\n\t\t/// <param name=\"path\"></param>\n\t\t/// <returns>\n\t\t/// True if a blob or symlink with the specified name can be found\n\t\t/// under this tree.\n\t\t/// </returns>\n\t\tpublic bool ExistsBlob(string path)\n\t\t{\n\t\t\treturn Exists(path, 0);\n\t\t}\n\n\t\tprivate TreeEntry FindMember(string s, byte slast)\n\t\t{\n\t\t\treturn FindMember(Repository.GitInternalSlash(Constants.encode(s)), slast, 0);\n\t\t}\n\n\t\tprivate TreeEntry FindMember(byte[] s, byte slast, int offset)\n\t\t{\n\t\t\tint slash;\n\n\t\t\tfor (slash = offset; slash < s.Length && s[slash] != '/'; slash++)\n\t\t\t{\n\t\t\t\t// search for path component terminator\n\t\t\t\t// [henon] body is intentionally empty!\n\t\t\t}\n\n\t\t\tEnsureLoaded();\n\t\t\tbyte xlast = slash < s.Length ? (byte)'/' : slast;\n\t\t\tint p = BinarySearch(_contents, s, xlast, offset, slash);\n\t\t\tif (p >= 0)\n\t\t\t{\n\t\t\t\tTreeEntry r = _contents[p];\n\t\t\t\tif (slash < s.Length - 1)\n\t\t\t\t{\n\t\t\t\t\tTree oTree = (r as Tree);\n\t\t\t\t\treturn oTree != null ? oTree.FindMember(s, slast, slash + 1) : null;\n\t\t\t\t}\n\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <param name=\"blobName\"></param>\n\t\t/// <returns>\n\t\t/// a <see cref=\"TreeEntry\"/> representing an object with the specified\n\t\t/// relative path.\n\t\t/// </returns>\n\t\tpublic TreeEntry FindBlobMember(string blobName)\n\t\t{\n\t\t\treturn FindMember(blobName, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t///\n\t\t/// </summary>\n\t\t/// <param name=\"treeName\">Tree name</param>\n\t\t/// <returns>return a <see cref=\"Tree\"/> with the name treeName or null</returns>\n\t\tpublic TreeEntry findTreeMember(string treeName)\n\t\t{\n\t\t\treturn FindMember(treeName, (byte)'/');\n\t\t}\n\n\t\tpublic override void Accept(TreeVisitor tv, int flags)\n\t\t{\n\t\t\tif ((MODIFIED_ONLY & flags) == MODIFIED_ONLY && !IsModified) return;\n\n\t\t\tif ((LOADED_ONLY & flags) == LOADED_ONLY && !IsLoaded)\n\t\t\t{\n\t\t\t\ttv.StartVisitTree(this);\n\t\t\t\ttv.EndVisitTree(this);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEnsureLoaded();\n\t\t\ttv.StartVisitTree(this);\n\n\t\t\tTreeEntry[] c = (CONCURRENT_MODIFICATION & flags) == CONCURRENT_MODIFICATION ? Members : _contents;\n\n\t\t\tfor (int k = 0; k < c.Length; k++)\n\t\t\t{\n\t\t\t\tc[k].Accept(tv, flags);\n\t\t\t}\n\n\t\t\ttv.EndVisitTree(this);\n\t\t}\n        \n\t\tprivate void EnsureLoaded()\n\t\t{\n\t\t\tif (IsLoaded) return;\n\n\t\t\tObjectLoader or = _db.OpenTree(Id);\n\t\t\tif (or == null)\n\t\t\t{\n\t\t\t\tthrow new MissingObjectException(Id, ObjectType.Tree);\n\t\t\t}\n\n\t\t\tReadTree(or.Bytes);\n\t\t}\n\n\t\tprivate void ReadTree(byte[] raw)\n\t\t{\n\t\t\tint rawSize = raw.Length;\n\t\t\tint rawPtr = 0;\n\t\t\tint nextIndex = 0;\n\n\t\t\twhile (rawPtr < rawSize)\n\t\t\t{\n\t\t\t\twhile (rawPtr < rawSize && raw[rawPtr] != 0)\n\t\t\t\t{\n\t\t\t\t\trawPtr++;\n\t\t\t\t}\n\n\t\t\t\trawPtr++;\n\t\t\t\trawPtr += Constants.OBJECT_ID_LENGTH;\n\t\t\t\tnextIndex++;\n\t\t\t}\n\n\t\t\tvar temp = new TreeEntry[nextIndex];\n\t\t\trawPtr = 0;\n\t\t\tnextIndex = 0;\n\n\t\t\twhile (rawPtr < rawSize)\n\t\t\t{\n\t\t\t\tint c = raw[rawPtr++];\n\t\t\t\tif (c < '0' || c > '7')\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(Id, \"invalid entry mode\");\n\t\t\t\t}\n\n\t\t\t\tint mode = c - '0';\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tc = raw[rawPtr++];\n\t\t\t\t\tif (' ' == c) break;\n\n\t\t\t\t\tif (c < '0' || c > '7')\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new CorruptObjectException(Id, \"invalid mode\");\n\t\t\t\t\t}\n\n\t\t\t\t\tmode <<= 3;\n\t\t\t\t\tmode += c - '0';\n\t\t\t\t}\n\n\t\t\t\tint nameLen = 0;\n\t\t\t\twhile (raw[rawPtr + nameLen] != 0)\n\t\t\t\t{\n\t\t\t\t\tnameLen++;\n\t\t\t\t}\n\n\t\t\t\tvar name = new byte[nameLen];\n\t\t\t\tArray.Copy(raw, rawPtr, name, 0, nameLen);\n\t\t\t\trawPtr += nameLen + 1;\n\n\t\t\t\tObjectId id = ObjectId.FromRaw(raw, rawPtr);\n\t\t\t\trawPtr += Constants.OBJECT_ID_LENGTH;\n\n\t\t\t\tTreeEntry ent;\n\t\t\t\tif (FileMode.RegularFile.Equals(mode))\n\t\t\t\t{\n\t\t\t\t\tent = new FileTreeEntry(this, id, name, false);\n\t\t\t\t}\n\t\t\t\telse if (FileMode.ExecutableFile.Equals(mode))\n\t\t\t\t{\n\t\t\t\t\tent = new FileTreeEntry(this, id, name, true);\n\t\t\t\t}\n\t\t\t\telse if (FileMode.Tree.Equals(mode))\n\t\t\t\t{\n\t\t\t\t\tent = new Tree(this, id, name);\n\t\t\t\t}\n                else if (FileMode.Symlink.Equals(mode))\n                {\n                    ent = new SymlinkTreeEntry(this, id, name);\n                }\n                else if (FileMode.GitLink.Equals(mode))\n                {\n                    ent = new GitLinkTreeEntry(this, id, name);\n                }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new CorruptObjectException(Id, \"Invalid mode: \" + Convert.ToString(mode, 8));\n\t\t\t\t}\n\n\t\t\t\ttemp[nextIndex++] = ent;\n\t\t\t}\n\n\t\t\t_contents = temp;\n\t\t}\n\n\t\tpublic ObjectId TreeId\n\t\t{\n\t\t\tget { return Id; }\n\t\t}\n\n\t\tpublic Tree TreeEntry\n\t\t{\n\t\t\tget { return this; }\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar r = new StringBuilder();\n\t\t\tr.Append(ObjectId.ToString(Id));\n\t\t\tr.Append(\" T \");\n\t\t\tr.Append(FullName);\n\t\t\treturn r.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeEntry.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public abstract class TreeEntry : IComparable, IComparable<TreeEntry>\n    {\n        // Fields\n        public static int CONCURRENT_MODIFICATION = 4;\n        public static int LOADED_ONLY = 2;\n        public static int MODIFIED_ONLY = 1;\n        private ObjectId _id;\n\n        // Methods\n        protected TreeEntry(Tree myParent, ObjectId id, byte[] nameUTF8)\n        {\n            NameUTF8 = nameUTF8;\n            Parent = myParent;\n            _id = id;\n        }\n\n        // Properties\n        public string FullName\n        {\n            get\n            {\n                var r = new StringBuilder();\n                AppendFullName(r);\n                return r.ToString();\n            }\n        }\n\n        public byte[] FullNameUTF8\n        {\n            get { return Constants.CHARSET.GetBytes(FullName); }\n        }\n\n        public ObjectId Id\n        {\n            get { return _id; }\n            set\n            {\n                Tree parent = Parent;\n                if (((parent != null) && (_id != value)) &&\n                    !((((_id != null) || (value == null)) && ((_id == null) || (value != null))) &&\n                      _id.Equals(value)))\n                {\n                    parent.Id = null;\n                }\n                _id = value;\n            }\n        }\n\n        public bool IsBlob\n        {\n            get { return (Mode.ObjectType == ObjectType.Blob); }\n        }\n\n        public bool IsCommit\n        {\n            get { return (Mode.ObjectType == ObjectType.Commit); }\n        }\n\n        public bool IsModified\n        {\n            get { return (_id == null); }\n        }\n\n        public bool IsTag\n        {\n            get { return (Mode.ObjectType == ObjectType.Tag); }\n        }\n\n        public bool IsTree\n        {\n            get { return (Mode.ObjectType == ObjectType.Tree); }\n        }\n\n        public abstract FileMode Mode { get; }\n\n        public string Name\n        {\n            get\n            {\n                if (NameUTF8 != null)\n                    return RawParseUtils.decode(NameUTF8);\n                return null;\n            }\n        }\n\n        public byte[] NameUTF8 { get; private set; }\n\n        public Tree Parent { get; private set; }\n\n        public virtual Repository Repository\n        {\n            get { return Parent.Repository; }\n        }\n\n        #region IComparable Members\n\n        public int CompareTo(object obj)\n        {\n            if (this == obj)\n            {\n                return 0;\n            }\n            return CompareTo(obj as TreeEntry);\n        }\n\n        #endregion\n\n        #region IComparable<TreeEntry> Members\n\n        public int CompareTo(TreeEntry other)\n        {\n            if (other != null)\n            {\n                return Tree.CompareNames(NameUTF8, other.NameUTF8, LastChar(this), LastChar(other));\n            }\n            return -1;\n        }\n\n        #endregion\n\n        public void Accept(TreeVisitor tv)\n        {\n            Accept(tv, 0);\n        }\n\n        public abstract void Accept(TreeVisitor tv, int flags);\n\n        private void AppendFullName(StringBuilder r)\n        {\n            TreeEntry parent = Parent;\n            string name = Name;\n            if (parent != null)\n            {\n                parent.AppendFullName(r);\n                if (r.Length > 0)\n                {\n                    r.Append('/');\n                }\n            }\n            if (name != null)\n            {\n                r.Append(name);\n            }\n        }\n\n        public void AttachParent(Tree p)\n        {\n            Parent = p;\n        }\n\n        public void Delete()\n        {\n            Parent.RemoveEntry(this);\n            DetachParent();\n        }\n\n        public void DetachParent()\n        {\n            Parent = null;\n        }\n\n        public static int LastChar(GitIndex.Entry i)\n        {\n            return (FileMode.Tree.Equals(i.getModeBits()) ? 0x2f : 0);\n        }\n\n        public static int LastChar(TreeEntry treeEntry)\n        {\n            if (!(treeEntry is Tree))\n            {\n                return Convert.ToInt32('\\0');\n            }\n            return Convert.ToInt32('/');\n        }\n\n        public void Rename(string n)\n        {\n            Rename(Constants.encode(n));\n        }\n\n        public void Rename(byte[] n)\n        {\n            Tree parent = Parent;\n            if (parent != null)\n            {\n                Delete();\n            }\n            NameUTF8 = n;\n            if (parent != null)\n            {\n                parent.AddEntry(this);\n            }\n        }\n\n        public void SetModified()\n        {\n            Id = null;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeIterator.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\tpublic class TreeIterator\n\t{\n\t\tprivate readonly Tree _tree;\n\t\tprivate readonly Order _order;\n\t\tprivate readonly bool _visitTreeNodes;\n\n\t\tprivate int _index;\n\t\tprivate TreeIterator _sub;\n\t\tprivate bool _hasVisitedTree;\n\n\t\t/// <summary>\n\t\t/// Traversal order\n\t\t/// </summary>\n\t\t[Serializable]\n\t\tpublic enum Order\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Visit node first, then leaves\n\t\t\t/// </summary>\n\t\t\tPREORDER,\n\n\t\t\t/// <summary>\n\t\t\t/// Visit leaves first, then node\n\t\t\t/// </summary>\n\t\t\tPOSTORDER\n\t\t};\n\n\t\t/// <summary>\n\t\t/// Construct a <see cref=\"TreeIterator\"/> for visiting all non-tree nodes.\n\t\t/// </summary>\n\t\t/// <param name=\"start\"></param>\n\t\tpublic TreeIterator(Tree start)\n\t\t\t: this(start, Order.PREORDER, false)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Construct a <see cref=\"TreeIterator\"/> for visiting all nodes in a\n\t\t/// tree in a given order\n\t\t/// </summary>\n\t\t/// <param name=\"start\">Root node</param>\n\t\t/// <param name=\"order\"><see cref=\"Order\"/></param>\n\t\tpublic TreeIterator(Tree start, Order order)\n\t\t\t: this(start, order, true)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Construct a <see cref=\"TreeIterator\"/>.\n\t\t/// </summary>\n\t\t/// <param name=\"start\">First node to visit</param>\n\t\t/// <param name=\"order\">Visitation <see cref=\"Order\"/></param>\n\t\t/// <param name=\"visitTreeNode\">True to include tree node</param>\n\t\tprivate TreeIterator(Tree start, Order order, bool visitTreeNode)\n\t\t{\n\t\t\t_tree = start;\n\t\t\t_visitTreeNodes = visitTreeNode;\n\t\t\t_index = -1;\n\t\t\t_order = order;\n\t\t\tif (!_visitTreeNodes)\n\t\t\t{\n\t\t\t\t_hasVisitedTree = true;\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tStep();\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new Exception(string.Empty, e);\n\t\t\t}\n\t\t}\n\n\t\tprivate TreeEntry NextTreeEntry()\n\t\t{\n\t\t\tif (_sub != null)\n\t\t\t\treturn _sub.NextTreeEntry();\n\n\t\t\tif (_index < 0 && _order == Order.PREORDER)\n\t\t\t\treturn _tree;\n\n\t\t\tif (_order == Order.POSTORDER && _index == _tree.MemberCount)\n\t\t\t\treturn _tree;\n\n\t\t\tif (_tree.Members.Length <= _index)\n\t\t\t\treturn null;\n\n\t\t\treturn _tree.Members[_index];\n\t\t}\n\n\t\tprivate bool HasNextTreeEntry()\n\t\t{\n\t\t\tif (_tree == null) return false;\n\n\t\t\treturn _sub != null || _index < _tree.MemberCount || _order == Order.POSTORDER && _index == _tree.MemberCount;\n\t\t}\n\n\t\tprivate bool Step()\n\t\t{\n\t\t\tif (_tree == null) return false;\n\t\t\tif (_sub != null)\n\t\t\t{\n\t\t\t\tif (_sub.Step()) return true;\n\t\t\t\t_sub = null;\n\t\t\t}\n\n\t\t\tif (_index < 0 && !_hasVisitedTree && _order == Order.PREORDER)\n\t\t\t{\n\t\t\t\t_hasVisitedTree = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\twhile (++_index < _tree.MemberCount)\n\t\t\t{\n\t\t\t\tTree e = (_tree.Members[_index] as Tree);\n\t\t\t\tif (e != null)\n\t\t\t\t{\n\t\t\t\t\t_sub = new TreeIterator(e, _order, _visitTreeNodes);\n\t\t\t\t\tif (_sub.HasNextTreeEntry()) return true;\n\t\t\t\t\t_sub = null;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (_index == _tree.MemberCount && !_hasVisitedTree && _order == Order.POSTORDER)\n\t\t\t{\n\t\t\t\t_hasVisitedTree = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\n\t\tpublic bool hasNext()\n\t\t{\n\t\t\treturn HasNextTreeEntry();\n\t\t}\n\n\t\tpublic TreeEntry next()\n\t\t{\n\t\t\tTreeEntry ret = NextTreeEntry();\n\t\t\tStep();\n\t\t\treturn ret;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/TreeVisitor.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A TreeVisitor is invoked depth first for every node in a tree and is expected\n\t/// to perform different actions.\n\t/// </summary>\n    public interface TreeVisitor\n    {\n\t\t///\t<summary>\n\t\t/// Visit to a tree node before child nodes are visited.\n\t\t///\t</summary>\n\t\t///\t<param name=\"t\">Tree</param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void StartVisitTree(Tree t);\n\n\t\t///\t<summary>\n\t\t/// Visit to a tree node. after child nodes have been visited.\n\t\t///\t</summary>\n\t\t///\t<param name=\"t\"> Tree </param>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n        void EndVisitTree(Tree t);\n\n\t\t///\t<summary>\n\t\t/// Visit to a blob.\n\t\t///\t</summary>\n\t\t///\t<param name=\"f\">Blob</param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void VisitFile(FileTreeEntry f);\n\n\t\t///\t<summary>\n\t\t/// Visit to a symlink.\n\t\t///\t</summary>\n\t\t///\t<param name=\"s\">Symlink entry.</param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void VisitSymlink(SymlinkTreeEntry s);\n\n\t\t///\t<summary>\n\t\t/// Visit to a gitlink.\n\t\t///\t</summary>\n\t\t///\t<param name=\"e\">Gitlink entry.</param>\n\t\t///\t<exception cref=\"IOException\"></exception>\n        void VisitGitlink(GitLinkTreeEntry e);\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeVisitorWithCurrentDirectory.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Abstract TreeVisitor for visiting all files known by a Tree.\n\t/// </summary>\n    public abstract class TreeVisitorWithCurrentDirectory : TreeVisitor\n    {\n        private readonly Stack<DirectoryInfo> stack;\n        private DirectoryInfo currentDirectory;\n\n        internal TreeVisitorWithCurrentDirectory(DirectoryInfo rootDirectory)\n        {\n            stack = new Stack<DirectoryInfo>(16);\n            currentDirectory = rootDirectory;\n        }\n\n        internal DirectoryInfo GetCurrentDirectory()\n        {\n            return currentDirectory;\n        }\n\n\n        #region TreeVisitor Members\n\n        public void StartVisitTree(Tree t)\n        {\n            stack.Push(currentDirectory);\n            if (!t.IsRoot)\n            {\n                currentDirectory = new DirectoryInfo(Path.Combine(currentDirectory.FullName, t.Name));\n            }\n        }\n\n        public virtual void EndVisitTree(Tree t)\n        {\n            currentDirectory = stack.Pop();\n        }\n\n        public abstract void VisitFile(FileTreeEntry f);\n\n        public abstract void VisitSymlink(SymlinkTreeEntry s);\n\n        public abstract void VisitGitlink(GitLinkTreeEntry e);\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeWalk/AbstractTreeIterator.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.TreeWalk.Filter;\n\nnamespace GitSharp.Core.TreeWalk\n{\n\t/// <summary>\n\t/// Walks a Git tree (directory) in Git sort order.\n\t/// <para />\n\t/// A new iterator instance should be positioned on the first entry, or at eof.\n\t/// Data for the first entry (if not at eof) should be available immediately.\n\t/// <para />\n\t/// Implementors must walk a tree in the Git sort order, which has the following\n\t/// odd sorting:\n\t/// <list>\n\t/// <item>A.c</item>\n\t/// <item>A/c</item>\n\t/// <item>A0c</item>\n\t/// </list>\n\t/// <para />\n\t/// In the second item, <code>A</code> is the name of a subtree and\n\t/// <code>c</code> is a file within that subtree. The other two items are files\n\t/// in the root level tree.\n\t/// </summary>\n\t/// <seealso cref=\"CanonicalTreeParser\"/>\n\tpublic abstract class AbstractTreeIterator\n\t{\n\t\t/// <summary>\n\t\t/// Default size for the <see cref=\"Path\"/> buffer.\n\t\t/// </summary>\n\t\tpublic static int DEFAULT_PATH_SIZE = 128;\n\n\t\t/// <summary>\n\t\t/// A dummy <see cref=\"ObjectId\"/> buffer that matches the zero <see cref=\"ObjectId\"/>.\n\t\t/// </summary>\n\t\tprotected static readonly byte[] ZeroId = new byte[Constants.OBJECT_ID_LENGTH];\n\n\t    protected readonly AbstractTreeIterator _parent;\n\n\t\t/// <summary>\n\t\t/// Create a new iterator with no parent.\n\t\t/// </summary>\n\t\tprotected AbstractTreeIterator()\n\t\t{\n\t\t\t_parent = null;\n\t\t\tPath = new byte[DEFAULT_PATH_SIZE];\n\t\t\tPathOffset = 0;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new iterator with no parent and a prefix.\n\t\t/// \n\t\t/// The prefix path supplied is inserted in front of all paths generated by\n\t\t/// this iterator. It is intended to be used when an iterator is being\n\t\t/// created for a subsection of an overall repository and needs to be\n\t\t/// combined with other iterators that are created to run over the entire\n\t\t/// repository namespace.\n\t\t/// </summary>\n\t\t/// <param name=\"prefix\">\n\t\t/// position of this iterator in the repository tree. The value\n\t\t/// may be null or the empty string to indicate the prefix is the\n\t\t/// root of the repository. A trailing slash ('/') is\n\t\t/// automatically appended if the prefix does not end in '/'.\n\t\t/// </param>\n\t\tprotected AbstractTreeIterator(string prefix)\n\t\t\t: this(Constants.CHARSET.GetBytes(prefix))\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create a new iterator with no parent and a prefix.\n\t\t/// \n\t\t/// The prefix path supplied is inserted in front of all paths generated by\n\t\t/// this iterator. It is intended to be used when an iterator is being\n\t\t/// created for a subsection of an overall repository and needs to be\n\t\t/// combined with other iterators that are created to run over the entire\n\t\t/// repository namespace.\n\t\t/// </summary>\n\t\t/// <param name=\"prefix\">\n\t\t/// position of this iterator in the repository tree. The value\n\t\t/// may be null or the empty array to indicate the prefix is the\n\t\t/// root of the repository. A trailing slash ('/') is\n\t\t/// automatically appended if the prefix does not end in '/'.\n\t\t/// </param>\n\t\tprotected AbstractTreeIterator(byte[] prefix)\n\t\t{\n\t\t\t_parent = null;\n\n\t\t\tif (prefix != null && prefix.Length > 0)\n\t\t\t{\n\t\t\t\tPathLen = prefix.Length;\n\t\t\t\tPath = new byte[Math.Max(DEFAULT_PATH_SIZE, PathLen + 1)];\n\t\t\t\tArray.Copy(prefix, 0, Path, 0, PathLen);\n\t\t\t\tif (Path[PathLen - 1] != (byte)'/')\n\t\t\t\t{\n\t\t\t\t\tPath[PathLen++] = (byte)'/';\n\t\t\t\t}\n\t\t\t\tPathOffset = PathLen;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tPath = new byte[DEFAULT_PATH_SIZE];\n\t\t\t\tPathOffset = 0;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create an iterator for a subtree of an existing iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"p\">parent tree iterator.</param>\n\t\tprotected AbstractTreeIterator(AbstractTreeIterator p)\n\t\t{\n\t\t\tif (p == null)\n\t\t\t\tthrow new ArgumentNullException (\"p\");\n\t\t\t_parent = p;\n\t\t\tPath = p.Path;\n\t\t\tPathOffset = p.PathLen + 1;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tPath[PathOffset - 1] = (byte)'/';\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\tgrowPath(p.PathLen);\n\t\t\t\tPath[PathOffset - 1] = (byte)'/';\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Create an iterator for a subtree of an existing iterator. \n\t\t/// The caller is responsible for setting up the path of the child iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"p\">parent tree iterator.</param>\n\t\t/// <param name=\"childPath\">\n\t\t/// Path array to be used by the child iterator. This path must\n\t\t/// contain the path from the top of the walk to the first child\n\t\t/// and must end with a '/'.\n\t\t/// </param>\n\t\t/// <param name=\"childPathOffset\">\n\t\t/// position within <code>childPath</code> where the child can\n\t\t/// insert its data. The value at\n\t\t/// <code>childPath[childPathOffset-1]</code> must be '/'.\n\t\t/// </param>\n\t\tprotected AbstractTreeIterator(AbstractTreeIterator p, byte[] childPath, int childPathOffset)\n\t\t{\n\t\t\t_parent = p;\n\t\t\tPath = childPath;\n\t\t\tPathOffset = childPathOffset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Grow the _path buffer larger.\n\t\t/// </summary>\n\t\t/// <param name=\"len\">\n\t\t/// Number of live bytes in the path buffer. This many bytes will\n\t\t/// be moved into the larger buffer.\n\t\t/// </param>\n\t\tpublic void growPath(int len)\n\t\t{\n\t\t\tSetPathCapacity(Path.Length << 1, len);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Ensure that path is capable to hold at least <paramref name=\"capacity\"/> bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"capacity\">the amount of bytes to hold</param>\n\t\t/// <param name=\"length\">the amount of live bytes in path buffer</param>\n\t\tprotected void ensurePathCapacity(int capacity, int length)\n\t\t{\n\t\t\tif (Path.Length >= capacity) return;\n\n\t\t\tbyte[] oldPath = Path;\n\t\t\tint currentLength = oldPath.Length;\n\t\t\tint newCapacity = currentLength;\n\n\t\t\twhile (newCapacity < capacity && newCapacity > 0)\n\t\t\t{\n\t\t\t\tnewCapacity <<= 1;\n\t\t\t}\n\n\t\t\tSetPathCapacity(newCapacity, length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Set path buffer capacity to the specified size\n\t\t/// </summary>\n\t\t/// <param name=\"capacity\">the new size</param>\n\t\t/// <param name=\"length\">the amount of bytes to copy</param>\n\t\tprivate void SetPathCapacity(int capacity, int length)\n\t\t{\n\t\t\tvar oldPath = Path;\n\t\t\tvar newPath = new byte[capacity];\n\t\t\tArray.Copy(oldPath, 0, newPath, 0, length);\n\n\t\t\tfor (AbstractTreeIterator p = this; p != null && p.Path == oldPath; p = p._parent)\n\t\t\t{\n\t\t\t\tp.Path = newPath;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compare the path of this current entry to another iterator's entry.\n\t\t/// </summary>\n\t\t/// <param name=\"treeIterator\">\n\t\t/// The other iterator to compare the path against.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// return -1 if this entry sorts first; 0 if the entries are equal; 1 if\n\t\t/// <paramref name=\"treeIterator\"/>'s entry sorts first.\n\t\t/// </returns>\n\t\tpublic int pathCompare(AbstractTreeIterator treeIterator)\n\t\t{\n\t\t\tif (treeIterator == null)\n\t\t\t\tthrow new ArgumentNullException (\"treeIterator\");\n\t\t\treturn pathCompare(treeIterator, treeIterator.Mode);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Compare the path of this current entry to another iterator's entry.\n\t\t/// </summary>\n\t\t/// <param name=\"treeIterator\">\n\t\t/// The other iterator to compare the path against.\n\t\t/// </param>\n\t\t/// <param name=\"treeIteratorMode\">\n\t\t/// The other iterator <see cref=\"FileMode\"/> bits.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// return -1 if this entry sorts first; 0 if the entries are equal; 1 if\n\t\t/// <paramref name=\"treeIterator\"/>'s entry sorts first.\n\t\t/// </returns>\n\t\tpublic int pathCompare(AbstractTreeIterator treeIterator, int treeIteratorMode)\n\t\t{\n\t\t\tif (treeIterator == null)\n\t\t\t\tthrow new ArgumentNullException (\"treeIterator\");\n\t\t\tbyte[] a = Path;\n\t\t\tbyte[] b = treeIterator.Path;\n\t\t\tint aLen = PathLen;\n\t\t\tint bLen = treeIterator.PathLen;\n\n\t\t\t// Its common when we are a subtree for both parents to match;\n\t\t\t// when this happens everything in _path[0..cPos] is known to\n\t\t\t// be equal and does not require evaluation again.\n\t\t\t//\n\t\t\tint cPos = AlreadyMatch(this, treeIterator);\n\n\t\t\tfor (; cPos < aLen && cPos < bLen; cPos++)\n\t\t\t{\n\t\t\t\tint cmp = (a[cPos] & 0xff) - (b[cPos] & 0xff);\n\t\t\t\tif (cmp != 0)\n\t\t\t\t{\n\t\t\t\t\treturn cmp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (cPos < aLen)\n\t\t\t{\n\t\t\t\treturn (a[cPos] & 0xff) - LastPathChar(treeIteratorMode);\n\t\t\t}\n\n\t\t\tif (cPos < bLen)\n\t\t\t{\n\t\t\t\treturn LastPathChar(Mode) - (b[cPos] & 0xff);\n\t\t\t}\n\n\t\t\treturn LastPathChar(Mode) - LastPathChar(treeIteratorMode);\n\t\t}\n\n\t\tprivate static int AlreadyMatch(AbstractTreeIterator a, AbstractTreeIterator b)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator ap = a._parent;\n\t\t\t\tAbstractTreeIterator bp = b._parent;\n\n\t\t\t\tif (ap == null || bp == null)\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tif (ap.Matches == bp.Matches)\n\t\t\t\t{\n\t\t\t\t\treturn a.PathOffset;\n\t\t\t\t}\n\n\t\t\t\ta = ap;\n\t\t\t\tb = bp;\n\t\t\t}\n\t\t}\n\n\t\tprivate static int LastPathChar(int mode)\n\t\t{\n\t\t\treturn FileMode.Tree == FileMode.FromBits(mode) ? (byte)'/' : (byte)'\\0';\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check if the current entry of both iterators has the same id.\n\t\t/// <para />\n\t\t/// This method is faster than <see cref=\"getEntryObjectId()\"/>as it does not\n\t\t/// require copying the bytes out of the buffers. A direct <see cref=\"idBuffer\"/>\n\t\t/// compare operation is performed.\n\t\t/// </summary>\n\t\t/// <param name=\"otherIterator\">the other iterator to test against.</param>\n\t\t/// <returns>\n\t\t/// true if both iterators have the same object id; false otherwise.\n\t\t/// </returns>\n\t\tpublic virtual bool idEqual(AbstractTreeIterator otherIterator)\n\t\t{\n\t\t\tif (otherIterator == null)\n\t\t\t\tthrow new ArgumentNullException (\"otherIterator\");\n\t\t\treturn ObjectId.Equals(idBuffer(), idOffset(), otherIterator.idBuffer(), otherIterator.idOffset());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the <see cref=\"ObjectId\"/> of the current entry.\n\t\t/// </summary>\n\t\t/// <returns>The <see cref=\"ObjectId\"/> for the current entry.</returns>\n\t\tpublic virtual ObjectId getEntryObjectId()\n\t\t{\n\t\t\treturn ObjectId.FromRaw(idBuffer(), idOffset());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the <see cref=\"ObjectId\"/> of the current entry.\n\t\t/// </summary>\n\t\t/// <param name=\"objectId\">buffer to copy the object id into.</param>\n\t\tpublic virtual void getEntryObjectId(MutableObjectId objectId)\n\t\t{\n\t\t\tif (objectId == null)\n\t\t\t\tthrow new ArgumentNullException (\"objectId\");\n\t\t\tobjectId.FromRaw(idBuffer(), idOffset());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The file mode of the current entry.\n\t\t/// </summary>\n\t\tpublic virtual FileMode EntryFileMode\n\t\t{\n\t\t\tget { return FileMode.FromBits(Mode); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The file mode of the current entry as bits.\n\t\t/// </summary>\n\t\tpublic int EntryRawMode\n\t\t{\n\t\t\tget { return Mode; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the path of the current entry, as a string.\n\t\t/// </summary>\n\t\tpublic string EntryPathString\n\t\t{\n\t\t\tget { return TreeWalk.pathOf(this); }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the byte array buffer object IDs must be copied out of.\n\t\t/// <para />\n\t\t/// The id buffer contains the bytes necessary to construct an <see cref=\"ObjectId\"/> for\n\t\t/// the current entry of this iterator. The buffer can be the same buffer for\n\t\t/// all entries, or it can be a unique buffer per-entry. Implementations are\n\t\t/// encouraged to expose their private buffer whenever possible to reduce\n\t\t/// garbage generation and copying costs.\n\t\t/// </summary>\n\t\t/// <returns>byte array the implementation stores object IDs within.</returns>\n\t\t/// <seealso cref=\"getEntryObjectId()\"/>\n\t\tpublic abstract byte[] idBuffer();\n\n\t\t/**\n\t\t * Get the position within {@link #idBuffer()} of this entry's ObjectId.\n\t\t * \n\t\t * @return offset into the array returned by {@link #idBuffer()} where the\n\t\t *         ObjectId must be copied out of.\n\t\t */\n\t\tpublic abstract int idOffset();\n\n\t\t/**\n\t\t * Create a new iterator for the current entry's subtree.\n\t\t * <para />\n\t\t * The parent reference of the iterator must be <code>this</code>,\n\t\t * otherwise the caller would not be able to exit out of the subtree\n\t\t * iterator correctly and return to continue walking <code>this</code>.\n\t\t * \n\t\t * @param repo\n\t\t *            repository to load the tree data from.\n\t\t * @return a new parser that walks over the current subtree.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             the current entry is not actually a tree and cannot be parsed\n\t\t *             as though it were a tree.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic abstract AbstractTreeIterator createSubtreeIterator(Repository repo);\n\n\t\t/**\n\t\t * Create a new iterator as though the current entry were a subtree.\n\t\t *\n\t\t * @return a new empty tree iterator.\n\t\t */\n\t\tpublic virtual EmptyTreeIterator createEmptyTreeIterator()\n\t\t{\n\t\t\treturn new EmptyTreeIterator(this);\n\t\t}\n\n\t\t/**\n\t\t * Create a new iterator for the current entry's subtree.\n\t\t * <para />\n\t\t * The parent reference of the iterator must be <code>this</code>, otherwise\n\t\t * the caller would not be able to exit out of the subtree iterator\n\t\t * correctly and return to continue walking <code>this</code>.\n\t\t *\n\t\t * @param repo\n\t\t *            repository to load the tree data from.\n\t\t * @param idBuffer\n\t\t *            temporary ObjectId buffer for use by this method.\n\t\t * @param curs\n\t\t *            window cursor to use during repository access.\n\t\t * @return a new parser that walks over the current subtree.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             the current entry is not actually a tree and cannot be parsed\n\t\t *             as though it were a tree.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic virtual AbstractTreeIterator createSubtreeIterator(Repository repo, MutableObjectId idBuffer, WindowCursor curs)\n\t\t{\n\t\t\treturn createSubtreeIterator(repo);\n\t\t}\n\n\t\t/**\n\t\t * Is this tree iterator positioned on its first entry?\n\t\t * <para />\n\t\t * An iterator is positioned on the first entry if <code>back(1)</code>\n\t\t * would be an invalid request as there is no entry before the current one.\n\t\t * <para />\n\t\t * An empty iterator (one with no entries) will be\n\t\t * <code>first() &amp;&amp; eof()</code>.\n\t\t *\n\t\t * @return true if the iterator is positioned on the first entry.\n\t\t */\n\t\tpublic abstract bool first();\n\n\t\t/**\n\t\t * Is this tree iterator at its EOF point (no more entries)?\n\t\t * <para />\n\t\t * An iterator is at EOF if there is no current entry.\n\t\t * \n\t\t * @return true if we have walked all entries and have none left.\n\t\t */\n\t\tpublic abstract bool eof();\n\n\t\t/**\n\t\t * Move to next entry, populating this iterator with the entry data.\n\t\t * <para />\n\t\t * The delta indicates how many moves forward should occur. The most common\n\t\t * delta is 1 to move to the next entry.\n\t\t * <para />\n\t\t * Implementations must populate the following members:\n\t\t * <ul>\n\t\t * <li>{@link #mode}</li>\n\t\t * <li>{@link #_path} (from {@link #_pathOffset} to {@link #_pathLen})</li>\n\t\t * <li>{@link #_pathLen}</li>\n\t\t * </ul>\n\t\t * as well as any implementation dependent information necessary to\n\t\t * accurately return data from {@link #idBuffer()} and {@link #idOffset()}\n\t\t * when demanded.\n\t\t *\n\t\t * @param delta\n\t\t *            number of entries to move the iterator by. Must be a positive,\n\t\t *            non-zero integer.\n\t\t * @throws CorruptObjectException\n\t\t *             the tree is invalid.\n\t\t */\n\t\tpublic abstract void next(int delta);\n\n\t\t/// <summary>\n\t\t/// Move to prior entry, populating this iterator with the entry data.\n\t\t/// <para />\n\t\t/// The delta indicates how many moves backward should occur.  \n\t\t/// The most common delta is 1 to move to the prior entry.\n\t\t/// <para />\n\t\t/// Implementations must populate the following members:\n\t\t/// <ul>\n\t\t/// <li><see cref=\"Mode\"/></li>\n\t\t/// <li>{@link #_path} (from {@link #_pathOffset} to {@link #_pathLen})</li>\n\t\t/// <li>{@link #_pathLen}</li>\n\t\t/// </ul>\n\t\t/// as well as any implementation dependent information necessary to\n\t\t/// accurately return data from <see cref=\"idBuffer()\"/> and <see cref=\"idOffset()\"/>\n\t\t/// when demanded.\n\t\t/// </summary>\n\t\t/// <param name=\"delta\">\n\t\t/// Number of entries to move the iterator by. Must be a positive,\n\t\t/// non-zero integer.\n\t\t/// </param>\n\t\tpublic abstract void back(int delta);\n\n\t\t/// <summary>\n\t\t/// Advance to the next tree entry, populating this iterator with its data.\n\t\t/// <para />\n\t\t/// This method behaves like <code>seek(1)</code> but is called by\n\t\t/// <see cref=\"TreeWalk\"/> only if a <see cref=\"TreeFilter\"/> was used and \n\t\t/// ruled out the current entry from the results. In such cases this tree \n\t\t/// iterator may perform special behavior.\n\t\t/// </summary>\n\t\tpublic virtual void skip()\n\t\t{\n\t\t\tnext(1);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Indicates to the iterator that no more entries will be Read.\n\t\t/// <para />\n\t\t/// This is only invoked by TreeWalk when the iteration is aborted early due\n\t\t/// to a <see cref=\"StopWalkException\"/> being thrown from\n\t\t/// within a TreeFilter.\n\t\t/// </summary>\n\t\tpublic virtual void stopWalk()\n\t\t{\n\t\t\t// Do nothing by default.  Most iterators do not care.\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the Length of the name component of the path for the current entry.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic int NameLength\n\t\t{\n\t\t\tget { return PathLen - PathOffset; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the name component of the current entry path into the provided buffer.\n\t\t/// </summary>\n\t\t/// <param name=\"buffer\">\n\t\t/// The buffer to get the name into, it is assumed that buffer can hold the name.\n\t\t/// </param>\n\t\t/// <param name=\"offset\">\n\t\t/// The offset of the name in the <paramref name=\"buffer\"/>\n\t\t/// </param>\n\t\t/// <seealso cref=\"NameLength\"/>\n\t\tpublic void getName(byte[] buffer, int offset)\n\t\t{\n\t\t\tArray.Copy(Path, PathOffset, buffer, offset, PathLen - PathOffset);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Iterator for the parent tree; null if we are the root iterator.\n\t\t/// </summary>\n\t\tpublic AbstractTreeIterator Parent\n\t\t{\n\t\t\tget { return _parent; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The iterator this current entry is path equal to.\n\t\t/// </summary>\n\t\tpublic AbstractTreeIterator Matches { get; set; }\n\n\t\t/// <summary>\n\t\t/// Number of entries we moved forward to force a D/F conflict match.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"NameConflictTreeWalk\"/>\n\t\tpublic int MatchShift { get; set; }\n\n\t\t/// <summary>\n\t\t/// <see cref=\"FileMode\"/> bits for the current entry.\n\t\t/// <para />\n\t\t/// A numerical value from FileMode is usually faster for an iterator to\n\t\t/// obtain from its data source so this is the preferred representation.\n\t\t/// </summary>\n\t\tpublic int Mode { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Path buffer for the current entry.\n\t\t/// <para />\n\t\t/// This buffer is pre-allocated at the start of walking and is shared from\n\t\t/// parent iterators down into their subtree iterators. The sharing allows\n\t\t/// the current entry to always be a full path from the root, while each\n\t\t/// subtree only needs to populate the part that is under their control.\n\t\t/// </summary>\n\t\tpublic byte[] Path { get; protected set; }\n\n\t\t/// <summary>\n\t\t/// Position within <see cref=\"Path\"/> this iterator starts writing at.\n\t\t/// <para />\n\t\t/// This is the first offset in <see cref=\"Path\"/> that this iterator must\n\t\t/// populate during <see cref=\"next\"/>. At the root level (when <see cref=\"Parent\"/>\n\t\t/// is null) this is 0. For a subtree iterator the index before this position\n\t\t/// should have the value '/'.\n\t\t/// </summary>\n\t\tpublic int PathOffset { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Total Length of the current entry's complete _path from the root.\n\t\t/// <para />\n\t\t/// This is the number of bytes within <see cref=\"Path\"/> that pertain to the\n\t\t/// current entry. Values at this index through the end of the array are\n\t\t/// garbage and may be randomly populated from prior entries.\n\t\t/// </summary>\n\t\tpublic int PathLen { get; protected set; }\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/CanonicalTreeParser.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.TreeWalk\n{\n    /// <summary>\n    /// Parses raw Git trees from the canonical semi-text/semi-binary format.\n    /// </summary>\n    public class CanonicalTreeParser : AbstractTreeIterator\n    {\n        private static readonly byte[] Empty = { };\n\n        private byte[] _raw;\n\n        /** First offset within {@link #_raw} of the prior entry. */\n        private int _prevPtr;\n\n        /** First offset within {@link #_raw} of the current entry's data. */\n        private int _currPtr;\n\n        /** Offset one past the current entry (first byte of next entry). */\n        private int _nextPtr;\n\n        /// <summary>\n        /// Create a new parser.\n        /// </summary>\n        public CanonicalTreeParser()\n        {\n            reset(Empty);\n        }\n\n        /**\n         * Create a new parser for a tree appearing in a subset of a repository.\n         *\n         * @param prefix\n         *            position of this iterator in the repository tree. The value\n         *            may be null or the empty array to indicate the prefix is the\n         *            root of the repository. A trailing slash ('/') is\n         *            automatically appended if the prefix does not end in '/'.\n         * @param repo\n         *            repository to load the tree data from.\n         * @param treeId\n         *            identity of the tree being parsed; used only in exception\n         *            messages if data corruption is found.\n         * @param curs\n         *            a window cursor to use during data access from the repository.\n         * @throws MissingObjectException\n         *             the object supplied is not available from the repository.\n         * @throws IncorrectObjectTypeException\n         *             the object supplied as an argument is not actually a tree and\n         *             cannot be parsed as though it were a tree.\n         * @throws IOException\n         *             a loose object or pack file could not be Read.\n         */\n        public CanonicalTreeParser(byte[] prefix, Repository repo, AnyObjectId treeId, WindowCursor curs)\n            : base(prefix)\n        {\n            reset(repo, treeId, curs);\n        }\n\n        private CanonicalTreeParser(AbstractTreeIterator p)\n            : base(p)\n        {\n        }\n\n        /**\n         * Reset this parser to walk through the given tree data.\n         * \n         * @param treeData\n         *            the raw tree content.\n         */\n        public void reset(byte[] treeData)\n        {\n            _raw = treeData;\n            _prevPtr = -1;\n            _currPtr = 0;\n            if (eof())\n            {\n                _nextPtr = 0;\n            }\n            else\n            {\n                ParseEntry();\n            }\n        }\n\n        /**\n         * Reset this parser to walk through the given tree.\n         * \n         * @param repo\n         *            repository to load the tree data from.\n         * @param id\n         *            identity of the tree being parsed; used only in exception\n         *            messages if data corruption is found.\n         * @param curs\n         *            window cursor to use during repository access.\n         * @return the root level parser.\n         * @throws MissingObjectException\n         *             the object supplied is not available from the repository.\n         * @throws IncorrectObjectTypeException\n         *             the object supplied as an argument is not actually a tree and\n         *             cannot be parsed as though it were a tree.\n         * @throws IOException\n         *             a loose object or pack file could not be Read.\n         */\n        public CanonicalTreeParser resetRoot(Repository repo, AnyObjectId id, WindowCursor curs)\n        {\n            CanonicalTreeParser p = this;\n            while (p.Parent != null)\n            {\n                p = (CanonicalTreeParser)p.Parent;\n            }\n            p.reset(repo, id, curs);\n            return p;\n        }\n\n        /// <summary>\n        /// Return this iterator, or its parent, if the tree is at eof.\n        /// </summary>\n        /// <returns></returns>\n        public CanonicalTreeParser next()\n        {\n            CanonicalTreeParser iterator = this;\n            while (true)\n            {\n                if (iterator._nextPtr == iterator._raw.Length)\n                {\n                    // This parser has reached EOF, return to the parent.\n                    if (iterator._parent == null)\n                    {\n                        iterator._currPtr = iterator._nextPtr;\n                        return iterator;\n                    }\n                    iterator = (CanonicalTreeParser)iterator.Parent;\n                    continue;\n                }\n\n                iterator._prevPtr = iterator._currPtr;\n                iterator._currPtr = iterator._nextPtr;\n                iterator.ParseEntry();\n                return iterator;\n            }\n        }\n\n        /**\n         * Reset this parser to walk through the given tree.\n         *\n         * @param repo\n         *            repository to load the tree data from.\n         * @param id\n         *            identity of the tree being parsed; used only in exception\n         *            messages if data corruption is found.\n         * @param curs\n         *            window cursor to use during repository access.\n         * @throws MissingObjectException\n         *             the object supplied is not available from the repository.\n         * @throws IncorrectObjectTypeException\n         *             the object supplied as an argument is not actually a tree and\n         *             cannot be parsed as though it were a tree.\n         * @throws IOException\n         *             a loose object or pack file could not be Read.\n         */\n        public void reset(Repository repo, AnyObjectId id, WindowCursor curs)\n        {\n            if (repo == null)\n                throw new ArgumentNullException(\"repo\");\n            ObjectLoader ldr = repo.OpenObject(curs, id);\n            if (ldr == null)\n            {\n                ObjectId me = id.ToObjectId();\n                throw new MissingObjectException(me, Constants.TYPE_TREE);\n            }\n            byte[] subtreeData = ldr.CachedBytes;\n            if (ldr.Type != Constants.OBJ_TREE)\n            {\n                ObjectId me = id.ToObjectId();\n                throw new IncorrectObjectTypeException(me, Constants.TYPE_TREE);\n            }\n            reset(subtreeData);\n        }\n\n        public new CanonicalTreeParser createSubtreeIterator(Repository repo, MutableObjectId idBuffer, WindowCursor curs)\n        {\n            if (idBuffer == null)\n                throw new ArgumentNullException(\"idBuffer\");\n            idBuffer.FromRaw(this.idBuffer(), idOffset());\n            if (FileMode.Tree != EntryFileMode)\n            {\n                ObjectId me = idBuffer.ToObjectId();\n                throw new IncorrectObjectTypeException(me, Constants.TYPE_TREE);\n            }\n            return createSubtreeIterator0(repo, idBuffer, curs);\n        }\n\n        /**\n         * Back door to quickly Create a subtree iterator for any subtree.\n         * <para />\n         * Don't use this unless you are ObjectWalk. The method is meant to be\n         * called only once the current entry has been identified as a tree and its\n         * identity has been converted into an ObjectId.\n         *\n         * @param repo\n         *            repository to load the tree data from.\n         * @param id\n         *            ObjectId of the tree to open.\n         * @param curs\n         *            window cursor to use during repository access.\n         * @return a new parser that walks over the current subtree.\n         * @throws IOException\n         *             a loose object or pack file could not be Read.\n         */\n        public CanonicalTreeParser createSubtreeIterator0(Repository repo, AnyObjectId id, WindowCursor curs) // [henon] createSubtreeIterator0 <--- not a typo!\n        {\n            var p = new CanonicalTreeParser(this);\n            p.reset(repo, id, curs);\n            return p;\n        }\n\n        public override AbstractTreeIterator createSubtreeIterator(Repository repo)\n        {\n            var curs = new WindowCursor();\n            try\n            {\n                return createSubtreeIterator(repo, new MutableObjectId(), curs);\n            }\n            finally\n            {\n                curs.Release();\n            }\n        }\n\n        public override byte[] idBuffer()\n        {\n            return _raw;\n        }\n\n        public override int idOffset()\n        {\n            return _nextPtr - Constants.OBJECT_ID_LENGTH;\n        }\n\n        public override bool first()\n        {\n            return _currPtr == 0;\n        }\n\n        public override bool eof()\n        {\n            return _currPtr == _raw.Length;\n        }\n\n        public override void next(int delta)\n        {\n            if (delta == 1)\n            {\n                // Moving forward one is the most common case.\n                //\n                _prevPtr = _currPtr;\n                _currPtr = _nextPtr;\n                if (!eof())\n                {\n                    ParseEntry();\n                }\n\n                return;\n            }\n\n            // Fast skip over records, then parse the last one.\n            //\n            int end = _raw.Length;\n            int ptr = _nextPtr;\n            while (--delta > 0 && ptr != end)\n            {\n                _prevPtr = ptr;\n                while (_raw[ptr] != 0)\n                {\n                    ptr++;\n                }\n\n                ptr += Constants.OBJECT_ID_LENGTH + 1;\n            }\n\n            if (delta != 0)\n            {\n                throw new IndexOutOfRangeException(delta.ToString());\n            }\n\n            _currPtr = ptr;\n            if (!eof())\n            {\n                ParseEntry();\n            }\n        }\n\n        public override void back(int delta)\n        {\n            if (delta == 1 && 0 <= _prevPtr)\n            {\n                // Moving back one is common in NameTreeWalk, as the average tree\n                // won't have D/F type conflicts to study.\n                //\n                _currPtr = _prevPtr;\n                _prevPtr = -1;\n                if (!eof())\n                {\n                    ParseEntry();\n                }\n                return;\n            }\n\n            if (delta <= 0)\n            {\n                throw new IndexOutOfRangeException(delta.ToString());\n            }\n\n            // Fast skip through the records, from the beginning of the tree.\n            // There is no reliable way to Read the tree backwards, so we must\n            // parse all over again from the beginning. We hold the last \"delta\"\n            // positions in a buffer, so we can find the correct position later.\n            //\n            var trace = new int[delta + 1];\n            trace.Fill(-1);\n            int ptr = 0;\n            while (ptr != _currPtr)\n            {\n                Array.Copy(trace, 1, trace, 0, delta);\n                trace[delta] = ptr;\n                while (_raw[ptr] != 0)\n                {\n                    ptr++;\n                }\n\n                ptr += Constants.OBJECT_ID_LENGTH + 1;\n            }\n\n            if (trace[1] == -1)\n            {\n                throw new IndexOutOfRangeException(delta.ToString());\n            }\n\n            _prevPtr = trace[0];\n            _currPtr = trace[1];\n            ParseEntry();\n        }\n\n        private void ParseEntry()\n        {\n            int ptr = _currPtr;\n            byte c = _raw[ptr++];\n            int tmp = c - (byte)'0';\n            for (; ; )\n            {\n                c = _raw[ptr++];\n                if (' ' == c)\n                    break;\n                tmp <<= 3;\n                tmp += c - (byte)'0';\n            }\n            Mode = tmp;\n\n            tmp = PathOffset;\n\n            for (; ; tmp++)\n            {\n                c = _raw[ptr++];\n                if (c == 0)\n                    break;\n                try\n                {\n                    Path[tmp] = c;\n                }\n                catch (IndexOutOfRangeException)\n                {\n                    growPath(tmp);\n                    Path[tmp] = c;\n                }\n            }\n\n            PathLen = tmp;\n            _nextPtr = ptr + Constants.OBJECT_ID_LENGTH;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/EmptyTreeIterator.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.TreeWalk\n{\n    /// <summary>\n\t/// Iterator over an empty tree (a directory with no files).\n    /// </summary>\n    public class EmptyTreeIterator : AbstractTreeIterator\n    {\n        /// <summary>\n\t\t/// Create a new iterator with no parent.\n        /// </summary>\n        public EmptyTreeIterator()\n        {\n            // Create a root empty tree.\n        }\n\n\t\t/// <summary>\n\t\t/// Create an iterator for a subtree of an existing iterator.\n\t\t/// The caller is responsible for setting up the path of the child iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"parentIterator\">Parent tree iterator.</param>\n        public EmptyTreeIterator(AbstractTreeIterator parentIterator)\n            : base(parentIterator)\n        {\n            PathLen = PathOffset;\n        }\n\n\t\t/// <summary>\n\t\t/// Create an iterator for a subtree of an existing iterator.\n\t\t/// The caller is responsible for setting up the path of the child iterator.\n\t\t/// </summary>\n\t\t/// <param name=\"parent\">Parent tree iterator.</param>\n\t\t/// <param name=\"childPath\">\n\t\t/// Path array to be used by the child iterator. This path must\n\t\t/// contain the path from the top of the walk to the first child\n\t\t/// and must end with a '/'.\n\t\t/// </param>\n\t\t/// <param name=\"childPathOffset\">\n\t\t/// position within <paramref name=\"childPath\"/> where the child can\n\t\t/// insert its data. The value at\n\t\t/// <code><paramref name=\"childPath\"/>[<paramref name=\"childPathOffset\"/>-1]</code> \n\t\t/// must be '/'.\n\t\t/// </param>\n        public EmptyTreeIterator(AbstractTreeIterator parent, byte[] childPath, int childPathOffset)\n            : base(parent, childPath, childPathOffset)\n        {\n            PathLen = childPathOffset - 1;\n        }\n\n        public override AbstractTreeIterator createSubtreeIterator(Repository repo)\n        {\n            return new EmptyTreeIterator(this);\n        }\n\n        public override ObjectId getEntryObjectId()\n        {\n            return ObjectId.ZeroId;\n        }\n\n        public override byte[] idBuffer()\n        {\n            return ZeroId;\n        }\n\n        public override int idOffset()\n        {\n            return 0;\n        }\n\n        public override bool first()\n        {\n            return true;\n        }\n\n        public override bool eof()\n        {\n            return true;\n        }\n\n        public override void next(int delta)\n        {\n            // Do nothing.\n        }\n\n        public override void back(int delta)\n        {\n            // Do nothing.\n        }\n\n        public override void stopWalk()\n        {\n            if (Parent != null)\n            {\n            \tParent.stopWalk();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/FileTreeIterator.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.TreeWalk\n{\n    /// <summary>\n    /// Working directory iterator for standard Java IO.\n    /// \n    /// This iterator uses the standard <code>java.io</code> package to Read the\n    /// specified working directory as part of a <see cref=\"TreeWalk\"/>.\n    /// </summary>\n    public class FileTreeIterator : WorkingTreeIterator\n    {\n        private readonly DirectoryInfo _directory;\n\n        /// <summary>\n        /// Create a new iterator to traverse the given directory and its children.\n        /// </summary>\n        /// <param name=\"root\">\n        /// The starting directory. This directory should correspond to\n        /// the root of the repository.\n        /// </param>\n        public FileTreeIterator(DirectoryInfo root)\n        {\n            _directory = root;\n            Init(Entries);\n        }\n\n        /// <summary>\n        /// Create a new iterator to traverse a subdirectory.\n        /// </summary>\n        /// <param name=\"p\">\n        /// The parent iterator we were created from.\n        /// </param>\n        /// <param name=\"root\">\n        /// The subdirectory. This should be a directory contained within\n        /// the parent directory.\n        /// </param>\n        public FileTreeIterator(WorkingTreeIterator p, DirectoryInfo root)\n            : base(p)\n        {\n            _directory = root;\n            Init(Entries);\n        }\n\n        public override AbstractTreeIterator createSubtreeIterator(Repository repo)\n        {\n            return new FileTreeIterator(this, ((FileEntry)Current).File as DirectoryInfo);\n        }\n\n        private Entry[] Entries\n        {\n\t\t\tget\n\t\t\t{\n\t\t\t\tFileSystemInfo[] all = null;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_directory.Refresh();\n\t\t\t\t\tall = _directory.GetFileSystemInfos();\n\t\t\t\t}\n\t\t\t\tcatch (DirectoryNotFoundException)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t}\n\n\t\t\t\tif (all == null) return Eof;\n\n\t\t\t\tvar r = new Entry[all.Length];\n\n\t\t\t\tfor (int i = 0; i < r.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tr[i] = new FileEntry(all[i]);\n\t\t\t\t}\n\n\t\t\t\treturn r;\n\t\t\t}\n        }\n\n        /// <summary>\n        /// Wrapper for a standard file\n        /// </summary>\n        public class FileEntry : Entry\n        {\n            private readonly FileSystemInfo _file;\n            private readonly FileMode _mode;\n            private long _fileLength = -1;\n            private long _lastModified;\r\n\r\n            private readonly bool _isADirectory = false;\n\n            public FileEntry(FileSystemInfo f)\n            {\n\t\t\t\t_file = f;\r\n                \r\n                if (f.IsDirectory())\r\n                {\r\n                    _isADirectory = true;\r\n                    if (PathUtil.CombineDirectoryPath((DirectoryInfo)f, Constants.DOT_GIT).IsDirectory())\r\n                        _mode = FileMode.GitLink;\r\n                    else\r\n                        _mode = FileMode.Tree;\r\n                }\r\n                else if (FS.canExecute(_file))\r\n                    _mode = FileMode.ExecutableFile;\r\n                else\r\n                    _mode = FileMode.RegularFile;\n            }\n\n            public override FileMode Mode\n            {\n                get { return _mode; }\n            }\n\n            public override string Name\n            {\n                get { return _file.Name; }\n            }\n\n            public override long Length\n            {\n                get\n                {\n                    if (_file.IsDirectory()) return 0;\n\n                    if (_fileLength < 0)\n                    {\n                        _fileLength = new FileInfo(_file.FullName).Length;\n                    }\n\n                    return _fileLength;\n                }\n            }\n\n            public override long LastModified\n            {\n                get\n                {\n                    if (_lastModified == 0)\n                    {\n                        if (_isADirectory)\r                        {\r\n                            _lastModified = ((DirectoryInfo)_file).lastModified();\r\n                        }\r                        else\r\n                        {\r\n                            _lastModified = ((FileInfo)_file).lastModified();\r                        }\n                    }\n\n                    return _lastModified;\n                }\n            }\n\n            public override FileStream OpenInputStream()\n            {\n                return new FileStream(_file.FullName, System.IO.FileMode.Open, FileAccess.Read);\n            }\n\n            /// <summary>\n            /// Get the underlying file of this entry.\n            /// </summary>\n            public FileSystemInfo File\n            {\n                get { return _file; }\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/AndTreeFilter.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n\n    /**\n     * Includes a tree entry only if all subfilters include the same tree entry.\n     * <para />\n     * Classic shortcut behavior is used, so evaluation of the\n     * {@link TreeFilter#include(TreeWalk)} method stops as soon as a false result\n     * is obtained. Applications can improve filtering performance by placing faster\n     * filters that are more likely to reject a result earlier in the list.\n     */\n    public abstract class AndTreeFilter : TreeFilter\n    {\n        /**\n         * Create a filter with two filters, both of which must match.\n         * \n         * @param a\n         *            first filter to test.\n         * @param b\n         *            second filter to test.\n         * @return a filter that must match both input filters.\n         */\n        public static TreeFilter create(TreeFilter a, TreeFilter b)\n        {\n            if (a == ALL)\n                return b;\n            if (b == ALL)\n                return a;\n            return new Binary(a, b);\n        }\n\n        /**\n         * Create a filter around many filters, all of which must match.\n         * \n         * @param list\n         *            list of filters to match against. Must contain at least 2\n         *            filters.\n         * @return a filter that must match all input filters.\n         */\n        public static TreeFilter create(TreeFilter[] list)\n        {\n\t\t\tif (list == null)\n\t\t\t\tthrow new ArgumentNullException (\"list\");\n            if (list.Length == 2)\n                return create(list[0], list[1]);\n            if (list.Length < 2)\n                throw new ArgumentException(\"At least two filters needed.\");\n            TreeFilter[] subfilters = new TreeFilter[list.Length];\n            Array.Copy(list, 0, subfilters, 0, list.Length);\n            return new List(subfilters);\n        }\n\n        /**\n         * Create a filter around many filters, all of which must match.\n         * \n         * @param list\n         *            list of filters to match against. Must contain at least 2\n         *            filters.\n         * @return a filter that must match all input filters.\n         */\n        public static TreeFilter create(IEnumerable<TreeFilter> list)\n        {\n            if (list.Count() < 2)\n                throw new ArgumentException(\"At least two filters needed.\");\n            TreeFilter[] subfilters = list.ToArray();\n            if (subfilters.Length == 2)\n                return create(subfilters[0], subfilters[1]);\n            return new List(subfilters);\n        }\n\n        private class Binary : AndTreeFilter\n        {\n            private TreeFilter a;\n\n            private TreeFilter b;\n\n            public Binary(TreeFilter one, TreeFilter two)\n            {\n                a = one;\n                b = two;\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n                return a.include(walker) && b.include(walker);\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                return a.shouldBeRecursive() || b.shouldBeRecursive();\n            }\n\n            public override TreeFilter Clone()\n            {\n                return new Binary(a.Clone(), b.Clone());\n            }\n\n            public override string ToString()\n            {\n                return \"(\" + a.ToString() + \" AND \" + b.ToString() + \")\";\n            }\n        }\n\n        private class List : AndTreeFilter\n        {\n            private TreeFilter[] subfilters;\n\n            public List(TreeFilter[] list)\n            {\n                subfilters = list;\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n                foreach (TreeFilter f in subfilters)\n                {\n                    if (!f.include(walker))\n                        return false;\n                }\n                return true;\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                foreach (TreeFilter f in subfilters)\n                    if (f.shouldBeRecursive())\n                        return true;\n                return false;\n            }\n\n            public override TreeFilter Clone()\n            {\n                TreeFilter[] s = new TreeFilter[subfilters.Length];\n                for (int i = 0; i < s.Length; i++)\n                    s[i] = subfilters[i].Clone();\n                return new List(s);\n            }\n\n            public override string ToString()\n            {\n                StringBuilder r = new StringBuilder();\n                r.Append(\"(\");\n                for (int i = 0; i < subfilters.Length; i++)\n                {\n                    if (i > 0)\n                        r.Append(\" AND \");\n                    r.Append(subfilters[i].ToString());\n                }\n                r.Append(\")\");\n                return r.ToString();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/NotTreeFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n\n    /** Includes an entry only if the subfilter does not include the entry. */\n    public class NotTreeFilter : TreeFilter\n    {\n        /**\n         * Create a filter that negates the result of another filter.\n         * \n         * @param a\n         *            filter to negate.\n         * @return a filter that does the reverse of <code>a</code>.\n         */\n        public static TreeFilter create(TreeFilter a)\n        {\n            return new NotTreeFilter(a);\n        }\n\n        private TreeFilter a;\n\n        private NotTreeFilter(TreeFilter one)\n        {\n            a = one;\n        }\n\n        public override TreeFilter negate()\n        {\n            return a;\n        }\n\n        public override bool include(TreeWalk walker)\n        {\n            return !a.include(walker);\n        }\n\n        public override bool shouldBeRecursive()\n        {\n            return a.shouldBeRecursive();\n        }\n\n        public override TreeFilter Clone()\n        {\n            TreeFilter n = a.Clone();\n            return n == a ? this : new NotTreeFilter(n);\n        }\n\n        public override string ToString()\n        {\n            return \"NOT \" + a.ToString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/OrTreeFilter.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n    /**\n     * Includes a tree entry if any subfilters include the same tree entry.\n     * <para />\n     * Classic shortcut behavior is used, so evaluation of the\n     * {@link TreeFilter#include(TreeWalk)} method stops as soon as a true result is\n     * obtained. Applications can improve filtering performance by placing faster\n     * filters that are more likely to accept a result earlier in the list.\n     */\n    public abstract class OrTreeFilter : TreeFilter\n    {\n        /**\n         * Create a filter with two filters, one of which must match.\n         * \n         * @param a\n         *            first filter to test.\n         * @param b\n         *            second filter to test.\n         * @return a filter that must match at least one input filter.\n         */\n        public static TreeFilter create(TreeFilter a, TreeFilter b)\n        {\n            if (a == ALL || b == ALL)\n                return ALL;\n            return new Binary(a, b);\n        }\n\n        /**\n         * Create a filter around many filters, one of which must match.\n         * \n         * @param list\n         *            list of filters to match against. Must contain at least 2\n         *            filters.\n         * @return a filter that must match at least one input filter.\n         */\n        public static TreeFilter create(TreeFilter[] list)\n        {\n\t\t\tif (list == null)\n\t\t\t\tthrow new ArgumentNullException (\"list\");\n            if (list.Length == 2)\n                return create(list[0], list[1]);\n            if (list.Length < 2)\n                throw new ArgumentException(\"At least two filters needed.\");\n            TreeFilter[] subfilters = new TreeFilter[list.Length];\n            Array.Copy(list, 0, subfilters, 0, list.Length);\n            return new List(subfilters);\n        }\n\n        /**\n         * Create a filter around many filters, one of which must match.\n         * \n         * @param list\n         *            list of filters to match against. Must contain at least 2\n         *            filters.\n         * @return a filter that must match at least one input filter.\n         */\n        public static TreeFilter create(IEnumerable<TreeFilter> list)\n        {\n            if (list.Count() < 2)\n                throw new ArgumentException(\"At least two filters needed.\");\n            TreeFilter[] subfilters = list.ToArray();\n            if (subfilters.Length == 2)\n                return create(subfilters[0], subfilters[1]);\n            return new List(subfilters);\n        }\n\n        private class Binary : OrTreeFilter\n        {\n            private TreeFilter a;\n\n            private TreeFilter b;\n\n            public Binary(TreeFilter one, TreeFilter two)\n            {\n                a = one;\n                b = two;\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n                return a.include(walker) || b.include(walker);\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                return a.shouldBeRecursive() || b.shouldBeRecursive();\n            }\n\n            public override TreeFilter Clone()\n            {\n                return new Binary(a.Clone(), b.Clone());\n            }\n\n            public override string ToString()\n            {\n                return \"(\" + a.ToString() + \" OR \" + b.ToString() + \")\";\n            }\n        }\n\n        private class List : OrTreeFilter\n        {\n            private TreeFilter[] subfilters;\n\n            public List(TreeFilter[] list)\n            {\n                subfilters = list;\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n                foreach (TreeFilter f in subfilters)\n                {\n                    if (f.include(walker))\n                        return true;\n                }\n                return false;\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                foreach (TreeFilter f in subfilters)\n                    if (f.shouldBeRecursive())\n                        return true;\n                return false;\n            }\n\n            public override TreeFilter Clone()\n            {\n                TreeFilter[] s = new TreeFilter[subfilters.Length];\n                for (int i = 0; i < s.Length; i++)\n                    s[i] = subfilters[i].Clone();\n                return new List(s);\n            }\n\n            public override string ToString()\n            {\n                var r = new StringBuilder();\n                r.Append(\"(\");\n                for (int i = 0; i < subfilters.Length; i++)\n                {\n                    if (i > 0)\n                        r.Append(\" OR \");\n                    r.Append(subfilters[i].ToString());\n                }\n                r.Append(\")\");\n                return r.ToString();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/PathFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n\n    /**\n     * Includes tree entries only if they match the configured path.\n     * <para />\n     * Applications should use {@link PathFilterGroup} to connect these into a tree\n     * filter graph, as the group supports breaking out of traversal once it is\n     * known the path can never match.\n     */\n    public class PathFilter : TreeFilter\n    {\n        /**\n         * Create a new tree filter for a user supplied path.\n         * <para />\n         * Path strings are relative to the root of the repository. If the user's\n         * input should be assumed relative to a subdirectory of the repository the\n         * caller must prepend the subdirectory's path prior to creating the filter.\n         * <para />\n         * Path strings use '/' to delimit directories on all platforms.\n         * \n         * @param path\n         *            the path to filter on. Must not be the empty string. All\n         *            trailing '/' characters will be trimmed before string's Length\n         *            is checked or is used as part of the constructed filter.\n         * @return a new filter for the requested path.\n         * @throws ArgumentException\n         *             the path supplied was the empty string.\n         */\n        public static PathFilter create(string path)\n        {\n\t\t\tif (path == null)\n\t\t\t\tthrow new ArgumentNullException (\"path\");\n            while (path.EndsWith(\"/\"))\n                path = path.Slice(0, path.Length - 1);\n            if (path.Length == 0)\n                throw new ArgumentException(\"Empty path not permitted.\");\n            return new PathFilter(path);\n        }\n\n        public string pathStr;\n\n        public byte[] pathRaw;\n\n        private PathFilter(string s)\n        {\n            pathStr = s;\n            pathRaw = Constants.encode(pathStr);\n        }\n\n        public override bool include(TreeWalk walker)\n        {\n\t\t\tif (walker == null)\n\t\t\t\tthrow new ArgumentNullException (\"walker\");\n            return walker.isPathPrefix(pathRaw, pathRaw.Length) == 0;\n        }\n\n        public override bool shouldBeRecursive()\n        {\n            foreach (byte b in pathRaw)\n                if (b == '/')\n                    return true;\n            return false;\n        }\n\n        public override TreeFilter Clone()\n        {\n            return this;\n        }\n\n        public override string ToString()\n        {\n            return \"PATH(\\\"\" + pathStr + \"\\\")\";\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/PathFilterGroup.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Linq;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n\n    /**\n     * Includes tree entries only if they match one or more configured paths.\n     * <para />\n     * Operates like {@link PathFilter} but causes the walk to abort as soon as the\n     * tree can no longer match any of the paths within the group. This may bypass\n     * the bool logic of a higher level AND or OR group, but does improve\n     * performance for the common case of examining one or more modified paths.\n     * <para />\n     * This filter is effectively an OR group around paths, with the early abort\n     * feature described above.\n     */\n    public static class PathFilterGroup\n    {\n        /**\n         * Create a collection of path filters from Java strings.\n         * <para />\n         * Path strings are relative to the root of the repository. If the user's\n         * input should be assumed relative to a subdirectory of the repository the\n         * caller must prepend the subdirectory's path prior to creating the filter.\n         * <para />\n         * Path strings use '/' to delimit directories on all platforms.\n         * <para />\n         * Paths may appear in any order within the collection. Sorting may be done\n         * internally when the group is constructed if doing so will improve path\n         * matching performance.\n         * \n         * @param paths\n         *            the paths to test against. Must have at least one entry.\n         * @return a new filter for the list of paths supplied.\n         */\n        public static TreeFilter createFromStrings(IEnumerable<string> paths)\n        {\n            if (paths.Count()==0)\n                throw new ArgumentException(\"At least one path is required.\");\n            PathFilter[] p = new PathFilter[paths.Count()];\n            int i = 0;\n            foreach (string s in paths)\n                p[i++] = PathFilter.create(s);\n            return create(p);\n        }\n\n        /**\n         * Create a collection of path filters.\n         * <para />\n         * Paths may appear in any order within the collection. Sorting may be done\n         * internally when the group is constructed if doing so will improve path\n         * matching performance.\n         * \n         * @param paths\n         *            the paths to test against. Must have at least one entry.\n         * @return a new filter for the list of paths supplied.\n         */\n        public static TreeFilter create(IEnumerable<PathFilter> paths)\n        {\n            if (paths.Count() == 0)\n                throw new ArgumentException(\"At least one path is required.\");\n            PathFilter[] p = paths.ToArray();\n            return create(p);\n        }\n\n        private static TreeFilter create(PathFilter[] p)\n        {\n            if (p.Length == 1)\n                return new Single(p[0]);\n            return new Group(p);\n        }\n\n        public class Single : TreeFilter\n        {\n            private PathFilter path;\n\n            private byte[] raw;\n\n            public Single(PathFilter p)\n            {\n                path = p;\n                raw = path.pathRaw;\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n\t\t\t\tif (walker == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"walker\");\n                int cmp = walker.isPathPrefix(raw, raw.Length);\n                if (cmp > 0)\n                    throw StopWalkException.INSTANCE;\n                return cmp == 0;\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                return path.shouldBeRecursive();\n            }\n\n            public override TreeFilter Clone()\n            {\n                return this;\n            }\n\n            public override string ToString()\n            {\n                return \"FAST_\" + path.ToString();\n            }\n        }\n\n        public class Group : TreeFilter\n        {\n            private static Comparison<PathFilter> PATH_SORT = new Comparison<PathFilter>((o1, o2) => o1.pathStr.CompareTo(o2.pathStr));\n\n\n            private PathFilter[] paths;\n\n            public Group(PathFilter[] p)\n            {\n                paths = p;\n                Array.Sort(paths, PATH_SORT);\n            }\n\n            public override bool include(TreeWalk walker)\n            {\n\t\t\t\tif (walker == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"walker\");\n                int n = paths.Length;\n                for (int i = 0; ; )\n                {\n                    byte[] r = paths[i].pathRaw;\n                    int cmp = walker.isPathPrefix(r, r.Length);\n                    if (cmp == 0)\n                        return true;\n                    if (++i < n)\n                        continue;\n                    if (cmp > 0)\n                        throw StopWalkException.INSTANCE;\n                    return false;\n                }\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                foreach (PathFilter p in paths)\n                    if (p.shouldBeRecursive())\n                        return true;\n                return false;\n            }\n\n            public override TreeFilter Clone()\n            {\n                return this;\n            }\n\n            public override string ToString()\n            {\n                StringBuilder r = new StringBuilder();\n                r.Append(\"FAST(\");\n                for (int i = 0; i < paths.Length; i++)\n                {\n                    if (i > 0)\n                        r.Append(\" OR \");\n                    r.Append(paths[i].ToString());\n                }\n                r.Append(\")\");\n                return r.ToString();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/PathSuffixFilter.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n    /**\n     * Includes tree entries only if they match the configured path.\n     */\n    public class PathSuffixFilter : TreeFilter\n    {\n\n        /**\n         * Create a new tree filter for a user supplied path.\n         * <para />\n         * Path strings use '/' to delimit directories on all platforms.\n         *\n         * @param path\n         *            the path (suffix) to filter on. Must not be the empty string.\n         * @return a new filter for the requested path.\n         * @throws IllegalArgumentException\n         *             the path supplied was the empty string.\n         */\n        public static PathSuffixFilter create(string path)\n        {\n\t\t\tif (path == null)\n\t\t\t\tthrow new ArgumentNullException (\"path\");\n            if (path.Length == 0)\n                throw new ArgumentException(\"Empty path not permitted.\");\n            return new PathSuffixFilter(path);\n        }\n\n        string pathStr;\n        byte[] pathRaw;\n\n        private PathSuffixFilter(string s)\n        {\n            pathStr = s;\n            pathRaw = Constants.encode(pathStr);\n        }\n\n\n        public override TreeFilter Clone()\n        {\n            return this;\n        }\n\n        public override bool include(TreeWalk walker)\n        {\n\t\t\tif (walker == null)\n\t\t\t\tthrow new ArgumentNullException (\"walker\");\n            if (walker.isSubtree())\n                return true;\n            else\n                return walker.isPathSuffix(pathRaw, pathRaw.Length);\n\n        }\n\n        public override bool shouldBeRecursive()\n        {\n            return true;\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeWalk/Filter/TreeFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nnamespace GitSharp.Core.TreeWalk.Filter\n{\n\n\n    /**\n     * Selects interesting tree entries during walking.\n     * <para />\n     * This is an abstract interface. Applications may implement a subclass, or use\n     * one of the predefined implementations already available within this package.\n     * <para />\n     * Unless specifically noted otherwise a TreeFilter implementation is not thread\n     * safe and may not be shared by different TreeWalk instances at the same time.\n     * This restriction allows TreeFilter implementations to cache state within\n     * their instances during {@link #include(TreeWalk)} if it is beneficial to\n     * their implementation. Deep clones created by {@link #Clone()} may be used to\n     * construct a thread-safe copy of an existing filter.\n     * \n     * <para />\n     * <b>Path filters:</b>\n     * <ul>\n     * <li>Matching pathname: {@link PathFilter}</li>\n     * </ul>\n     * \n     * <para />\n     * <b>Difference filters:</b>\n     * <ul>\n     * <li>Only select differences: {@link #ANY_DIFF}.</li>\n     * </ul>\n     * \n     * <para />\n     * <b>Boolean modifiers:</b>\n     * <ul>\n     * <li>AND: {@link AndTreeFilter}</li>\n     * <li>OR: {@link OrTreeFilter}</li>\n     * <li>NOT: {@link NotTreeFilter}</li>\n     * </ul>\n     */\n    public abstract class TreeFilter\n    {\n        /** Selects all tree entries. */\n        public static TreeFilter ALL = new TreeFilter_ALL();\n\n        private class TreeFilter_ALL : TreeFilter\n        {\n            public override bool include(TreeWalk walker)\n            {\n                return true;\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                return false;\n            }\n\n            public override TreeFilter Clone()\n            {\n                return this;\n            }\n\n            public override string ToString()\n            {\n                return \"ALL\";\n            }\n        }\n\n        /**\n         * Selects only tree entries which differ between at least 2 trees.\n         * <para />\n         * This filter also prevents a TreeWalk from recursing into a subtree if all\n         * parent trees have the identical subtree at the same path. This\n         * dramatically improves walk performance as only the changed subtrees are\n         * entered into.\n         * <para />\n         * If this filter is applied to a walker with only one tree it behaves like\n         * {@link #ALL}, or as though the walker was matching a virtual empty tree\n         * against the single tree it was actually given. Applications may wish to\n         * treat such a difference as \"all names added\".\n         */\n        public static TreeFilter ANY_DIFF = new TreeFilter_ANY_DIFF();\n\n        private class TreeFilter_ANY_DIFF : TreeFilter\n        {\n            private static int baseTree = 0;\n\n            public override bool include(TreeWalk walker)\n            {\n                int n = walker.getTreeCount();\n                if (n == 1) // Assume they meant difference to empty tree.\n                    return true;\n\n                int m = walker.getRawMode(baseTree);\n                for (int i = 1; i < n; i++)\n                    if (walker.getRawMode(i) != m || !walker.idEqual(i, baseTree))\n                        return true;\n                return false;\n            }\n\n            public override bool shouldBeRecursive()\n            {\n                return false;\n            }\n\n            public override TreeFilter Clone()\n            {\n                return this;\n            }\n\n            public override string ToString()\n            {\n                return \"ANY_DIFF\";\n            }\n        }\n\n        /**\n         * Create a new filter that does the opposite of this filter.\n         * \n         * @return a new filter that includes tree entries this filter rejects.\n         */\n        public virtual TreeFilter negate()\n        {\n            return NotTreeFilter.create(this);\n        }\n\n        /**\n         * Determine if the current entry is interesting to report.\n         * <para />\n         * This method is consulted for subtree entries even if\n         * {@link TreeWalk#isRecursive()} is enabled. The consultation allows the\n         * filter to bypass subtree recursion on a case-by-case basis, even when\n         * recursion is enabled at the application level.\n         * \n         * @param walker\n         *            the walker the filter needs to examine.\n         * @return true if the current entry should be seen by the application;\n         *         false to hide the entry.\n         * @throws MissingObjectException\n         *             an object the filter needs to consult to determine its answer\n         *             does not exist in the Git repository the walker is operating\n         *             on. Filtering this current walker entry is impossible without\n         *             the object.\n         * @throws IncorrectObjectTypeException\n         *             an object the filter needed to consult was not of the\n         *             expected object type. This usually indicates a corrupt\n         *             repository, as an object link is referencing the wrong type.\n         * @throws IOException\n         *             a loose object or pack file could not be Read to obtain data\n         *             necessary for the filter to make its decision.\n         */\n        public abstract bool include(TreeWalk walker);\n\n        /**\n         * Does this tree filter require a recursive walk to match everything?\n         * <para />\n         * If this tree filter is matching on full entry path names and its pattern\n         * is looking for a '/' then the filter would require a recursive TreeWalk\n         * to accurately make its decisions. The walker is not required to enable\n         * recursive behavior for any particular filter, this is only a hint.\n         * \n         * @return true if the filter would like to have the walker recurse into\n         *         subtrees to make sure it matches everything correctly; false if\n         *         the filter does not require entering subtrees.\n         */\n        public abstract bool shouldBeRecursive();\n\n        /**\n         * Clone this tree filter, including its parameters.\n         * <para />\n         * This is a deep Clone. If this filter embeds objects or other filters it\n         * must also Clone those, to ensure the instances do not share mutable data.\n         * \n         * @return another copy of this filter, suitable for another thread.\n         */\n        public abstract TreeFilter Clone();\n\n        public override string ToString()\n        {\n            string n =GetType().Name;\n            int lastDot = n.LastIndexOf('.');\n            if (lastDot >= 0)\n            {\n                n = n.Substring(lastDot + 1);\n            }\n            return n.Replace('$', '.');\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/TreeWalk/NameConflictTreeWalk.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core.TreeWalk\n{\n    /**\n     * Specialized TreeWalk to detect directory-file (D/F) name conflicts.\n     * <para />\n     * Due to the way a Git tree is organized the standard {@link TreeWalk} won't\n     * easily find a D/F conflict when merging two or more trees together. In the\n     * standard TreeWalk the file will be returned first, and then much later the\n     * directory will be returned. This makes it impossible for the application to\n     * efficiently detect and handle the conflict.\n     * <para />\n     * Using this walk implementation causes the directory to report earlier than\n     * usual, at the same time as the non-directory entry. This permits the\n     * application to handle the D/F conflict in a single step. The directory is\n     * returned only once, so it does not get returned later in the iteration.\n     * <para />\n     * When a D/F conflict is detected {@link TreeWalk#isSubtree()} will return true\n     * and {@link TreeWalk#enterSubtree()} will recurse into the subtree, no matter\n     * which iterator originally supplied the subtree.\n     * <para />\n     * Because conflicted directories report early, using this walk implementation\n     * to populate a {@link DirCacheBuilder} may cause the automatic resorting to\n     * run and fix the entry ordering.\n     * <para />\n     * This walk implementation requires more CPU to implement a look-ahead and a\n     * look-behind to merge a D/F pair together, or to skip a previously reported\n     * directory. In typical Git repositories the look-ahead cost is 0 and the\n     * look-behind doesn't trigger, as users tend not to Create trees which contain\n     * both \"foo\" as a directory and \"foo.c\" as a file.\n     * <para />\n     * In the worst-case however several thousand look-ahead steps per walk step may\n     * be necessary, making the overhead quite significant. Since this worst-case\n     * should never happen this walk implementation has made the time/space tradeoff\n     * in favor of more-time/less-space, as that better suits the typical case.\n     */\n    public class NameConflictTreeWalk : TreeWalk\n    {\n        private static readonly int TreeMode = FileMode.Tree.Bits;\n        private bool _fastMinHasMatch;\n\n        /**\n         * Create a new tree walker for a given repository.\n         *\n         * @param repo\n         *            the repository the walker will obtain data from.\n         */\n        public NameConflictTreeWalk(Repository repo)\n            : base(repo)\n        {\n        }\n\n        public override AbstractTreeIterator min()\n        {\n            while (true)\n            {\n                AbstractTreeIterator minRef = FastMin();\n                if (_fastMinHasMatch)\n                {\n                \treturn minRef;\n                }\n\n                if (IsTree(minRef))\n                {\n                    if (SkipEntry(minRef))\n                    {\n                        foreach (AbstractTreeIterator t in Trees)\n                        {\n                        \tif (t.Matches != minRef) continue;\n                        \tt.next(1);\n                        \tt.Matches = null;\n                        }\n\n                        continue;\n                    }\n\n                    return minRef;\n                }\n\n                return CombineDF(minRef);\n            }\n        }\n\n        private AbstractTreeIterator FastMin()\n        {\n            _fastMinHasMatch = true;\n\n            int i = 0;\n            AbstractTreeIterator minRef = Trees[i];\n            while (minRef.eof() && ++i < Trees.Length)\n            {\n            \tminRef = Trees[i];\n            }\n\n            if (minRef.eof())\n            {\n            \treturn minRef;\n            }\n\n            minRef.Matches = minRef;\n            while (++i < Trees.Length)\n            {\n                AbstractTreeIterator t = Trees[i];\n                if (t.eof())\n                {\n                \tcontinue;\n                }\n\n                int cmp = t.pathCompare(minRef);\n                if (cmp < 0)\n                {\n                    if (_fastMinHasMatch && IsTree(minRef) && !IsTree(t)\n                            && NameEqual(minRef, t))\n                    {\n                        // We used to be at a tree, but now we are at a file\n                        // with the same name. Allow the file to match the\n                        // tree anyway.\n                        //\n                        t.Matches = minRef;\n                    }\n                    else\n                    {\n                        _fastMinHasMatch = false;\n                        t.Matches = t;\n                        minRef = t;\n                    }\n                }\n                else if (cmp == 0)\n                {\n                    // Exact name/mode match is best.\n                    //\n                    t.Matches = minRef;\n                }\n                else if (_fastMinHasMatch && IsTree(t) && !IsTree(minRef)\n                      && NameEqual(t, minRef))\n                {\n                    // The minimum is a file (non-tree) but the next entry\n                    // of this iterator is a tree whose name matches our file.\n                    // This is a classic D/F conflict and commonly occurs like\n                    // this, with no gaps in between the file and directory.\n                    //\n                    // Use the tree as the minimum instead (see CombineDF).\n                    //\n\n                    for (int k = 0; k < i; k++)\n                    {\n                        AbstractTreeIterator p = Trees[k];\n                        if (p.Matches == minRef)\n                        {\n                        \tp.Matches = t;\n                        }\n                    }\n\n                    t.Matches = t;\n                    minRef = t;\n                }\n                else\n                {\n                \t_fastMinHasMatch = false;\n                }\n            }\n\n            return minRef;\n        }\n\n        private static bool NameEqual(AbstractTreeIterator a,\n                 AbstractTreeIterator b)\n        {\n            return a.pathCompare(b, TreeMode) == 0;\n        }\n\n        private static bool IsTree(AbstractTreeIterator p)\n        {\n            return FileMode.Tree == p.EntryFileMode;\n        }\n\n        private bool SkipEntry(AbstractTreeIterator minRef)\n        {\n            // A tree D/F may have been handled earlier. We need to\n            // not report this path if it has already been reported.\n            //\n            foreach (AbstractTreeIterator t in Trees)\n            {\n                if (t.Matches == minRef || t.first()) continue;\n\n                int stepsBack = 0;\n                while (true)\n                {\n                    stepsBack++;\n                    t.back(1);\n\n                    int cmp = t.pathCompare(minRef, 0);\n                    if (cmp == 0)\n                    {\n                        // We have already seen this \"$path\" before. Skip it.\n                        //\n                        t.next(stepsBack);\n                        return true;\n                    }\n\n                \tif (cmp >= 0 && !t.first()) continue;\n\n                \t// We cannot find \"$path\" in t; it will never appear.\n                \t//\n                \tt.next(stepsBack);\n                \tbreak;\n                }\n            }\n\n            // We have never seen the current path before.\n            //\n            return false;\n        }\n\n        private AbstractTreeIterator CombineDF(AbstractTreeIterator minRef)\n        {\n            // Look for a possible D/F conflict forward in the tree(s)\n            // as there may be a \"$path/\" which matches \"$path\". Make\n            // such entries match this entry.\n            //\n            AbstractTreeIterator treeMatch = null;\n            foreach (AbstractTreeIterator t in Trees)\n            {\n                if (t.Matches == minRef || t.eof()) continue;\n\n                for (; ; )\n                {\n                    int cmp = t.pathCompare(minRef, TreeMode);\n                    if (cmp < 0)\n                    {\n                        // The \"$path/\" may still appear later.\n                        //\n                        t.MatchShift++;\n                        t.next(1);\n                        if (t.eof())\n                        {\n                            t.back(t.MatchShift);\n                            t.MatchShift = 0;\n                            break;\n                        }\n                    }\n                    else if (cmp == 0)\n                    {\n                        // We have a conflict match here.\n                        //\n                        t.Matches = minRef;\n                        treeMatch = t;\n                        break;\n                    }\n                    else\n                    {\n                        // A conflict match is not possible.\n                        //\n                        if (t.MatchShift != 0)\n                        {\n                            t.back(t.MatchShift);\n                            t.MatchShift = 0;\n                        }\n                        break;\n                    }\n                }\n            }\n\n            if (treeMatch != null)\n            {\n                // If we do have a conflict use one of the directory\n                // matching iterators instead of the file iterator.\n                // This way isSubtree is true and isRecursive works.\n                //\n                foreach (AbstractTreeIterator t in Trees)\n                {\n                \tif (t.Matches == minRef)\n                \t{\n                \t\tt.Matches = treeMatch;\n                \t}\n                }\n\n                return treeMatch;\n            }\n\n            return minRef;\n        }\n\n        public override void popEntriesEqual()\n        {\n            AbstractTreeIterator ch = CurrentHead;\n            for (int i = 0; i < Trees.Length; i++)\n            {\n                AbstractTreeIterator t = Trees[i];\n                if (t.Matches == ch)\n                {\n                    if (t.MatchShift == 0)\n                    {\n                    \tt.next(1);\n                    }\n                    else\n                    {\n                        t.back(t.MatchShift);\n                        t.MatchShift = 0;\n                    }\n                    t.Matches = null;\n                }\n            }\n        }\n\n        public override void skipEntriesEqual()\n        {\n            AbstractTreeIterator ch = CurrentHead;\n            for (int i = 0; i < Trees.Length; i++)\n            {\n                AbstractTreeIterator t = Trees[i];\n            \tif (t.Matches != ch) continue;\n\n            \tif (t.MatchShift == 0)\n            \t{\n            \t\tt.skip();\n            \t}\n            \telse\n            \t{\n            \t\tt.back(t.MatchShift);\n            \t\tt.MatchShift = 0;\n            \t}\n\n            \tt.Matches = null;\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/TreeWalk.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.TreeWalk\n{\n\t/**\n\t * Walks one or more {@link AbstractTreeIterator}s in parallel.\n\t * <para />\n\t * This class can perform n-way differences across as many trees as necessary.\n\t * <para />\n\t * Each tree added must have the same root as existing trees in the walk.\n\t * <para />\n\t * A TreeWalk instance can only be used once to generate results. Running a\n\t * second time requires creating a new TreeWalk instance, or invoking\n\t * {@link #reset()} and adding new trees before starting again. Resetting an\n\t * existing instance may be faster for some applications as some internal\n\t * buffers may be recycled.\n\t * <para />\n\t * TreeWalk instances are not thread-safe. Applications must either restrict\n\t * usage of a TreeWalk instance to a single thread, or implement their own\n\t * synchronization at a higher level.\n\t * <para />\n\t * Multiple simultaneous TreeWalk instances per {@link Repository} are\n\t * permitted, even from concurrent threads.\n\t */\n\tpublic class TreeWalk\n\t{\n\t\t/**\n\t\t * Open a tree walk and filter to exactly one path.\n\t\t * <para />\n\t\t * The returned tree walk is already positioned on the requested path, so\n\t\t * the caller should not need to invoke {@link #next()} unless they are\n\t\t * looking for a possible directory/file name conflict.\n\t\t * \n\t\t * @param db\n\t\t *            repository to Read tree object data from.\n\t\t * @param path\n\t\t *            single path to advance the tree walk instance into.\n\t\t * @param trees\n\t\t *            one or more trees to walk through, all with the same root.\n\t\t * @return a new tree walk configured for exactly this one path; null if no\n\t\t *         path was found in any of the trees.\n\t\t * @throws IOException\n\t\t *             reading a pack file or loose object failed.\n\t\t * @throws CorruptObjectException\n\t\t *             an tree object could not be Read as its data stream did not\n\t\t *             appear to be a tree, or could not be inflated.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             an object we expected to be a tree was not a tree.\n\t\t * @throws MissingObjectException\n\t\t *             a tree object was not found.\n\t\t */\n\n\t\tpublic static TreeWalk ForPath(Repository db, string path, params AnyObjectId[] trees)\n\t\t{\n\t\t\tvar r = new TreeWalk(db);\n\t\t\tr.Recursive = r.getFilter().shouldBeRecursive();\n\n\t\t\tr.setFilter(PathFilterGroup.createFromStrings(new HashSet<string> { path }));\n\t\t\tr.reset(trees);\n\t\t\treturn r.next() ? r : null;\n\t\t}\n\n\t\t/**\n\t\t * Open a tree walk and filter to exactly one path.\n\t\t * <para />\n\t\t * The returned tree walk is already positioned on the requested path, so\n\t\t * the caller should not need to invoke {@link #next()} unless they are\n\t\t * looking for a possible directory/file name conflict.\n\t\t * \n\t\t * @param db\n\t\t *            repository to Read tree object data from.\n\t\t * @param path\n\t\t *            single path to advance the tree walk instance into.\n\t\t * @param tree\n\t\t *            the single tree to walk through.\n\t\t * @return a new tree walk configured for exactly this one path; null if no\n\t\t *         path was found in any of the trees.\n\t\t * @throws IOException\n\t\t *             reading a pack file or loose object failed.\n\t\t * @throws CorruptObjectException\n\t\t *             an tree object could not be Read as its data stream did not\n\t\t *             appear to be a tree, or could not be inflated.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             an object we expected to be a tree was not a tree.\n\t\t * @throws MissingObjectException\n\t\t *             a tree object was not found.\n\t\t */\n\t\tpublic static TreeWalk ForPath(Repository db, string path, RevTree tree)\n\t\t{\n\t\t\treturn ForPath(db, path, new ObjectId[] { tree });\n\t\t}\n\n\t\tprivate readonly Repository _db;\n\t\tprivate readonly MutableObjectId _idBuffer;\n\t\tprivate readonly WindowCursor _cursor;\n\n\t\tprivate TreeFilter _filter;\n\t\tprivate AbstractTreeIterator[] _trees;\n\t\tprivate int _depth;\n\t\tprivate bool _advance;\n\t\tprivate bool _postChildren;\n\t\tprivate AbstractTreeIterator _currentHead;\n\n\t\t/// <summary>\n\t\t/// Create a new tree walker for a given repository.\n\t\t/// </summary>\n\t\t/// <param name=\"repo\">\n\t\t/// The repository the walker will obtain data from.\n\t\t/// </param>\n\t\tpublic TreeWalk(Repository repo)\n\t\t{\n\t\t\t_idBuffer = new MutableObjectId();\n\t\t\t_cursor = new WindowCursor();\n\n\t\t\t_db = repo;\n\t\t\t_filter = TreeFilter.ALL;\n\t\t\t_trees = new AbstractTreeIterator[] { new EmptyTreeIterator() };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the repository this tree walker is reading from.\n\t\t/// </summary>\n\t\tpublic Repository Repository\n\t\t{\n\t\t\tget { return _db; }\n\t\t}\n\n\t\t/**\n\t\t * Get the currently configured filter.\n\t\t * \n\t\t * @return the current filter. Never null as a filter is always needed.\n\t\t */\n\t\tpublic TreeFilter getFilter()\n\t\t{\n\t\t\treturn _filter;\n\t\t}\n\n\t\t/**\n\t\t * Set the tree entry filter for this walker.\n\t\t * <para />\n\t\t * Multiple filters may be combined by constructing an arbitrary tree of\n\t\t * <code>AndTreeFilter</code> or <code>OrTreeFilter</code> instances to\n\t\t * describe the bool expression required by the application. Custom\n\t\t * filter implementations may also be constructed by applications.\n\t\t * <para />\n\t\t * Note that filters are not thread-safe and may not be shared by concurrent\n\t\t * TreeWalk instances. Every TreeWalk must be supplied its own unique\n\t\t * filter, unless the filter implementation specifically states it is (and\n\t\t * always will be) thread-safe. Callers may use {@link TreeFilter#Clone()}\n\t\t * to Create a unique filter tree for this TreeWalk instance.\n\t\t * \n\t\t * @param newFilter\n\t\t *            the new filter. If null the special {@link TreeFilter#ALL}\n\t\t *            filter will be used instead, as it matches every entry.\n\t\t * @see org.spearce.jgit.treewalk.filter.AndTreeFilter\n\t\t * @see org.spearce.jgit.treewalk.filter.OrTreeFilter\n\t\t */\n\t\tpublic void setFilter(TreeFilter newFilter)\n\t\t{\n\t\t\t_filter = newFilter ?? TreeFilter.ALL;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Is this walker automatically entering into subtrees?\n\t\t/// <para />\n\t\t/// If recursive mode is enabled the walker will hide subtree nodes from the\n\t\t/// calling application and will produce only file level nodes. If a tree\n\t\t/// (directory) is deleted then all of the file level nodes will appear to be\n\t\t/// deleted, recursively, through as many levels as necessary to account for\n\t\t/// all entries.\n\t\t/// </summary>\n\t\tpublic bool Recursive { get; set; }\n\n\t\t/**\n\t\t * Does this walker return a tree entry After it exits the subtree?\n\t\t * <para />\n\t\t * If post order traversal is enabled then the walker will return a subtree\n\t\t * After it has returned the last entry within that subtree. This may cause\n\t\t * a subtree to be seen by the application twice if {@link #isRecursive()}\n\t\t * is false, as the application will see it once, call\n\t\t * {@link #enterSubtree()}, and then see it again as it leaves the subtree.\n\t\t * <para />\n\t\t * If an application does not enable {@link #isRecursive()} and it does not\n\t\t * call {@link #enterSubtree()} then the tree is returned only once as none\n\t\t * of the children were processed.\n\t\t *\n\t\t * @return true if subtrees are returned After entries within the subtree.\n\t\t */\n\t\tpublic bool PostOrderTraversal { get; set; }\n\n\t\t/// <summary>\n\t\t/// Reset this walker so new tree iterators can be added to it.\n\t\t/// </summary>\n\t\tpublic void reset()\n\t\t{\n\t\t\t_trees = new AbstractTreeIterator[0];\n\t\t\t_advance = false;\n\t\t\t_depth = 0;\n\t\t}\n\n\t\t/**\n\t\t * Reset this walker to run over a single existing tree.\n\t\t *\n\t\t * @param id\n\t\t *            the tree we need to parse. The walker will execute over this\n\t\t *            single tree if the reset is successful.\n\t\t * @throws MissingObjectException\n\t\t *             the given tree object does not exist in this repository.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             the given object id does not denote a tree, but instead names\n\t\t *             some other non-tree type of object. Note that commits are not\n\t\t *             trees, even if they are sometimes called a \"tree-ish\".\n\t\t * @throws CorruptObjectException\n\t\t *             the object claimed to be a tree, but its contents did not\n\t\t *             appear to be a tree. The repository may have data corruption.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic void reset(AnyObjectId id)\n\t\t{\n\t\t\tif (_trees.Length == 1)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator iterator = _trees[0];\n\t\t\t\twhile (iterator.Parent != null)\n\t\t\t\t{\n\t\t\t\t\titerator = iterator.Parent;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCanonicalTreeParser oParse = (iterator as CanonicalTreeParser);\n\t\t\t\tif (oParse != null)\n\t\t\t\t{\n\t\t\t\t\titerator.Matches = null;\n\t\t\t\t\titerator.MatchShift = 0;\n\n\t\t\t\t\toParse.reset(_db, id, _cursor);\n\t\t\t\t\t_trees[0] = iterator;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_trees[0] = ParserFor(id);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_trees = new AbstractTreeIterator[] { ParserFor(id) };\n\t\t\t}\n\n\t\t\t_advance = false;\n\t\t\t_depth = 0;\n\t\t}\n\n\t\t/**\n\t\t * Reset this walker to run over a set of existing trees.\n\t\t * \n\t\t * @param ids\n\t\t *            the trees we need to parse. The walker will execute over this\n\t\t *            many parallel trees if the reset is successful.\n\t\t * @throws MissingObjectException\n\t\t *             the given tree object does not exist in this repository.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             the given object id does not denote a tree, but instead names\n\t\t *             some other non-tree type of object. Note that commits are not\n\t\t *             trees, even if they are sometimes called a \"tree-ish\".\n\t\t * @throws CorruptObjectException\n\t\t *             the object claimed to be a tree, but its contents did not\n\t\t *             appear to be a tree. The repository may have data corruption.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic void reset(AnyObjectId[] ids)\n\t\t{\n\t\t\tif (ids==null)\n\t\t\t\tthrow new ArgumentNullException(\"ids\");\n\t\t\tint oldLen = _trees.Length;\n\t\t\tint newLen = ids.Length;\n\t\t\tAbstractTreeIterator[] r = newLen == oldLen ? _trees : new AbstractTreeIterator[newLen];\n\t\t\tfor (int i = 0; i < newLen; i++)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator iterator;\n\n\t\t\t\tif (i < oldLen)\n\t\t\t\t{\n\t\t\t\t\titerator = _trees[i];\n\t\t\t\t\twhile (iterator.Parent != null)\n\t\t\t\t\t{\n\t\t\t\t\t\titerator = iterator.Parent;\n\t\t\t\t\t}\n\n\t\t\t\t\tCanonicalTreeParser oParse = (iterator as CanonicalTreeParser);\n\t\t\t\t\tif (oParse != null && iterator.PathOffset == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titerator.Matches = null;\n\t\t\t\t\t\titerator.MatchShift = 0;\n\t\t\t\t\t\toParse.reset(_db, ids[i], _cursor);\n\t\t\t\t\t\tr[i] = iterator;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\titerator = ParserFor(ids[i]);\n\t\t\t\tr[i] = iterator;\n\t\t\t}\n\n\t\t\t_trees = r;\n\t\t\t_advance = false;\n\t\t\t_depth = 0;\n\t\t}\n\n\t\t/**\n\t\t * Add an already existing tree object for walking.\n\t\t * <para />\n\t\t * The position of this tree is returned to the caller, in case the caller\n\t\t * has lost track of the order they added the trees into the walker.\n\t\t * <para />\n\t\t * The tree must have the same root as existing trees in the walk.\n\t\t * \n\t\t * @param id\n\t\t *            identity of the tree object the caller wants walked.\n\t\t * @return position of this tree within the walker.\n\t\t * @throws MissingObjectException\n\t\t *             the given tree object does not exist in this repository.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             the given object id does not denote a tree, but instead names\n\t\t *             some other non-tree type of object. Note that commits are not\n\t\t *             trees, even if they are sometimes called a \"tree-ish\".\n\t\t * @throws CorruptObjectException\n\t\t *             the object claimed to be a tree, but its contents did not\n\t\t *             appear to be a tree. The repository may have data corruption.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic int addTree(ObjectId id)\n\t\t{\n\t\t\treturn addTree(ParserFor(id));\n\t\t}\n\n\t\t/**\n\t\t * Add an already created tree iterator for walking.\n\t\t * <para />\n\t\t * The position of this tree is returned to the caller, in case the caller\n\t\t * has lost track of the order they added the trees into the walker.\n\t\t * <para />\n\t\t * The tree which the iterator operates on must have the same root as\n\t\t * existing trees in the walk.\n\t\t * \n\t\t * @param parentIterator\n\t\t *            an iterator to walk over. The iterator should be new, with no\n\t\t *            parent, and should still be positioned before the first entry.\n\t\t *            The tree which the iterator operates on must have the same root\n\t\t *            as other trees in the walk.\n\t\t *\n\t\t * @return position of this tree within the walker.\n\t\t * @throws CorruptObjectException\n\t\t *             the iterator was unable to obtain its first entry, due to\n\t\t *             possible data corruption within the backing data store.\n\t\t */\n\t\tpublic int addTree(AbstractTreeIterator parentIterator)\n\t\t{\n\t\t\tif (parentIterator == null)\n\t\t\t\tthrow new ArgumentNullException (\"parentIterator\");\n\t\t\tint n = _trees.Length;\n\t\t\tvar newTrees = new AbstractTreeIterator[n + 1];\n\n\t\t\tArray.Copy(_trees, 0, newTrees, 0, n);\n\t\t\tnewTrees[n] = parentIterator;\n\t\t\tparentIterator.Matches = null;\n\t\t\tparentIterator.MatchShift = 0;\n\n\t\t\t_trees = newTrees;\n\t\t\treturn n;\n\t\t}\n\n\t\t/**\n\t\t * Get the number of trees known to this walker.\n\t\t * \n\t\t * @return the total number of trees this walker is iterating over.\n\t\t */\n\t\tpublic int getTreeCount()\n\t\t{\n\t\t\treturn _trees.Length;\n\t\t}\n\n\t\t/**\n\t\t * Advance this walker to the next relevant entry.\n\t\t * \n\t\t * @return true if there is an entry available; false if all entries have\n\t\t *         been walked and the walk of this set of tree iterators is over.\n\t\t * @throws MissingObjectException\n\t\t *             {@link #isRecursive()} was enabled, a subtree was found, but\n\t\t *             the subtree object does not exist in this repository. The\n\t\t *             repository may be missing objects.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             {@link #isRecursive()} was enabled, a subtree was found, and\n\t\t *             the subtree id does not denote a tree, but instead names some\n\t\t *             other non-tree type of object. The repository may have data\n\t\t *             corruption.\n\t\t * @throws CorruptObjectException\n\t\t *             the contents of a tree did not appear to be a tree. The\n\t\t *             repository may have data corruption.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic bool next()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (_advance)\n\t\t\t\t{\n\t\t\t\t\t_advance = false;\n\t\t\t\t\t_postChildren = false;\n\t\t\t\t\tpopEntriesEqual();\n\t\t\t\t}\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tAbstractTreeIterator t = min();\n\t\t\t\t\tif (t.eof())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_depth > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tExitSubtree();\n\t\t\t\t\t\t\tif (PostOrderTraversal)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_advance = true;\n\t\t\t\t\t\t\t\t_postChildren = true;\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpopEntriesEqual();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t_currentHead = t;\n\t\t\t\t\tif (!_filter.include(this))\n\t\t\t\t\t{\n\t\t\t\t\t\tskipEntriesEqual();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Recursive && FileMode.Tree == t.EntryFileMode)\n\t\t\t\t\t{\n\t\t\t\t\t\tenterSubtree();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t_advance = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (StopWalkException)\n\t\t\t{\n\t\t\t\tforeach (AbstractTreeIterator t in _trees)\n\t\t\t\t\tt.stopWalk();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Obtain the tree iterator for the current entry.\n\t\t/// <para />\n\t\t/// Entering into (or exiting out of) a subtree causes the current tree\n\t\t/// iterator instance to be changed for the nth tree. This allows the tree\n\t\t/// iterators to manage only one list of items, with the diving handled by\n\t\t/// recursive trees.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">type of the tree iterator expected by the caller.</typeparam>\n\t\t/// <param name=\"nth\">tree to obtain the current iterator of.</param>\n\t\t/// <param name=\"clazz\">type of the tree iterator expected by the caller.</param>\n\t\t/// <returns>\n\t\t/// The current iterator of the requested type; null if the tree\n\t\t/// has no entry to match the current path.\n\t\t/// </returns>\n\t\tpublic T getTree<T>(int nth, Type clazz) // [henon] was Class<T> clazz\n\t\t\twhere T : AbstractTreeIterator\n\t\t{\n\t\t\tAbstractTreeIterator t = _trees[nth];\n\t\t\treturn t.Matches == _currentHead ? (T)t : null;\n\t\t}\n\n\t\t/**\n\t\t * Obtain the raw {@link FileMode} bits for the current entry.\n\t\t * <para />\n\t\t * Every added tree supplies mode bits, even if the tree does not contain\n\t\t * the current entry. In the latter case {@link FileMode#MISSING}'s mode\n\t\t * bits (0) are returned.\n\t\t * \n\t\t * @param nth\n\t\t *            tree to obtain the mode bits from.\n\t\t * @return mode bits for the current entry of the nth tree.\n\t\t * @see FileMode#FromBits(int)\n\t\t */\n\t\tpublic int getRawMode(int nth)\n\t\t{\n\t\t\tAbstractTreeIterator t = _trees[nth];\n\t\t\treturn t.Matches == _currentHead ? t.Mode : 0;\n\t\t}\n\n\t\t/**\n\t\t * Obtain the {@link FileMode} for the current entry.\n\t\t * <para />\n\t\t * Every added tree supplies a mode, even if the tree does not contain the\n\t\t * current entry. In the latter case {@link FileMode#MISSING} is returned.\n\t\t * \n\t\t * @param nth\n\t\t *            tree to obtain the mode from.\n\t\t * @return mode for the current entry of the nth tree.\n\t\t */\n\t\tpublic FileMode getFileMode(int nth)\n\t\t{\n\t\t\treturn FileMode.FromBits(getRawMode(nth));\n\t\t}\n\n\t\t/**\n\t\t * Obtain the ObjectId for the current entry.\n\t\t * <para />\n\t\t * Using this method to compare ObjectId values between trees of this walker\n\t\t * is very inefficient. Applications should try to use\n\t\t * {@link #idEqual(int, int)} or {@link #getObjectId(MutableObjectId, int)}\n\t\t * whenever possible.\n\t\t * <para />\n\t\t * Every tree supplies an object id, even if the tree does not contain the\n\t\t * current entry. In the latter case {@link ObjectId#zeroId()} is returned.\n\t\t * \n\t\t * @param nth\n\t\t *            tree to obtain the object identifier from.\n\t\t * @return object identifier for the current tree entry.\n\t\t * @see #getObjectId(MutableObjectId, int)\n\t\t * @see #idEqual(int, int)\n\t\t */\n\t\tpublic ObjectId getObjectId(int nth)\n\t\t{\n\t\t\tAbstractTreeIterator t = _trees[nth];\n\t\t\treturn t.Matches == _currentHead ? t.getEntryObjectId() : ObjectId.ZeroId;\n\t\t}\n\n\t\t/**\n\t\t * Obtain the ObjectId for the current entry.\n\t\t * <para />\n\t\t * Every tree supplies an object id, even if the tree does not contain the\n\t\t * current entry. In the latter case {@link ObjectId#zeroId()} is supplied.\n\t\t * <para />\n\t\t * Applications should try to use {@link #idEqual(int, int)} when possible\n\t\t * as it avoids conversion overheads.\n\t\t *\n\t\t * @param out\n\t\t *            buffer to copy the object id into.\n\t\t * @param nth\n\t\t *            tree to obtain the object identifier from.\n\t\t * @see #idEqual(int, int)\n\t\t */\n\t\tpublic void getObjectId(MutableObjectId @out, int nth)\n\t\t{\n\t\t\tAbstractTreeIterator t = _trees[nth];\n\t\t\tif (t.Matches == _currentHead)\n\t\t\t\tt.getEntryObjectId(@out);\n\t\t\telse\n\t\t\t\t@out.Clear();\n\t\t}\n\n\t\t/**\n\t\t * Compare two tree's current ObjectId values for equality.\n\t\t * \n\t\t * @param nthA\n\t\t *            first tree to compare the object id from.\n\t\t * @param nthB\n\t\t *            second tree to compare the object id from.\n\t\t * @return result of\n\t\t *         <code>getObjectId(nthA).Equals(getObjectId(nthB))</code>.\n\t\t * @see #getObjectId(int)\n\t\t */\n\t\tpublic bool idEqual(int nthA, int nthB)\n\t\t{\n\t\t\tAbstractTreeIterator ch = _currentHead;\n\t\t\tAbstractTreeIterator a = _trees[nthA];\n\t\t\tAbstractTreeIterator b = _trees[nthB];\n\t\t\tif (a.Matches == ch && b.Matches == ch)\n\t\t\t{\n\t\t\t\treturn a.idEqual(b);\n\t\t\t}\n\n\t\t\tif (a.Matches != ch && b.Matches != ch)\n\t\t\t{\n\t\t\t\t// If neither tree matches the current path node then neither\n\t\t\t\t// tree has this entry. In such case the ObjectId is zero(),\n\t\t\t\t// and zero() is always equal to zero().\n\t\t\t\t//\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Get the current entry's name within its parent tree.\n\t\t * <para />\n\t\t * This method is not very efficient and is primarily meant for debugging\n\t\t * and  output generation. Applications should try to avoid calling it,\n\t\t * and if invoked do so only once per interesting entry, where the name is\n\t\t * absolutely required for correct function.\n\t\t *\n\t\t * @return name of the current entry within the parent tree (or directory).\n\t\t *         The name never includes a '/'.\n\t\t */\n\t\tpublic string getNameString()\n\t\t{\n\t\t\tAbstractTreeIterator t = _currentHead;\n\t\t\tint off = t.PathOffset;\n\t\t\tint end = t.PathLen;\n\t\t\treturn RawParseUtils.decode(Constants.CHARSET, t.Path, off, end);\n\t\t}\n\n\t\t/**\n\t\t * Get the current entry's complete path.\n\t\t * <para />\n\t\t * This method is not very efficient and is primarily meant for debugging\n\t\t * and  output generation. Applications should try to avoid calling it,\n\t\t * and if invoked do so only once per interesting entry, where the name is\n\t\t * absolutely required for correct function.\n\t\t * \n\t\t * @return complete path of the current entry, from the root of the\n\t\t *         repository. If the current entry is in a subtree there will be at\n\t\t *         least one '/' in the returned string.\n\t\t */\n\t\tpublic string getPathString()\n\t\t{\n\t\t\treturn pathOf(_currentHead);\n\t\t}\n\n\t\t/**\n\t\t * Get the current entry's complete path as a UTF-8 byte array.\n\t\t *\n\t\t * @return complete path of the current entry, from the root of the\n\t\t *         repository. If the current entry is in a subtree there will be at\n\t\t *         least one '/' in the returned string.\n\t\t */\n\t\tpublic byte[] getRawPath()\n\t\t{\n\t\t\tAbstractTreeIterator treeIterator = CurrentHead;\n\t\t\tint newPathLen = treeIterator.PathLen;\n\t\t\tvar rawPath = new byte[newPathLen];\n\t\t\tArray.Copy(treeIterator.Path, 0, rawPath, 0, newPathLen);\n\t\t\treturn rawPath;\n\t\t}\n\n\t\t/**\n\t\t * Test if the supplied path matches the current entry's path.\n\t\t * <para />\n\t\t * This method tests that the supplied path is exactly equal to the current\n\t\t * entry, or is one of its parent directories. It is faster to use this\n\t\t * method then to use {@link #getPathString()} to first Create a string\n\t\t * object, then test <code>startsWith</code> or some other type of string\n\t\t * match function.\n\t\t * \n\t\t * @param p\n\t\t *            path buffer to test. Callers should ensure the path does not\n\t\t *            end with '/' prior to invocation.\n\t\t * @param pLen\n\t\t *            number of bytes from <code>buf</code> to test.\n\t\t * @return &lt; 0 if p is before the current path; 0 if p matches the current\n\t\t *         path; 1 if the current path is past p and p will never match\n\t\t *         again on this tree walk.\n\t\t */\n\t\tpublic int isPathPrefix(byte[] p, int pLen)\n\t\t{\n\t\t\tif (p==null)\n\t\t\t\tthrow new ArgumentNullException(\"p\");\n\t\t\tAbstractTreeIterator t = _currentHead;\n\t\t\tbyte[] c = t.Path;\n\t\t\tint cLen = t.PathLen;\n\t\t\tint ci;\n\n\t\t\tfor (ci = 0; ci < cLen && ci < pLen; ci++)\n\t\t\t{\n\t\t\t\tint cValue = (c[ci] & 0xff) - (p[ci] & 0xff);\n\t\t\t\tif (cValue != 0)\n\t\t\t\t{\n\t\t\t\t\treturn cValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ci < cLen)\n\t\t\t{\n\t\t\t\t// Ran out of pattern but we still had current data.\n\t\t\t\t// If c[ci] == '/' then pattern matches the subtree.\n\t\t\t\t// Otherwise we cannot be certain so we return -1.\n\t\t\t\t//\n\t\t\t\treturn c[ci] == '/' ? 0 : -1;\n\t\t\t}\n\n\t\t\tif (ci < pLen)\n\t\t\t{\n\t\t\t\t// Ran out of current, but we still have pattern data.\n\t\t\t\t// If p[ci] == '/' then pattern matches this subtree,\n\t\t\t\t// otherwise we cannot be certain so we return -1.\n\t\t\t\t//\n\t\t\t\treturn p[ci] == '/' ? 0 : -1;\n\t\t\t}\n\n\t\t\t// Both strings are identical.\n\t\t\t//\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Test if the supplied path matches (being suffix of) the current entry's\n\t\t * path.\n\t\t * <para />\n\t\t * This method tests that the supplied path is exactly equal to the current\n\t\t * entry, or is relative to one of entry's parent directories. It is faster\n\t\t * to use this method then to use {@link #getPathString()} to first Create\n\t\t * a String object, then test <code>endsWith</code> or some other type of\n\t\t * string match function.\n\t\t *\n\t\t * @param p\n\t\t *            path buffer to test.\n\t\t * @param pLen\n\t\t *            number of bytes from <code>buf</code> to test.\n\t\t * @return true if p is suffix of the current path;\n\t\t *         false if otherwise\n\t\t */\n\t\tpublic bool isPathSuffix(byte[] p, int pLen)\n\t\t{\n\t\t\tif (p==null)\n\t\t\t\tthrow new ArgumentNullException(\"p\");\n\t\t\tAbstractTreeIterator t = _currentHead;\n\t\t\tbyte[] c = t.Path;\n\t\t\tint cLen = t.PathLen;\n\t\t\tint ci;\n\n\t\t\tfor (ci = 1; ci < cLen && ci < pLen; ci++)\n\t\t\t{\n\t\t\t\tif (c[cLen - ci] != p[pLen - ci]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Get the current subtree depth of this walker.\n\t\t *\n\t\t * @return the current subtree depth of this walker.\n\t\t */\n\n\t\tpublic int Depth\n\t\t{\n\t\t\tget { return _depth; }\n\t\t}\n\n\t\t/**\n\t\t * Is the current entry a subtree?\n\t\t * <para />\n\t\t * This method is faster then testing the raw mode bits of all trees to see\n\t\t * if any of them are a subtree. If at least one is a subtree then this\n\t\t * method will return true.\n\t\t * \n\t\t * @return true if {@link #enterSubtree()} will work on the current node.\n\t\t */\n\t\tpublic bool isSubtree()\n\t\t{\n\t\t\treturn FileMode.Tree == CurrentHead.EntryFileMode;\n\t\t}\n\n\t\t/**\n\t\t * Is the current entry a subtree returned After its children?\n\t\t *\n\t\t * @return true if the current node is a tree that has been returned After\n\t\t *         its children were already processed.\n\t\t * @see #isPostOrderTraversal()\n\t\t */\n\t\tpublic bool isPostChildren()\n\t\t{\n\t\t\treturn _postChildren && isSubtree();\n\t\t}\n\n\t\t/**\n\t\t * Enter into the current subtree.\n\t\t * <para />\n\t\t * If the current entry is a subtree this method arranges for its children\n\t\t * to be returned before the next sibling following the subtree is returned.\n\t\t * \n\t\t * @throws MissingObjectException\n\t\t *             a subtree was found, but the subtree object does not exist in\n\t\t *             this repository. The repository may be missing objects.\n\t\t * @throws IncorrectObjectTypeException\n\t\t *             a subtree was found, and the subtree id does not denote a\n\t\t *             tree, but instead names some other non-tree type of object.\n\t\t *             The repository may have data corruption.\n\t\t * @throws CorruptObjectException\n\t\t *             the contents of a tree did not appear to be a tree. The\n\t\t *             repository may have data corruption.\n\t\t * @throws IOException\n\t\t *             a loose object or pack file could not be Read.\n\t\t */\n\t\tpublic void enterSubtree()\n\t\t{\n\t\t\tAbstractTreeIterator ch = CurrentHead;\n\t\t\tvar tmp = new AbstractTreeIterator[_trees.Length];\n\t\t\tfor (int i = 0; i < _trees.Length; i++)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator treeIterator = _trees[i];\n\t\t\t\tAbstractTreeIterator newIterator;\n\n\t\t\t\tif (treeIterator.Matches == ch && !treeIterator.eof() && FileMode.Tree == treeIterator.EntryFileMode)\n\t\t\t\t{\n\t\t\t\t\tnewIterator = treeIterator.createSubtreeIterator(_db, _idBuffer, _cursor);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewIterator = treeIterator.createEmptyTreeIterator();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttmp[i] = newIterator;\n\t\t\t}\n\n\t\t\t_depth++;\n\t\t\t_advance = false;\n\n\t\t\tArray.Copy(tmp, 0, _trees, 0, _trees.Length);\n\t\t}\n\n\t\tpublic virtual AbstractTreeIterator min()\n\t\t{\n\t\t\tint i = 0;\n\t\t\tAbstractTreeIterator minRef = _trees[i];\n\t\t\twhile (minRef.eof() && ++i < _trees.Length)\n\t\t\t{\n\t\t\t\tminRef = _trees[i];\n\t\t\t}\n\n\t\t\tif (minRef.eof())\n\t\t\t{\n\t\t\t\treturn minRef;\n\t\t\t}\n\n\t\t\tminRef.Matches = minRef;\n\t\t\twhile (++i < _trees.Length)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator t = _trees[i];\n\t\t\t\tif (t.eof()) continue;\n\n\t\t\t\tint cmp = t.pathCompare(minRef);\n\t\t\t\tif (cmp < 0)\n\t\t\t\t{\n\t\t\t\t\tt.Matches = t;\n\t\t\t\t\tminRef = t;\n\t\t\t\t}\n\t\t\t\telse if (cmp == 0)\n\t\t\t\t{\n\t\t\t\t\tt.Matches = minRef;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn minRef;\n\t\t}\n\n\t\tpublic virtual void popEntriesEqual()\n\t\t{\n\t\t\tAbstractTreeIterator ch = _currentHead;\n\t\t\tfor (int i = 0; i < _trees.Length; i++)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator t = _trees[i];\n\t\t\t\tif (t.Matches == ch)\n\t\t\t\t{\n\t\t\t\t\tt.next(1);\n\t\t\t\t\tt.Matches = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void skipEntriesEqual()\n\t\t{\n\t\t\tAbstractTreeIterator ch = _currentHead;\n\t\t\tfor (int i = 0; i < _trees.Length; i++)\n\t\t\t{\n\t\t\t\tAbstractTreeIterator t = _trees[i];\n\t\t\t\tif (t.Matches != ch) continue;\n\n\t\t\t\tt.skip();\n\t\t\t\tt.Matches = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate void ExitSubtree()\n\t\t{\n\t\t\t_depth--;\n\t\t\tfor (int i = 0; i < _trees.Length; i++)\n\t\t\t{\n\t\t\t\t_trees[i] = _trees[i].Parent;\n\t\t\t}\n\n\t\t\tAbstractTreeIterator minRef = null;\n\t\t\tforeach (AbstractTreeIterator t in _trees)\n\t\t\t{\n\t\t\t\tif (t.Matches != t) continue;\n\n\t\t\t\tif (minRef == null || t.pathCompare(minRef) < 0)\n\t\t\t\t{\n\t\t\t\t\tminRef = t;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_currentHead = minRef;\n\t\t}\n\n\t\tprivate CanonicalTreeParser ParserFor(AnyObjectId id)\n\t\t{\n\t\t\tvar p = new CanonicalTreeParser();\n\t\t\tp.reset(_db, id, _cursor);\n\t\t\treturn p;\n\t\t}\n\n\t\tpublic AbstractTreeIterator CurrentHead\n\t\t{\n\t\t\tget { return _currentHead; }\n\t\t}\n\n\t\tpublic AbstractTreeIterator[] Trees\n\t\t{\n\t\t\tget { return _trees; }\n\t\t}\n\n\t\tpublic static string pathOf(AbstractTreeIterator t)\n\t\t{\n\t\t\tif (t == null)\n\t\t\t\tthrow new ArgumentNullException (\"t\");\n\t\t\treturn RawParseUtils.decode(Constants.CHARSET, t.Path, 0, t.PathLen);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/TreeWalk/WorkingTreeIterator.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.TreeWalk\n{\n    /// <summary>\n    /// Walks a working directory tree as part of a {@link TreeWalk}.\n    /// \n    /// Most applications will want to use the standard implementation of this\n    /// iterator, {@link FileTreeIterator}, as that does all IO through the standard\n    /// <code>java.io</code> package. Plugins for a Java based IDE may however wish\n    /// to Create their own implementations of this class to allow traversal of the\n    /// IDE's project space, as well as benefit from any caching the IDE may have.\n    /// \n    /// <seealso cref=\"FileTreeIterator\"/>\n    /// </summary>\n    public abstract class WorkingTreeIterator : AbstractTreeIterator\n    {\n        private static readonly byte[] Digits = { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9' };\n        private static readonly byte[] HBlob = Constants.encodedTypeString(Constants.OBJ_BLOB);\n        private static readonly Comparison<Entry> EntryComparison = (o1, o2) =>\n        {\n            byte[] a = o1.EncodedName;\n            byte[] b = o2.EncodedName;\n            int aLen = o1.EncodedNameLen;\n            int bLen = o2.EncodedNameLen;\n            int cPos;\n\n            for (cPos = 0; cPos < aLen && cPos < bLen; cPos++)\n            {\n                int cmp = (a[cPos] & 0xff) - (b[cPos] & 0xff);\n                if (cmp != 0) return cmp;\n            }\n\n            if (cPos < aLen) return (a[cPos] & 0xff) - LastPathChar(o2);\n            if (cPos < bLen) return LastPathChar(o1) - (b[cPos] & 0xff);\n            return LastPathChar(o1) - LastPathChar(o2);\n        };\n\n        /// <summary>\n        /// An empty entry array, suitable for <see cref=\"Init\"/>.\n        /// </summary>\n        protected static readonly Entry[] Eof = { };\n\n        /// <summary>\n        /// Size we perform file IO in if we have to Read and hash a file.\n        /// </summary>\n        private const int BufferSize = 2048;\n\n        /// <summary>\n        /// The <see cref=\"idBuffer\"/> for the current entry.\n        /// </summary>\n        private byte[] _contentId;\n\n        /// <summary>\n        /// Index within <see cref=\"_entries\"/> that <see cref=\"_contentId\"/> came from.\n        /// </summary>\n        private int _contentIdFromPtr;\n\n        /// <summary>\n\t\t/// Buffer used to perform <see cref=\"_contentId\"/> computations.\n        /// </summary>\n        private byte[] _contentReadBuffer;\n\n        /// <summary>\n\t\t/// Digest computer for <see cref=\"_contentId\"/> computations.\n        /// </summary>\n        private MessageDigest _contentDigest;\n\n        /// <summary>\n\t\t/// File name character encoder.\n        /// </summary>\n        private readonly Encoding _nameEncoder;\n\n        /// <summary>\n\t\t/// List of entries obtained from the subclass.\n        /// </summary>\n        private Entry[] _entries;\n\n        /// <summary>\n\t\t/// Total number of _entries in <see cref=\"_entries\"/> that are valid.\n        /// </summary>\n        private int _entryCount;\n\n        /// <summary>\n\t\t/// Current position within <see cref=\"_entries\"/>.\n        /// </summary>\n        private int ptr;\n\n        /// <summary>\n        /// Create a new iterator with no parent.\n        /// </summary>\n        protected WorkingTreeIterator()\n        {\n            _nameEncoder = Constants.CHARSET;\n        }\n\n        /// <summary>\n        /// Create a new iterator with no parent and a prefix.\n        /// \n        /// The prefix path supplied is inserted in front of all paths generated by\n        /// this iterator. It is intended to be used when an iterator is being\n        /// created for a subsection of an overall repository and needs to be\n        /// combined with other iterators that are created to run over the entire\n        /// repository namespace.\n        /// </summary>\n        /// <param name=\"prefix\">\n        /// Position of this iterator in the repository tree. The value\n        /// may be null or the empty string to indicate the prefix is the\n        /// root of the repository. A trailing slash ('/') is\n        /// automatically appended if the prefix does not end in '/'.\n        /// </param>\n        protected WorkingTreeIterator(string prefix)\n            : base(prefix)\n        {\n            _nameEncoder = Constants.CHARSET;\n        }\n\n        /// <summary>\n        /// Create an iterator for a subtree of an existing iterator.\n        /// </summary>\n        /// <param name=\"parent\">Parent tree iterator.</param>\n        protected WorkingTreeIterator(WorkingTreeIterator parent) \n            : base(parent)\n        {\n            _nameEncoder = parent._nameEncoder;\n        }\n\n        public override byte[] idBuffer()\n        {\n            if (_contentIdFromPtr == ptr)\n            {\n                return _contentId;\n            }\n\n            switch (Mode & FileMode.TYPE_MASK)\n            {\n                case FileMode.TYPE_FILE:\n                    _contentIdFromPtr = ptr;\n                    return _contentId = IdBufferBlob(_entries[ptr]);\n\n                case FileMode.TYPE_SYMLINK:\n                    // Windows does not support symbolic links, so we should not\n                    // have reached this particular part of the walk code.\n                    //\n                    return ZeroId;\n\n                case FileMode.TYPE_GITLINK:\n                    // TODO: Support obtaining current HEAD SHA-1 from nested repository\n                    //\n                    return ZeroId;\n            }\n\n            return ZeroId;\n        }\n\n        private void InitializeDigest()\n        {\n            if (_contentDigest != null) return;\n\n            if (Parent == null)\n            {\n                _contentReadBuffer = new byte[BufferSize];\n                _contentDigest = Constants.newMessageDigest();\n            }\n            else\n            {\n                var p = (WorkingTreeIterator)Parent;\n                p.InitializeDigest();\n                _contentReadBuffer = p._contentReadBuffer;\n                _contentDigest = p._contentDigest;\n            }\n        }\n\n        private byte[] IdBufferBlob(Entry entry)\n        {\n            try\n            {\n                FileStream @is = entry.OpenInputStream();\n                if (@is == null)\n                {\n                    return ZeroId;\n                }\n\n                try\n                {\n                    InitializeDigest();\n\n                    _contentDigest.Reset();\n                    _contentDigest.Update(HBlob);\n                    _contentDigest.Update((byte)' ');\n\n                    long blobLength = entry.Length;\n                    \n                    long size = blobLength;\n                    if (size == 0)\n                    {\n                        _contentDigest.Update((byte)'0');\n                    }\n                    else\n                    {\n                        int bufn = _contentReadBuffer.Length;\n                        int p = bufn;\n                        do\n                        {\n                            _contentReadBuffer[--p] = Digits[(int)(size % 10)];\n                            size /= 10;\n                        } while (size > 0);\n\n                        _contentDigest.Update(_contentReadBuffer, p, bufn - p);\n                    }\n\n                    _contentDigest.Update(0);\n\n                    while (true)\n                    {\n                        int r = @is.Read(_contentReadBuffer, 0, _contentReadBuffer.Length); // was: Read(_contentReadBuffer) in java\n                        if (r <= 0) break;\n                        _contentDigest.Update(_contentReadBuffer, 0, r);\n                        size += r;\n                    }\n\n                    if (size != blobLength)\n                    {\n                        return ZeroId;\n                    }\n\n                    return _contentDigest.Digest();\n                }\n                finally\n                {\n                    try\n                    {\n                        @is.Close();\n                    }\n                    catch (IOException)\n                    {\n                        // Suppress any error related to closing an input\n                        // stream. We don't care, we should not have any\n                        // outstanding data to flush or anything like that.\n                    }\n                }\n            }\n            catch (IOException)\n            {\n                // Can't Read the file? Don't report the failure either.\n                //\n            }\n\n            return ZeroId;\n        }\n\n        public override int idOffset()\n        {\n            return 0;\n        }\n\n        public override bool first()\n        {\n            return ptr == 0;\n        }\n\n        public override bool eof()\n        {\n            return ptr == _entryCount;\n        }\n\n        public override void next(int delta)\n        {\n            ptr += delta;\n\n            if (!eof())\n            {\n                ParseEntry();\n            }\n        }\n\n        public override void back(int delta)\n        {\n            ptr -= delta;\n            ParseEntry();\n        }\n\n        private void ParseEntry()\n        {\n            Entry e = _entries[ptr];\n            Mode = e.Mode.Bits;\n\n            int nameLen = e.EncodedNameLen;\n            ensurePathCapacity(PathOffset + nameLen, PathOffset);\n            Array.Copy(e.EncodedName, 0, Path, PathOffset, nameLen);\n            PathLen = PathOffset + nameLen;\n        }\n\n        /// <summary>\n        /// Get the byte Length of this entry.\n        /// </summary>\n\t\t/// <returns>Size of this file, in bytes.</returns>\n        public long getEntryLength()\n        {\n            return Current.Length;\n        }\n\n        /// <summary>\n        /// Get the last modified time of this entry.\n        /// </summary>\n        /// <returns>\n        /// Last modified time of this file, in milliseconds since the epoch\n\t\t/// (Jan 1, 1970 UTC).\n        /// </returns>\n        public long getEntryLastModified()\n        {\n            return Current.LastModified;\n        }\n\n        private static int LastPathChar(Entry e)\n        {\n            return e.Mode == FileMode.Tree ? (byte)'/' : (byte)'\\0';\n        }\n\n        /// <summary>\n        /// Constructor helper.\n        /// </summary>\n        /// <param name=\"list\">\n        /// Files in the subtree of the work tree this iterator operates on.\n        /// </param>\n        protected void Init(Entry[] list)\n        {\n            var treeEntries = new[] {\".\", \"..\", Constants.DOT_GIT};\n\n            // Filter out nulls, . and .. as these are not valid tree entries,\n            // also cache the encoded forms of the path names for efficient use\n            // later on during sorting and iteration.\n            //\n            _entries = list;\n            int i, o;\n\n            for (i = 0, o = 0; i < _entries.Length; i++)\n            {\n                Entry e = _entries[i];\n                if (e == null || treeEntries.Contains(e.Name)) continue;\n\n                if (i != o)\n                {\n                    _entries[o] = e;\n                }\n\n                e.EncodeName(_nameEncoder);\n                o++;\n            }\n\n            _entryCount = o;\n            Array.Sort(_entries, EntryComparison); // was Arrays.sort(entries, 0, _entryCnt, EntryComparison) in java\n\n            _contentIdFromPtr = -1;\n            ptr = 0;\n            if (!eof())\n            {\n                ParseEntry();\n            }\n        }\n\n        /// <summary>\n        /// Obtain the current entry from this iterator.\n        /// </summary>\n        internal Entry Current\n        {\n            get { return _entries[ptr]; }\n        }\n\n        #region Nested Types\n\n        /// <summary>\n        /// A single entry within a working directory tree.\n        /// </summary>\n        public abstract class Entry\n        {\n            public byte[] EncodedName { get; private set; }\n\n            public int EncodedNameLen\n            {\n                get { return EncodedName.Length; }\n            }\n\n            public void EncodeName(Encoding enc)\n            {\n                try\n                {\n                    EncodedName = enc.GetBytes(Name);\n                }\n                catch (EncoderFallbackException)\n                {\n                    // This should so never happen.\n                    throw new Exception(\"Unencodeable file: \" + Name);\n                }\n            }\n\n            public override string ToString()\n            {\n                return Mode + \" \" + Name;\n            }\n\n            /// <summary>\n            /// Get the type of this entry.\n            /// \n            /// <b>Note: Efficient implementation required.</b>\n            /// \n            /// The implementation of this method must be efficient. If a subclass\n            /// needs to compute the value they should cache the reference within an\n            /// instance member instead.\n            /// </summary>\n            /// <returns>\n            /// A file mode constant from <see cref=\"FileMode\"/>.\n            /// </returns>\n            public abstract FileMode Mode { get; }\n\n            /// <summary>\n            /// Get the byte Length of this entry.\n            /// \n            /// <b>Note: Efficient implementation required.</b>\n            /// \n            /// The implementation of this method must be efficient. If a subclass\n            /// needs to compute the value they should cache the reference within an\n            /// instance member instead.\n            /// </summary>\n            public abstract long Length { get; }\n\n            /// <summary>\n            /// Get the last modified time of this entry.\n            /// \n            /// <b>Note: Efficient implementation required.</b>\n            /// \n            /// The implementation of this method must be efficient. If a subclass\n            /// needs to compute the value they should cache the reference within an\n            /// instance member instead.\n            /// </summary>\n            public abstract long LastModified { get; }\n\n            /// <summary>\n            /// Get the name of this entry within its directory.\n            /// \n            /// Efficient implementations are not required. The caller will obtain\n            /// the name only once and cache it once obtained.\n            /// </summary>\n            public abstract string Name { get; }\n\n            /// <summary>\n            /// Obtain an input stream to Read the file content.\n            /// \n            /// Efficient implementations are not required. The caller will usually\n            /// obtain the stream only once per entry, if at all.\n            /// \n            /// The input stream should not use buffering if the implementation can\n            /// avoid it. The caller will buffer as necessary to perform efficient\n            /// block IO operations.\n            /// \n            /// The caller will close the stream once complete.\n            /// </summary>\n            /// <returns>\n            /// A stream to Read from the file.\n            /// </returns>\n            public abstract FileStream OpenInputStream();\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Treeish.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core\n{\n    [Complete]\n    public interface Treeish\n    {\n        ObjectId TreeId{ get; }\n        Tree TreeEntry{ get; }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/UnpackedObjectCache.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Util;\nusing System.Runtime.CompilerServices;\n\nnamespace GitSharp.Core\n{\n    public static class UnpackedObjectCache\n    {\n        private const int CacheSize = 1024;\n\n        private static readonly WeakReference<Entry> Dead;\n        private static int _maxByteCount;\n        private static readonly Slot[] Cache;\n        private static Slot _lruHead;\n        private static Slot _lruTail;\n        private static int _openByteCount;\n\t\t\n\t\tprivate static Object locker = new Object();\n\n        private static int Hash(long position)\n        {\n            return (int)((uint)(((int)position) << 22) >> 22);\n        }\n\n        static UnpackedObjectCache()\n        {\n            Dead = new WeakReference<Entry>(null);\n            _maxByteCount = new WindowCacheConfig().DeltaBaseCacheLimit;\n\n            Cache = new Slot[CacheSize];\n            for (int i = 0; i < CacheSize; i++)\n            {\n                Cache[i] = new Slot();\n            }\n        }\n\n        public static void Reconfigure(WindowCacheConfig cfg)\n        {\n\t\t\tif (cfg == null)\n\t\t\t\tthrow new ArgumentNullException (\"cfg\");\n\t\t\tlock(locker)\n\t\t\t{\n\t            int dbLimit = cfg.DeltaBaseCacheLimit;\n\t            if (_maxByteCount != dbLimit)\n\t            {\n\t                _maxByteCount = dbLimit;\n\t                ReleaseMemory();\n\t            }\n\t\t\t}\n        }\n\n        public static Entry get(PackFile pack, long position)\n        {\n\t\t\tlock(locker)\n\t\t\t{\n\t            Slot e = Cache[Hash(position)];\n\t            if (e.provider == pack && e.position == position)\n\t            {\n\t                Entry buf = e.data.get();\n\t                if (buf != null)\n\t                {\n\t                    MoveToHead(e);\n\t                    return buf;\n\t                }\n\t            }\n\t            return null;\n\t\t\t}\n        }\n\n        public static void store(PackFile pack, long position,\n                 byte[] data, int objectType)\n        {\n\t\t\tif (data==null)\n\t\t\t\tthrow new ArgumentNullException(\"data\");\n\t\t\tlock(locker)\n\t\t\t{\n\t            if (data.Length > _maxByteCount)\n\t                return; // Too large to cache.\n\t\n\t            Slot e = Cache[Hash(position)];\n\t            ClearEntry(e);\n\t\n\t            _openByteCount += data.Length;\n\t            ReleaseMemory();\n\t\n\t            e.provider = pack;\n\t            e.position = position;\n\t            e.sz = data.Length;\n\t            e.data = new WeakReference<Entry>(new Entry(data, objectType));\n\t            MoveToHead(e);\n\t\t\t}\n        }\n\n        private static void ReleaseMemory()\n        {\n            while (_openByteCount > _maxByteCount && _lruTail != null)\n            {\n                Slot currOldest = _lruTail;\n                Slot nextOldest = currOldest.lruPrev;\n\n                ClearEntry(currOldest);\n                currOldest.lruPrev = null;\n                currOldest.lruNext = null;\n\n                if (nextOldest == null)\n                {\n                    _lruHead = null;\n                }\n                else\n                {\n                    nextOldest.lruNext = null;\n                }\n\n                _lruTail = nextOldest;\n            }\n        }\n\n        public static void purge(PackFile file)\n        {\n\t\t\tlock(locker)\n\t\t\t{\n\t            foreach (Slot e in Cache)\n\t            {\n\t                if (e.provider == file)\n\t                {\n\t                    ClearEntry(e);\n\t                    Unlink(e);\n\t                }\n\t            }\n\t\t\t}\n        }\n\n        private static void MoveToHead(Slot e)\n        {\n            Unlink(e);\n            e.lruPrev = null;\n            e.lruNext = _lruHead;\n            if (_lruHead != null)\n            {\n                _lruHead.lruPrev = e;\n            }\n            else\n            {\n                _lruTail = e;\n            }\n            _lruHead = e;\n        }\n\n        private static void Unlink(Slot e)\n        {\n            Slot prev = e.lruPrev;\n            Slot next = e.lruNext;\n\n            if (prev != null)\n            {\n                prev.lruNext = next;\n            }\n            if (next != null)\n            {\n                next.lruPrev = prev;\n            }\n        }\n\n        private static void ClearEntry(Slot e)\n        {\n            _openByteCount -= e.sz;\n            e.provider = null;\n            e.data = Dead;\n            e.sz = 0;\n        }\n\n        #region Nested Types\n\n        public class Entry\n        {\n            public byte[] data;\n\n            public int type;\n\n            public Entry(byte[] aData, int aType)\n            {\n                data = aData;\n                type = aType;\n            }\n        }\n\n        private class Slot : IDisposable\n        {\n            public Slot lruPrev;\n\n            public Slot lruNext;\n\n            public PackFile provider;\n\n            public long position;\n\n            public int sz;\n\n            public WeakReference<Entry> data = Dead;\n\t\t\t\n\t\t\tpublic void Dispose ()\n\t\t\t{\n\t\t\t\tprovider.Dispose();\n\t\t\t\tlruNext.Dispose();\n\t\t\t\tlruPrev.Dispose();\n\t\t\t}\n\t\t\t\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/UnpackedObjectLoader.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// Loose object loader. This class loads an object not stored in a pack.\n\t/// </summary>\n\tpublic class UnpackedObjectLoader : ObjectLoader\n\t{\n\t\tprivate readonly int _objectType;\n\t\tprivate readonly int _objectSize;\n\t\tprivate readonly byte[] _bytes;\n\n\t\t/// <summary>\n\t\t/// Construct an ObjectLoader to read from the file.\n\t\t/// </summary>\n\t\t/// <param name=\"path\">location of the loose object to read.</param>\n\t\t/// <param name=\"id\">Expected identity of the object being loaded, if known.</param>\n\t\t///\t<exception cref=\"FileNotFoundException\">\n\t\t/// The loose object file does not exist.\n\t\t/// </exception>\n\t\t/// <exception cref=\"IOException\">\n\t\t/// The loose object file exists, but is corrupt.\n\t\t/// </exception>\n\t\tpublic UnpackedObjectLoader(FileSystemInfo path, AnyObjectId id)\n\t\t\t: this(ReadCompressed(path), id)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Construct an ObjectLoader from a loose object's compressed form.\n\t\t/// </summary>\n\t\t/// <param name=\"compressed\">\n\t\t/// Entire content of the loose object file.\n\t\t/// </param>\n\t\t///\t<exception cref=\"CorruptObjectException\">\n\t\t///\tThe compressed data supplied does not match the format for a\n\t\t///\tvalid loose object.\n\t\t/// </exception>\n\t\tpublic UnpackedObjectLoader(byte[] compressed)\n\t\t\t: this(compressed, null)\n\t\t{\n\t\t}\n\n\t\tprivate static byte[] ReadCompressed(FileSystemInfo path)\n\t\t{\n\t\t\tusing (var inStream = new FileStream(path.FullName, System.IO.FileMode.Open, FileAccess.Read))\n\t\t\t{\n\t\t\t\tvar compressed = new byte[(int)inStream.Length];\n\t\t\t\tIO.ReadFully(inStream, compressed, 0, compressed.Length);\n\t\t\t\treturn compressed;\n\t\t\t}\n\t\t}\n\n\t\tprivate UnpackedObjectLoader(byte[] compressed, AnyObjectId id)\n\t\t{\n\t\t\t// Try to determine if this is a legacy format loose object or\n\t\t\t// a new style loose object. The legacy format was completely\n\t\t\t// compressed with zlib so the first byte must be 0x78 (15-bit\n\t\t\t// window size, deflated) and the first 16 bit word must be\n\t\t\t// evenly divisible by 31. Otherwise its a new style loose\n\t\t\t// object.\n\t\t\t//\n\t\t\tInflater inflater = InflaterCache.Instance.get();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint fb = compressed[0] & 0xff;\n\t\t\t\tif (fb == 0x78 && (((fb << 8) | compressed[1] & 0xff) % 31) == 0)\n\t\t\t\t{\n\t\t\t\t\tinflater.SetInput(compressed);\n\t\t\t\t\tvar hdr = new byte[64];\n\t\t\t\t\tint avail = 0;\n\t\t\t\t\twhile (!inflater.IsFinished && avail < hdr.Length)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tavail += inflater.Inflate(hdr, avail, hdr.Length - avail);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (IOException dfe)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar coe = new CorruptObjectException(id, \"bad stream\", dfe);\n\t\t\t\t\t\t\t//inflater.end();\n\t\t\t\t\t\t\tthrow coe;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (avail < 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new CorruptObjectException(id, \"no header\");\n\t\t\t\t\t}\n\n\t\t\t\t\tvar p = new MutableInteger();\n\t\t\t\t\t_objectType = Constants.decodeTypeString(id, hdr, (byte)' ', p);\n\t\t\t\t\t_objectSize = RawParseUtils.parseBase10(hdr, p.value, p);\n\n\t\t\t\t\tif (_objectSize < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new CorruptObjectException(id, \"negative size\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (hdr[p.value++] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new CorruptObjectException(id, \"garbage after size\");\n\t\t\t\t\t}\n\n\t\t\t\t\t_bytes = new byte[_objectSize];\n\n\t\t\t\t\tif (p.value < avail)\n\t\t\t\t\t{\n\t\t\t\t\t\tArray.Copy(hdr, p.value, _bytes, 0, avail - p.value);\n\t\t\t\t\t}\n\n\t\t\t\t\tDecompress(id, inflater, avail - p.value);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint p = 0;\n\t\t\t\t\tint c = compressed[p++] & 0xff;\n\t\t\t\t\tint typeCode = (c >> 4) & 7;\n\t\t\t\t\tint size = c & 15;\n\t\t\t\t\tint shift = 4;\n\t\t\t\t\twhile ((c & 0x80) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tc = compressed[p++] & 0xff;\n\t\t\t\t\t\tsize += (c & 0x7f) << shift;\n\t\t\t\t\t\tshift += 7;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (typeCode)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase Constants.OBJ_COMMIT:\n\t\t\t\t\t\tcase Constants.OBJ_TREE:\n\t\t\t\t\t\tcase Constants.OBJ_BLOB:\n\t\t\t\t\t\tcase Constants.OBJ_TAG:\n\t\t\t\t\t\t\t_objectType = typeCode;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new CorruptObjectException(id, \"invalid type\");\n\t\t\t\t\t}\n\n\t\t\t\t\t_objectSize = size;\n\t\t\t\t\t_bytes = new byte[_objectSize];\n\t\t\t\t\tinflater.SetInput(compressed, p, compressed.Length - p);\n\t\t\t\t\tDecompress(id, inflater, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tInflaterCache.Instance.release(inflater);\n\t\t\t}\n\t\t}\n\n\t\tprivate void Decompress(AnyObjectId id, Inflater inf, int p)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (!inf.IsFinished)\n\t\t\t\t{\n\t\t\t\t\tp += inf.Inflate(_bytes, p, _objectSize - p);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException dfe)\n\t\t\t{\n\t\t\t\tvar coe = new CorruptObjectException(id, \"bad stream\", dfe);\n\t\t\t\tthrow coe;\n\t\t\t}\n\n\t\t\tif (p != _objectSize)\n\t\t\t{\n\t\t\t\tthrow new CorruptObjectException(id, \"incorrect Length\");\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Type\n\t\t{\n\t\t\tget { return _objectType; }\n\t\t\tprotected set { }\n\t\t}\n\n\t\tpublic override long Size\n\t\t{\n\t\t\tget { return _objectSize; }\n\t\t\tprotected set { }\n\t\t}\n\n\t\tpublic override byte[] CachedBytes\n\t\t{\n\t\t\tget { return _bytes; }\n\t\t\tprotected set { }\n\t\t}\n\n\t\tpublic override int RawType\n\t\t{\n\t\t\tget { return _objectType; }\n\t\t}\n\n\t\tpublic override long RawSize\n\t\t{\n\t\t\tget { return _objectSize; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/UserConfig.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Yann Simon <yann.simon.fr@gmail.com>\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\n    public class UserConfig\n    {\n        private class SectionParser : Config.SectionParser<UserConfig>\n        {\n            public UserConfig parse(Config cfg)\n            {\n                return new UserConfig(cfg);\n            }\n        }\n\n        public static Config.SectionParser<UserConfig> KEY = new SectionParser();\n\n        private readonly string authorName;\n        private readonly string authorEmail;\n        private readonly string committerName;\n        private readonly string committerEmail;\n\n        public UserConfig(Config rc)\n        {\n            authorName = getNameInternal(rc, Constants.GIT_AUTHOR_NAME_KEY);\n            authorEmail = getEmailInternal(rc, Constants.GIT_AUTHOR_EMAIL_KEY);\n\n            committerName = getNameInternal(rc, Constants.GIT_COMMITTER_NAME_KEY);\n            committerEmail = getEmailInternal(rc, Constants.GIT_COMMITTER_EMAIL_KEY);\n        }\n\n        public string getAuthorName()\n        {\n            return authorName;\n        }\n\n        public string getCommitterName()\n        {\n            return committerName;\n        }\n\n        public string getAuthorEmail()\n        {\n            return authorEmail;\n        }\n        \n        public string getCommitterEmail()\n        {\n            return committerEmail;\n        }\n\n        private string getNameInternal(Config rc, string envKey)\n        {\n            string username = rc.getString(\"user\", null, \"name\");\n\n            if (username == null)\n            {\n                username = system().getenv(envKey);\n            }\n            if (username == null)\n            {\n                username = system().getProperty(Constants.OS_USER_NAME_KEY);\n            }\n            if (username == null)\n            {\n                username = Constants.UNKNOWN_USER_DEFAULT;\n            }\n\n            return username;\n        }\n\n        private string getEmailInternal(Config rc, string envKey)\n        {\n            string email = rc.getString(\"user\", null, \"email\");\n\n            if (email == null)\n            {\n                email = system().getenv(envKey);\n            }\n            if (email == null)\n            {\n                string username = system().getProperty(Constants.OS_USER_NAME_KEY);\n                if (username == null)\n                {\n                    username = Constants.UNKNOWN_USER_DEFAULT;\n                }\n                email = username + \"@\" + system().getHostname();\n            }\n\n            return email;\n        }\n\n        private SystemReader system()\n        {\n            return SystemReader.getInstance();\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/UserInfoProvider.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing Tamir.SharpSsh.jsch;\n\nnamespace GitSharp.Core\n{\n\n    public abstract class UserInfoProvider : UserInfo\n    {\n        public static UserInfoProvider Provider = new ConsoleUserInfoProvider();\n\n        protected string Passphrase;\n        protected string Password;\n\n        public string getPassphrase()\n        {\n            return Passphrase;\n        }\n\n        public string getPassword()\n        {\n            return Password;\n        }\n\n        public abstract bool promptPassword(string message);\n        public abstract bool promptPassphrase(string message);\n        public abstract bool promptYesNo(string message);\n        public abstract void showMessage(string message);\n    }\n\n}"
  },
  {
    "path": "GitSharp.Core/Util/ArrayExtensions.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Util\n{\n    public static class ArrayExtension\n    {\n\t\t/// <summary>\n\t\t/// Assigns the specified int value to each element of the specified array of ints.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">type of the array's values</typeparam>\n\t\t/// <param name=\"array\"> the array to be filled</param>\n\t\t/// <param name=\"value\">the value to be stored in all elements of the array</param>\n\t\tpublic static void Fill<T>(this T[] array, T value)\n\t\t{\n\t\t\tFill(array, 0, array.Length, value);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Assigns the specified int value to each element of the specified range of the specified array of ints. \n\t\t///     The range to be filled extends from index fromIndex, inclusive, to index toIndex, exclusive. \n\t\t///     (If fromIndex==toIndex, the range to be filled is empty.)\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">type of the array's values</typeparam>\n\t\t/// <param name=\"array\"> the array to be filled</param>\n\t\t/// <param name=\"fromIndex\"> the index of the first element (inclusive) to be filled with the specified value</param>\n\t\t/// <param name=\"toIndex\">the index of the last element (exclusive) to be filled with the specified value</param>\n\t\t/// <param name=\"value\">the value to be stored in the specified range of elements of the array</param>\n\t\tpublic static void Fill<T>(this T[] array, int fromIndex, int toIndex, T value)\n\t\t{\n\t\t\tfor (int i = Math.Max(0, fromIndex); i < Math.Max(array.Length, toIndex); i++)\n\t\t\t{\n\t\t\t\tarray[i] = value;\n\t\t\t}\n\t\t}\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/AtomicReferenceArray.cs",
    "content": "/*\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    public class AtomicReferenceArray<T>\n    {\n        T[] array;\n\t\tprivate Object locker = new Object();\n\n        public AtomicReferenceArray(int size)\n        {\n            array = new T[size];\n        }\n\n        public T get(int slot)\n        {\n            return array[slot];\n        }\n\n        public bool compareAndSet(int slot, T expect, T update)\n        {\n            lock(locker) {\n                if ((array[slot] == null && expect==null) || (array[slot] != null && array[slot].Equals(expect)))\n                {\n                    array[slot] = update;\n                    return true;\n                }\n                return false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/BigEndianBitConverter.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nnamespace MiscUtil.Conversion\n{\n\t/// <summary>\n\t/// Implementation of EndianBitConverter which converts to/from big-endian\n\t/// byte arrays.\n\t/// </summary>\n\tpublic sealed class BigEndianBitConverter : EndianBitConverter\n\t{\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Different computer architectures store data using different byte orders. \"Big-endian\"\n\t\t/// means the most significant byte is on the left end of a word. \"Little-endian\" means the \n\t\t/// most significant byte is on the right end of a word.\n\t\t/// </remarks>\n\t\t/// <returns>true if this converter is little-endian, false otherwise.</returns>\n\t\tpublic sealed override bool IsLittleEndian()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\tpublic sealed override Endianness Endianness \n\t\t{ \n\t\t\tget { return Endianness.BigEndian; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified number of bytes from value to buffer, starting at index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to copy</param>\n\t\t/// <param name=\"bytes\">The number of bytes to copy</param>\n\t\t/// <param name=\"buffer\">The buffer to copy the bytes into</param>\n\t\t/// <param name=\"index\">The index to start at</param>\n\t\tprotected override void CopyBytesImpl(long value, int bytes, byte[] buffer, int index)\n\t\t{\n\t\t\tint endOffset = index+bytes-1;\n\t\t\tfor (int i=0; i < bytes; i++)\n\t\t\t{\n\t\t\t\tbuffer[endOffset-i] = unchecked((byte)(value&0xff));\n\t\t\t\tvalue = value >> 8;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns a value built from the specified number of bytes from the given buffer,\n\t\t/// starting at index.\n\t\t/// </summary>\n\t\t/// <param name=\"buffer\">The data in byte array format</param>\n\t\t/// <param name=\"startIndex\">The first index to use</param>\n\t\t/// <param name=\"bytesToConvert\">The number of bytes to use</param>\n\t\t/// <returns>The value built from the given bytes</returns>\n\t\tprotected override long FromBytes(byte[] buffer, int startIndex, int bytesToConvert)\n\t\t{\n\t\t\tlong ret = 0;\n\t\t\tfor (int i=0; i < bytesToConvert; i++)\n\t\t\t{\n\t\t\t\tret = unchecked((ret << 8) | buffer[startIndex+i]);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/CRC32.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Kevin Thompson <kevin.thompson@theautomaters.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Util\n{\n\tpublic class Crc32\n\t{\n\t\t#region CRC Table\n\n\t\tprivate static readonly UInt32[] CrcTable =\n\t\t\t{\n\t\t\t\t0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n\t\t\t\t0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n\t\t\t\t0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n\t\t\t\t0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n\t\t\t\t0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n\t\t\t\t0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n\t\t\t\t0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n\t\t\t\t0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n\t\t\t\t0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n\t\t\t\t0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n\t\t\t\t0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n\t\t\t\t0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n\t\t\t\t0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n\t\t\t\t0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n\t\t\t\t0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n\t\t\t\t0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n\t\t\t\t0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n\t\t\t\t0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n\t\t\t\t0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n\t\t\t\t0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n\t\t\t\t0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n\t\t\t\t0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n\t\t\t\t0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n\t\t\t\t0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n\t\t\t\t0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n\t\t\t\t0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n\t\t\t\t0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n\t\t\t\t0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n\t\t\t\t0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n\t\t\t\t0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n\t\t\t\t0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n\t\t\t\t0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n\t\t\t\t0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n\t\t\t\t0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n\t\t\t\t0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n\t\t\t\t0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n\t\t\t\t0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n\t\t\t\t0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n\t\t\t\t0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n\t\t\t\t0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n\t\t\t\t0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n\t\t\t\t0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n\t\t\t\t0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n\t\t\t\t0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n\t\t\t\t0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n\t\t\t\t0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n\t\t\t\t0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n\t\t\t\t0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n\t\t\t\t0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n\t\t\t\t0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n\t\t\t\t0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n\t\t\t\t0x2d02ef8d\n\t\t\t};\n\n\t\t#endregion\n\n\t\tprivate uint _value;\n\n\t\tpublic Crc32()\n\t\t{\n\t\t\tReset();\n\t\t}\n\n\t\tpublic uint Value\n\t\t{\n\t\t\tget { return _value ^ 0xffffffff; }\n\t\t}\n\n\t\tpublic void Reset()\n\t\t{\n\t\t\t_value = 0xffffffff;\n\t\t}\n\n\t\tpublic void Update(uint value)\n\t\t{\n\t\t\t_value = CrcTable[(_value ^ value) & 0xFF] ^ (_value >> 8);\n\t\t}\n\n\t\tpublic void Update(byte value)\n\t\t{\n\t\t\t_value = (_value >> 8) ^ CrcTable[(_value & 0xff) ^ value];\n\t\t}\n\n\t\tpublic void Update(byte[] values, int offset, int Length)\n\t\t{\n\t\t\tfor (int i = offset; i < offset + Length; i++)\n\t\t\t{\n\t\t\t\tUpdate(values[i]);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Update(byte[] values)\n\t\t{\n\t\t\tUpdate(values, 0, values.Length);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Util/CheckedOutputStream.cs",
    "content": "/*\n * Copyright (C) 2008, Miguel de Icaza <miguel@novell.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n\n    public class CheckedOutputStream : System.IO.Stream\n    {\n        Stream under;\n        Crc32 crc;\n\n        // Stream configuration: read-only, non-seeking stream\n        public override bool CanRead { get { return false; } }\n        public override bool CanSeek { get { return false; } }\n        public override bool CanWrite { get { return true; } }\n\n        public CheckedOutputStream(Stream under, Crc32 crc)\n        {\n            this.under = under;\n            this.crc = crc;\n        }\n\n        public override void Flush()\n        {\n            under.Flush();\n        }\n\n        public override int Read(byte[] buffer, int offset, int count)\n        {\n            throw new InvalidOperationException();\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            throw new InvalidOperationException();\n        }\n\n        public override void SetLength(long value)\n        {\n            throw new InvalidOperationException();\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            if (buffer == null)\n                throw new ArgumentNullException(\"buffer\");\n\n            if (offset < 0)\n                throw new ArgumentOutOfRangeException(\"offset\", \"< 0\");\n\n            if (count < 0)\n                throw new ArgumentOutOfRangeException(\"count\", \"< 0\");\n\n            // ordered to avoid possible integer overflow\n            if (offset > buffer.Length - count)\n                throw new ArgumentException(\"Reading would overrun buffer\");\n\n            crc.Update(buffer, offset, count);\n            under.Write(buffer, offset, count);\n        }\n\n        public override long Length\n        {\n            get\n            {\n                return under.Length;\n            }\n        }\n\n        public override long Position\n        {\n            get\n            {\n                return under.Position;\n            }\n\n            set\n            {\n                throw new InvalidOperationException();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/DateTimeExtensions.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Globalization;\n\nnamespace GitSharp.Core.Util\n{\n    public static class DateTimeExtensions\n    {\n    \tprivate static readonly long EPOCH_TICKS = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks;\n\n        public static long ToMillisecondsSinceEpoch(this DateTimeOffset dateTimeOffset)\n        {\n            return ((dateTimeOffset.Ticks - dateTimeOffset.Offset.Ticks - EPOCH_TICKS) / TimeSpan.TicksPerMillisecond);\n        }\n\n        public static long ToMillisecondsSinceEpoch(this DateTime dateTime)\n        {\n            if (dateTime.Kind != DateTimeKind.Utc)\n            {\n                throw new ArgumentException(\"dateTime is expected to be expressed as a UTC DateTime\", \"dateTime\");\n            }\n\n            return new DateTimeOffset(DateTime.SpecifyKind(dateTime, DateTimeKind.Utc), TimeSpan.Zero).ToMillisecondsSinceEpoch();\n        }\n\n        public static DateTime MillisToUtcDateTime(this long milliSecondsSinceEpoch)\n        {\n            return milliSecondsSinceEpoch.MillisToDateTimeOffset(0).UtcDateTime;\n        }\n\n        public static DateTimeOffset MillisToDateTimeOffset(this long milliSecondsSinceEpoch, long offsetMinutes)\n        {\n            var offset = TimeSpan.FromMinutes(offsetMinutes);\n            var utcTicks = EPOCH_TICKS + milliSecondsSinceEpoch * TimeSpan.TicksPerMillisecond;\n            return new DateTimeOffset(utcTicks + offset.Ticks, offset);\n        }\n\n\t\t/// <summary>\n\t\t/// Gets the DateTime in the sortable ISO format.\n\t\t/// </summary>\n\t\t/// <param name=\"when\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static string ToIsoDateFormat(this DateTime when)\n\t\t{\n\t\t\treturn when.ToString(\"s\", CultureInfo.InvariantCulture);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the DateTimeOffset in the sortable ISO format.\n\t\t/// </summary>\n\t\t/// <param name=\"when\"></param>\n\t\t/// <returns></returns>\n\t\tpublic static string ToIsoDateFormat(this DateTimeOffset when)\n\t\t{\n\t\t\treturn when.ToString(\"s\", CultureInfo.InvariantCulture);\n\t\t}\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/DigestOutputStream.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Util\n{\n\n    /// <summary>\n    /// A light version of a std Java class that updates a hash while writing bytes to a stream.\n    /// </summary>\n    public class DigestOutputStream : Stream\n    {\n        Stream m_stream;\n        MessageDigest m_digest;\n\n        public DigestOutputStream(Stream stream, MessageDigest digest)\n            : base()\n        {\n            m_digest = digest;\n            m_stream = stream;\n        }\n\n        public override bool CanRead\n        {\n            get { return m_stream.CanRead; }\n        }\n\n        public override bool CanSeek\n        {\n            get { return m_stream.CanSeek; }\n        }\n\n        public override bool CanWrite\n        {\n            get { return m_stream.CanWrite; }\n        }\n\n        public override void Flush()\n        {\n            m_stream.Flush();\n        }\n\n        public override long Length\n        {\n            get { return m_stream.Length; }\n        }\n\n        public override long Position\n        {\n            get\n            {\n                return m_stream.Position;\n            }\n            set\n            {\n                m_stream.Position = value;\n            }\n        }\n\n        public override int Read(byte[] buffer, int offset, int count)\n        {\n            return m_stream.Read(buffer, offset, count);\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            return m_stream.Seek(offset, origin);\n        }\n\n        public override void SetLength(long value)\n        {\n            m_stream.SetLength(value);\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            m_digest.Update(buffer, offset, count);\n            m_stream.Write(buffer, offset, count);\n        }\n\n        public void Write(byte[] buffer)\n        {\n\t\t\tif (buffer==null)\n\t\t\t\tthrow new ArgumentNullException(\"buffer\");\n            Write(buffer, 0, buffer.Length);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/EndianBinaryReader.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing MiscUtil.Conversion;\n\nnamespace MiscUtil.IO\n{\n\t/// <summary>\n\t/// Equivalent of System.IO.BinaryReader, but with either endianness, depending on\n\t/// the EndianBitConverter it is constructed with. No data is buffered in the\n\t/// reader; the client may seek within the stream at will.\n\t/// </summary>\n\tpublic class EndianBinaryReader : IDisposable\n\t{\n\t\t#region Fields not directly related to properties\n\t\t/// <summary>\n\t\t/// Whether or not this reader has been disposed yet.\n\t\t/// </summary>\n\t\tbool disposed=false;\n\t\t/// <summary>\n\t\t/// Decoder to use for string conversions.\n\t\t/// </summary>\n\t\tDecoder decoder;\n\t\t/// <summary>\n\t\t/// Buffer used for temporary storage before conversion into primitives\n\t\t/// </summary>\n\t\tbyte[] buffer = new byte[16];\n\t\t/// <summary>\n\t\t/// Buffer used for temporary storage when reading a single character\n\t\t/// </summary>\n\t\tchar[] charBuffer = new char[1];\n\t\t/// <summary>\n\t\t/// Minimum number of bytes used to encode a character\n\t\t/// </summary>\n\t\tint minBytesPerChar;\n\t\t#endregion\n\n\t\t#region Constructors\n\t\t/// <summary>\n\t\t/// Equivalent of System.IO.BinaryWriter, but with either endianness, depending on\n\t\t/// the EndianBitConverter it is constructed with.\n\t\t/// </summary>\n\t\t/// <param name=\"bitConverter\">Converter to use when reading data</param>\n\t\t/// <param name=\"stream\">Stream to read data from</param>\n\t\tpublic EndianBinaryReader (EndianBitConverter bitConverter,\n\t\t\t\t\t\t\t\t   Stream stream) : this (bitConverter, stream, Encoding.UTF8)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Constructs a new binary reader with the given bit converter, reading\n\t\t/// to the given stream, using the given encoding.\n\t\t/// </summary>\n\t\t/// <param name=\"bitConverter\">Converter to use when reading data</param>\n\t\t/// <param name=\"stream\">Stream to read data from</param>\n\t\t/// <param name=\"encoding\">Encoding to use when reading character data</param>\n\t\tpublic EndianBinaryReader (EndianBitConverter bitConverter,\tStream stream, Encoding encoding)\n\t\t{\n\t\t\tif (bitConverter==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"bitConverter\");\n\t\t\t}\n\t\t\tif (stream==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"stream\");\n\t\t\t}\n\t\t\tif (encoding==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"encoding\");\n\t\t\t}\n\t\t\tif (!stream.CanRead)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Stream isn't writable\", \"stream\");\n\t\t\t}\n\t\t\tthis.stream = stream;\n\t\t\tthis.bitConverter = bitConverter;\n\t\t\tthis.encoding = encoding;\n\t\t\tthis.decoder = encoding.GetDecoder();\n\t\t\tthis.minBytesPerChar = 1;\n\n\t\t\tif (encoding is UnicodeEncoding)\n\t\t\t{\n\t\t\t\tminBytesPerChar = 2;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Properties\n\t\tEndianBitConverter bitConverter;\n\t\t/// <summary>\n\t\t/// The bit converter used to read values from the stream\n\t\t/// </summary>\n\t\tpublic EndianBitConverter BitConverter\n\t\t{\n\t\t\tget { return bitConverter; }\n\t\t}\n\n\t\tEncoding encoding;\n\t\t/// <summary>\n\t\t/// The encoding used to read strings\n\t\t/// </summary>\n\t\tpublic Encoding Encoding\n\t\t{\n\t\t\tget { return encoding; }\n\t\t}\n\n\t\tStream stream;\n\t\t/// <summary>\n\t\t/// Gets the underlying stream of the EndianBinaryReader.\n\t\t/// </summary>\n\t\tpublic Stream BaseStream\n\t\t{\n\t\t\tget { return stream; }\n\t\t}\n\t\t#endregion\n\t\n\t\t#region Public methods\n\t\t/// <summary>\n\t\t/// Closes the reader, including the underlying stream..\n\t\t/// </summary>\n\t\tpublic void Close()\n\t\t{\n\t\t\tDispose();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Seeks within the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">Offset to seek to.</param>\n\t\t/// <param name=\"origin\">Origin of seek operation.</param>\n\t\tpublic void Seek (int offset, SeekOrigin origin)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tstream.Seek (offset, origin);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a single byte from the stream.\n\t\t/// </summary>\n\t\t/// <returns>The byte read</returns>\n\t\tpublic byte ReadByte()\n\t\t{\n\t\t\tReadInternal(buffer, 1);\n\t\t\treturn buffer[0];\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a single signed byte from the stream.\n\t\t/// </summary>\n\t\t/// <returns>The byte read</returns>\n\t\tpublic sbyte ReadSByte()\n\t\t{\n\t\t\tReadInternal(buffer, 1);\n\t\t\treturn unchecked((sbyte)buffer[0]);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a boolean from the stream. 1 byte is read.\n\t\t/// </summary>\n\t\t/// <returns>The boolean read</returns>\n\t\tpublic bool ReadBoolean()\n\t\t{\n\t\t\tReadInternal(buffer, 1);\n\t\t\treturn bitConverter.ToBoolean(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 16-bit signed integer from the stream, using the bit converter\n\t\t/// for this reader. 2 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 16-bit integer read</returns>\n\t\tpublic short ReadInt16()\n\t\t{\n\t\t\tReadInternal(buffer, 2);\n\t\t\treturn bitConverter.ToInt16(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 32-bit signed integer from the stream, using the bit converter\n\t\t/// for this reader. 4 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 32-bit integer read</returns>\n\t\tpublic int ReadInt32()\n\t\t{\n\t\t\tReadInternal(buffer, 4);\n\t\t\treturn bitConverter.ToInt32(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 64-bit signed integer from the stream, using the bit converter\n\t\t/// for this reader. 8 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 64-bit integer read</returns>\n\t\tpublic long ReadInt64()\n\t\t{\n\t\t\tReadInternal(buffer, 8);\n\t\t\treturn bitConverter.ToInt64(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 16-bit unsigned integer from the stream, using the bit converter\n\t\t/// for this reader. 2 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 16-bit unsigned integer read</returns>\n\t\tpublic ushort ReadUInt16()\n\t\t{\n\t\t\tReadInternal(buffer, 2);\n\t\t\treturn bitConverter.ToUInt16(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 32-bit unsigned integer from the stream, using the bit converter\n\t\t/// for this reader. 4 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 32-bit unsigned integer read</returns>\n\t\tpublic uint ReadUInt32()\n\t\t{\n\t\t\tReadInternal(buffer, 4);\n\t\t\treturn bitConverter.ToUInt32(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 64-bit unsigned integer from the stream, using the bit converter\n\t\t/// for this reader. 8 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The 64-bit unsigned integer read</returns>\n\t\tpublic ulong ReadUInt64()\n\t\t{\n\t\t\tReadInternal(buffer, 8);\n\t\t\treturn bitConverter.ToUInt64(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a single-precision floating-point value from the stream, using the bit converter\n\t\t/// for this reader. 4 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The floating point value read</returns>\n\t\tpublic float ReadSingle()\n\t\t{\n\t\t\tReadInternal(buffer, 4);\n\t\t\treturn bitConverter.ToSingle(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a double-precision floating-point value from the stream, using the bit converter\n\t\t/// for this reader. 8 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The floating point value read</returns>\n\t\tpublic double ReadDouble()\n\t\t{\n\t\t\tReadInternal(buffer, 8);\n\t\t\treturn bitConverter.ToDouble(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a decimal value from the stream, using the bit converter\n\t\t/// for this reader. 16 bytes are read.\n\t\t/// </summary>\n\t\t/// <returns>The decimal value read</returns>\n\t\tpublic decimal ReadDecimal()\n\t\t{\n\t\t\tReadInternal(buffer, 16);\n\t\t\treturn bitConverter.ToDecimal(buffer, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a single character from the stream, using the character encoding for\n\t\t/// this reader. If no characters have been fully read by the time the stream ends,\n\t\t/// -1 is returned.\n\t\t/// </summary>\n\t\t/// <returns>The character read, or -1 for end of stream.</returns>\n\t\tpublic int Read()\n\t\t{\n\t\t\tint charsRead = Read(charBuffer, 0, 1);\n\t\t\tif (charsRead==0)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn charBuffer[0];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the specified number of characters into the given buffer, starting at\n\t\t/// the given index.\n\t\t/// </summary>\n\t\t/// <param name=\"data\">The buffer to copy data into</param>\n\t\t/// <param name=\"index\">The first index to copy data into</param>\n\t\t/// <param name=\"count\">The number of characters to read</param>\n\t\t/// <returns>The number of characters actually read. This will only be less than\n\t\t/// the requested number of characters if the end of the stream is reached.\n\t\t/// </returns>\n\t\tpublic int Read(char[] data, int index, int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (data==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"data\");\n\t\t\t}\n\t\t\tif (index < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tif (count < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tif (count+index > data.Length)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException\n\t\t\t\t\t(\"Not enough space in buffer for specified number of characters starting at specified index\");\n\t\t\t}\n\n\t\t\tint read=0;\n\t\t\tbool firstTime=true;\n\n\t\t\t// Use the normal buffer if we're only reading a small amount, otherwise\n\t\t\t// use at most 4K at a time.\n\t\t\tbyte[] byteBuffer = buffer;\n\n\t\t\tif (byteBuffer.Length < count*minBytesPerChar)\n\t\t\t{\n\t\t\t\tbyteBuffer = new byte[4096];\n\t\t\t}\n\n\t\t\twhile (read < count)\n\t\t\t{\n\t\t\t\tint amountToRead;\n\t\t\t\t// First time through we know we haven't previously read any data\n\t\t\t\tif (firstTime)\n\t\t\t\t{\n\t\t\t\t\tamountToRead = count*minBytesPerChar;\n\t\t\t\t\tfirstTime=false;\n\t\t\t\t}\n\t\t\t\t// After that we can only assume we need to fully read \"chars left -1\" characters\n\t\t\t\t// and a single byte of the character we may be in the middle of\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tamountToRead = ((count-read-1)*minBytesPerChar)+1;\n\t\t\t\t}\n\t\t\t\tif (amountToRead > byteBuffer.Length)\n\t\t\t\t{\n\t\t\t\t\tamountToRead = byteBuffer.Length;\n\t\t\t\t}\n\t\t\t\tint bytesRead = TryReadInternal(byteBuffer, amountToRead);\n\t\t\t\tif (bytesRead==0)\n\t\t\t\t{\n\t\t\t\t\treturn read;\n\t\t\t\t}\n\t\t\t\tint decoded = decoder.GetChars(byteBuffer, 0, bytesRead, data, index);\n\t\t\t\tread += decoded;\n\t\t\t\tindex += decoded;\n\t\t\t}\n\t\t\treturn read;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the specified number of bytes into the given buffer, starting at\n\t\t/// the given index.\n\t\t/// </summary>\n\t\t/// <param name=\"buffer\">The buffer to copy data into</param>\n\t\t/// <param name=\"index\">The first index to copy data into</param>\n\t\t/// <param name=\"count\">The number of bytes to read</param>\n\t\t/// <returns>The number of bytes actually read. This will only be less than\n\t\t/// the requested number of bytes if the end of the stream is reached.\n\t\t/// </returns>\n\t\tpublic int Read(byte[] buffer, int index, int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (buffer==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"buffer\");\n\t\t\t}\n\t\t\tif (index < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tif (count < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tif (count+index > buffer.Length)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException\n\t\t\t\t\t(\"Not enough space in buffer for specified number of bytes starting at specified index\");\n\t\t\t}\n\t\t\tint read=0;\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tint block = stream.Read(buffer, index, count);\n\t\t\t\tif (block==0)\n\t\t\t\t{\n\t\t\t\t\treturn read;\n\t\t\t\t}\n\t\t\t\tindex += block;\n\t\t\t\tread += block;\n\t\t\t\tcount -= block;\n\t\t\t}\n\t\t\treturn read;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the specified number of bytes, returning them in a new byte array.\n\t\t/// If not enough bytes are available before the end of the stream, this\n\t\t/// method will return what is available.\n\t\t/// </summary>\n\t\t/// <param name=\"count\">The number of bytes to read</param>\n\t\t/// <returns>The bytes read</returns>\n\t\tpublic byte[] ReadBytes(int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (count < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"count\");\n\t\t\t}\n\t\t\tbyte[] ret = new byte[count];\n\t\t\tint index=0;\n\t\t\twhile (index < count)\n\t\t\t{\n\t\t\t\tint read = stream.Read(ret, index, count-index);\n\t\t\t\t// Stream has finished half way through. That's fine, return what we've got.\n\t\t\t\tif (read==0)\n\t\t\t\t{\n\t\t\t\t\tbyte[] copy = new byte[index];\n\t\t\t\t\tBuffer.BlockCopy(ret, 0, copy, 0, index);\n\t\t\t\t\treturn copy;\n\t\t\t\t}\n\t\t\t\tindex += read;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the specified number of bytes, returning them in a new byte array.\n\t\t/// If not enough bytes are available before the end of the stream, this\n\t\t/// method will throw an IOException.\n\t\t/// </summary>\n\t\t/// <param name=\"count\">The number of bytes to read</param>\n\t\t/// <returns>The bytes read</returns>\n\t\tpublic byte[] ReadBytesOrThrow(int count)\n\t\t{\n\t\t\tbyte[] ret = new byte[count];\n\t\t\tReadInternal(ret, count);\n\t\t\treturn ret;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 7-bit encoded integer from the stream. This is stored with the least significant\n\t\t/// information first, with 7 bits of information per byte of value, and the top\n\t\t/// bit as a continuation flag. This method is not affected by the endianness\n\t\t/// of the bit converter.\n\t\t/// </summary>\n\t\t/// <returns>The 7-bit encoded integer read from the stream.</returns>\n\t\tpublic int Read7BitEncodedInt()\n\t\t{\n\t\t\tCheckDisposed();\n\n\t\t\tint ret=0;\n\t\t\tfor (int shift = 0; shift < 35; shift+=7)\n\t\t\t{\n\t\t\t\tint b = stream.ReadByte();\n\t\t\t\tif (b==-1)\n\t\t\t\t{\n\t\t\t\t\tthrow new EndOfStreamException();\n\t\t\t\t}\n\t\t\t\tret = ret | ((b&0x7f) << shift);\n\t\t\t\tif ((b & 0x80) == 0)\n\t\t\t\t{\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Still haven't seen a byte with the high bit unset? Dodgy data.\n\t\t\tthrow new IOException(\"Invalid 7-bit encoded integer in stream.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a 7-bit encoded integer from the stream. This is stored with the most significant\n\t\t/// information first, with 7 bits of information per byte of value, and the top\n\t\t/// bit as a continuation flag. This method is not affected by the endianness\n\t\t/// of the bit converter.\n\t\t/// </summary>\n\t\t/// <returns>The 7-bit encoded integer read from the stream.</returns>\n\t\tpublic int ReadBigEndian7BitEncodedInt()\n\t\t{\n\t\t\tCheckDisposed();\n\n\t\t\tint ret=0;\n\t\t\tfor (int i=0; i < 5; i++)\n\t\t\t{\n\t\t\t\tint b = stream.ReadByte();\n\t\t\t\tif (b==-1)\n\t\t\t\t{\n\t\t\t\t\tthrow new EndOfStreamException();\n\t\t\t\t}\n\t\t\t\tret = (ret << 7) | (b&0x7f);\n\t\t\t\tif ((b & 0x80) == 0)\n\t\t\t\t{\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Still haven't seen a byte with the high bit unset? Dodgy data.\n\t\t\tthrow new IOException(\"Invalid 7-bit encoded integer in stream.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a length-prefixed string from the stream, using the encoding for this reader.\n\t\t/// A 7-bit encoded integer is first read, which specifies the number of bytes \n\t\t/// to read from the stream. These bytes are then converted into a string with\n\t\t/// the encoding for this reader.\n\t\t/// </summary>\n\t\t/// <returns>The string read from the stream.</returns>\n\t\tpublic string ReadString()\n\t\t{\n\t\t\tint bytesToRead = Read7BitEncodedInt();\n\n\t\t\tbyte[] data = new byte[bytesToRead];\n\t\t\tReadInternal(data, bytesToRead);\n\t\t\treturn encoding.GetString(data, 0, data.Length);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Private methods\n\t\t/// <summary>\n\t\t/// Checks whether or not the reader has been disposed, throwing an exception if so.\n\t\t/// </summary>\n\t\tvoid CheckDisposed()\n\t\t{\n\t\t\tif (disposed)\n\t\t\t{\n\t\t\t\tthrow new ObjectDisposedException(\"EndianBinaryReader\");\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the given number of bytes from the stream, throwing an exception\n\t\t/// if they can't all be read.\n\t\t/// </summary>\n\t\t/// <param name=\"data\">Buffer to read into</param>\n\t\t/// <param name=\"size\">Number of bytes to read</param>\n\t\tvoid ReadInternal (byte[] data, int size)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tint index=0;\n\t\t\twhile (index < size)\n\t\t\t{\n\t\t\t\tint read = stream.Read(data, index, size-index);\n\t\t\t\tif (read==0)\n\t\t\t\t{\n\t\t\t\t\tthrow new EndOfStreamException\n\t\t\t\t\t\t(String.Format(\"End of stream reached with {0} byte{1} left to read.\", size-index,\n\t\t\t\t\t\tsize-index==1 ? \"s\" : string.Empty));\n\t\t\t\t}\n\t\t\t\tindex += read;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads the given number of bytes from the stream if possible, returning\n\t\t/// the number of bytes actually read, which may be less than requested if\n\t\t/// (and only if) the end of the stream is reached.\n\t\t/// </summary>\n\t\t/// <param name=\"data\">Buffer to read into</param>\n\t\t/// <param name=\"size\">Number of bytes to read</param>\n\t\t/// <returns>Number of bytes actually read</returns>\n\t\tint TryReadInternal (byte[] data, int size)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tint index=0;\n\t\t\twhile (index < size)\n\t\t\t{\n\t\t\t\tint read = stream.Read(data, index, size-index);\n\t\t\t\tif (read==0)\n\t\t\t\t{\n\t\t\t\t\treturn index;\n\t\t\t\t}\n\t\t\t\tindex += read;\n\t\t\t}\n\t\t\treturn index;\n\t\t}\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\t\t/// <summary>\n\t\t/// Disposes of the underlying stream.\n\t\t/// </summary>\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (!disposed)\n\t\t\t{\n\t\t\t\tdisposed = true;\n\t\t\t\t((IDisposable)stream).Dispose();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/EndianBinaryWriter.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing MiscUtil.Conversion;\n\nnamespace MiscUtil.IO\n{\n\t/// <summary>\n\t/// Equivalent of System.IO.BinaryWriter, but with either endianness, depending on\n\t/// the EndianBitConverter it is constructed with.\n\t/// </summary>\n\tpublic class EndianBinaryWriter : IDisposable\n\t{\n\t\t#region Fields not directly related to properties\n\t\t/// <summary>\n\t\t/// Whether or not this writer has been disposed yet.\n\t\t/// </summary>\n\t\tbool disposed=false;\n\t\t/// <summary>\n\t\t/// Buffer used for temporary storage during conversion from primitives\n\t\t/// </summary>\n\t\tbyte[] buffer = new byte[16];\n\t\t/// <summary>\n\t\t/// Buffer used for Write(char)\n\t\t/// </summary>\n\t\tchar[] charBuffer = new char[1];\n\t\t#endregion\n\n\t\t#region Constructors\n\t\t/// <summary>\n\t\t/// Constructs a new binary writer with the given bit converter, writing\n\t\t/// to the given stream, using UTF-8 encoding.\n\t\t/// </summary>\n\t\t/// <param name=\"bitConverter\">Converter to use when writing data</param>\n\t\t/// <param name=\"stream\">Stream to write data to</param>\n\t\tpublic EndianBinaryWriter (EndianBitConverter bitConverter,\n\t\t\tStream stream) : this (bitConverter, stream, Encoding.UTF8)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Constructs a new binary writer with the given bit converter, writing\n\t\t/// to the given stream, using the given encoding.\n\t\t/// </summary>\n\t\t/// <param name=\"bitConverter\">Converter to use when writing data</param>\n\t\t/// <param name=\"stream\">Stream to write data to</param>\n\t\t/// <param name=\"encoding\">Encoding to use when writing character data</param>\n\t\tpublic EndianBinaryWriter (EndianBitConverter bitConverter,\tStream stream, Encoding encoding)\n\t\t{\n\t\t\tif (bitConverter==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"bitConverter\");\n\t\t\t}\n\t\t\tif (stream==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"stream\");\n\t\t\t}\n\t\t\tif (encoding==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"encoding\");\n\t\t\t}\n\t\t\tif (!stream.CanWrite)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Stream isn't writable\", \"stream\");\n\t\t\t}\n\t\t\tthis.stream = stream;\n\t\t\tthis.bitConverter = bitConverter;\n\t\t\tthis.encoding = encoding;\n\t\t}\n\t\t#endregion\n\n\t\t#region Properties\n\t\tEndianBitConverter bitConverter;\n\t\t/// <summary>\n\t\t/// The bit converter used to write values to the stream\n\t\t/// </summary>\n\t\tpublic EndianBitConverter BitConverter\n\t\t{\n\t\t\tget { return bitConverter; }\n\t\t}\n\n\t\tEncoding encoding;\n\t\t/// <summary>\n\t\t/// The encoding used to write strings\n\t\t/// </summary>\n\t\tpublic Encoding Encoding\n\t\t{\n\t\t\tget { return encoding; }\n\t\t}\n\n\t\tStream stream;\n\t\t/// <summary>\n\t\t/// Gets the underlying stream of the EndianBinaryWriter.\n\t\t/// </summary>\n\t\tpublic Stream BaseStream\n\t\t{\n\t\t\tget { return stream; }\n\t\t}\n\t\t#endregion\n\t\n\t\t#region Public methods\n\t\t/// <summary>\n\t\t/// Closes the writer, including the underlying stream.\n\t\t/// </summary>\n\t\tpublic void Close()\n\t\t{\n\t\t\tDispose();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Flushes the underlying stream.\n\t\t/// </summary>\n\t\tpublic void Flush()\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tstream.Flush();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Seeks within the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">Offset to seek to.</param>\n\t\t/// <param name=\"origin\">Origin of seek operation.</param>\n\t\tpublic void Seek (int offset, SeekOrigin origin)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tstream.Seek (offset, origin);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a boolean value to the stream. 1 byte is written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (bool value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 1);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 16-bit signed integer to the stream, using the bit converter\n\t\t/// for this writer. 2 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (short value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 2);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 32-bit signed integer to the stream, using the bit converter\n\t\t/// for this writer. 4 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (int value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 64-bit signed integer to the stream, using the bit converter\n\t\t/// for this writer. 8 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (long value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 16-bit unsigned integer to the stream, using the bit converter\n\t\t/// for this writer. 2 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (ushort value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 2);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 32-bit unsigned integer to the stream, using the bit converter\n\t\t/// for this writer. 4 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (uint value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 64-bit unsigned integer to the stream, using the bit converter\n\t\t/// for this writer. 8 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (ulong value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a single-precision floating-point value to the stream, using the bit converter\n\t\t/// for this writer. 4 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (float value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a double-precision floating-point value to the stream, using the bit converter\n\t\t/// for this writer. 8 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (double value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a decimal value to the stream, using the bit converter for this writer.\n\t\t/// 16 bytes are written.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (decimal value)\n\t\t{\n\t\t\tbitConverter.CopyBytes(value, buffer, 0);\n\t\t\tWriteInternal(buffer, 16);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a signed byte to the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (byte value)\n\t\t{\n\t\t\tbuffer[0] = value;\n\t\t\tWriteInternal(buffer, 1);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes an unsigned byte to the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write (sbyte value)\n\t\t{\n\t\t\tbuffer[0] = unchecked((byte)value);\n\t\t\tWriteInternal(buffer, 1);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes an array of bytes to the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The values to write</param>\n\t\tpublic void Write (byte[] value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t{\n\t\t\t\tthrow (new System.ArgumentNullException(\"value\"));\n\t\t\t}\n\t\t\tWriteInternal(value, value.Length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a portion of an array of bytes to the stream.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array containing the bytes to write</param>\n\t\t/// <param name=\"offset\">The index of the first byte to write within the array</param>\n\t\t/// <param name=\"count\">The number of bytes to write</param>\n\t\tpublic void Write (byte[] value, int offset, int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tstream.Write(value, offset, count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a single character to the stream, using the encoding for this writer.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write</param>\n\t\tpublic void Write(char value)\n\t\t{\n\t\t\tcharBuffer[0] = value;\n\t\t\tWrite(charBuffer);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes an array of characters to the stream, using the encoding for this writer.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array containing the characters to write</param>\n\t\tpublic void Write(char[] value)\n\t\t{\n\t\t\tif (value==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tCheckDisposed();\n\t\t\tbyte[] data = Encoding.GetBytes(value, 0, value.Length);\n\t\t\tWriteInternal(data, data.Length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a string to the stream, using the encoding for this writer.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to write. Must not be null.</param>\n\t\t/// <exception cref=\"ArgumentNullException\">value is null</exception>\n\t\tpublic void Write(string value)\n\t\t{\n\t\t\tif (value==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tCheckDisposed();\n\t\t\tbyte[] data = Encoding.GetBytes(value);\n\t\t\tWrite7BitEncodedInt(data.Length);\n\t\t\tWriteInternal(data, data.Length);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes a 7-bit encoded integer from the stream. This is stored with the least significant\n\t\t/// information first, with 7 bits of information per byte of value, and the top\n\t\t/// bit as a continuation flag.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The 7-bit encoded integer to write to the stream</param>\n\t\tpublic void Write7BitEncodedInt(int value)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (value < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"value\", \"Value must be greater than or equal to 0.\");\n\t\t\t}\n\t\t\tint index=0;\n\t\t\twhile (value >= 128)\n\t\t\t{\n\t\t\t\tbuffer[index++]= (byte)((value&0x7f) | 0x80);\n\t\t\t\tvalue = value >> 7;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tbuffer[index++]=(byte)value;\n\t\t\tstream.Write(buffer, 0, index);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Private methods\n\t\t/// <summary>\n\t\t/// Checks whether or not the writer has been disposed, throwing an exception if so.\n\t\t/// </summary>\n\t\tvoid CheckDisposed()\n\t\t{\n\t\t\tif (disposed)\n\t\t\t{\n\t\t\t\tthrow new ObjectDisposedException(\"EndianBinaryWriter\");\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Writes the specified number of bytes from the start of the given byte array,\n\t\t/// after checking whether or not the writer has been disposed.\n\t\t/// </summary>\n\t\t/// <param name=\"bytes\">The array of bytes to write from</param>\n\t\t/// <param name=\"length\">The number of bytes to write</param>\n\t\tvoid WriteInternal (byte[] bytes, int length)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tstream.Write(bytes, 0, length);\n\t\t}\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\t\t/// <summary>\n\t\t/// Disposes of the underlying stream.\n\t\t/// </summary>\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (!disposed)\n\t\t\t{\n\t\t\t\tFlush();\n\t\t\t\tdisposed = true;\n\t\t\t\t((IDisposable)stream).Dispose();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/EndianBitConverter.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace MiscUtil.Conversion\n{\n\t/// <summary>\n\t/// Equivalent of System.BitConverter, but with either endianness.\n\t/// </summary>\n\tpublic abstract class EndianBitConverter\n\t{\n\t\t#region Endianness of this converter\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Different computer architectures store data using different byte orders. \"Big-endian\"\n\t\t/// means the most significant byte is on the left end of a word. \"Little-endian\" means the \n\t\t/// most significant byte is on the right end of a word.\n\t\t/// </remarks>\n\t\t/// <returns>true if this converter is little-endian, false otherwise.</returns>\n\t\tpublic abstract bool IsLittleEndian();\n\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\tpublic abstract Endianness Endianness { get; }\n\t\t#endregion\n\n\t\t#region Factory properties\n\t\tstatic LittleEndianBitConverter little = new LittleEndianBitConverter();\n\t\t/// <summary>\n\t\t/// Returns a little-endian bit converter instance. The same instance is\n\t\t/// always returned.\n\t\t/// </summary>\n\t\tpublic static LittleEndianBitConverter Little\n\t\t{\n\t\t\tget { return little; }\n\t\t}\n\n\t\tstatic BigEndianBitConverter big = new BigEndianBitConverter();\n\t\t/// <summary>\n\t\t/// Returns a big-endian bit converter instance. The same instance is\n\t\t/// always returned.\n\t\t/// </summary>\n\t\tpublic static BigEndianBitConverter Big\n\t\t{\n\t\t\tget { return big; }\n\t\t}\n\t\t#endregion\n\n\t\t#region Double/primitive conversions\n\t\t/// <summary>\n\t\t/// Converts the specified double-precision floating point number to a \n\t\t/// 64-bit signed integer. Note: the endianness of this converter does not\n\t\t/// affect the returned value.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert. </param>\n\t\t/// <returns>A 64-bit signed integer whose value is equivalent to value.</returns>\n\t\tpublic long DoubleToInt64Bits(double value)\n\t\t{\n\t\t\treturn BitConverter.DoubleToInt64Bits(value);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts the specified 64-bit signed integer to a double-precision \n\t\t/// floating point number. Note: the endianness of this converter does not\n\t\t/// affect the returned value.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert. </param>\n\t\t/// <returns>A double-precision floating point number whose value is equivalent to value.</returns>\n\t\tpublic double Int64BitsToDouble (long value)\n\t\t{\n\t\t\treturn BitConverter.Int64BitsToDouble(value);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts the specified single-precision floating point number to a \n\t\t/// 32-bit signed integer. Note: the endianness of this converter does not\n\t\t/// affect the returned value.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert. </param>\n\t\t/// <returns>A 32-bit signed integer whose value is equivalent to value.</returns>\n\t\tpublic int SingleToInt32Bits(float value)\n\t\t{\n\t\t\treturn new Int32SingleUnion(value).AsInt32;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts the specified 32-bit signed integer to a single-precision floating point \n\t\t/// number. Note: the endianness of this converter does not\n\t\t/// affect the returned value.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert. </param>\n\t\t/// <returns>A single-precision floating point number whose value is equivalent to value.</returns>\n\t\tpublic float Int32BitsToSingle (int value)\n\t\t{\n\t\t\treturn new Int32SingleUnion(value).AsSingle;\n\t\t}\n\t\t#endregion\n\n\t\t#region To(PrimitiveType) conversions\n\t\t/// <summary>\n\t\t/// Returns a Boolean value converted from one byte at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>true if the byte at startIndex in value is nonzero; otherwise, false.</returns>\n\t\tpublic bool ToBoolean (byte[] value, int startIndex)\n\t\t{\n\t\t\tCheckByteArgument(value, startIndex, 1);\n\t\t\treturn BitConverter.ToBoolean(value, startIndex);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a Unicode character converted from two bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A character formed by two bytes beginning at startIndex.</returns>\n\t\tpublic char ToChar (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((char) (CheckedFromBytes(value, startIndex, 2)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a double-precision floating point number converted from eight bytes \n\t\t/// at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A double precision floating point number formed by eight bytes beginning at startIndex.</returns>\n\t\tpublic double ToDouble (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn Int64BitsToDouble(ToInt64(value, startIndex));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a single-precision floating point number converted from four bytes \n\t\t/// at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A single precision floating point number formed by four bytes beginning at startIndex.</returns>\n\t\tpublic float ToSingle (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn Int32BitsToSingle(ToInt32(value, startIndex));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 16-bit signed integer formed by two bytes beginning at startIndex.</returns>\n\t\tpublic short ToInt16 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((short) (CheckedFromBytes(value, startIndex, 2)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 32-bit signed integer formed by four bytes beginning at startIndex.</returns>\n\t\tpublic int ToInt32 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((int) (CheckedFromBytes(value, startIndex, 4)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 64-bit signed integer formed by eight bytes beginning at startIndex.</returns>\n\t\tpublic long ToInt64 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn CheckedFromBytes(value, startIndex, 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 16-bit unsigned integer formed by two bytes beginning at startIndex.</returns>\n\t\tpublic ushort ToUInt16 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((ushort) (CheckedFromBytes(value, startIndex, 2)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 32-bit unsigned integer formed by four bytes beginning at startIndex.</returns>\n\t\tpublic uint ToUInt32 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((uint) (CheckedFromBytes(value, startIndex, 4)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A 64-bit unsigned integer formed by eight bytes beginning at startIndex.</returns>\n\t\tpublic ulong ToUInt64 (byte[] value, int startIndex)\n\t\t{\n\t\t\treturn unchecked((ulong) (CheckedFromBytes(value, startIndex, 8)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks the given argument for validity.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The byte array passed in</param>\n\t\t/// <param name=\"startIndex\">The start index passed in</param>\n\t\t/// <param name=\"bytesRequired\">The number of bytes required</param>\n\t\t/// <exception cref=\"ArgumentNullException\">value is a null reference</exception>\n\t\t/// <exception cref=\"ArgumentOutOfRangeException\">\n\t\t/// startIndex is less than zero or greater than the length of value minus bytesRequired.\n\t\t/// </exception>\n\t\tstatic void CheckByteArgument(byte[] value, int startIndex, int bytesRequired)\n\t\t{\n\t\t\tif (value==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tif (startIndex < 0 || startIndex > value.Length-bytesRequired)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"startIndex\");\n\t\t\t}\n\t\t}\n\n        /// <summary>\n        /// Checks the arguments for validity before calling FromBytes\n        /// (which can therefore assume the arguments are valid).\n        /// </summary>\n        /// <param name=\"value\">The bytes to convert after checking</param>\n        /// <param name=\"startIndex\">The index of the first byte to convert</param>\n        /// <param name=\"bytesToConvert\">The number of bytes to convert</param>\n        /// <returns></returns>\n\t\tlong CheckedFromBytes(byte[] value, int startIndex, int bytesToConvert)\n\t\t{\n\t\t\tCheckByteArgument(value, startIndex, bytesToConvert);\n\t\t\treturn FromBytes(value, startIndex, bytesToConvert);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert the given number of bytes from the given array, from the given start\n\t\t/// position, into a long, using the bytes as the least significant part of the long.\n\t\t/// By the time this is called, the arguments have been checked for validity.\n\t\t/// </summary>\n\t\t/// <param name=\"buffer\">The bytes to convert</param>\n\t\t/// <param name=\"startIndex\">The index of the first byte to convert</param>\n\t\t/// <param name=\"bytesToConvert\">The number of bytes to use in the conversion</param>\n\t\t/// <returns>The converted number</returns>\n        protected abstract long FromBytes(byte[] buffer, int startIndex, int bytesToConvert);\n\t\t#endregion\n\n\t\t#region ToString conversions\n\t\t/// <summary>\n\t\t/// Returns a String converted from the elements of a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <remarks>All the elements of value are converted.</remarks>\n\t\t/// <returns>\n\t\t/// A String of hexadecimal pairs separated by hyphens, where each pair \n\t\t/// represents the corresponding element in value; for example, \"7F-2C-4A\".\n\t\t/// </returns>\n\t\tpublic static string ToString(byte[] value)\n\t\t{\n\t\t\treturn BitConverter.ToString(value);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a String converted from the elements of a byte array starting at a specified array position.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <remarks>The elements from array position startIndex to the end of the array are converted.</remarks>\n\t\t/// <returns>\n\t\t/// A String of hexadecimal pairs separated by hyphens, where each pair \n\t\t/// represents the corresponding element in value; for example, \"7F-2C-4A\".\n\t\t/// </returns>\n\t\tpublic static string ToString(byte[] value, int startIndex)\n\t\t{\n\t\t\treturn BitConverter.ToString(value, startIndex);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a String converted from a specified number of bytes at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <param name=\"length\">The number of bytes to convert.</param>\n\t\t/// <remarks>The length elements from array position startIndex are converted.</remarks>\n\t\t/// <returns>\n\t\t/// A String of hexadecimal pairs separated by hyphens, where each pair \n\t\t/// represents the corresponding element in value; for example, \"7F-2C-4A\".\n\t\t/// </returns>\n\t\tpublic static string ToString(byte[] value, int startIndex, int length)\n\t\t{\n\t\t\treturn BitConverter.ToString(value, startIndex, length);\n\t\t}\n\t\t#endregion\n\n\t\t#region\tDecimal conversions\n\t\t/// <summary>\n\t\t/// Returns a decimal value converted from sixteen bytes \n\t\t/// at a specified position in a byte array.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">An array of bytes.</param>\n\t\t/// <param name=\"startIndex\">The starting position within value.</param>\n\t\t/// <returns>A decimal  formed by sixteen bytes beginning at startIndex.</returns>\n\t\tpublic decimal ToDecimal (byte[] value, int startIndex)\n\t\t{\n\t\t\t// HACK: This always assumes four parts, each in their own endianness,\n\t\t\t// starting with the first part at the start of the byte array.\n\t\t\t// On the other hand, there's no real format specified...\n\t\t\tint[] parts = new int[4];\n\t\t\tfor (int i=0; i < 4; i++)\n\t\t\t{\n\t\t\t\tparts[i] = ToInt32(value, startIndex+i*4);\n\t\t\t}\n\t\t\treturn new Decimal(parts);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified decimal value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 16.</returns>\n\t\tpublic byte[] GetBytes(decimal value)\n\t\t{\n\t\t\tbyte[] bytes = new byte[16];\n\t\t\tint[] parts = decimal.GetBits(value);\n\t\t\tfor (int i=0; i < 4; i++)\n\t\t\t{\n\t\t\t\tCopyBytesImpl(parts[i], 4, bytes, i*4);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified decimal value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">A character to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(decimal value, byte[] buffer, int index)\n\t\t{\n\t\t\tint[] parts = decimal.GetBits(value);\n\t\t\tfor (int i=0; i < 4; i++)\n\t\t\t{\n\t\t\t\tCopyBytesImpl(parts[i], 4, buffer, i*4+index);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region GetBytes conversions\n\t\t/// <summary>\n\t\t/// Returns an array with the given number of bytes formed\n\t\t/// from the least significant bytes of the specified value.\n\t\t/// This is used to implement the other GetBytes methods.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to get bytes for</param>\n\t\t/// <param name=\"bytes\">The number of significant bytes to return</param>\n\t\tbyte[] GetBytes(long value, int bytes)\n\t\t{\n\t\t\tbyte[] buffer = new byte[bytes];\n\t\t\tCopyBytes(value, bytes, buffer, 0);\n\t\t\treturn buffer;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified Boolean value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">A Boolean value.</param>\n\t\t/// <returns>An array of bytes with length 1.</returns>\n\t\tpublic byte[] GetBytes(bool value)\n\t\t{\n\t\t\treturn BitConverter.GetBytes(value);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified Unicode character value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">A character to convert.</param>\n\t\t/// <returns>An array of bytes with length 2.</returns>\n\t\tpublic byte[] GetBytes(char value)\n\t\t{\n\t\t\treturn GetBytes(value, 2);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified double-precision floating point value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 8.</returns>\n\t\tpublic byte[] GetBytes(double value)\n\t\t{\n\t\t\treturn GetBytes(DoubleToInt64Bits(value), 8);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the specified 16-bit signed integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 2.</returns>\n\t\tpublic byte[] GetBytes(short value)\n\t\t{\n\t\t\treturn GetBytes(value, 2);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified 32-bit signed integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 4.</returns>\n\t\tpublic byte[] GetBytes(int value)\n\t\t{\n\t\t\treturn GetBytes(value, 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified 64-bit signed integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 8.</returns>\n\t\tpublic byte[] GetBytes(long value)\n\t\t{\n\t\t\treturn GetBytes(value, 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified single-precision floating point value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 4.</returns>\n\t\tpublic byte[] GetBytes(float value)\n\t\t{\n\t\t\treturn GetBytes(SingleToInt32Bits(value), 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified 16-bit unsigned integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 2.</returns>\n\t\tpublic byte[] GetBytes(ushort value)\n\t\t{\n\t\t\treturn GetBytes(value, 2);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified 32-bit unsigned integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 4.</returns>\n\t\tpublic byte[] GetBytes(uint value)\n\t\t{\n\t\t\treturn GetBytes(value, 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the specified 64-bit unsigned integer value as an array of bytes.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <returns>An array of bytes with length 8.</returns>\n\t\tpublic byte[] GetBytes(ulong value)\n\t\t{\n\t\t\treturn GetBytes(unchecked((long)value), 8);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region CopyBytes conversions\n\t\t/// <summary>\n\t\t/// Copies the given number of bytes from the least-specific\n\t\t/// end of the specified value into the specified byte array, beginning\n\t\t/// at the specified index.\n\t\t/// This is used to implement the other CopyBytes methods.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to copy bytes for</param>\n\t\t/// <param name=\"bytes\">The number of significant bytes to copy</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tvoid CopyBytes(long value, int bytes, byte[] buffer, int index)\n\t\t{\n\t\t\tif (buffer==null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"buffer\", \"Byte array must not be null\");\n\t\t\t}\n\t\t\tif (buffer.Length < index+bytes)\n\t\t\t{\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"buffer\",\"Buffer not big enough for value\");\n\t\t\t}\n\t\t\tCopyBytesImpl(value, bytes, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the given number of bytes from the least-specific\n\t\t/// end of the specified value into the specified byte array, beginning\n\t\t/// at the specified index.\n\t\t/// This must be implemented in concrete derived classes, but the implementation\n\t\t/// may assume that the value will fit into the buffer.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to copy bytes for</param>\n\t\t/// <param name=\"bytes\">The number of significant bytes to copy</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tprotected abstract void CopyBytesImpl(long value, int bytes, byte[] buffer, int index);\n\n\t\t/// <summary>\n\t\t/// Copies the specified Boolean value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">A Boolean value.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(bool value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value ? 1 : 0, 1, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified Unicode character value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">A character to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(char value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 2, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified double-precision floating point value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(double value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(DoubleToInt64Bits(value), 8, buffer, index);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Copies the specified 16-bit signed integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(short value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 2, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified 32-bit signed integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(int value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 4, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified 64-bit signed integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(long value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 8, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified single-precision floating point value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(float value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(SingleToInt32Bits(value), 4, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified 16-bit unsigned integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(ushort value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 2, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified 32-bit unsigned integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(uint value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(value, 4, buffer, index);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified 64-bit unsigned integer value into the specified byte array,\n\t\t/// beginning at the specified index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The number to convert.</param>\n\t\t/// <param name=\"buffer\">The byte array to copy the bytes into</param>\n\t\t/// <param name=\"index\">The first index into the array to copy the bytes into</param>\n\t\tpublic void CopyBytes(ulong value, byte[] buffer, int index)\n\t\t{\n\t\t\tCopyBytes(unchecked((long)value), 8, buffer, index);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Private struct used for Single/Int32 conversions\n\t\t/// <summary>\n\t\t/// Union used solely for the equivalent of DoubleToInt64Bits and vice versa.\n\t\t/// </summary>\n\t\t[StructLayout(LayoutKind.Explicit)]\n\t\t\tstruct Int32SingleUnion\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Int32 version of the value.\n\t\t\t/// </summary>\n\t\t\t[FieldOffset(0)]\n\t\t\tint i;\n\t\t\t/// <summary>\n\t\t\t/// Single version of the value.\n\t\t\t/// </summary>\n\t\t\t[FieldOffset(0)]\n\t\t\tfloat f;\n\n\t\t\t/// <summary>\n\t\t\t/// Creates an instance representing the given integer.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"i\">The integer value of the new instance.</param>\n\t\t\tinternal Int32SingleUnion(int i)\n\t\t\t{\n\t\t\t\tthis.f = 0; // Just to keep the compiler happy\n\t\t\t\tthis.i = i;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Creates an instance representing the given floating point number.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"f\">The floating point value of the new instance.</param>\n\t\t\tinternal Int32SingleUnion(float f)\n\t\t\t{\n\t\t\t\tthis.i = 0; // Just to keep the compiler happy\n\t\t\t\tthis.f = f;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Returns the value of the instance as an integer.\n\t\t\t/// </summary>\n\t\t\tinternal int AsInt32\n\t\t\t{\n\t\t\t\tget { return i; }\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Returns the value of the instance as a floating point number.\n\t\t\t/// </summary>\n\t\t\tinternal float AsSingle\n\t\t\t{\n\t\t\t\tget { return f; }\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/Endianness.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nusing System;\n\nnamespace MiscUtil.Conversion\n{\n\t/// <summary>\n\t/// Endianness of a converter\n\t/// </summary>\n\t[Serializable]\n\tpublic enum Endianness\n\t{\n\t\t/// <summary>\n\t\t/// Little endian - least significant byte first\n\t\t/// </summary>\n\t\tLittleEndian,\n\t\t/// <summary>\n\t\t/// Big endian - most significant byte first\n\t\t/// </summary>\n\t\tBigEndian\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/Extensions.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Security;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    public static class Extensions\n    {\n        private static string alphaNumeric = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\n        public static long UnsignedRightShift(this long n, int s) //Overloaded function where n is a long\n        {\n            if (n > 0)\n            {\n                return n >> s;\n            }\n            \n            return (n >> s) + (((long) 2) << ~s);\n        }\n\n        public static int UnsignedRightShift(this int n, int s)\n        {\n            if (n > 0)\n            {\n                return n >> s;\n            }\n            \n            return (n >> s) + (2 << ~s);\n        }\n\n        /// <summary>\n        /// Adds or replaces the a value based on a key.\n        /// </summary>\n        /// <typeparam name=\"K\"></typeparam>\n        /// <typeparam name=\"V\"></typeparam>\n        /// <param name=\"dict\">The dict.</param>\n        /// <param name=\"key\">The key.</param>\n        /// <param name=\"value\">The value.</param>\n        public static void AddOrReplace<K, V>(this IDictionary<K, V> dict, K key, V value)\n        {\n            dict.put(key, value);\n        }\n\n        /// <summary>\n        /// Adds or replaces the a value based on a key.\n        /// </summary>\n        /// <typeparam name=\"K\"></typeparam>\n        /// <typeparam name=\"V\"></typeparam>\n        /// <param name=\"dict\">The dict.</param>\n        /// <param name=\"key\">The key.</param>\n        /// <param name=\"value\">The value.</param>\n        /// <returns>the previous value of the specified key in this dictionary, or null if it did not have one. </returns>\n        public static V put<K, V>(this IDictionary<K, V> dict, K key, V value)\n        {\n            V previous = default(V);\n            if (dict.ContainsKey(key))\n            {\n                previous = dict[key];\n                dict[key] = value;\n            }\n            else\n            {\n                dict.Add(key, value);\n            }\n\n            return previous;\n        }\n\n        /// <summary>\n        /// Returns a value from a dictionary or the values default\n        /// </summary>\n        /// <typeparam name=\"K\">Key Type</typeparam>\n        /// <typeparam name=\"V\">Value Type</typeparam>\n        /// <param name=\"dict\">dictionary to search</param>\n        /// <param name=\"key\">Key to search for</param>\n        /// <returns>default(V) or item if Key is found</returns>\n        public static V get<K, V>(this IDictionary<K, V> dict, K key)\n        {\n            V v;\n            if (dict.TryGetValue(key, out v))\n            {\n                return v;\n            }\n\n            return default(V);\n        }\n\n        public static int size<K, V>(this IDictionary<K, V> dict)\n        {\n            return dict.Count();\n        }\n\n        public static V GetValue<K, V>(this IDictionary<K, V> dict, K key)\n        {\n            return dict.get(key);\n        }\n        public static V remove<K, V>(this IDictionary<K, V> dict, K key)\n        {\n            V v;\n            if (dict.TryGetValue(key, out v))\n            {\n                dict.Remove(key);\n                return v;\n            }\n\n            return default(V);\n        }\n\n        public static V RemoveValue<K, V>(this IDictionary<K, V> dict, K key)\n        {\n            return dict.remove(key);\n        }\n\n        public static void Write(this BinaryWriter writer, ObjectId o)\n        {\n            o.CopyTo(writer);\n        }\n\n        public static FileInfo CreateTempFile(this DirectoryInfo d, string prefix)\n        {\n            return CreateTempFile(d, prefix, null);\n        }\n\n        public static FileInfo CreateTempFile(this DirectoryInfo d, string prefix, string suffix)\n        {\n            string name = string.Empty;\n            var rnd = new Random((int) DateTime.Now.Ticks);\n            if (!string.IsNullOrEmpty(prefix))\n                name += prefix;\n\n            int i = 8;\n            while (i-- > 0)\n                name += alphaNumeric[rnd.Next(alphaNumeric.Length - 1)];\n\n            if (suffix == null)\n                name += \".tmp\";\n            else\n                name += suffix;\n\n            return new FileInfo(Path.Combine(d.FullName, name));\n        }\n\n        public static bool RenameTo(this FileInfo file, string newPath)\n        {\n            try\n            {\n                file.MoveTo(newPath);\n                return true;\n            }\n            catch (IOException)\n            {\n            }\n            catch (ArgumentNullException)\n            {\n            }\n            catch (ArgumentException)\n            {\n            }\n            catch (SecurityException)\n            {\n            }\n            catch (UnauthorizedAccessException)\n            {\n            }\n            catch (NotSupportedException)\n            {\n            }\n\n            return false;\n        }\n\n        public static string DirectoryName(this FileSystemInfo fileSystemInfo)\n        {\n            return fileSystemInfo.FullName;\n        }\n\n        public static bool IsDirectory(this FileSystemInfo fileSystemInfo)\n        {\n            return Directory.Exists(fileSystemInfo.FullName);\n        }\n\n        public static bool IsFile(this FileSystemInfo fileSystemInfo)\n        {\n            return File.Exists(fileSystemInfo.FullName);\n        }\n\n        public static FileSystemInfo[] ListFiles(this FileSystemInfo fileInfo)\n        {\n            if (fileInfo.IsFile())\n            {\n                return null;\n            }\n\n            return Directory.GetFileSystemEntries(fileInfo.FullName).Select(x => new FileInfo(x)).ToArray();\n        }\n\n        /// <summary>\n        /// Returns the time that the file denoted by this abstract pathname was last modified.\n        /// </summary>\n        /// <param name=\"fi\">A file</param>\n        /// <returns>A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs.</returns>\n        public static long lastModified(this FileInfo fi)\n        {\n            return InternalLastModified(fi, fsi => fsi.IsFile());\n        }\n\n        /// <summary>\n        /// Returns the time that the directory denoted by this abstract pathname was last modified.\n        /// </summary>\n        /// <param name=\"di\">A directory</param>\n        /// <returns>A long value representing the time the directory was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the directory does not exist or if an I/O error occurs.</returns>\n        public static long lastModified(this DirectoryInfo di)\n        {\n            return InternalLastModified(di, fsi => fsi.IsDirectory());\n        }\n\n        private static long InternalLastModified(FileSystemInfo fsi, Func<FileSystemInfo, bool> typeAndExistenceChecker)\n        {\n            if (fsi == null)\n            {\n                return 0;\n            }\n\n            if (!typeAndExistenceChecker(fsi))\n            {\n                return 0;\n            }\n\n            fsi.Refresh();\n            return fsi.LastWriteTimeUtc.ToMillisecondsSinceEpoch();\n        }\n\n        public static bool Mkdirs(this DirectoryInfo directoryInfo)\n        {\n            if (directoryInfo.Exists)\n            {\n                return true;\n            }\n\n            directoryInfo.Parent.Mkdirs();\n\n            directoryInfo.Create();\n\n\t\t\tdirectoryInfo.Refresh();\n\n            return true;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/FS.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core;\n\nnamespace GitSharp.Core.Util\n{\n\n    /* Abstraction to support various file system operations not in Java. */\n    public static class FS\n    {\n        /* The implementation selected for this operating system and JRE. */\n        //public static FS INSTANCE = new FS_Win32;\n\n        //static {\n        //    if (FS_Win32.detect()) {\n        //        if (FS_Win32_Cygwin.detect())\n        //            INSTANCE = new FS_Win32_Cygwin();\n        //        else\n        //            INSTANCE = new FS_Win32();\n        //    } else if (FS_POSIX_Java6.detect())\n        //        INSTANCE = new FS_POSIX_Java6();\n        //    else\n        //        INSTANCE = new FS_POSIX_Java5();\n        //}\n\n        /**\n         * Does this operating system and JRE support the execute flag on files?\n         * \n         * @return true if this implementation can provide reasonably accurate\n         *         executable bit information; false otherwise.\n         */\n        public static bool supportsExecute()\n        {\n            return false; // windows does not support executable file flag\n        }\n\n        /**\n         * Determine if the file is executable (or not).\n         * <para />\n         * Not all platforms and JREs support executable flags on files. If the\n         * feature is unsupported this method will always return false.\n         * \n         * @param f\n         *            abstract path to test.\n         * @return true if the file is believed to be executable by the user.\n         */\n        public static bool canExecute(FileSystemInfo f)\n        {\n            return false; // windows does not support executable file flag\n        }\n\n        /**\n         * Set a file to be executable by the user.\n         * <para />\n         * Not all platforms and JREs support executable flags on files. If the\n         * feature is unsupported this method will always return false and no\n         * changes will be made to the file specified.\n         * \n         * @param f\n         *            path to modify the executable status of.\n         * @param canExec\n         *            true to enable execution; false to disable it.\n         * @return true if the change succeeded; false otherwise.\n         */\n        public static bool setExecute(FileInfo f, bool canExec)\n        {\n            return false; // windows does not support executable file flag\n        }\n\n        /**\n         * Resolve this file to its actual path name that the JRE can use.\n         * <para />\n         * This method can be relatively expensive. Computing a translation may\n         * require forking an external process per path name translated. Callers\n         * should try to minimize the number of translations necessary by caching\n         * the results.\n         * <para />\n         * Not all platforms and JREs require path name translation. Currently only\n         * Cygwin on Win32 require translation for Cygwin based paths.\n         * \n         * @param dir\n         *            directory relative to which the path name is.\n         * @param name\n         *            path name to translate.\n         * @return the translated path. <code>new File(dir,name)</code> if this\n         *         platform does not require path name translation.\n         */\n        public static FileSystemInfo resolve(DirectoryInfo dir, string name)\n        {\n            return resolveImpl(dir, name);\n        }\n\n        /**\n         * Resolve this file to its actual path name that the JRE can use.\n         * <para />\n         * This method can be relatively expensive. Computing a translation may\n         * require forking an external process per path name translated. Callers\n         * should try to minimize the number of translations necessary by caching\n         * the results.\n         * <para />\n         * Not all platforms and JREs require path name translation. Currently only\n         * Cygwin on Win32 require translation for Cygwin based paths.\n         * \n         * @param dir\n         *            directory relative to which the path name is.\n         * @param name\n         *            path name to translate.\n         * @return the translated path. <code>new File(dir,name)</code> if this\n         *         platform does not require path name translation.\n         */\n        private static FileSystemInfo resolveImpl(DirectoryInfo dir, string name)\n        {\n            string fullname = Path.Combine(dir.FullName, name);\n            if (Directory.Exists(fullname))\n            {\n                return new DirectoryInfo(fullname);\n            }\n            \n            return new FileInfo(fullname);\n        }\n\n        /**\n         * Determine the user's home directory (location where preferences are).\n         * <para />\n         * This method can be expensive on the first invocation if path name\n         * translation is required. Subsequent invocations return a cached result.\n         * <para />\n         * Not all platforms and JREs require path name translation. Currently only\n         * Cygwin on Win32 requires translation of the Cygwin HOME directory.\n         * \n         * @return the user's home directory; null if the user does not have one.\n         */\n        public static DirectoryInfo userHome()\n        {\n            return USER_HOME.home;\n        }\n\n        private static class USER_HOME\n        {\n            public static DirectoryInfo home = userHomeImpl();\n        }\n\n        /**\n         * Determine the user's home directory (location where preferences are).\n         * \n         * @return the user's home directory; null if the user does not have one.\n         */\n        private static DirectoryInfo userHomeImpl()\n        {\n            string userHomeFolderPath;\n\n            var platform = (int)Environment.OSVersion.Platform;\n\n            if (platform == (int)PlatformID.Unix || platform  == 6 /* (int)PlatformID.MacOSX */\n                || platform == (int)PlatformType.UnixMono)\n            {\n                userHomeFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);\n            }\n            else\n            {\n                userHomeFolderPath = Environment.GetEnvironmentVariable(\"USERPROFILE\");\n            }\n\n            return new DirectoryInfo(userHomeFolderPath);\n        }\n\n        /**\n         * Determine the global application directory (location where preferences are).\n         * Also known as the \"all users\" directory.\n         * <para />\n         * This method can be expensive on the first invocation if path name\n         * translation is required. Subsequent invocations return a cached result.\n         * <para />\n         * \n         * @return the user's home directory; null if the user does not have one.\n         */\n        public static DirectoryInfo globalHome()\n        {\n            return GLOBAL_HOME.home;\n        }\n\n        private static class GLOBAL_HOME\n        {\n            public static DirectoryInfo home = globalHomeImpl();\n        }\n        \n        /// <summary>\n        /// Returns the global (user-specific) path for application settings based on OS\n        /// </summary>\n        /// <returns>Value of the global path</returns>\n        public static DirectoryInfo globalHomeImpl()\n        {\n            string path = string.Empty;\n            PlatformType ptype = SystemReader.getInstance().getOperatingSystem();\n            \n            switch (ptype)\n            {\n                case PlatformType.Windows:\n                    path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\n                    break;\n                case PlatformType.Unix:\n                    path = \"~/\";\n                    break;\n                case PlatformType.MacOSX:\n                    path = \"~/\";\n                    break;\n                case PlatformType.Xbox:\n                default:\n                    throw new ArgumentException(\"GlobalHomeImpl support for '\" + Environment.OSVersion.VersionString + \" ' is not implemented.\");\n            }\n\n            return new DirectoryInfo(path);\n        }\n\n        /**\n         * Determine the system-wide application directory (location where preferences are).\n         * Also known as the \"all users\" directory.\n         * <para />\n         * This method can be expensive on the first invocation if path name\n         * translation is required. Subsequent invocations return a cached result.\n         * <para />\n         * \n         * @return the user's home directory; null if the user does not have one.\n         */\n        public static DirectoryInfo systemHome()\n        {\n            return SYSTEM_HOME.home;\n        }\n\n        private static class SYSTEM_HOME\n        {\n            public static DirectoryInfo home = systemHomeImpl();\n        }\n        \n        /// <summary>\n        /// Returns the system-wide path for application settings based on OS\n        /// </summary>\n        /// <returns></returns>\n        public static DirectoryInfo systemHomeImpl()\n        {\n            string path = string.Empty;\n            PlatformType ptype = SystemReader.getInstance().getOperatingSystem();\n\n            switch (ptype)\n            {\n                case PlatformType.Windows:\n            \t\tpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), \"GitSharp\");\n                    break;\n                case PlatformType.Unix:\n                    path = \"~(prefix)/etc\";\n                    break;\n                case PlatformType.MacOSX:\n                    path = \"~(prefix)/etc\";\n                    break;\n                case PlatformType.Xbox:\n                default:\n                    throw new ArgumentException(\"SystemHomeImpl support for '\" + Environment.OSVersion.VersionString + \" ' is not implemented.\");\n            }\n\n            return new DirectoryInfo(path);\n        }\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/GenericComparer.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    public class GenericComparer<T> : IComparer<T>\n    {\n        private Comparison<T> cmp;\n        public GenericComparer(Comparison<T> comparison)\n        {\n            cmp = comparison;\n        }\n\n        #region IComparer<T> Members\n\n        public int Compare(T x, T y)\n        {\n            return cmp(x, y);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/Hex.cs",
    "content": "/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    public static class Hex\n    {\n        private static readonly byte[] _hexCharToValue;\n        private static char[] _valueToHexChar;\n        private static byte[] _valueToHexByte;\n        private const int Nibble = 4;\n        \n\t\tstatic Hex()\n        {\n            _valueToHexChar = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n            _valueToHexByte = new byte[_valueToHexChar.Length];\n            for (int i = 0; i < _valueToHexChar.Length; i++)\n                _valueToHexByte[i] = (byte)_valueToHexChar[i];\n\n            _hexCharToValue = new byte['f' + 1];\n            for (int i = 0; i < _hexCharToValue.Length; i++)\n                _hexCharToValue[i] = byte.MaxValue;\n            for (char i = '0'; i <= '9'; i++)\n                _hexCharToValue[i] = (byte)(i - '0');\n            for (char i = 'a'; i <= 'f'; i++)\n                _hexCharToValue[i] = (byte)((i - 'a') + 10);\n        }\n\n        public static byte HexCharToValue(Char c)\n        {\n            return _hexCharToValue[c];\n        }\n\n        private static byte HexCharToValue(byte c)\n        {\n            return _hexCharToValue[c];\n        }\n\n        private static int HexStringToUInt32(byte[] bs, int offset)\n        {\n            return RawParseUtils.parseHexInt32(bs,offset);\n        }\n        \n        public static void FillHexByteArray(byte[] dest, int offset, int value)\n        {\n            uint uvalue = (uint)value;\n            int curOffset = offset + 7;\n            while (curOffset >= offset && uvalue != 0)\n            {\n                dest[curOffset--] = _valueToHexByte[uvalue & 0xf];\n                uvalue >>= Nibble;\n            }\n\n            while (curOffset >= offset)\n            {\n            \tdest[curOffset--] = _valueToHexByte[0];\n            }\n        }\n\n        public static void FillHexCharArray(char[] dest, int offset, int value)\n        {\n            uint uvalue = (uint)value;\n            int curOffset = offset + 7;\n            while (curOffset >= offset && uvalue != 0)\n            {\n                dest[curOffset--] = _valueToHexChar[uvalue & 0xf];\n                uvalue >>= Nibble;\n            }\n\n            while (curOffset >= offset)\n            {\n            \tdest[curOffset--] = '0';\n            }\n        }\n\n\t\tpublic static int HexUInt32(byte[] bs, int p, int end)\n\t\t{\n\t\t\tif (8 <= end - p)\n\t\t\t{\n\t\t\t\treturn HexStringToUInt32(bs, p);\n\t\t\t}\n\n\t\t\tint r = 0, n = 0;\n\t\t\twhile (n < 8 && p < end)\n\t\t\t{\n\t\t\t\tint v = HexCharToValue(bs[p++]);\n\t\t\t\tif (v < 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t\t}\n\t\t\t\tr <<= 4;\n\t\t\t\tr |= v;\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\treturn r << (8 - n) * 4;\n\t\t}\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/ICharSequence.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Resembles Java's CharSequence interface\n    /// </summary>\n    public interface ICharSequence\n    {\n        // Returns the character at the specified index.\n        char CharAt(int index);\n        //Returns the Length of this character sequence.\n        int Length();\n        //Returns a new character sequence that is a subsequence of this sequence.\n        ICharSequence subSequence(int start, int end);\n        //Returns a string containing the characters in this sequence in the same order as this sequence.\n        string ToString();\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/IListUtil.cs",
    "content": "using System.Collections.Generic;\n\nnamespace GitSharp.Core.Util\n{\n    public static class IListUtil\n    {\n        public static bool isEmpty<T>(this ICollection<T> l)\n        {\n\t\t\tif (l == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"l\");\n            return l.Count == 0;\n        }\n\n        public static bool isEmpty<TK, TV>(this IDictionary<TK, TV> d)\n        {\n\t\t\tif (d == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"d\");\n            return (d.Count == 0);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/IO/InterruptTimer.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Threading;\nusing Tamir.SharpSsh.java.lang;\nusing Thread = Tamir.SharpSsh.java.lang.Thread;\n\nnamespace GitSharp.Core.Util\n{\n\n\t// TODO: [henon] this approach does not work in .net. Either the calling thread must be aborted (which is problematic) or the IO stream closed. \n\t// See how TimeoutStream uses a timer to abort IO.\n\n\t/// <summary>\n\t///  Triggers an interrupt on the calling thread if it doesn't complete a block.\n\t///  <para/>\n\t///  Classes can use this to trip an alarm interrupting the calling thread if it\n\t///  doesn't complete a block within the specified timeout. Typical calling\n\t///  pattern is:\n\t/// \n\t/// <code>\n\t///  private InterruptTimer myTimer = ...;\n\t///  void foo() {\n\t///    try {\n\t///      myTimer.begin(timeout);\n\t///      // work\n\t///    } finally {\n\t///      myTimer.end();\n\t///    }\n\t///  }\n\t/// </code>\n\t/// <para/>\n\t///  An InterruptTimer is not recursive. To implement recursive timers,\n\t///  independent InterruptTimer instances are required. A single InterruptTimer\n\t///  may be shared between objects which won't recursively call each other.\n\t///  <para/>\n\t///  Each InterruptTimer spawns one background thread to sleep the specified time\n\t///  and interrupt the thread which called {@link #begin(int)}. It is up to the\n\t///  caller to ensure that the operations within the work block between the\n\t///  matched begin and end calls tests the interrupt flag (most IO operations do).\n\t///  <para/>\n\t///  To terminate the background thread, use {@link #terminate()}. If the\n\t///  application fails to terminate the thread, it will (eventually) terminate\n\t///  itself when the InterruptTimer instance is garbage collected.\n\t/// \n\t///  <see cref=\"TimeoutInputStream\"/>\n\t/// </summary>\n\tpublic class InterruptTimer\n\t{\n\t\tprivate readonly AlarmState state;\n\n\t\tprivate readonly AlarmThread thread;\n\n\t\tprivate readonly AutoKiller autoKiller;\n\n\t\t/// <summary> Create a new timer with a default thread name./// </summary>\n\t\tpublic InterruptTimer()\n\t\t\t: this(\"JGit-InterruptTimer\")\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Create a new timer to signal on interrupt on the caller.\n\t\t///  <para/>\n\t\t///  The timer thread is created in the calling thread's ThreadGroup.\n\t\t/// \n\t\t///  <param name=\"threadName\"> name of the timer thread.</param>\n\t\t/// </summary>\n\t\tpublic InterruptTimer(String threadName)\n\t\t{\n\t\t\tstate = new AlarmState();\n\t\t\tautoKiller = new AutoKiller(state);\n\t\t\tthread = new AlarmThread(threadName, state);\n\t\t\tthread.start();\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Arm the interrupt timer before entering a blocking operation.\n\t\t/// \n\t\t///  <param name=\"timeout\">\n\t\t///             number of milliseconds before the interrupt should trigger.\n\t\t///             Must be > 0.</param>\n\t\t/// </summary>\n\t\tpublic void begin(int timeout)\n\t\t{\n\t\t\tif (timeout <= 0)\n\t\t\t\tthrow new ArgumentException(\"Invalid timeout: \" + timeout);\n\t\t\t//Thread.interrupted();\n\t\t\tstate.begin(timeout);\n\t\t}\n\n\t\t/// <summary> Disable the interrupt timer, as the operation is complete./// </summary>\n\t\tpublic void end()\n\t\t{\n\t\t\tstate.end();\n\t\t}\n\n\t\t/// <summary> Shutdown the timer thread, and wait for it to terminate./// </summary>\n\t\tpublic void terminate()\n\t\t{\n\t\t\tstate.terminate();\n\t\t\t//try {\n\t\t\tthread.InnerThread.Join();\n\t\t\t//} catch (InterruptedException e) {\n\t\t\t//   //\n\t\t\t//}\n\t\t}\n\t}\n\n\tpublic class AlarmThread : Thread\n\t{\n\t\tpublic AlarmThread(String name, AlarmState q)\n\t\t\t: base(q)\n\t\t{\n\t\t\tsetName(name);\n\t\t\tInnerThread.IsBackground = true;\n\t\t}\n\n\t\t// Todo: [henon] this can easily break so we should better adapt our own Java-Thread implementation based on TamirSsh's Thread and expose the inner thread\n\t\tpublic System.Threading.Thread InnerThread\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn typeof(Thread).GetField(\"t\", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as System.Threading.Thread;\n\t\t\t}\n\t\t}\n\t}\n\n\t// The trick here is, the AlarmThread does not have a reference to the\n\t// AutoKiller instance, only the InterruptTimer itself does. Thus when\n\t// the InterruptTimer is GC'd, the AutoKiller is also unreachable and\n\t// can be GC'd. When it gets finalized, it tells the AlarmThread to\n\t// terminate, triggering the thread to exit gracefully.\n\t//\n\tinternal class AutoKiller\n\t{\n\t\tprivate AlarmState state;\n\n\t\tpublic AutoKiller(AlarmState s)\n\t\t{\n\t\t\tstate = s;\n\t\t}\n\n\t\t~AutoKiller()\n\t\t{\n\t\t\tstate.terminate();\n\t\t}\n\t}\n\n\tpublic class AlarmState : Runnable\n\t{\n\n\n\t\tprivate Thread callingThread;\n\n\t\tprivate long deadline;\n\n\t\tprivate bool terminated;\n\n\t\tpublic AlarmState()\n\t\t{\n\t\t\tcallingThread = Thread.currentThread();\n\t\t}\n\n\t\tpublic void run()\n\t\t{\n\t\t\tlock (this)\n\t\t\t{\n\t\t\t\twhile (!terminated && callingThread.isAlive())\n\t\t\t\t{\n\t\t\t\t\t//try\n\t\t\t\t\t//{\n\t\t\t\t\tif (0 < deadline)\n\t\t\t\t\t{\n\t\t\t\t\t\tlong delay = deadline - now();\n\t\t\t\t\t\tif (delay <= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdeadline = 0;\n\t\t\t\t\t\t\tcallingThread.interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.sleep((int)delay);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\twait(1000);\n\t\t\t\t\t}\n\t\t\t\t\t//}\n\t\t\t\t\t//catch (InterruptedException e) // Note: [henon] Thread does not throw an equivalent exception in C# ??\n\t\t\t\t\t//{\n\t\t\t\t\t//   // Treat an interrupt as notice to examine state.\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void begin(int timeout)\n\t\t{\n\t\t\tlock (this)\n\t\t\t{\n\t\t\t\tif (terminated)\n\t\t\t\t\tthrow new InvalidOperationException(\"Timer already terminated\");\n\t\t\t\tcallingThread = Thread.currentThread();\n\t\t\t\tdeadline = now() + timeout;\n\t\t\t\tnotifyAll();\n\t\t\t}\n\t\t}\n\n\t\tpublic void end()\n\t\t{\n\t\t\tlock (this)\n\t\t\t{\n\t\t\t\t//if (0 == deadline)\n\t\t\t\t//   Thread.interrupted(); // <-- Note: [henon] this code does nothing but reset an irrelevant java thread internal flag AFAIK (which is not supported by our thread implementation)\n\t\t\t\t//else\n\t\t\t\tdeadline = 0;\n\t\t\t\tnotifyAll();\n\t\t\t}\n\t\t}\n\n\t\tpublic void terminate()\n\t\t{\n\t\t\tlock (this)\n\t\t\t{\n\t\t\t\tif (!terminated)\n\t\t\t\t{\n\t\t\t\t\tdeadline = 0;\n\t\t\t\t\tterminated = true;\n\t\t\t\t\tnotifyAll();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static long now()\n\t\t{\n\t\t\treturn DateTime.Now.ToMillisecondsSinceEpoch();\n\t\t}\n\n\t\t#region --> Java helpers\n\n\t\t// Note: [henon] to simulate java's builtin wait and notifyAll we use a waithandle\n\t\tprivate AutoResetEvent wait_handle = new AutoResetEvent(false);\n\n\t\tprivate void wait(int milliseconds)\n\t\t{\n\t\t\twait_handle.WaitOne(milliseconds);\n\t\t}\n\n\t\tprivate void notifyAll()\n\t\t{\n\t\t\twait_handle.Set();\n\t\t}\n\n\t\t#endregion\n\t}\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/IO/TimeoutStream.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * This program and the accompanying materials are made available\n * under the terms of the Eclipse Distribution License v1.0 which\n * accompanies this distribution, is reproduced below, and is\n * available at http://www.eclipse.org/org/documents/edl-v10.php\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Timers;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core.Util\n{\n\n\t//Note: [henon] this is a unified port of jgit's TimoutInputStream and TimeoutOutputStream\n\n\t/// <summary>\n\t///  Stream with a configurable timeout.\n\t/// </summary>\n\tpublic class TimeoutStream : Stream\n\t{\n\n\t\tprivate readonly Stream _stream;\n\t\t// private InterruptTimer myTimer;\n\t\tprivate readonly Timer _read_timer = new Timer();\n\t\tprivate readonly Timer _write_timer = new Timer();\n\n\t\t//private int timeout;\n\n\t\t///<summary>\n\t\t/// Wrap an input stream with a timeout on all read operations.\n\t\t///</summary>\n\t\t///<param name=\"src\">base input stream (to read from). The stream must be\n\t\t///            interruptible (most socket streams are).</param>\n\t\tpublic TimeoutStream(Stream src)\n\t\t\t: base()\n\t\t{\n\t\t\t//myTimer = timer;\n\t\t\t_stream = src;\n\t\t\t_read_timer.Elapsed += OnTimout;\n\t\t\t_write_timer.Elapsed += OnTimout;\n\t\t}\n\n\t\tprivate void OnTimout(object sender, ElapsedEventArgs e)\n\t\t{\n\t\t\t_stream.Close();\n\t\t}\n\n\t\t///<summary> return number of milliseconds before aborting a read. </summary>\n\t\tpublic int getTimeout()\n\t\t{\n\t\t\treturn (int)_read_timer.Interval;\n\t\t}\n\n\n\t\t/// <param name=\"millis\"> number of milliseconds before aborting a read. Must be > 0.</param>\n\t\tpublic void setTimeout(int millis)\n\t\t{\n\t\t\tif (millis < 0)\n\t\t\t\tthrow new ArgumentException(\"Invalid timeout: \" + millis);\n\t\t\t_read_timer.Interval = millis;\n\t\t\t_write_timer.Interval = millis;\n\t\t}\n\n\t\tpublic override int ReadByte()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginRead();\n\t\t\t\treturn _stream.ReadByte();\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow readTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendRead();\n\t\t\t}\n\t\t}\n\n\n\t\tpublic override int Read(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginRead();\n\t\t\t\treturn _stream.Read(buffer, offset, count);\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow readTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendRead();\n\t\t\t}\n\t\t}\n\n\t\tpublic long Skip(long cnt)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginRead();\n\t\t\t\treturn _stream.Seek(cnt, SeekOrigin.Current);\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow readTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendRead();\n\t\t\t}\n\t\t}\n\n\t\tprivate void beginRead()\n\t\t{\n\t\t\t_read_timer.Start();\n\t\t}\n\n\t\tprivate void endRead()\n\t\t{\n\t\t\t_read_timer.Stop();\n\t\t}\n\n\t\tprivate static TimeoutException readTimedOut()\n\t\t{\n\t\t\treturn new TimeoutException(\"Read timed out\");\n\t\t}\n\n\t\tpublic override void WriteByte(byte value)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginWrite();\n\t\t\t\t_stream.WriteByte(value);\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow writeTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendWrite();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Write(byte[] buf)\n\t\t{\n\t\t\tWrite(buf, 0, buf.Length);\n\t\t}\n\n\n\t\tpublic override void Write(byte[] buf, int off, int len)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginWrite();\n\t\t\t\t_stream.Write(buf, off, len);\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow writeTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendWrite();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginWrite();\n\t\t\t\t_stream.Flush();\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow writeTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendWrite();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Close()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbeginWrite();\n\t\t\t\t_stream.Close();\n\t\t\t}\n\t\t\tcatch (ObjectDisposedException)\n\t\t\t{\n\t\t\t\tthrow writeTimedOut();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tendWrite();\n\t\t\t}\n\t\t}\n\n\t\tprivate void beginWrite()\n\t\t{\n\t\t\t_write_timer.Start();\n\t\t}\n\n\t\tprivate void endWrite()\n\t\t{\n\t\t\t_write_timer.Stop();\n\t\t}\n\n\t\tprivate static TimeoutException writeTimedOut()\n\t\t{\n\t\t\treturn new TimeoutException(\"Write timed out\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, gets a value indicating whether the current stream supports reading.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if the stream supports reading; otherwise, false.\n\t\t/// </returns>\n\t\t/// <filterpriority>1</filterpriority>\n\t\tpublic override bool CanRead\n\t\t{\n\t\t\tget { return _stream.CanRead; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, gets a value indicating whether the current stream supports seeking.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if the stream supports seeking; otherwise, false.\n\t\t/// </returns>\n\t\t/// <filterpriority>1</filterpriority>\n\t\tpublic override bool CanSeek\n\t\t{\n\t\t\tget { return _stream.CanSeek; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, gets a value indicating whether the current stream supports writing.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true if the stream supports writing; otherwise, false.\n\t\t/// </returns>\n\t\t/// <filterpriority>1</filterpriority>\n\t\tpublic override bool CanWrite\n\t\t{\n\t\t\tget { return _stream.CanWrite; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, gets the length in bytes of the stream.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A long value representing the length of the stream in bytes.\n\t\t/// </returns>\n\t\t/// <exception cref=\"T:System.NotSupportedException\">A class derived from Stream does not support seeking. \n\t\t///                 </exception><exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. \n\t\t///                 </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Length\n\t\t{\n\t\t\tget { return _stream.Length; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, gets or sets the position within the current stream.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The current position within the stream.\n\t\t/// </returns>\n\t\t/// <exception cref=\"T:System.IO.IOException\">An I/O error occurs. \n\t\t///                 </exception><exception cref=\"T:System.NotSupportedException\">The stream does not support seeking. \n\t\t///                 </exception><exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. \n\t\t///                 </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Position\n\t\t{\n\t\t\tget { return _stream.Position; }\n\t\t\tset { _stream.Position = value; }\n\t\t}\n\n\t\tpublic int Read(byte[] buf)\n\t\t{\n\t\t\treturn Read(buf, 0, buf.Length);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, sets the position within the current stream.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The new position within the current stream.\n\t\t/// </returns>\n\t\t/// <param name=\"offset\">A byte offset relative to the <paramref name=\"origin\"/> parameter. \n\t\t///                 </param><param name=\"origin\">A value of type <see cref=\"T:System.IO.SeekOrigin\"/> indicating the reference point used to obtain the new position. \n\t\t///                 </param><exception cref=\"T:System.IO.IOException\">An I/O error occurs. \n\t\t///                 </exception><exception cref=\"T:System.NotSupportedException\">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. \n\t\t///                 </exception><exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. \n\t\t///                 </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Seek(long offset, SeekOrigin origin)\n\t\t{\n\t\t\treturn _stream.Seek(offset, origin);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When overridden in a derived class, sets the length of the current stream.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The desired length of the current stream in bytes. \n\t\t///                 </param><exception cref=\"T:System.IO.IOException\">An I/O error occurs. \n\t\t///                 </exception><exception cref=\"T:System.NotSupportedException\">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. \n\t\t///                 </exception><exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. \n\t\t///                 </exception><filterpriority>2</filterpriority>\n\t\tpublic override void SetLength(long value)\n\t\t{\n\t\t\t_stream.SetLength(value);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/IO/UnionInputStream.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// An InputStream which reads from one or more InputStreams.\n    /// <para/>\n    /// This stream may enter into an EOF state, returning -1 from any of the read\n    /// methods, and then later successfully read additional bytes if a new\n    /// InputStream is added after reaching EOF.\n    /// <para/>\n    /// Currently this stream does not support the mark/reset APIs. If mark and later\n    /// reset functionality is needed the caller should wrap this stream with a\n    /// {@link java.io.BufferedInputStream}.\n    /// </summary>\n    public class UnionInputStream : DumbStream\n    {\n        private static readonly Stream Eof = new EofStream();\n\n        private class EofStream : DumbStream\n        {\n            public override int Read(byte[] buffer, int offset, int count)\n            {\n                return 0;\n            }\n        };\n\n        private readonly LinkedList<Stream> _streams = new LinkedList<Stream>();\n\n        /// <summary>\n        /// Create an empty InputStream that is currently at EOF state.\n        /// </summary>\n        public UnionInputStream()\n        {\n            // Do nothing.\n        }\n\n        /// <summary>\n        /// Create an InputStream that is a union of the individual streams.\n        /// <para/>\n        /// As each stream reaches EOF, it will be automatically closed before bytes\n        /// from the next stream are read.\n        /// </summary>\n        /// <param name=\"inputStreams\">streams to be pushed onto this stream.</param>\n        public UnionInputStream(params Stream[] inputStreams)\n        {\n            foreach (Stream i in inputStreams)\n                add(i);\n        }\n\n        private Stream head()\n        {\n            return _streams.Count == 0 ? Eof : _streams.First.Value;\n        }\n\n        private void pop()\n        {\n            if (_streams.Count != 0)\n            {\n                Stream stream = _streams.First.Value;\n                _streams.RemoveFirst();\n                stream.Dispose();\n            }\n        }\n\n        /// <summary>\n        /// Add the given InputStream onto the end of the stream queue.\n        /// <para/>\n        /// When the stream reaches EOF it will be automatically closed.\n        /// </summary>\n        /// <param name=\"in\">the stream to add; must not be null.</param>\n        public void add(Stream @in)\n        {\n            _streams.AddLast(@in);\n        }\n\n        /// <summary>\n        /// Returns true if there are no more InputStreams in the stream queue.\n        /// <para/>\n        /// If this method returns <code>true</code> then all read methods will signal EOF\n        /// by returning -1, until another InputStream has been pushed into the queue\n        /// with <see cref=\"add\"/>.\n        /// </summary>\n        /// <returns>true if there are no more streams to read from.</returns>\n        public bool isEmpty()\n        {\n            return _streams.Count == 0;\n        }\n\n        public int read()\n        {\n            return ReadByte();\n        }\n\n        public override int ReadByte()\n        {\n            for (; ; )\n            {\n                Stream @in = head();\n                int r = @in.ReadByte();\n                if (0 <= r)\n                    return r;\n                else if (@in == Eof)\n                    return -1;\n                else\n                    pop();\n            }\n        }\n\n        public override int Read(byte[] b, int off, int len)\n        {\n            int cnt = 0;\n            while (0 < len)\n            {\n                Stream @in = head();\n                int n = @in.Read(b, off, len);\n                if (0 < n)\n                {\n                    cnt += n;\n                    off += n;\n                    len -= n;\n                }\n                else if (@in == Eof)\n                    return 0 < cnt ? cnt : -1;\n                else\n                    pop();\n            }\n            return cnt;\n        }\n\n        public int available()\n        {\n            return (int)head().available();\n        }\n\n        public long skip(long len)\n        {\n            long cnt = 0;\n            while (0 < len)\n            {\n                Stream @in = head();\n                long n = @in.skip(len);\n                if (0 < n)\n                {\n                    cnt += n;\n                    len -= n;\n\n                }\n                else if (@in == Eof)\n                {\n                    return cnt;\n\n                }\n                else\n                {\n                    // Is this stream at EOF? We can't tell from skip alone.\n                    // Read one byte to test for EOF, discard it if we aren't\n                    // yet at EOF.\n                    //\n                    int r = @in.ReadByte();\n                    if (r < 0)\n                    {\n                        pop();\n                    }\n                    else\n                    {\n                        cnt += 1;\n                        len -= 1;\n                    }\n                }\n            }\n            return cnt;\n        }\n\n        public override void Close()\n        {\n            IOException err = null;\n\n            for (var i = new LinkedListIterator<Stream>(_streams); i.hasNext(); )\n            {\n                try\n                {\n                    i.next().Dispose();\n                }\n                catch (IOException closeError)\n                {\n                    err = closeError;\n                }\n                i.remove();\n            }\n\n            if (err != null)\n                throw err;\n        }\n    \n        public bool markSupported()\n        {\n            return false; // TODO : CanSeek ?  \n        }\n    }\n\n    public abstract class DumbStream : Stream\n    {\n        public override void Flush()\n        {\n            throw new NotSupportedException();\n        }\n\n        public override long Seek(long offset, SeekOrigin origin)\n        {\n            return 0;\n        }\n\n        public override void SetLength(long value)\n        {\n            throw new NotSupportedException();\n        }\n\n        public override void Write(byte[] buffer, int offset, int count)\n        {\n            throw new NotSupportedException();\n        }\n\n        public override bool CanRead\n        {\n            get { return true; }\n        }\n\n        public override bool CanSeek\n        {\n            get { return true; }\n        }\n\n        public override bool CanWrite\n        {\n            get { return false; }\n        }\n\n        public override long Length\n        {\n            get { return 0; }\n        }\n\n        public override long Position\n        {\n            get { return 0; }\n            set { throw new NotSupportedException(); }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/IO.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Input/Output utilities\n    /// </summary>\n    public static class IO\n    {\n        /// <summary>\n        /// Read an entire local file into memory as a byte array.\n        /// </summary>\n        /// <param name=\"path\">Location of the file to read.</param>\n        /// <returns>Complete contents of the requested local file.</returns>\n        /// <exception cref=\"IOException\">\n        /// The file exists, but its contents cannot be read.\n        /// </exception>\n        public static byte[] ReadFully(FileInfo path)\n        {\n            return ReadFully(path, int.MaxValue);\n        }\n\n        /// <summary>\n        /// Read an entire local file into memory as a byte array.\n        /// </summary>\n        /// <param name=\"path\">Location of the file to read.</param>\n        /// <param name=\"max\">\n        /// Maximum number of bytes to Read, if the file is larger than\n        /// this limit an IOException is thrown.\n        /// </param>\n        /// <returns>\n        /// Complete contents of the requested local file.\n        /// </returns>\n        /// <exception cref=\"FileNotFoundException\">\n        /// The file exists, but its contents cannot be Read.\n        /// </exception>\n        /// <exception cref=\"IOException\"></exception>\n        public static byte[] ReadFully(FileInfo path, int max)\n        {\n            using (var @in = new FileStream(path.FullName, System.IO.FileMode.Open, FileAccess.Read))\n            {\n                long sz = @in.Length;\n                if (sz > max)\n                    throw new IOException(\"File is too large: \" + path);\n                var buf = new byte[(int)sz];\n                ReadFully(@in, buf, 0, buf.Length);\n                return buf;\n            }\n        }\n\n        /// <summary>\n        /// Read the entire byte array into memory, or throw an exception.\n        /// </summary>\n        /// <param name=\"fd\">Input stream to read the data from.</param>\n        /// <param name=\"dst\">buffer that must be fully populated</param>\n        /// <param name=\"off\">position within the buffer to start writing to.</param>\n        /// <param name=\"len\">number of bytes that must be read.</param>\n        /// <exception cref=\"EndOfStreamException\">\n        /// The stream ended before <paramref name=\"dst\"/> was fully populated.\n        /// </exception>\n        /// <exception cref=\"IOException\">\n        /// There was an error reading from the stream.\n        /// </exception>\n        public static void ReadFully(Stream fd, byte[] dst, int off, int len)\n        {\n            while (len > 0)\n            {\n                int r = fd.Read(dst, off, len);\n                if (r <= 0)\n                    throw new EndOfStreamException(\"Short Read of block.\");\n                off += r;\n                len -= r;\n            }\n        }\n\n        /// <summary>\n        /// Read the entire byte array into memory, or throw an exception.\n        /// </summary>\n        /// <param name=\"fd\">Stream to read the data from.</param>\n        /// <param name=\"pos\">Position to read from the file at.</param>\n        /// <param name=\"dst\">Buffer that must be fully populated, [off, off+len].</param>\n        /// <param name=\"off\">position within the buffer to start writing to.</param>\n        /// <param name=\"len\">number of bytes that must be read.</param>\n        /// <exception cref=\"EndOfStreamException\">\n        /// The <paramref name=\"fd\"/> ended before the requested number of \n        /// bytes were read.\n        /// </exception>\n        /// <exception cref=\"NotSupportedException\">\n        /// The <paramref name=\"fd\"/> does not supports seeking.\n        /// </exception>\n        /// <exception cref=\"IOException\">\n        /// There was an error reading from the stream.\n        /// </exception>\n        public static void ReadFully(Stream fd, long pos, byte[] dst, int off, int len)\n        {\n            while (len > 0)\n            {\n                fd.Position = pos;\n                int r = fd.Read(dst, off, len);\n                if (r <= 0)\n                    throw new EndOfStreamException(\"Short Read of block.\");\n                pos += r;\n                off += r;\n                len -= r;\n            }\n        }\n\n        /// <summary>\n        /// Skip an entire region of an input stream.\n        /// <para />\n        /// The input stream's position is moved forward by the number of requested\n        /// bytes, discarding them from the input. This method does not return until\n        /// the exact number of bytes requested has been skipped.\n        /// </summary>\n        /// <param name=\"fd\">The stream to skip bytes from.</param>\n        /// <param name=\"toSkip\">\n        /// Total number of bytes to be discarded. Must be >= 0.\n        /// </param>\n        /// <exception cref=\"EndOfStreamException\">\n        /// The stream ended before the requested number of bytes were\n        /// skipped.\n        /// </exception>\n        /// <exception cref=\"IOException\">\n        /// There was an error reading from the stream.\n        /// </exception>\n        public static void skipFully(Stream fd, long toSkip)\n        {\n            while (toSkip > 0)\n            {\n                var r = fd.Seek(toSkip, SeekOrigin.Current);\n                if (r <= 0)\n                    throw new EndOfStreamException(\"Short skip of block\");\n                toSkip -= r;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/Inspect.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\nusing System.IO;\n\nnamespace GitSharp.Core.Util\n{\n    public class Inspector\n    {\n        Repository db;\n\n        public Inspector(Repository db)\n        {\n            this.db = db;\n        }\n\n        public string Inspect(ObjectId id)\n        {\n            return Inspect(db.ToFile(id).FullName, id);\n        }\n\n        public static string Inspect(string path, string id)\n        {\n            return Inspect(path + \"/\" + id, ObjectId.FromString(id));\n        }\n\n        private static string Inspect(string filename, ObjectId id)\n        {\n            return Encoding.ASCII.GetString(new UnpackedObjectLoader(new FileInfo(filename), id).Bytes);\n        }\n\n        public Stream ContentStream(ObjectId id)\n        {\n            return ContentStream(db.ToFile(id).FullName, id);\n        }\n\n        public static Stream ContentStream(string path, string id)\n        {\n            return ContentStream(path + \"/\" + id, ObjectId.FromString(id));\n        }\n\n        private static Stream ContentStream(string filename, ObjectId id)\n        {\n            return new MemoryStream(new UnpackedObjectLoader(new FileInfo(filename), id).Bytes);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/Int32.cs",
    "content": "﻿/*\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Diagnostics;\n\nnamespace GitSharp.Core.Util\n{\n    public static class Int32Extensions\n    {\n        /// <summary>\n        /// computes the number of 1 bits in the two's complement binary representation of the integer\n        /// </summary>\n        /// <param name=\"n\"></param>\n        /// <returns></returns>\n        public static int BitCount(this int n)\n        {\n            int i = n;\n            int count = 0;\n            while (i != 0)\n            {\n                count++;\n                i &= (i - 1);\n            }\n            return count;\n        }\n\n        /// <summary>\n        /// computes the number of 0 bits to the right of the first 1\n        /// </summary>\n        /// <param name=\"n\"></param>\n        /// <returns></returns>\n        public static int NumberOfTrailingZeros(this int n)\n        {\n            Debug.Assert(n != 0);\n            uint i = (uint)n;\n            int zeros = 0;\n            while ((i & 1) == 0)\n            {\n                zeros++;\n                i >>= 1;\n            }\n            return zeros;\n        }\n\n        /// <summary>\n        /// Returns the number of zero bits preceding the highest-order (\"leftmost\") one-bit in the two's complement \n        /// binary representation of the specified int value. Returns 32 if the specified value has no one-bits in its two's \n        /// complement representation, in other words if it is equal to zero.\n        /// </summary>\n        /// <param name=\"n\"></param>\n        /// <returns></returns>\n        public static int LowestOneBit(this int n)\n        {\n            if (n == 0)\n                return 0;\n            return 1 << NumberOfTrailingZeros(n);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/IntList.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// A more efficient <see cref=\"List{Int32}\"/> using a primitive integer array.\n    /// </summary>\n    public class IntList\n    {\n        private int[] entries;\n\n        private int count;\n\n        /// <summary>\n        /// Create an empty list with a default capacity.\n        /// </summary>\n        public IntList()\n            : this(10)\n        {\n        }\n\n        /// <summary>\n        /// Create an empty list with the specified capacity.\n        /// </summary>\n        /// <param name=\"capacity\">number of entries the list can initially hold.</param>\n        public IntList(int capacity)\n        {\n            entries = new int[capacity];\n        }\n\n        /// <returns>\n        /// Number of entries in this list\n        /// </returns>\n        public int size()\n        {\n            return count;\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <param name=\"i\">index to Read, must be in the range [0, <see cref=\"size\"/>).</param>\n        /// <returns>the number at the specified index</returns>\n        public int get(int i)\n        {\n            if (count <= i)\n                throw new IndexOutOfRangeException();\n            return entries[i];\n        }\n\n        /// <summary>\n        /// Empty this list\n        /// </summary>\n        public void clear()\n        {\n            count = 0;\n        }\n\n        /// <summary>\n        /// Add an entry to the end of the list.\n        /// </summary>\n        /// <param name=\"n\">The nbumber to add</param>\n        public void add(int n)\n        {\n            if (count == entries.Length)\n                grow();\n            entries[count++] = n;\n        }\n\n        /// <summary>\n        /// Assign an entry in the list.\n        /// </summary>\n        /// <param name=\"index\">index to set, must be in the range [0, <see cref=\"size()\"/>).</param>\n        /// <param name=\"n\">value to store at the position.</param>\n        public void set(int index, int n)\n        {\n            if (count < index)\n                throw new ArgumentOutOfRangeException(\"index\");\n\n            if (count == index)\n                add(n);\n            else\n                entries[index] = n;\n        }\n\n        /// <summary>\n        /// Pad the list with entries.\n        /// </summary>\n        /// <param name=\"toIndex\">index position to stop filling at. 0 inserts no filler. 1 ensures the list has a size of 1, adding <code>val</code> if the list is currently empty.</param>\n        /// <param name=\"val\">value to insert into padded positions.</param>\n        public void fillTo(int toIndex, int val)\n        {\n            while (count < toIndex)\n                add(val);\n        }\n\n        private void grow()\n        {\n            var n = new int[(entries.Length + 16) * 3 / 2];\n            Array.Copy(entries, 0, n, 0, count);\n            entries = n;\n        }\n\n        public string toString()\n        {\n            var r = new StringBuilder();\n            r.Append('[');\n            for (int i = 0; i < count; i++)\n            {\n                if (i > 0)\n                    r.Append(\", \");\n                r.Append(entries[i]);\n            }\n            r.Append(']');\n            return r.ToString();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/JavaHelper/AtomicInteger.cs",
    "content": "﻿namespace GitSharp.Core.Util.JavaHelper\n{\n    public class AtomicInteger : AtomicValue<int>\n    {\n        public AtomicInteger(int init)\n            : base(init)\n        {\n        }\n\n        public AtomicInteger()\n        {\n        }\n\n        protected override int InnerAdd(int value, int delta)\n        {\n            return value + delta;\n        }\n\n        protected override int One\n        {\n            get { return 1; }\n        }\n\n        protected override int MinusOne\n        {\n            get { return -1; }\n        }\n    }\n\n    public class AtomicLong : AtomicValue<long>\n    {\n        public AtomicLong(int init)\n            : base(init)\n        {\n        }\n\n        public AtomicLong()\n        {\n        }\n\n        protected override long InnerAdd(long value, long delta)\n        {\n            return value + delta;\n        }\n\n        protected override long One\n        {\n            get { return 1; }\n        }\n\n        protected override long MinusOne\n        {\n            get { return -1; }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Core/Util/JavaHelper/AtomicReference.cs",
    "content": "/*\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\n\nnamespace GitSharp.Core.Util.JavaHelper\n{\n    public class AtomicReference<T>\n    {\n        private T _reference;\n        private readonly Object _locker = new Object();\n\n        public AtomicReference() : this(default(T))\n        {\n        }\n\n        public AtomicReference(T reference)\n        {\n            _reference = reference;\n        }\n\n        /// <summary>\n        /// Atomically set the value to the given updated value if the current value == the expected value. the expected value\n        /// </summary>\n        /// <param name=\"expected\">the expected value</param>\n        /// <param name=\"update\">the new value</param>\n        /// <returns>true if successful. False return indicates that the actual value was not equal to the expected value.</returns>\n        public bool compareAndSet(T expected, T update)\n        {\n            lock (_locker)\n            {\n                if ((Equals(_reference, default(T)) && Equals(expected, default(T))) || (!Equals(_reference, default(T)) && _reference.Equals(expected)))\n                {\n                    _reference = update;\n                    return true;\n                }\n                return false;\n            }\n        }\n\n        /// <summary>\n        /// Set to the given value.\n        /// </summary>\n        /// <param name=\"update\">the new value</param>\n        public void set(T update)\n        {\n            lock (_locker)\n            {\n                _reference = update;\n            }\n        }\n\n        /// <summary>\n        /// Get the current value.\n        /// </summary>\n        /// <returns>the current value</returns>\n        public T get()\n        {\n            lock (_locker)\n            {\n                return _reference;\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/JavaHelper/AtomicValue.cs",
    "content": "/*\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\n\nnamespace GitSharp.Core.Util.JavaHelper\n{\n    public abstract class AtomicValue<T> : AtomicReference<T>\n    {\n        private readonly Object _locker = new Object();\n\n        protected AtomicValue(T init) : base(init)\n        {\n        }\n\n        protected AtomicValue()\n        {\n        }\n\n        /// <summary>\n        /// Atomically add the given value to current value.\n        /// </summary>\n        /// <param name=\"delta\">the value to add</param>\n        /// <returns>the updated value</returns>\n        public T addAndGet(T delta)\n        {\n            lock (_locker)\n            {\n                T oldValue = get();\n                T newValue = InnerAdd(oldValue, delta);\n                set(newValue);\n                return newValue;\n            }\n        }\n\n        /// <summary>\n        /// Atomically increment by one the current value.\n        /// </summary>\n        /// <returns>the updated value</returns>\n        public T incrementAndGet()\n        {\n            lock (_locker)\n            {\n                return addAndGet(One);\n            }\n        }\n\n        /// <summary>\n        /// Atomically decrement by one the current value.\n        /// </summary>\n        /// <returns>the updated value</returns>\n        public T decrementAndGet()\n        {\n            lock (_locker)\n            {\n                return addAndGet(MinusOne);\n            }\n        }\n\n        protected abstract T InnerAdd(T value, T delta);\n        protected abstract T One { get; }\n        protected abstract T MinusOne { get; }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/JavaHelper/Charset.cs",
    "content": "using System.Text;\n\nnamespace GitSharp.Core.Util.JavaHelper\n{\n    public static class Charset\n    {\n        public static Encoding forName(string encodingAlias)\n        {\n            Encoding encoder;\n\n            if (encodingAlias == \"euc_JP\")\n            {\n                encodingAlias = \"EUC-JP\";   // Hacked as euc_JP is not valid from the IANA perspective (http://www.iana.org/assignments/character-sets)\n                // See also http://tagunov.tripod.com/i18n/jdk11enc.html for further historical information\n            }\n\n            switch (encodingAlias.ToUpperInvariant())\n            {\n                case \"UTF-8\":\n                    encoder = new UTF8Encoding(false, true);\n                    break;\n\n                default:\n                    encoder = Encoding.GetEncoding(encodingAlias, new EncoderExceptionFallback(), new DecoderExceptionFallback());\n                    break;\n            }\n\n            return encoder;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/JavaHelper/Properties.cs",
    "content": "using System;\n\nnamespace GitSharp.Core.Util.JavaHelper\n{\n    public class Properties\n    {\n        public string getProperty(string key)\n        {\n            throw new NotImplementedException();\n        }\n\n        public string getProperty(string key, string defaultValue)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/ListIterator.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Java style iterator with remove capability (which is not supported by IEnumerator).\n    /// This iterator is able to iterate over a list without being corrupted by removal of elements\n    /// via the remove() method.\n    /// </summary>\n    public class ListIterator<T>\n    {\n        protected List<T> list;\n        protected int index = -1;\n        protected bool can_remove = false;\n\n        public ListIterator(List<T> list)\n        {\n            this.list = list;\n        }\n\n        public virtual bool hasNext()\n        {\n            if (index >= list.Count - 1)\n                return false;\n            return true;\n        }\n\n        public virtual T next()\n        {\n            if (index >= list.Count)\n                throw new InvalidOperationException();\n            can_remove = true;\n            return list[index++];\n        }\n\n        public virtual void remove()\n        {\n            if (index >= list.Count || index == -1)\n                throw new InvalidOperationException(\"Index is out of bounds of underlying list! \" + index);\n            if (!can_remove)\n                throw new InvalidOperationException(\"Can not remove (twice), call next first!\");\n            can_remove = false; // <--- remove can only be called once per call to next\n            list.RemoveAt(index);\n            index--;\n        }\n    }\n\n    public class LinkedListIterator<T> : IIterator<T>\n    {\n        private readonly LinkedList<T> _list;\n        private bool _canRemove;\n        private LinkedListNode<T> _current;\n        private LinkedListNode<T> _next;\n\n        public LinkedListIterator(LinkedList<T> list)\n        {\n            _list = list;\n            _current = null;\n            _next = list.First;\n        }\n\n        public virtual bool hasNext()\n        {\n            if (_next == null)\n                return false;\n\n            return true;\n        }\n\n        public virtual T next()\n        {\n            if (!hasNext())\n                throw new IndexOutOfRangeException();\n            \n            _current = _next;\n\n            _next = _current == null ? null : _current.Next;\n\n            _canRemove = true;\n            return _current.Value;\n        }\n\n        public virtual void remove()\n        {\n            if (_current == null)\n                throw new IndexOutOfRangeException();\n            if (!_canRemove)\n                throw new InvalidOperationException(\"Can not remove (twice), call next first!\");\n            _canRemove = false; // <--- remove can only be called once per call to next\n            _list.Remove(_current);\n            _current = null;\n        }\n    }\n\n    public interface IIterable<T> : IEnumerable<T>\n    {\n        IteratorBase<T> iterator();\n        int size();\n        T get(int index);\n    }\n\n    public class BasicIterable<T> : IIterable<T>\n    {\n        private readonly IList<T> _entries;\n\n        public BasicIterable(IList<T> entries)\n        {\n            _entries = entries;\n        }\n\n        public IEnumerator<T> GetEnumerator()\n        {\n            return iterator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public IteratorBase<T> iterator()\n        {\n            return new BasicIterator<T>(this);\n        }\n\n        public int size()\n        {\n            return _entries.Count;\n        }\n\n        public T get(int index)\n        {\n            return _entries[index];\n        }\n    }\n\n    public class BasicIterator<T> : IteratorBase<T>\n    {\n        private readonly IIterable<T> _iterable;\n        private int _index;\n\n        public BasicIterator(IIterable<T> iterable)\n        {\n            _iterable = iterable;\n        }\n\n        public override bool hasNext()\n        {\n            return _index < _iterable.size();\n        }\n\n        protected override T InnerNext()\n        {\n            return _iterable.get(_index++);\n        }\n    }\n\n    public class LambdaConverterIterator<TInput, TOutput> : IteratorBase<TOutput>\n    {\n        private readonly IteratorBase<TInput> _iterator;\n        private readonly Func<TInput, TOutput> _converter;\n\n        public LambdaConverterIterator(IteratorBase<TInput> iterator, Func<TInput, TOutput> converter)\n        {\n            _iterator = iterator;\n            _converter = converter;\n        }\n\n        public override bool hasNext()\n        {\n            return _iterator.hasNext();\n        }\n\n        protected override TOutput InnerNext()\n        {\n            TInput entry = _iterator.next();\n            TOutput converted = _converter(entry);\n            return converted;\n        }\n    }\n\n    public interface IIterator<T>\n    {\n        bool hasNext();\n        T next();\n        void remove();\n    }\n\n    public abstract class IteratorBase<T> : IEnumerator<T>, IIterator<T>\n    {\n        private T _current;\n\n        public abstract bool hasNext();\n\n        public T next()\n        {\n            _current = InnerNext();\n            return _current;\n        }\n\n        public virtual void remove()\n        {\n            throw new NotSupportedException();\n        }\n\n        protected abstract T InnerNext();\n\n        public bool MoveNext()\n        {\n            if (!hasNext())\n            {\n                return false;\n            }\n\n            next();\n            return true;\n        }\n\n        public virtual void Reset()\n        {\n            throw new NotSupportedException();\n        }\n\n        public T Current\n        {\n            get { return _current; }\n        }\n\n        object IEnumerator.Current\n        {\n            get { return Current; }\n        }\n\n        public virtual void Dispose()\n        {\n            // nothing to dispose.\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/LittleEndianBitConverter.cs",
    "content": "/*\n\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n */\n\nnamespace MiscUtil.Conversion\n{\n\t/// <summary>\n\t/// Implementation of EndianBitConverter which converts to/from little-endian\n\t/// byte arrays.\n\t/// </summary>\n\tpublic sealed class LittleEndianBitConverter : EndianBitConverter\n\t{\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Different computer architectures store data using different byte orders. \"Big-endian\"\n\t\t/// means the most significant byte is on the left end of a word. \"Little-endian\" means the \n\t\t/// most significant byte is on the right end of a word.\n\t\t/// </remarks>\n\t\t/// <returns>true if this converter is little-endian, false otherwise.</returns>\n\t\tpublic sealed override bool IsLittleEndian()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Indicates the byte order (\"endianess\") in which data is converted using this class.\n\t\t/// </summary>\n\t\tpublic sealed override Endianness Endianness \n\t\t{ \n\t\t\tget { return Endianness.LittleEndian; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Copies the specified number of bytes from value to buffer, starting at index.\n\t\t/// </summary>\n\t\t/// <param name=\"value\">The value to copy</param>\n\t\t/// <param name=\"bytes\">The number of bytes to copy</param>\n\t\t/// <param name=\"buffer\">The buffer to copy the bytes into</param>\n\t\t/// <param name=\"index\">The index to start at</param>\n\t\tprotected override void CopyBytesImpl(long value, int bytes, byte[] buffer, int index)\n\t\t{\n\t\t\tfor (int i=0; i < bytes; i++)\n\t\t\t{\n\t\t\t\tbuffer[i+index] = unchecked((byte)(value&0xff));\n\t\t\t\tvalue = value >> 8;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns a value built from the specified number of bytes from the given buffer,\n\t\t/// starting at index.\n\t\t/// </summary>\n\t\t/// <param name=\"buffer\">The data in byte array format</param>\n\t\t/// <param name=\"startIndex\">The first index to use</param>\n\t\t/// <param name=\"bytesToConvert\">The number of bytes to use</param>\n\t\t/// <returns>The value built from the given bytes</returns>\n\t\tprotected override long FromBytes(byte[] buffer, int startIndex, int bytesToConvert)\n\t\t{\n\t\t\tlong ret = 0;\n\t\t\tfor (int i=0; i < bytesToConvert; i++)\n\t\t\t{\n\t\t\t\tret = unchecked((ret << 8) | buffer[startIndex+bytesToConvert-1-i]);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/LongList.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n/* A more efficient List<Long> using a primitive long array. */\nusing System;\nusing System.Text;\n\npublic class LongList {\n\tprivate long[] entries;\n\n\tprivate int count;\n\n\t/* Create an empty list with a default capacity. */\n\tpublic LongList() : this(10) {\n\t\t\n\t}\n\n\t/*\n\t * Create an empty list with the specified capacity.\n\t *\n\t * @param capacity\n\t *            number of entries the list can initially hold.\n\t */\n\tpublic LongList(int capacity) {\n\t\tentries = new long[capacity];\n\t}\n\n\t/* @return number of entries in this list */\n\tpublic int size() {\n\t\treturn count;\n\t}\n\n\t/*\n\t * @param i\n\t *            index to read, must be in the range [0, {@link #size()}).\n\t * @return the number at the specified index\n\t * @throws ArrayIndexOutOfBoundsException\n\t *             the index outside the valid range\n\t */\n\tpublic long get(int i) {\n\t\tif (count <= i)\n\t\t\tthrow new ArgumentOutOfRangeException(\"i\");\n\t\treturn entries[i];\n\t}\n\n\t/** Empty this list */\n\tpublic void clear() {\n\t\tcount = 0;\n\t}\n\n\t/**\n\t * Add an entry to the end of the list.\n\t *\n\t * @param n\n\t *            the number to add.\n\t */\n\tpublic void add(long n) {\n\t\tif (count == entries.Length)\n\t\t\tgrow();\n\t\tentries[count++] = n;\n\t}\n\n\t/**\n\t * Assign an entry in the list.\n\t *\n\t * @param index\n\t *            index to set, must be in the range [0, {@link #size()}).\n\t * @param n\n\t *            value to store at the position.\n\t */\n\tpublic void set(int index, long n) {\n\t\tif (count < index)\n\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\telse if (count == index)\n\t\t\tadd(n);\n\t\telse\n\t\t\tentries[index] = n;\n\t}\n\n\t/**\n\t * Pad the list with entries.\n\t *\n\t * @param toIndex\n\t *            index position to stop filling at. 0 inserts no filler. 1\n\t *            ensures the list has a size of 1, adding <code>val</code> if\n\t *            the list is currently empty.\n\t * @param val\n\t *            value to insert into padded positions.\n\t */\n\tpublic void fillTo(int toIndex, long val) {\n\t\twhile (count < toIndex)\n\t\t\tadd(val);\n\t}\n\n\tprivate void grow() {\n\t\tlong[] n = new long[(entries.Length + 16) * 3 / 2];\n\t\tSystem.Array.Copy(entries, 0, n, 0, count);\n\t\tentries = n;\n\t}\n\n\tpublic String toString() {\n\t\tStringBuilder r = new StringBuilder();\n\t\tr.Append('[');\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tif (i > 0)\n\t\t\t\tr.Append(\", \");\n\t\t\tr.Append(entries[i]);\n\t\t}\n\t\tr.Append(']');\n\t\treturn r.ToString();\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/MessageDigest.cs",
    "content": "/*\n * Copyright (C) 2009, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n */\n\nusing System;\nusing System.Security.Cryptography;\nusing System.IO;\n\nnamespace GitSharp.Core.Util\n{\n    public abstract class MessageDigest : IDisposable\n    {\n        public static MessageDigest getInstance(string algorithm)\n        {\n            switch (algorithm.ToLower())\n            {\n                case \"sha-1\":\n                    return new MessageDigest<SHA1Managed>();\n                case \"md5\":\n                    return new MessageDigest<MD5CryptoServiceProvider>();\n                default:\n                    throw new NotSupportedException(string.Format(\"The requested algorithm \\\"{0}\\\" is not supported.\", algorithm));\n            }\n        }\n\n        public abstract byte[] Digest();\n        public abstract byte[] Digest(byte[] input);\n        public abstract void Reset();\n        public abstract void Update(byte input);\n        public abstract void Update(byte[] input);\n        public abstract void Update(byte[] input, int index, int count);\n        public abstract void Dispose();\n    }\n\n    public class MessageDigest<TAlgorithm> : MessageDigest where TAlgorithm : HashAlgorithm, new()\n    {\n        private CryptoStream _stream;\n        private TAlgorithm _hash;\n\n        public MessageDigest()\n        {\n            Init();\n        }\n\n        private void Init()\n        {\n            _hash = new TAlgorithm();\n            _stream = new CryptoStream(Stream.Null, _hash, CryptoStreamMode.Write);\n        }\n\n        public override byte[] Digest()\n        {\n            _stream.FlushFinalBlock();\n            var ret = _hash.Hash;\n            Reset();\n            return ret;\n        }\n\n        public override byte[] Digest(byte[] input)\n        {\n            using (var me = new MessageDigest<TAlgorithm>())\n            {\n                me.Update(input);\n                return me.Digest();\n            }\n        }\n\n        public override void Reset()\n        {\n            Dispose();\n            Init();\n        }\n\n        public override void Update(byte input)\n        {\n            _stream.WriteByte(input);\n        }\n\n        public override void Update(byte[] input)\n        {\n            _stream.Write(input, 0, input.Length);\n        }\n\n        public override void Update(byte[] input, int index, int count)\n        {\n            _stream.Write(input, index, count);\n        }\n\n        public override void Dispose()\n        {\n            if (_stream != null)\n                _stream.Dispose();\n            _stream = null;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/MutableInteger.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /** A boxed integer that can be modified. */\n    public class MutableInteger\n    {\n        /** Current value of this boxed value. */\n        public int value;\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/NB.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// Note: this file originates from jgit's NB.java\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Net;\n\nnamespace GitSharp.Core.Util\n{\n\t/// <summary>\n\t/// Conversion utilities for network byte order handling.\n\t/// </summary>\n\tpublic static class NB // [henon] need public for testsuite\n\t{\n\t\t/// <summary>\n\t\t/// Compare a 32 bit unsigned integer stored in a 32 bit signed integer.\n\t\t/// <para />\n\t\t/// This function performs an unsigned compare operation, even though Java\n\t\t/// does not natively support unsigned integer values. Negative numbers are\n\t\t/// treated as larger than positive ones.\n\t\t/// </summary>\n\t\t/// <param name=\"a\">the first value to compare.</param>\n\t\t/// <param name=\"b\">the second value to compare.</param>\n\t\t/// <returns>return &lt; 0 if a &lt; b; 0 if a == b; &gt; 0 if a &gt; b.</returns>\n\t\tpublic static int CompareUInt32(int a, int b)\n\t\t{\n\t\t\tvar cmp = (int)(((uint)a >> 1) - ((uint)b >> 1));\n\t\t\tif (cmp != 0)\n\t\t\t\treturn cmp;\n\t\t\treturn (a & 1) - (b & 1);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert sequence of 2 bytes (network byte order) into unsigned value.\n\t\t/// </summary>\n\t\t/// <param name=\"intbuf\">\n\t\t/// Buffer to acquire the 2 bytes of data from.\n\t\t/// </param>\n\t\t/// <param name=\"offset\">\n\t\t/// Position within the buffer to begin reading from. This\n\t\t/// position and the next byte After it (for a total of 2 bytes)\n\t\t/// will be read.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Unsigned integer value that matches the 16 bits Read.\n\t\t/// </returns>\n\t\tpublic static int decodeUInt16(byte[] intbuf, int offset)\n\t\t{\n\t\t\tint r = (intbuf[offset] & 0xff) << 8;\n\t\t\treturn r | (intbuf[offset + 1] & 0xff);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert sequence of 4 bytes (network byte order) into unsigned value.\n\t\t/// </summary>\n\t\t/// <param name=\"intbuf\">buffer to acquire the 4 bytes of data from.</param>\n\t\t/// <param name=\"offset\">\n\t\t/// position within the buffer to begin reading from. This\n\t\t/// position and the next 3 bytes After it (for a total of 4\n\t\t/// bytes) will be read.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Unsigned integer value that matches the 32 bits Read.\n\t\t/// </returns>\n\t\tpublic static long decodeUInt32(byte[] intbuf, int offset)\n\t\t{\n\t\t\tuint low = (intbuf[offset + 1] & (uint)0xff) << 8;\n\t\t\tlow |= (intbuf[offset + 2] & (uint)0xff);\n\t\t\tlow <<= 8;\n\n\t\t\tlow |= (intbuf[offset + 3] & (uint)0xff);\n\t\t\treturn ((long)(intbuf[offset] & 0xff)) << 24 | low;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert sequence of 4 bytes (network byte order) into unsigned value.\n\t\t/// </summary>\n\t\t/// <param name=\"intbuf\">buffer to acquire the 4 bytes of data from.</param>\n\t\t/// <param name=\"offset\">\n\t\t/// position within the buffer to begin reading from. This\n\t\t/// position and the next 3 bytes After it (for a total of 4\n\t\t/// bytes) will be read.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Unsigned integer value that matches the 32 bits Read.\n\t\t/// </returns>\n\t\tpublic static long DecodeUInt32(byte[] intbuf, int offset)\n\t\t{\n\t\t\treturn decodeUInt32(intbuf, offset);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert sequence of 4 bytes (network byte order) into signed value.\n\t\t/// </summary>\n\t\t/// <param name=\"intbuf\">Buffer to acquire the 4 bytes of data from.</param>\n\t\t/// <param name=\"offset\">\n\t\t/// position within the buffer to begin reading from. This\n\t\t/// position and the next 3 bytes After it (for a total of 4\n\t\t/// bytes) will be read.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Signed integer value that matches the 32 bits Read.\n\t\t/// </returns>\n\t\tpublic static int DecodeInt32(byte[] intbuf, int offset)\n\t\t{\n\t\t\treturn IPAddress.NetworkToHostOrder(BitConverter.ToInt32(intbuf, offset));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Convert sequence of 8 bytes (network byte order) into unsigned value.\n\t\t/// </summary>\n\t\t/// <param name=\"intbuf\">buffer to acquire the 8 bytes of data from.</param>\n\t\t/// <param name=\"offset\">\n\t\t/// Position within the buffer to begin reading from. This\n\t\t/// position and the next 7 bytes After it (for a total of 8\n\t\t/// bytes) will be read.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Unsigned integer value that matches the 64 bits read.\n\t\t/// </returns>\n\t\tpublic static long DecodeUInt64(byte[] intbuf, int offset)\n\t\t{\n\t\t\treturn (DecodeUInt32(intbuf, offset) << 32) | DecodeUInt32(intbuf, offset + 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This function takes two arguments; the integer value to be \n\t\t/// converted and the base value (2, 8, or 16)  to which the number \n\t\t/// is converted to.\n\t\t/// </summary>\n\t\t/// <param name=\"iDec\">the decimal</param>\n\t\t/// <param name=\"numbase\">the base of the output</param>\n\t\t/// <returns>a string representation of the base number</returns>\n\t\tpublic static string DecimalToBase(int iDec, int numbase) // [henon] needed to output octal numbers\n\t\t{\n\t\t\treturn Convert.ToString(iDec, numbase);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This function takes two arguments; a string value representing the binary, octal, or hexadecimal \n\t\t/// value and the corresponding integer base value respective to the first argument. For instance, \n\t\t/// if you pass the first argument value \"1101\", then the second argument should take the value \"2\".\n\t\t/// </summary>\n\t\t/// <param name=\"sBase\">the string in base sBase notation</param>\n\t\t/// <param name=\"numBase\">the base to convert from</param>\n\t\t/// <returns>decimal</returns>\n\t\tpublic static int BaseToDecimal(string sBase, int numBase)\n\t\t{\n\t\t\tlong value;\n\t\t\tif (!long.TryParse(sBase, out value))\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"sBase\");\n\t\t\t}\n\n\t\t\treturn Convert.ToInt32(Convert.ToString(value, CultureInfo.InvariantCulture), numBase);\n\t\t}\n\n\t\t/**\n\t\t * Write a 16 bit integer as a sequence of 2 bytes (network byte order).\n\t\t *\n\t\t * @param intbuf\n\t\t *            buffer to write the 2 bytes of data into.\n\t\t * @param offset\n\t\t *            position within the buffer to begin writing to. This position\n\t\t *            and the next byte After it (for a total of 2 bytes) will be\n\t\t *            replaced.\n\t\t * @param v\n\t\t *            the value to write.\n\t\t */\n\t\tpublic static void encodeInt16(byte[] intbuf, int offset, int v)\n\t\t{\n\t\t\tintbuf[offset + 1] = (byte)v;\n\t\t\tv >>= 8; // >>>\n\n\t\t\tintbuf[offset] = (byte)v;\n\t\t}\n\n\t\t/**\n\t\t * Write a 32 bit integer as a sequence of 4 bytes (network byte order).\n\t\t * \n\t\t * @param intbuf\n\t\t *            buffer to write the 4 bytes of data into.\n\t\t * @param offset\n\t\t *            position within the buffer to begin writing to. This position\n\t\t *            and the next 3 bytes After it (for a total of 4 bytes) will be\n\t\t *            replaced.\n\t\t * @param v\n\t\t *            the value to write.\n\t\t */\n\t\tpublic static void encodeInt32(byte[] intbuf, int offset, int v)\n\t\t{\n\t\t\tintbuf[offset + 3] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 2] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 1] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset] = (byte)v;\n\t\t}\n\n\t\t/**\n\t\t * Write a 64 bit integer as a sequence of 8 bytes (network byte order).\n\t\t *\n\t\t * @param intbuf\n\t\t *            buffer to write the 48bytes of data into.\n\t\t * @param offset\n\t\t *            position within the buffer to begin writing to. This position\n\t\t *            and the next 7 bytes After it (for a total of 8 bytes) will be\n\t\t *            replaced.\n\t\t * @param v\n\t\t *            the value to write.\n\t\t */\n\t\tpublic static void encodeInt64(byte[] intbuf, int offset, long v)\n\t\t{\n\t\t\tintbuf[offset + 7] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 6] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 5] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 4] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 3] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 2] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset + 1] = (byte)v;\n\t\t\tv >>= 8;\n\n\t\t\tintbuf[offset] = (byte)v;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts an unsigned byte (.NET default when reading files, for instance) \n\t\t/// to a signed byte\n\t\t/// </summary>\n\t\t/// <param name=\"b\">The value to be converted.</param>\n\t\t/// <returns></returns>\n\t\tpublic static sbyte ConvertUnsignedByteToSigned(byte b)\n\t\t{\n\t\t\t// Convert to the equivalent binary string, then to the equivalent signed value.\n\t\t\treturn Convert.ToSByte(Convert.ToString(b, 2), 2);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Util/NestedDictionary.cs",
    "content": "/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Xml.Serialization;\n\nnamespace GitSharp.Core.Util\n{\n\n    /// <summary>\n    /// Basic implementation of the NestedDictionaryBase using an underlying Dictionary\n    /// </summary>\n    /// <typeparam name=\"K\"></typeparam>\n    /// <typeparam name=\"V\"></typeparam>\n    public sealed class NestedDictionary<K, V> : NestedDictionaryBase<K, V, NestedDictionary<K, V>>\n    {\n\n        #region Operator Overloads\n\n        public static implicit operator NestedDictionary<K, V>(V value)\n        {\n            NestedDictionary<K, V> d = new NestedDictionary<K, V>();\n            d.Value = value;\n            return d;\n        }\n\n        public static bool operator true(NestedDictionary<K, V> value)\n        {\n            return !(value.Value.Equals(default(V)));\n        }\n\n        public static bool operator false(NestedDictionary<K, V> value)\n        {\n            return (value.Value.Equals(default(V)));\n        }\n\n        public static bool operator !(NestedDictionary<K, V> value)\n        {\n            if (value)\n                return false;\n            else\n                return true;\n        }\n\n        #endregion\n\n    }\n\n    /// <summary>\n    /// Basic implementation of the NestedDictionaryBase using an underlying SortedDictionary\n    /// </summary>\n    /// <typeparam name=\"K\"></typeparam>\n    /// <typeparam name=\"V\"></typeparam>\n    public sealed class NestedSortedDictionary<K, V> : NestedDictionaryBase<K, V, NestedSortedDictionary<K, V>>\n    {\n\n        #region Operator Overloads\n\n        public static implicit operator NestedSortedDictionary<K, V>(V value)\n        {\n            NestedSortedDictionary<K, V> d = new NestedSortedDictionary<K, V>();\n            d.Value = value;\n            return d;\n        }\n\n        #endregion\n\n        #region Protected Methods\n\n        internal override IDictionary<K, NestedSortedDictionary<K, V>> CreateDictionary()\n        {\n            return new SortedDictionary<K, NestedSortedDictionary<K, V>>();\n        }\n\n        #endregion\n\n    }\n\n    /// <summary>\n    /// Base class used for a nested dictionary\n    /// NOTE: You should overload the implicit operator for converting V to your class for best functionality\n    /// </summary>\n    /// <typeparam name=\"K\">Key Type</typeparam>\n    /// <typeparam name=\"V\">Value Type</typeparam>\n    /// <typeparam name=\"D\">Nested Dictionary Type (Typically inherits from NestedDictionaryBase)</typeparam>\n    public abstract class NestedDictionaryBase<K, V, D> : IDictionary<K, D>, IXmlSerializable\n        where D : NestedDictionaryBase<K, V, D>, new()\n    {\n\n        #region Constructors\n\n        protected NestedDictionaryBase()\n        {\n        }\n\n        protected NestedDictionaryBase(V value)\n        {\n            this._value = value;\n        }\n\n        #endregion\n\n        #region Operator Overloads\n\n        public static implicit operator NestedDictionaryBase<K, V, D>(V value)\n        {\n            D d = new D();\n            d.Value = value;\n            return d;\n        }\n\n        public static explicit operator V(NestedDictionaryBase<K, V, D> d)\n        {\n            return d.As<V>();\n        }\n\n        #endregion\n\n        #region Protected Methods\n\n        internal virtual IDictionary<K, D> CreateDictionary()\n        {\n            return new Dictionary<K, D>();\n        }\n\n        #endregion\n\n        #region Public Methods\n\n        public virtual D[] ToArray()\n        {\n            List<D> array = new List<D>();\n\n            foreach (KeyValuePair<K, D> kvp in this)\n            {\n                array.Add(kvp.Value);\n            }\n            return array.ToArray();\n        }\n\n        public virtual T As<T>()\n        {\n            if (!(_value is T))\n                throw new InvalidOperationException(string.Format(\"object is not of type {0}\", typeof(T).ToString()));\n\n            return (T)(object)_value;\n        }\n\n        public virtual D Add(K key)\n        {\n            if (key == null)\n                throw new ArgumentNullException(\"key\");\n\n            D value = new D();\n            ((IDictionary<K, D>)this).Add(key, value);\n            return value;\n        }\n\n        public virtual D Add(K key, V value)\n        {\n            D d = this.Add(key);\n            d.Value = value;\n            return (D)this;\n        }\n\n        public virtual void AddRange(IDictionary<K, D> dict)\n        {\n            foreach (KeyValuePair<K, D> pair in dict)\n                this.Add(pair);\n        }\n\n        #endregion\n\n        #region IDictionary<K, D> Members\n\n        void IDictionary<K, D>.Add(K key, D value)\n        {\n            this.Dictionary.Add(key, value);\n        }\n\n        public bool ContainsKey(K key)\n        {\n            return this.Dictionary.ContainsKey(key);\n        }\n\n        public ICollection<K> Keys\n        {\n            get { return this.Dictionary.Keys; }\n        }\n\n        public bool Remove(K key)\n        {\n            return this.Dictionary.Remove(key);\n        }\n\n        public bool TryGetValue(K key, out D value)\n        {\n            return this.Dictionary.TryGetValue(key, out value);\n        }\n\n        public ICollection<D> Values\n        {\n            get { return this.Dictionary.Values; }\n        }\n\n        public D this[K key]\n        {\n            get\n            {\n                D value;\n\n                if (!this.TryGetValue(key, out value))\n                    return this.Add(key);\n\n                return value;\n            }\n            set\n            {\n                this.Dictionary[key] = value;\n            }\n        }\n\n        #endregion\n\n        #region ICollection<KeyValuePair<K, V>> Members\n\n        public void Add(KeyValuePair<K, D> item)\n        {\n            this.Dictionary.Add(item);\n        }\n\n        public void Clear()\n        {\n            this.Dictionary.Clear();\n        }\n\n        public bool Contains(KeyValuePair<K, D> item)\n        {\n            return this.Dictionary.Contains(item);\n        }\n\n        public void CopyTo(KeyValuePair<K, D>[] array, int arrayIndex)\n        {\n            this.Dictionary.CopyTo(array, arrayIndex);\n        }\n\n        public int Count\n        {\n            get { return this.Dictionary.Count; }\n        }\n\n        public bool IsReadOnly\n        {\n            get { return this.Dictionary.IsReadOnly; }\n        }\n\n        public bool Remove(KeyValuePair<K, D> item)\n        {\n            return this.Dictionary.Remove(item);\n        }\n\n        #endregion\n\n        #region IEnumerable<KeyValuePair<K, V>> Members\n\n        public IEnumerator<KeyValuePair<K, D>> GetEnumerator()\n        {\n            return this.Dictionary.GetEnumerator();\n        }\n\n        #endregion\n\n        #region IEnumerable Members\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return this.Dictionary.GetEnumerator();\n        }\n\n        #endregion\n\n        #region Properties\n\n        private IDictionary<K, D> _dictionary;\n        internal virtual IDictionary<K, D> Dictionary\n        {\n            get\n            {\n                if (this._dictionary == null)\n                    this._dictionary = this.CreateDictionary();\n\n                return this._dictionary;\n            }\n        }\n\n        private V _value;\n        public virtual V Value\n        {\n            get { return this._value; }\n            set { this._value = value; }\n        }\n\n        #endregion\n\n        #region IXmlSerializable Members\n\n        public System.Xml.Schema.XmlSchema GetSchema()\n        {\n            throw new System.NotImplementedException(\"The method or operation is not implemented.\");\n        }\n\n        public void ReadXml(System.Xml.XmlReader reader)\n        {\n            throw new System.NotImplementedException(\"The method or operation is not implemented.\");\n        }\n\n        public void WriteXml(System.Xml.XmlWriter writer)\n        {\n\n            if (this.Count > 0)\n            {\n                foreach (K key in this.Keys)\n                {\n                    writer.WriteStartElement(\"item\");\n                    writer.WriteAttributeString(\"key\", key.ToString());\n                    this[key].WriteXml(writer);\n                    writer.WriteEndElement();\n                }\n            }\n            else if (_value != null)\n            {\n                writer.WriteValue(_value);\n            }\n\n        }\n\n        #endregion\n\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/PathUtil.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace GitSharp.Core.Util\n{\n    public static class PathUtil\n    {\n        public static string Combine(params string[] paths)\n        {\n            if (paths.Length < 2)\n                throw new ArgumentException(\"Must have at least two paths\", \"paths\");\n\n            string path = paths[0];\n            for (int i = 0; i < paths.Length; ++i)\n            {\n                path = Path.Combine(path, paths[i]);\n            }\n            return path;\n        }\n\n\n        public static DirectoryInfo CombineDirectoryPath(DirectoryInfo path, string subdir)\n        {\n            return new DirectoryInfo(Path.Combine(path.FullName, subdir));\n        }\n\n        public static FileInfo CombineFilePath(DirectoryInfo path, string filename)\n        {\n            return new FileInfo(Path.Combine(path.FullName, filename));\n        }\n\n        /// <summary>\n        /// Delete file without complaining about readonly status\n        /// </summary>\n        /// <param name=\"path\"></param>\n        public static bool DeleteFile(this FileSystemInfo path)\n        {\n            return DeleteFile(path.FullName);\n        }\n\n        /// <summary>\n        /// Delete file without complaining about readonly status\n        /// </summary>\n        /// <param name=\"path\"></param>\n        public static bool DeleteFile(string path)\n        {\n            var file = new FileInfo(path);\n            if (!file.Exists) return false;\n\n            file.IsReadOnly = false;\n            try\n            {\n                file.Delete();\n            }\n            catch (Exception)\n            {\n                return false;\n            }\n\n            return true;\n        }\n\n\t\t  /// <summary>\n\t\t  /// Computes relative path, where path is relative to reference_path\n\t\t  /// </summary>\n\t\t  /// <param name=\"reference_path\"></param>\n\t\t  /// <param name=\"path\"></param>\n\t\t  /// <returns></returns>\n\t\t  public static string RelativePath(string reference_path, string path)\n\t\t  {\n\t\t\t  if (reference_path == null)\n\t\t\t\t  throw new ArgumentNullException(\"reference_path\");\n\t\t\t  if (path == null)\n\t\t\t\t  throw new ArgumentNullException(\"path\");\n\t\t\t  //reference_path = reference_path.Replace('/', '\\\\');\n\t\t\t  //path = path.Replace('/', '\\\\');\n\t\t\t  bool isRooted = Path.IsPathRooted(reference_path) && Path.IsPathRooted(path);\n\t\t\t  if (isRooted)\n\t\t\t  {\n\t\t\t\t  bool isDifferentRoot = string.Compare(Path.GetPathRoot(reference_path), Path.GetPathRoot(path), true) != 0;\n\t\t\t\t  if (isDifferentRoot)\n\t\t\t\t\t  return path;\n\t\t\t  }\n\t\t\t  var relativePath = new StringCollection();\n\t\t\t  string[] fromDirectories = Regex.Split(reference_path, @\"[/\\\\]+\");\n\t\t\t  string[] toDirectories = Regex.Split( path, @\"[/\\\\]+\");\n\t\t\t  int length = Math.Min(fromDirectories.Length, toDirectories.Length);\n\t\t\t  int lastCommonRoot = -1;\n\t\t\t  // find common root\n\t\t\t  for (int x = 0; x < length; x++)\n\t\t\t  {\n\t\t\t\t  if (string.Compare(fromDirectories[x],\n\t\t\t\t\t\ttoDirectories[x], true) != 0)\n\t\t\t\t\t  break;\n\t\t\t\t  lastCommonRoot = x;\n\t\t\t  }\n\t\t\t  if (lastCommonRoot == -1)\n\t\t\t\t  return string.Join(Path.DirectorySeparatorChar.ToString(), toDirectories);\n\t\t\t  // add relative folders in from path\n\t\t\t  for (int x = lastCommonRoot + 1; x < fromDirectories.Length; x++)\n\t\t\t\t  if (fromDirectories[x].Length > 0)\n\t\t\t\t\t  relativePath.Add(\"..\");\n\t\t\t  // add to folders to path\n\t\t\t  for (int x = lastCommonRoot + 1; x < toDirectories.Length; x++)\n\t\t\t\t  relativePath.Add(toDirectories[x]);\n\t\t\t  // create relative path\n\t\t\t  string[] relativeParts = new string[relativePath.Count];\n\t\t\t  relativePath.CopyTo(relativeParts, 0);\n\t\t\t  string newPath = string.Join(Path.DirectorySeparatorChar.ToString(), relativeParts);\n\t\t\t  return newPath;\n\t\t  }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/PipeStream.cs",
    "content": "///\tCopyright (c) 2006 James Kolpack (james dot kolpack at google mail)\n///\tCopyright (C) 2010 Henon <meinrad.recheis@gmail.com>\n///\t\n///\tPermission is hereby granted, free of charge, to any person obtaining a copy of this software and \n///\tassociated documentation files (the \"Software\"), to deal in the Software without restriction, \n///\tincluding without limitation the rights to use, copy, modify, merge, publish, distribute, \n///\tsublicense, and/or sell copies of the Software, and to permit persons to whom the Software is \n///\tfurnished to do so, subject to the following conditions:\n///\t\n///\tThe above copyright notice and this permission notice shall be included in all copies or \n///\tsubstantial portions of the Software.\n///\t\n///\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, \n///\tINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR \n///\tPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE \n///\tLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT \n///\tOR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \n///\tOTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\n\nnamespace GitSharp.Core.Util\n{\n\t/// <summary>\n\t/// PipeStream is a thread-safe read/write data stream for use between two threads in a \n\t/// single-producer/single-consumer type problem.\n\t/// </summary>\n\t/// <version>2006/10/13 1.0</version>\n\t/// <remarks>Update on 2008/10/9 1.1 - uses Monitor instead of Manual Reset events for more elegant synchronicity.</remarks>\n\tpublic class PipeStream : Stream\n\t{\n\t\t#region Private members\n\n\t\t/// <summary>\n\t\t/// Queue of bytes provides the datastructure for transmitting from an\n\t\t/// input stream to an output stream.\n\t\t/// </summary>\n\t\t/// <remarks>Possible more effecient ways to accomplish this.</remarks>\n\t\tprivate readonly Queue<byte> mBuffer = new Queue<byte>();\n\n\t\t/// <summary>\n\t\t/// Indicates that the input stream has been flushed and that\n\t\t/// all remaining data should be written to the output stream.\n\t\t/// </summary>\n\t\tprivate bool mFlushed;\n\n\t\t/// <summary>\n\t\t/// Maximum number of bytes to store in the buffer.\n\t\t/// </summary>\n\t\tprivate long mMaxBufferLength = 200 * MB;\n\n\t\t/// <summary>\n\t\t/// Setting this to true will cause Read() to block if it appears\n\t\t/// that it will run out of data.\n\t\t/// </summary>\n\t\tprivate bool mBlockLastRead;\n\n\t\t#endregion\n\n\t\t#region Public Const members\n\n\t\t/// <summary>\n\t\t/// Number of bytes in a kilobyte\n\t\t/// </summary>\n\t\tpublic const long KB = 1024;\n\n\t\t/// <summary>\n\t\t/// Number of bytes in a megabyte\n\t\t/// </summary>\n\t\tpublic const long MB = KB * 1024;\n\n\t\t#endregion\n\n\t\t#region Public properties\n\n\t\t/// <summary>\n\t\t/// Gets or sets the maximum number of bytes to store in the buffer.\n\t\t/// </summary>\n\t\t/// <value>The length of the max buffer.</value>\n\t\tpublic long MaxBufferLength\n\t\t{\n\t\t\tget { return mMaxBufferLength; }\n\t\t\tset { mMaxBufferLength = value; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets a value indicating whether to block last read method before the buffer is empty.\n\t\t/// When true, Read() will block until it can fill the passed in buffer and count.\n\t\t/// When false, Read() will not block, returning all the available buffer data.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Setting to true will remove the possibility of ending a stream reader prematurely.\n\t\t/// </remarks>\n\t\t/// <value>\n\t\t/// \t<c>true</c> if block last read method before the buffer is empty; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tpublic bool BlockLastReadBuffer\n\t\t{\n\t\t\tget { return mBlockLastRead; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tmBlockLastRead = value;\n\n\t\t\t\t// when turning off the block last read, signal Read() that it may now read the rest of the buffer.\n\t\t\t\tif (!mBlockLastRead)\n\t\t\t\t\tlock (mBuffer)\n\t\t\t\t\t\tMonitor.Pulse(mBuffer);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Stream overide methods\n\n\t\tpublic override void Close()\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tbase.Close();\n\t\t\tDispose();\n\t\t\tlock (mBuffer)\n\t\t\t\tMonitor.Pulse(mBuffer);\n\t\t}\n\n\t\t///<summary>\n\t\t///Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n\t\t///</summary>\n\t\t///<filterpriority>2</filterpriority>\n\t\tpublic new void Dispose()\n\t\t{\n\t\t\tif (mDisposed)\n\t\t\t\treturn;\n\t\t\t// clear the internal buffer\n\t\t\tmBuffer.Clear();\n\t\t\tmDisposed = true;\n\t\t}\n\n\t\tprivate bool mDisposed;\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.\n\t\t///</summary>\n\t\t///\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception><filterpriority>2</filterpriority>\n\t\tpublic override void Flush()\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tmFlushed = true;\n\t\t\tlock (mBuffer)\n\t\t\t\tMonitor.Pulse(mBuffer);\n\t\t}\n\n\t\tprivate void CheckDisposed()\n\t\t{\n\t\t\tif (mDisposed)\n\t\t\t\tthrow new ObjectDisposedException(\"stream has been closed\");\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, sets the position within the current stream.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///The new position within the current stream.\n\t\t///</returns>\n\t\t///<param name=\"offset\">A byte offset relative to the origin parameter. </param>\n\t\t///<param name=\"origin\">A value of type <see cref=\"T:System.IO.SeekOrigin\"></see> indicating the reference point used to obtain the new position. </param>\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n\t\t///<exception cref=\"T:System.NotSupportedException\">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Seek(long offset, SeekOrigin origin)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, sets the length of the current stream.\n\t\t///</summary>\n\t\t///<param name=\"value\">The desired length of the current stream in bytes. </param>\n\t\t///<exception cref=\"T:System.NotSupportedException\">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception><filterpriority>2</filterpriority>\n\t\tpublic override void SetLength(long value)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.\n\t\t///</returns>\n\t\t///<param name=\"offset\">The zero-based byte offset in buffer at which to begin storing the data read from the current stream. </param>\n\t\t///<param name=\"count\">The maximum number of bytes to be read from the current stream. </param>\n\t\t///<param name=\"buffer\">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. </param>\n\t\t///<exception cref=\"T:System.ArgumentException\">The sum of offset and count is larger than the buffer length. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception>\n\t\t///<exception cref=\"T:System.NotSupportedException\">The stream does not support reading. </exception>\n\t\t///<exception cref=\"T:System.ArgumentNullException\">buffer is null. </exception>\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n\t\t///<exception cref=\"T:System.ArgumentOutOfRangeException\">offset or count is negative. </exception><filterpriority>1</filterpriority>\n\t\tpublic override int Read(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (offset != 0)\n\t\t\t\tthrow new NotImplementedException(\"Offsets with value of non-zero are not supported\");\n\t\t\tif (buffer == null)\n\t\t\t\tthrow new ArgumentException(\"Buffer is null\");\n\t\t\tif (offset + count > buffer.Length)\n\t\t\t\tthrow new ArgumentException(\"The sum of offset and count is greater than the buffer length. \");\n\t\t\tif (offset < 0 || count < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", \"offset or count is negative.\");\n\t\t\tif (BlockLastReadBuffer && count >= mMaxBufferLength)\n\t\t\t\tthrow new ArgumentException(String.Format(\"count({0}) > mMaxBufferLength({1})\", count, mMaxBufferLength));\n\n\t\t\tif (count == 0)\n\t\t\t\treturn 0;\n\n\t\t\tint readLength = 0;\n\n\t\t\tlock (mBuffer)\n\t\t\t{\n\t\t\t\twhile (!ReadAvailable(count))\n\t\t\t\t{\n\t\t\t\t\tMonitor.Wait(mBuffer);\n\t\t\t\t\tCheckDisposed();\n\t\t\t\t}\n\t\t\t\t// fill the read buffer\n\t\t\t\tfor (; readLength < count && Length > 0; readLength++)\n\t\t\t\t{\n\t\t\t\t\tbuffer[readLength] = mBuffer.Dequeue();\n\t\t\t\t}\n\n\t\t\t\tMonitor.Pulse(mBuffer);\n\t\t\t}\n\t\t\treturn readLength;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if there are \n\t\t/// </summary>\n\t\t/// <param name=\"count\"></param>\n\t\t/// <returns></returns>\n\t\tprivate bool ReadAvailable(int count)\n\t\t{\n\t\t\treturn (Length >= count || mFlushed) &&\n\t\t\t\t(Length >= (count + 1) || !BlockLastReadBuffer);\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.\n\t\t///</summary>\n\t\t///<param name=\"offset\">The zero-based byte offset in buffer at which to begin copying bytes to the current stream. </param>\n\t\t///<param name=\"count\">The number of bytes to be written to the current stream. </param>\n\t\t///<param name=\"buffer\">An array of bytes. This method copies count bytes from buffer to the current stream. </param>\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n\t\t///<exception cref=\"T:System.NotSupportedException\">The stream does not support writing. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception>\n\t\t///<exception cref=\"T:System.ArgumentNullException\">buffer is null. </exception>\n\t\t///<exception cref=\"T:System.ArgumentException\">The sum of offset and count is greater than the buffer length. </exception>\n\t\t///<exception cref=\"T:System.ArgumentOutOfRangeException\">offset or count is negative. </exception><filterpriority>1</filterpriority>\n\t\tpublic override void Write(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tCheckDisposed();\n\t\t\tif (buffer == null)\n\t\t\t\tthrow new ArgumentException(\"Buffer is null\");\n\t\t\tif (offset + count > buffer.Length)\n\t\t\t\tthrow new ArgumentException(\"The sum of offset and count is greater than the buffer length. \");\n\t\t\tif (offset < 0 || count < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", \"offset or count is negative.\");\n\t\t\tif (count == 0)\n\t\t\t\treturn;\n\n\t\t\tlock (mBuffer)\n\t\t\t{\n\t\t\t\t// wait until the buffer isn't full\n\t\t\t\twhile (Length >= mMaxBufferLength)\n\t\t\t\t\tMonitor.Wait(mBuffer);\n\t\t\t\tCheckDisposed();\n\t\t\t\tmFlushed = false; // if it were flushed before, it soon will not be.\n\n\t\t\t\t// queue up the buffer data\n\t\t\t\tfor (int i = offset; i < offset + count; i++)\n\t\t\t\t{\n\t\t\t\t\tmBuffer.Enqueue(buffer[i]);\n\t\t\t\t}\n\n\t\t\t\tMonitor.Pulse(mBuffer); // signal that write has occured\n\t\t\t}\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, gets a value indicating whether the current stream supports reading.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///true if the stream supports reading; otherwise, false.\n\t\t///</returns>\n\t\t///<filterpriority>1</filterpriority>\n\t\tpublic override bool CanRead\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, gets a value indicating whether the current stream supports seeking.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///true if the stream supports seeking; otherwise, false.\n\t\t///</returns>\n\t\t///<filterpriority>1</filterpriority>\n\t\tpublic override bool CanSeek\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, gets a value indicating whether the current stream supports writing.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///true if the stream supports writing; otherwise, false.\n\t\t///</returns>\n\t\t///<filterpriority>1</filterpriority>\n\t\tpublic override bool CanWrite\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, gets the length in bytes of the stream.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///A long value representing the length of the stream in bytes.\n\t\t///</returns>\n\t\t///\n\t\t///<exception cref=\"T:System.NotSupportedException\">A class derived from Stream does not support seeking. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Length\n\t\t{\n\t\t\tget { return mBuffer.Count; }\n\t\t}\n\n\t\t///<summary>\n\t\t///When overridden in a derived class, gets or sets the position within the current stream.\n\t\t///</summary>\n\t\t///<returns>\n\t\t///The current position within the stream.\n\t\t///</returns>\n\t\t///<exception cref=\"T:System.IO.IOException\">An I/O error occurs. </exception>\n\t\t///<exception cref=\"T:System.NotSupportedException\">The stream does not support seeking. </exception>\n\t\t///<exception cref=\"T:System.ObjectDisposedException\">Methods were called after the stream was closed. </exception><filterpriority>1</filterpriority>\n\t\tpublic override long Position\n\t\t{\n\t\t\tget { return 0; }\n\t\t\tset { throw new NotImplementedException(); }\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Util/QuotedString.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp;\nusing System.Text;\nusing System;\nusing System.Text.RegularExpressions;\n\nnamespace GitSharp.Core.Util\n{\n\t/// <summary>\n\t/// Utility functions related to quoted string handling.\n\t/// </summary>\n    public abstract class QuotedString\n    {\n\t\t/// <summary>\n\t\t/// Quoting style that obeys the rules Git applies to file names.\n\t\t/// </summary>\n\t\tpublic static readonly GitPathStyle GIT_PATH = new GitPathStyle();\n\n\t\t/// <summary>\n\t\t/// Quoting style used by the Bourne shell.\n\t\t/// <para />\n\t\t/// Quotes are unconditionally inserted during <see cref=\"quote(string)\"/>. This\n\t\t/// protects shell meta-characters like <code>$</code> or <code>~</code> from\n\t\t/// being recognized as special.\n\t\t/// </summary>\n\t    public static readonly BourneStyle BOURNE = new BourneStyle();\n\n\t\t/// <summary>\n\t\t/// Bourne style, but permits <code>~user</code> at the start of the string.\n\t\t/// </summary>\n\t    public static readonly BourneUserPathStyle BOURNE_USER_PATH = new BourneUserPathStyle();\n\n\t\t/// <summary>\n\t\t/// Quote an input string by the quoting rules.\n\t\t/// <para />\n\t\t/// If the input string does not require any quoting, the same String\n\t\t/// reference is returned to the caller.\n\t\t/// <para />\n\t\t/// Otherwise a quoted string is returned, including the opening and closing\n\t\t/// quotation marks at the start and end of the string. If the style does not\n\t\t/// permit raw Unicode characters then the string will first be encoded in\n\t\t/// UTF-8, with unprintable sequences possibly escaped by the rules.\n\t\t/// </summary>\n        /// <param name=\"instr\">any non-null Unicode string</param>\n\t\t/// <returns>a quoted <see cref=\"string\"/>. See above for details.</returns>\n\t    public abstract string quote(string instr);\n\n\t\t/// <summary>\n\t\t/// Clean a previously quoted input, decoding the result via UTF-8.\n\t\t/// <para />\n\t\t/// This method must match quote such that:\n\t\t/// <para />\n\t\t/// <example>\n\t\t/// a.Equals(qequote(quote(a)));\n\t\t/// </example>\n\t\t/// is true for any <code>a</code>.\n\t\t/// </summary>\n\t\t/// <param name=\"instr\">a Unicode string to remove quoting from.</param>\n\t\t/// <returns>the cleaned string.</returns>\n\t\t/// <seealso cref=\"dequote(byte[], int, int)\"/>\n\t    public string dequote(string instr)\n        {\n\t\t\tif (instr == null)\n\t\t\t\tthrow new ArgumentNullException (\"instr\");\n\t\t\t\n\t\t    byte[] b = Constants.encode(instr);\n\t\t    return dequote(b, 0, b.Length);\n\t    }\n\n\t\t/// <summary>\n\t\t/// Decode a previously quoted input, scanning a UTF-8 encoded buffer.\n\t\t/// <para />\n\t\t/// This method must match quote such that:\n\t\t/// <para />\n\t\t/// <example>\n\t\t/// a.Equals(Dequote(Constants.encode(quote(a))));\n\t\t/// </example>\n\t\t/// is true for any <code>a</code>.\n\t\t/// <para />\n\t\t/// This method removes any opening/closing quotation marks added by\n\t\t/// </summary>\n\t\t/// <param name=\"instr\">\n\t\t/// The input buffer to parse.\n\t\t/// </param>\n\t\t/// <param name=\"offset\">\n\t\t/// First position within <paramref name=\"instr\"/> to scan.\n\t\t/// </param>\n\t\t/// <param name=\"end\">\n\t\t/// One position past in <paramref name=\"instr\"/> to scan.\n\t\t/// </param>\n\t\t/// <returns>The cleaned string.</returns>\n\t\t/// <seealso cref=\"quote(string)\"/>.\n\t    public abstract string dequote(byte[] instr, int offset, int end);\n\n\t\t/// <summary>\n\t\t/// Quoting style used by the Bourne shell.\n\t\t/// <para />\n\t\t/// Quotes are unconditionally inserted during <see cref=\"quote(string)\"/>. This\n\t\t/// protects shell meta-characters like <code>$</code> or <code>~</code> from\n\t\t/// being recognized as special.\n\t\t/// </summary>\n\t    public class BourneStyle : QuotedString\n        {\n\t\t    public override string quote(string instr)\n            {\n\t\t\t\tif (instr == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"instr\");\n\t\t\t    StringBuilder r = new StringBuilder();\n\t\t\t    r.Append('\\'');\n\t\t\t    int start = 0, i = 0;\n\t\t\t    for (; i < instr.Length; i++) {\n\t\t\t\t    switch (instr[i]) {\n\t\t\t\t    case '\\'':\n\t\t\t\t    case '!':\n\t\t\t\t\t    r.Append(instr, start, i - start);\n\t\t\t\t\t    r.Append('\\'');\n\t\t\t\t\t    r.Append('\\\\');\n\t\t\t\t\t    r.Append(instr[i]);\n\t\t\t\t\t    r.Append('\\'');\n\t\t\t\t\t    start = i + 1;\n\t\t\t\t\t    break;\n\t\t\t\t    }\n\t\t\t    }\n\n                r.Append(instr, start, i - start);\n\t\t\t    r.Append('\\'');\n\t\t\t    return r.ToString();\n\t\t    }\n\n\t\t    public override string dequote(byte[] instr, int offset, int end)\n            {\n\t\t\t\tif (instr==null)\n\t\t\t\t\tthrow new ArgumentNullException(\"instr\");\n\t\t\t    bool inquote = false;\n\t\t\t    byte[] r = new byte[end - offset];\n\t\t\t    int rPtr = 0;\n\t\t\t    while (offset < end)\n                {\n\t\t\t\t    byte b = instr[offset++];\n\t\t\t\t    switch (b)\n                    {\n\t\t\t\t    case (byte)'\\'':\n\t\t\t\t\t    inquote = !inquote;\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'\\\\':\n\t\t\t\t\t    if (inquote || offset == end)\n\t\t\t\t\t\t    r[rPtr++] = b; // literal within a quote\n\t\t\t\t\t    else\n\t\t\t\t\t\t    r[rPtr++] = instr[offset++];\n\t\t\t\t\t    continue;\n\t\t\t\t    default:\n\t\t\t\t\t    r[rPtr++] = b;\n\t\t\t\t\t    continue;\n\t\t\t\t    }\n\t\t\t    }\n\t\t\t    return RawParseUtils.decode(Constants.CHARSET, r, 0, rPtr);\n\t\t    }\n\t    }\n\n\t\t/// <summary>\n\t\t/// Bourne style, but permits <code>~user</code> at the start of the string.\n\t\t/// </summary>\n        public sealed class BourneUserPathStyle : BourneStyle\n        {\n\t\t    public override string quote(string instr)\n            {\n                if (new Regex(\"^~[A-Za-z0-9_-]+$\").IsMatch(instr))\n                {\n\t\t\t\t    // If the string is just \"~user\" we can assume they\n\t\t\t\t    // mean \"~user/\".\n\t\t\t\t    //\n\t\t\t\t    return instr + \"/\";\n\t\t\t    }\n\n\t\t\t    if (new Regex(\"^~[A-Za-z0-9_-]*/.*$\").IsMatch(instr))\n                {\n\t\t\t\t    // If the string is of \"~/path\" or \"~user/path\"\n\t\t\t\t    // we must not escape ~/ or ~user/ from the shell.\n\t\t\t\t    //\n\t\t\t\t    int i = instr.IndexOf('/') + 1;\n\t\t\t\t    if (i == instr.Length)\n\t\t\t\t\t    return instr;\n\t\t\t\t    return instr.Slice(0, i) + base.quote(instr.Substring(i));\n\t\t\t    }\n\n\t\t\t    return base.quote(instr);\n\t\t    }\n\t    }\n\n\t\t/// <summary>\n\t\t/// Quoting style that obeys the rules Git applies to file names\n\t\t/// </summary>\n\t    public sealed class GitPathStyle : QuotedString\n        {\n\t\t    private static readonly int[] quote_m;\n\t\t    \n            static GitPathStyle()\n            {\n                quote_m = new int[128];\n                for (int i = 0; i < quote_m.Length; i++)\n                {\n                    quote_m[i] = -1;\n                }\n\n\t\t\t    for (int i = '0'; i <= '9'; i++)\n                    quote_m[i] = 0;\n\t\t\t    for (int i = 'a'; i <= 'z'; i++)\n                    quote_m[i] = 0;\n\t\t\t    for (int i = 'A'; i <= 'Z'; i++)\n                    quote_m[i] = 0;\n\n                quote_m[' '] = 0;\n                quote_m['+'] = 0;\n                quote_m[','] = 0;\n                quote_m['-'] = 0;\n                quote_m['.'] = 0;\n                quote_m['/'] = 0;\n                quote_m['='] = 0;\n                quote_m['_'] = 0;\n                quote_m['^'] = 0;\n\n                quote_m['\\u0007'] = (int)'a';\n                quote_m['\\b'] = (int)'b';\n                quote_m['\\f'] = (int)'f';\n                quote_m['\\n'] = (int)'n';\n                quote_m['\\r'] = (int)'r';\n                quote_m['\\t'] = (int)'t';\n                quote_m['\\u000B'] = (int)'v';\n                quote_m['\\\\'] = (int)'\\\\';\n                quote_m['\"'] = (int)'\"';\n\t\t    }\n\n\t\t    public override string quote(string instr)\n            {\n\t\t\t\tif (instr == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"instr\");\n\t\t\t    if (instr.Length == 0)\n\t\t\t\t    return \"\\\"\\\"\";\n\t\t\t    bool reuse = true;\n\t\t\t    byte[] in_str = Constants.encode(instr);\n\t\t\t    StringBuilder r = new StringBuilder(2 + in_str.Length);\n\t\t\t    r.Append('\"');\n\t\t\t    for (int i = 0; i < in_str.Length; i++) {\n\t\t\t\t    int c = in_str[i] & 0xff;\n                    if (c < quote_m.Length)\n                    {\n                        int style = quote_m[c];\n\t\t\t\t\t    if (style == 0) {\n\t\t\t\t\t\t    r.Append((char) c);\n\t\t\t\t\t\t    continue;\n\t\t\t\t\t    }\n\t\t\t\t\t    if (style > 0) {\n\t\t\t\t\t\t    reuse = false;\n\t\t\t\t\t\t    r.Append('\\\\');\n\t\t\t\t\t\t    r.Append((char) style);\n\t\t\t\t\t\t    continue;\n\t\t\t\t\t    }\n\t\t\t\t    }\n\n\t\t\t\t    reuse = false;\n\t\t\t\t    r.Append('\\\\');\n\t\t\t\t    r.Append((char) (((c >> 6) & 03) + '0'));\n\t\t\t\t    r.Append((char) (((c >> 3) & 07) + '0'));\n\t\t\t\t    r.Append((char) (((c >> 0) & 07) + '0'));\n\t\t\t    }\n\t\t\t    if (reuse)\n\t\t\t\t    return instr;\n\t\t\t    r.Append('\"');\n\t\t\t    return r.ToString();\n\t\t    }\n\n\t\t    public override string dequote(byte[] instr, int offset, int end)\n            {\n\t\t\t\tif (instr==null)\n\t\t\t\t\tthrow new ArgumentNullException(\"instr\");\n\t\t\t    if (2 <= end - offset && instr[offset] == '\"' && instr[end - 1] == '\"')\n\t\t\t\t    return dq(instr, offset + 1, end - 1);\n\t\t\t    return RawParseUtils.decode(Constants.CHARSET, instr, offset, end);\n\t\t    }\n\n\t\t    private static string dq(byte[] instr, int offset, int end)\n            {\n\t\t\t    byte[] r = new byte[end - offset];\n\t\t\t    int rPtr = 0;\n\t\t\t    while (offset < end)\n                {\n\t\t\t\t    byte b = instr[offset++];\n\t\t\t\t    if (b != '\\\\') {\n\t\t\t\t\t    r[rPtr++] = b;\n\t\t\t\t\t    continue;\n\t\t\t\t    }\n\n\t\t\t\t    if (offset == end) {\n\t\t\t\t\t    // Lone trailing backslash. Treat it as a literal.\n\t\t\t\t\t    //\n\t\t\t\t\t    r[rPtr++] = (byte)'\\\\';\n\t\t\t\t\t    break;\n\t\t\t\t    }\n\n\t\t\t\t    switch (instr[offset++]) {\n\t\t\t\t    case (byte)'a':\n\t\t\t\t\t    r[rPtr++] = 0x07 /* \\a = BEL */;\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'b':\n\t\t\t\t\t    r[rPtr++] = (byte)'\\b';\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'f':\n\t\t\t\t\t    r[rPtr++] = (byte)'\\f';\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'n':\n\t\t\t\t\t    r[rPtr++] = (byte)'\\n';\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'r':\n\t\t\t\t\t    r[rPtr++] = (byte)'\\r';\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'t':\n\t\t\t\t\t    r[rPtr++] = (byte)'\\t';\n\t\t\t\t\t    continue;\n\t\t\t\t    case (byte)'v':\n\t\t\t\t\t    r[rPtr++] = 0x0B/* \\v = VT */;\n\t\t\t\t\t    continue;\n\n\t\t\t\t    case (byte)'\\\\':\n\t\t\t\t    case (byte)'\"':\n\t\t\t\t\t    r[rPtr++] = instr[offset - 1];\n\t\t\t\t\t    continue;\n\n\t\t\t\t    case (byte)'0':\n\t\t\t\t    case (byte)'1':\n\t\t\t\t    case (byte)'2':\n\t\t\t\t    case (byte)'3': {\n\t\t\t\t\t    int cp = instr[offset - 1] - '0';\n\t\t\t\t\t    while (offset < end) {\n\t\t\t\t\t\t    byte c = instr[offset];\n\t\t\t\t\t\t    if ('0' <= c && c <= '7') {\n\t\t\t\t\t\t\t    cp <<= 3;\n\t\t\t\t\t\t\t    cp |= c - '0';\n\t\t\t\t\t\t\t    offset++;\n\t\t\t\t\t\t    } else {\n\t\t\t\t\t\t\t    break;\n\t\t\t\t\t\t    }\n\t\t\t\t\t    }\n\t\t\t\t\t    r[rPtr++] = (byte) cp;\n\t\t\t\t\t    continue;\n\t\t\t\t    }\n\n\t\t\t\t    default:\n\t\t\t\t\t    // Any other code is taken literally.\n\t\t\t\t\t    //\n\t\t\t\t\t    r[rPtr++] = (byte)'\\\\';\n\t\t\t\t\t    r[rPtr++] = instr[offset - 1];\n\t\t\t\t\t    continue;\n\t\t\t\t    }\n\t\t\t    }\n\n\t\t\t    return RawParseUtils.decode(Constants.CHARSET, r, 0, rPtr);\n\t\t    }\n\n\t\t    internal GitPathStyle()\n\t\t\t{\n\t\t\t    // Singleton\n\t\t    }\n\t    }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/RawCharSequence.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n\n    /**\n     * A rough character sequence around a raw byte buffer.\n     * <para />\n     * Characters are assumed to be 8-bit US-ASCII.\n     */\n    public class RawCharSequence : ICharSequence\n    {\n        /** A zero-Length character sequence. */\n        public static RawCharSequence EMPTY = new RawCharSequence(null, 0, 0);\n\n        public byte[] buffer;\n\n        public int startPtr;\n\n        public int endPtr;\n\n        /**\n         * Create a rough character sequence around the raw byte buffer.\n         *\n         * @param buf\n         *            buffer to scan.\n         * @param start\n         *            starting position for the sequence.\n         * @param end\n         *            ending position for the sequence.\n         */\n        public RawCharSequence(byte[] buf, int start, int end)\n        {\n            buffer = buf;\n            startPtr = start;\n            endPtr = end;\n        }\n\n        public char CharAt(int index)\n        {\n            return (char)(buffer[startPtr + index] & 0xff);\n        }\n\n        public int Length()\n        {\n            return endPtr - startPtr;\n        }\n\n        public ICharSequence subSequence(int start, int end)\n        {\n            return new RawCharSequence(buffer, startPtr + start, startPtr + end);\n        }\n\n        public override string ToString()\n        {\n            int n = Length();\n            StringBuilder b = new StringBuilder(n);\n            for (int i = 0; i < n; i++)\n                b.Append(CharAt(i));\n            return b.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/RawParseUtils.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n * \n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core.Util\n{\n\tpublic static class RawParseUtils\n\t{\n\t\tprivate static readonly byte[] footerLineKeyChars = GenerateFooterLineKeyChars();\n\t\tprivate static readonly byte[] Base10Byte = { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9' };\n\n\t\tprivate static byte[] GenerateFooterLineKeyChars()\n\t\t{\n\t\t\tvar footerLineKeyChars = new byte[(byte)'z' + 1];\n\t\t\tfooterLineKeyChars[(byte)'-'] = 1;\n\n\t\t\tfor (char i = '0'; i <= '9'; i++)\n\t\t\t{\n\t\t\t\tfooterLineKeyChars[i] = 1;\n\t\t\t}\n\n\t\t\tfor (char i = 'A'; i <= 'Z'; i++)\n\t\t\t{\n\t\t\t\tfooterLineKeyChars[i] = 1;\n\t\t\t}\n\n\t\t\tfor (char i = 'a'; i <= 'z'; i++)\n\t\t\t{\n\t\t\t\tfooterLineKeyChars[i] = 1;\n\t\t\t}\n\n\t\t\treturn footerLineKeyChars;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determine if b[ptr] matches src.\n\t\t/// </summary>\n\t\t/// <param name=\"b\">the buffer to scan.</param>\n\t\t/// <param name=\"ptr\">first position within b, this should match src[0].</param>\n\t\t/// <param name=\"src\">the buffer to test for equality with b.</param>\n\t\t/// <returns>ptr + src.Length if b[ptr..src.Length] == src; else -1.</returns>\n\t\tpublic static int match(byte[] b, int ptr, byte[] src)\n\t\t{\n\t\t\tif (ptr + src.Length > b.Length)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < src.Length; i++, ptr++)\n\t\t\t{\n\t\t\t\tif (b[ptr] != src[i])\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ptr;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Format a base 10 numeric into a temporary buffer.\n\t\t/// <para />\n\t\t/// Formatting is performed backwards. The method starts at offset\n\t\t/// <code>o-1</code> and ends at <code>o-1-digits</code>, where\n\t\t/// <code>digits</code> is the number of positions necessary to store the\n\t\t/// base 10 value.\n\t\t/// <para />\n\t\t/// The argument and return values from this method make it easy to chain\n\t\t/// writing, for example:\n\t\t/// <para />\n\t\t/// <example>\n\t\t/// byte[] tmp = new byte[64];\n\t\t/// int ptr = tmp.Length;\n\t\t/// tmp[--ptr] = '\\n';\n\t\t/// ptr = RawParseUtils.formatBase10(tmp, ptr, 32);\n\t\t/// tmp[--ptr] = ' ';\n\t\t/// ptr = RawParseUtils.formatBase10(tmp, ptr, 18);\n\t\t/// tmp[--ptr] = 0;\n\t\t/// string str = new string(tmp, ptr, tmp.Length - ptr);\n\t\t/// </example>\n\t\t/// </summary>\n\t\t/// <param name=\"b\">buffer to write into.</param>\n\t\t/// <param name=\"o\">\n\t\t/// One offset past the location where writing will begin; writing\n\t\t/// proceeds towards lower index values.\n\t\t/// </param>\n\t\t/// <param name=\"value\">the value to store.</param>\n\t\t/// <returns>\n\t\t/// the new offset value <code>o</code>. This is the position of\n\t\t/// the last byte written. Additional writing should start at one\n\t\t/// position earlier.\n\t\t/// </returns>\n\t\tpublic static int formatBase10(byte[] b, int o, int value)\n\t\t{\n\t\t\tif (value == 0)\n\t\t\t{\n\t\t\t\tb[--o] = (byte)'0';\n\t\t\t\treturn o;\n\t\t\t}\n\n\t\t\tbool isneg = value < 0;\n\n\t\t\twhile (value != 0)\n\t\t\t{\n\t\t\t\tb[--o] = Base10Byte[value % 10];\n\t\t\t\tvalue /= 10;\n\t\t\t}\n\n\t\t\tif (isneg)\n\t\t\t{\n\t\t\t\tb[--o] = (byte)'-';\n\t\t\t}\n\n\t\t\treturn o;\n\t\t}\n\n\t\t/**\n         * Parse a base 10 numeric from a sequence of ASCII digits into an int.\n         * <para />\n         * Digit sequences can begin with an optional run of spaces before the\n         * sequence, and may start with a '+' or a '-' to indicate sign position.\n         * Any other characters will cause the method to stop and return the current\n         * result to the caller.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position within buffer to start parsing digits at.\n         * @param ptrResult\n         *            optional location to return the new ptr value through. If null\n         *            the ptr value will be discarded.\n         * @return the value at this location; 0 if the location is not a valid\n         *         numeric.\n         */\n\t\tpublic static int parseBase10(byte[] b, int ptr, MutableInteger ptrResult)\n\t\t{\n\t\t\tint r = 0;\n\t\t\tint sign = 0;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint sz = b.Length;\n\t\t\t\twhile (ptr < sz && b[ptr] == ' ')\n\t\t\t\t\tptr++;\n\t\t\t\tif (ptr >= sz)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tswitch (b[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase ((byte)'-'):\n\t\t\t\t\t\tsign = -1;\n\t\t\t\t\t\tptr++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ((byte)'+'):\n\t\t\t\t\t\tptr++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twhile (ptr < sz)\n\t\t\t\t{\n\t\t\t\t\tbyte d = b[ptr];\n\t\t\t\t\tif ((d < (byte)'0') || (d > (byte)'9'))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tr = r * 10 + (d - (byte)'0');\n\t\t\t\t\tptr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\t// Not a valid digit.\n\t\t\t}\n\t\t\tif (ptrResult != null)\n\t\t\t\tptrResult.value = ptr;\n\t\t\treturn sign < 0 ? -r : r;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse a base 10 numeric from a sequence of ASCII digits into a long.\n\t\t/// <para />\n\t\t/// Digit sequences can begin with an optional run of spaces before the\n\t\t/// sequence, and may start with a '+' or a '-' to indicate sign position.\n\t\t/// Any other characters will cause the method to stop and return the current\n\t\t/// result to the caller.\n\t\t/// </summary>\n\t\t/// <param name=\"b\">Buffer to scan.</param>\n\t\t/// <param name=\"ptr\">\n\t\t/// Position within buffer to start parsing digits at.\n\t\t/// </param>\n\t\t/// <param name=\"ptrResult\">\n\t\t/// Optional location to return the new ptr value through. If null\n\t\t/// the ptr value will be discarded.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// The value at this location; 0 if the location is not a valid\n\t\t/// numeric.\n\t\t/// </returns>\n\t\tpublic static long parseLongBase10(byte[] b, int ptr, MutableInteger ptrResult)\n\t\t{\n\t\t\tlong r = 0;\n\t\t\tint sign = 0;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint sz = b.Length;\n\t\t\t\twhile (ptr < sz && b[ptr] == ' ')\n\t\t\t\t\tptr++;\n\t\t\t\tif (ptr >= sz)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tswitch (b[ptr])\n\t\t\t\t{\n\t\t\t\t\tcase (byte)'-':\n\t\t\t\t\t\tsign = -1;\n\t\t\t\t\t\tptr++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (byte)'+':\n\t\t\t\t\t\tptr++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twhile (ptr < sz)\n\t\t\t\t{\n\t\t\t\t\tint v = b[ptr] - (byte)'0';\n\t\t\t\t\tif (v < 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tr = (r * 10) + v;\n\t\t\t\t\tptr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\t// Not a valid digit.\n\t\t\t}\n\t\t\tif (ptrResult != null)\n\t\t\t\tptrResult.value = ptr;\n\t\t\treturn sign < 0 ? -r : r;\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse 4 character base 16 (hex) formatted string to unsigned integer.\n\t\t/// <para />\n\t\t/// The number is read in network byte order, that is, most significant\n\t\t/// nibble first.\n\t\t/// </summary>\n\t\t/// <param name=\"bs\">\n\t\t/// buffer to parse digits from; positions <code>[p, p+4]</code> will\n\t\t/// be parsed.\n\t\t/// </param>\n\t\t/// <param name=\"p\">First position within the buffer to parse.</param>\n\t\t///\t<returns>The integer value.</returns>\n\t\t/// <exception cref=\"IndexOutOfRangeException\">\n\t\t/// If the string is not hex formatted.\n\t\t/// </exception>\n\t\tpublic static int parseHexInt16(byte[] bs, int p)\n\t\t{\n\t\t\ttry \n\t\t\t{\n                string hex = Charset.forName(\"US-ASCII\").GetString(bs, p, 4);\n\t\t\t\t\n\t\t\t\thex = hex.Substring(p);\n\t\t\t\treturn UInt16.Parse(hex,System.Globalization.NumberStyles.AllowHexSpecifier);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new IndexOutOfRangeException(\"Exception Parsing Hex\",e);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse 8 character base 16 (hex) formatted string to unsigned integer.\n\t\t///\t<para />\n\t\t///\tThe number is read in network byte order, that is, most significant\n\t\t///\tnibble first.\n\t\t///\t</summary>\n\t\t///\t<param name=\"bs\">\n\t\t/// Buffer to parse digits from; positions <code>[p, p+8]</code> will\n\t\t/// be parsed.\n\t\t/// </param>\n\t\t///\t<param name=\"p\">First position within the buffer to parse.</param>\n\t\t///\t<returns> the integer value.</returns>\n\t\t///\t<exception cref=\"IndexOutOfRangeException\">\n\t\t///\tif the string is not hex formatted.\n\t\t/// </exception>\n\t\tpublic static int parseHexInt32(byte[] bs, int p)\n\t\t{\n\t\t\ttry \n\t\t\t{\n                string hex = Charset.forName(\"US-ASCII\").GetString(bs, p, 8);\n                //string hex = Encoding.ASCII.GetString(bs).Substring(p, 8);\n\t\t\t\t\n\t\t\t\treturn (int)UInt32.Parse(hex,System.Globalization.NumberStyles.AllowHexSpecifier);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new IndexOutOfRangeException(\"Exception Parsing Hex\",e);\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Parse a single hex digit to its numeric value (0-15).\n\t\t///\t</summary>\n\t\t///\t<param name=\"digit\">Hex character to parse.</param>\n\t\t///\t<returns>Numeric value, in the range 0-15.</returns>\n\t\t///\t<exception cref=\"IndexOutOfRangeException\">\n\t\t///\tIf the input digit is not a valid hex digit.\n\t\t/// </exception>\n\t\tpublic static int parseHexInt4(byte digit)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tchar c = (char)digit;\n\t\t\t\tUInt16 result = UInt16.Parse(c.ToString(),System.Globalization.NumberStyles.AllowHexSpecifier);\n\t\t\t\t\n\t\t\t\tif (result > 15)\n\t\t\t\t\tthrow new OverflowException();\n\t\t\t\t\n\t\t\t\treturn (int)result;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new IndexOutOfRangeException(\"Exception Parsing Hex\",e);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse a Git style timezone string.\n\t\t///\t<para />\n\t\t///\tThe sequence \"-0315\" will be parsed as the numeric value -195, as the\n\t\t///\tlower two positions count minutes, not 100ths of an hour.\n\t\t///\t</summary>\n\t\t///\t<param name=\"b\">Buffer to scan.</param>\n\t\t///\t<param name=\"ptr\">\n\t\t///\tPosition within buffer to start parsing digits at. </param>\n\t\t///\t<returns> the timezone at this location, expressed in minutes. </returns>\n\t\tpublic static int parseTimeZoneOffset(byte[] b, int ptr)\n\t\t{\n\t\t\tint v = parseBase10(b, ptr, null);\n\t\t\tint tzMins = v % 100;\n\t\t\tint tzHours = v / 100;\n\t\t\treturn tzHours * 60 + tzMins;\n\t\t}\n\n\t\tpublic static int next(byte[] b, int ptr, byte chrA)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\twhile (ptr < sz)\n\t\t\t{\n\t\t\t\tif (b[ptr++] == chrA)\n\t\t\t\t\treturn ptr;\n\t\t\t}\n\t\t\treturn ptr;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Locate the first position after LF.\n\t\t/// </summary>\n\t\t/// <param name=\"b\">buffer to scan.</param>\n\t\t/// <param name=\"ptr\">\n\t\t/// position within buffer to start looking for LF at.\n\t\t/// </param>\n\t\t/// <returns>New position just after LF.</returns>\n\t\tpublic static int nextLF(byte[] b, int ptr)\n\t\t{\n\t\t\treturn next(b, ptr, (byte)'\\n');\n\t\t}\n\n\t\t/**\n         * Locate the first position After either the given character or LF.\n         * <para />\n         * This method stops on the first match it finds from either chrA or '\\n'.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position within buffer to start looking for chrA or LF at.\n         * @param chrA\n         *            character to find.\n         * @return new position just After the first chrA or LF to be found.\n         */\n\t\tpublic static int nextLF(byte[] b, int ptr, byte chrA)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\twhile (ptr < sz)\n\t\t\t{\n\t\t\t\tbyte c = b[ptr++];\n\t\t\t\tif (c == chrA || c == (byte)'\\n')\n\t\t\t\t\treturn ptr;\n\t\t\t}\n\t\t\treturn ptr;\n\t\t}\n\n\n\t\t/**\n         * Locate the first position before a given character.\n         *\n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position within buffer to start looking for chrA at.\n         * @param chrA\n         *            character to find.\n         * @return new position just before chrA, -1 for not found\n         */\n\t\tpublic static int prev(byte[] b, int ptr, char chrA)\n\t\t{\n\t\t\tif (ptr == b.Length)\n\t\t\t\t--ptr;\n\t\t\twhile (ptr >= 0)\n\t\t\t{\n\t\t\t\tif (b[ptr--] == chrA)\n\t\t\t\t\treturn ptr;\n\t\t\t}\n\t\t\treturn ptr;\n\t\t}\n\n\t\t/**\n         * Locate the first position before the previous LF.\n         * <para />\n         * This method stops on the first '\\n' it finds.\n         *\n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position within buffer to start looking for LF at.\n         * @return new position just before the first LF found, -1 for not found\n         */\n\t\tpublic static int prevLF(byte[] b, int ptr)\n\t\t{\n\t\t\treturn prev(b, ptr, '\\n');\n\t\t}\n\n\t\t/**\n         * Locate the previous position before either the given character or LF.\n         * <para />\n         * This method stops on the first match it finds from either chrA or '\\n'.\n         *\n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position within buffer to start looking for chrA or LF at.\n         * @param chrA\n         *            character to find.\n         * @return new position just before the first chrA or LF to be found, -1 for\n         *         not found\n         */\n\t\tpublic static int prevLF(byte[] b, int ptr, char chrA)\n\t\t{\n\t\t\tif (ptr == b.Length)\n\t\t\t\t--ptr;\n\t\t\twhile (ptr >= 0)\n\t\t\t{\n\t\t\t\tbyte c = b[ptr--];\n\t\t\t\tif (c == (byte)chrA || c == (byte)'\\n')\n\t\t\t\t\treturn ptr;\n\t\t\t}\n\t\t\treturn ptr;\n\t\t}\n\n\t\t/**\n         * Index the region between <code>[ptr, end)</code> to find line starts.\n         * <para />\n         * The returned list is 1 indexed. Index 0 contains\n         * {@link Integer#MIN_VALUE} to pad the list out.\n         * <para />\n         * Using a 1 indexed list means that line numbers can be directly accessed\n         * from the list, so <code>list.get(1)</code> (aka get line 1) returns\n         * <code>ptr</code>.\n         * <para />\n         * The last element (index <code>map.size()-1</code>) always contains\n         * <code>end</code>.\n         *\n         * @param buf\n         *            buffer to scan.\n         * @param ptr\n         *            position within the buffer corresponding to the first byte of\n         *            line 1.\n         * @param end\n         *            1 past the end of the content within <code>buf</code>.\n         * @return a line map indexing the start position of each line.\n         */\n\t\tpublic static IntList lineMap(byte[] buf, int ptr, int end)\n\t\t{\n\t\t\t// Experimentally derived from multiple source repositories\n\t\t\t// the average number of bytes/line is 36. Its a rough guess\n\t\t\t// to initially size our map close to the target.\n\t\t\t//\n\t\t\tIntList map = new IntList((end - ptr) / 36);\n\t\t\tmap.fillTo(1, int.MinValue);\n\t\t\tfor (; ptr < end; ptr = nextLF(buf, ptr))\n\t\t\t\tmap.add(ptr);\n\t\t\tmap.add(end);\n\t\t\treturn map;\n\t\t}\n\n\t\t/**\n         * Locate the \"author \" header line data.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position in buffer to start the scan at. Most callers should\n         *            pass 0 to ensure the scan starts from the beginning of the\n         *            commit buffer and does not accidentally look at message body.\n         * @return position just After the space in \"author \", so the first\n         *         character of the author's name. If no author header can be\n         *         located -1 is returned.\n         */\n\t\tpublic static int author(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\tif (ptr == 0)\n\t\t\t\tptr += 46; // skip the \"tree ...\" line.\n\t\t\twhile (ptr < sz && b[ptr] == (byte)'p')\n\t\t\t\tptr += 48; // skip this parent.\n\t\t\treturn match(b, ptr, ObjectChecker.author);\n\t\t}\n\n\t\t/**\n         * Locate the \"committer \" header line data.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position in buffer to start the scan at. Most callers should\n         *            pass 0 to ensure the scan starts from the beginning of the\n         *            commit buffer and does not accidentally look at message body.\n         * @return position just After the space in \"committer \", so the first\n         *         character of the committer's name. If no committer header can be\n         *         located -1 is returned.\n         */\n\t\tpublic static int committer(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\tif (ptr == 0)\n\t\t\t\tptr += 46; // skip the \"tree ...\" line.\n\t\t\twhile (ptr < sz && b[ptr] == (byte)'p')\n\t\t\t\tptr += 48; // skip this parent.\n\t\t\tif (ptr < sz && b[ptr] == (byte)'a')\n\t\t\t\tptr = nextLF(b, ptr);\n\t\t\treturn match(b, ptr, ObjectChecker.committer);\n\t\t}\n\n\t\t/**\n         * Locate the \"tagger \" header line data.\n         *\n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position in buffer to start the scan at. Most callers should\n         *            pass 0 to ensure the scan starts from the beginning of the tag\n         *            buffer and does not accidentally look at message body.\n         * @return position just After the space in \"tagger \", so the first\n         *         character of the tagger's name. If no tagger header can be\n         *         located -1 is returned.\n         */\n\t\tpublic static int tagger(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\tif (ptr == 0)\n\t\t\t\tptr += 48; // skip the \"object ...\" line.\n\t\t\twhile (ptr < sz)\n\t\t\t{\n\t\t\t\tif (b[ptr] == (byte)'\\n')\n\t\t\t\t\treturn -1;\n\t\t\t\tint m = match(b, ptr, ObjectChecker.tagger);\n\t\t\t\tif (m >= 0)\n\t\t\t\t\treturn m;\n\t\t\t\tptr = nextLF(b, ptr);\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n         * Locate the \"encoding \" header line.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position in buffer to start the scan at. Most callers should\n         *            pass 0 to ensure the scan starts from the beginning of the\n         *            buffer and does not accidentally look at the message body.\n         * @return position just After the space in \"encoding \", so the first\n         *         character of the encoding's name. If no encoding header can be\n         *         located -1 is returned (and UTF-8 should be assumed).\n         */\n\t\tpublic static int encoding(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\twhile (ptr < sz)\n\t\t\t{\n\t\t\t\tif (b[ptr] == '\\n')\n\t\t\t\t\treturn -1;\n\t\t\t\tif (b[ptr] == 'e')\n\t\t\t\t\tbreak;\n\t\t\t\tptr = nextLF(b, ptr);\n\t\t\t}\n\t\t\treturn match(b, ptr, ObjectChecker.encoding);\n\t\t}\n\n\t\t/**\n         * Parse the \"encoding \" header into a character set reference.\n         * <para />\n         * Locates the \"encoding \" header (if present) by first calling\n         * {@link #encoding(byte[], int)} and then returns the proper character set\n         * to Apply to this buffer to evaluate its contents as character data.\n         * <para />\n         * If no encoding header is present, {@link Constants#CHARSET} is assumed.\n         * \n         * @param b\n         *            buffer to scan.\n         * @return the Java character set representation. Never null.\n         */\n\t\tpublic static Encoding parseEncoding(byte[] b)\n\t\t{\n\t\t\tint enc = encoding(b, 0);\n\t\t\tif (enc < 0)\n\t\t\t{\n\t\t\t    return Constants.CHARSET;\n\t\t\t}\n\n\t\t\tint lf = nextLF(b, enc);\n\t\t\tstring encodingName = decode(Constants.CHARSET, b, enc, lf - 1);\n\n\t\t\treturn Charset.forName(encodingName);\n\t\t}\n\n\t\t/**\n         * Parse a name line (e.g. author, committer, tagger) into a PersonIdent.\n         * <para />\n         * When passing in a value for <code>nameB</code> callers should use the\n         * return value of {@link #author(byte[], int)} or\n         * {@link #committer(byte[], int)}, as these methods provide the proper\n         * position within the buffer.\n         * \n         * @param raw\n         *            the buffer to parse character data from.\n         * @param nameB\n         *            first position of the identity information. This should be the\n         *            first position After the space which delimits the header field\n         *            name (e.g. \"author\" or \"committer\") from the rest of the\n         *            identity line.\n         * @return the parsed identity. Never null.\n         */\n\t\tpublic static PersonIdent parsePersonIdent(byte[] raw, int nameB)\n\t\t{\n\t\t\tEncoding cs = parseEncoding(raw);\n\t\t\tint emailB = nextLF(raw, nameB, (byte)'<');\n\t\t\tint emailE = nextLF(raw, emailB, (byte)'>');\n\n\t\t\tstring name = decode(cs, raw, nameB, emailB - 2);\n\t\t\tstring email = decode(cs, raw, emailB, emailE - 1);\n\n\t\t\tvar ptrout = new MutableInteger();\n\t\t\tlong when = parseLongBase10(raw, emailE + 1, ptrout);\n\t\t\tint tz = parseTimeZoneOffset(raw, ptrout.value);\n\n\t\t\treturn new PersonIdent(name, email, when * 1000, tz);\n\t\t}\n\n\n\t\t/**\n         * Parse a name data (e.g. as within a reflog) into a PersonIdent.\n         * <para />\n         * When passing in a value for <code>nameB</code> callers should use the\n         * return value of {@link #author(byte[], int)} or\n         * {@link #committer(byte[], int)}, as these methods provide the proper\n         * position within the buffer.\n         *\n         * @param raw\n         *            the buffer to parse character data from.\n         * @param nameB\n         *            first position of the identity information. This should be the\n         *            first position After the space which delimits the header field\n         *            name (e.g. \"author\" or \"committer\") from the rest of the\n         *            identity line.\n         * @return the parsed identity. Never null.\n         */\n\t\tpublic static PersonIdent parsePersonIdentOnly(byte[] raw, int nameB)\n\t\t{\n\t\t\tint stop = nextLF(raw, nameB);\n\t\t\tint emailB = nextLF(raw, nameB, (byte)'<');\n\t\t\tint emailE = nextLF(raw, emailB, (byte)'>');\n\t\t\tstring name;\n\t\t\tstring email;\n\t\t\tif (emailE < stop)\n\t\t\t{\n\t\t\t\temail = decode(raw, emailB, emailE - 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\temail = \"invalid\";\n\t\t\t}\n\t\t\tif (emailB < stop)\n\t\t\t\tname = decode(raw, nameB, emailB - 2);\n\t\t\telse\n\t\t\t\tname = decode(raw, nameB, stop);\n\n\t\t\tMutableInteger ptrout = new MutableInteger();\n\t\t\tlong when;\n\t\t\tint tz;\n\t\t\tif (emailE < stop)\n\t\t\t{\n\t\t\t\twhen = parseLongBase10(raw, emailE + 1, ptrout);\n\t\t\t\ttz = parseTimeZoneOffset(raw, ptrout.value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhen = 0;\n\t\t\t\ttz = 0;\n\t\t\t}\n\t\t\treturn new PersonIdent(name, email, when * 1000, tz);\n\t\t}\n\n\t\t/**\n         * Locate the end of a footer line key string.\n         * <para />\n         * If the region at {@code raw[ptr]} matches {@code ^[A-Za-z0-9-]+:} (e.g.\n         * \"Signed-off-by: A. U. Thor\\n\") then this method returns the position of\n         * the first ':'.\n         * <para />\n         * If the region at {@code raw[ptr]} does not match {@code ^[A-Za-z0-9-]+:}\n         * then this method returns -1.\n         *\n         * @param raw\n         *            buffer to scan.\n         * @param ptr\n         *            first position within raw to consider as a footer line key.\n         * @return position of the ':' which terminates the footer line key if this\n         *         is otherwise a valid footer line key; otherwise -1.\n         */\n\t\tpublic static int endOfFooterLineKey(byte[] raw, int ptr)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfor (; ; )\n\t\t\t\t{\n\t\t\t\t\tbyte c = raw[ptr];\n\t\t\t\t\tif (footerLineKeyChars[c] == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (c == (byte)':')\n\t\t\t\t\t\t\treturn ptr;\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\tptr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IndexOutOfRangeException)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tprivate static string decode(byte[] b, Encoding charset)\n\t\t{\n\t\t\treturn charset.GetString(b);\n\t\t}\n\n\t\t/**\n         * Decode a buffer under UTF-8, if possible.\n         *\n         * If the byte stream cannot be decoded that way, the platform default is tried\n         * and if that too fails, the fail-safe ISO-8859-1 encoding is tried.\n         * \n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @return a string representation of the range <code>[start,end)</code>,\n         *         After decoding the region through the specified character set.\n         */\n\t\tpublic static string decode(byte[] buffer)\n\t\t{\n\t\t\treturn decode(buffer, 0, buffer.Length);\n\t\t}\n\n\t\t/**\n         * Decode a buffer under UTF-8, if possible.\n         *\n         * If the byte stream cannot be decoded that way, the platform default is\n         * tried and if that too fails, the fail-safe ISO-8859-1 encoding is tried.\n         *\n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @param start\n         *            start position in buffer\n         * @param end\n         *            one position past the last location within the buffer to take\n         *            data from.\n         * @return a string representation of the range <code>[start,end)</code>,\n         *         After decoding the region through the specified character set.\n         */\n\t\tpublic static string decode(byte[] buffer, int start, int end)\n\t\t{\n\t\t\treturn decode(Constants.CHARSET, buffer, start, end);\n\t\t}\n\n\t\t/**\n         * Decode a buffer under the specified character set if possible.\n         *\n         * If the byte stream cannot be decoded that way, the platform default is tried\n         * and if that too fails, the fail-safe ISO-8859-1 encoding is tried.\n         * \n         * @param cs\n         *            character set to use when decoding the buffer.\n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @return a string representation of the range <code>[start,end)</code>,\n         *         After decoding the region through the specified character set.\n         */\n\t\tpublic static string decode(Encoding cs, byte[] buffer)\n\t\t{\n\t\t\treturn decode(cs, buffer, 0, buffer.Length);\n\t\t}\n\n\t\t/**\n         * Decode a region of the buffer under the specified character set if possible.\n         *\n         * If the byte stream cannot be decoded that way, the platform default is tried\n         * and if that too fails, the fail-safe ISO-8859-1 encoding is tried.\n         * \n         * @param cs\n         *            character set to use when decoding the buffer.\n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @param start\n         *            first position within the buffer to take data from.\n         * @param end\n         *            one position past the last location within the buffer to take\n         *            data from.\n         * @return a string representation of the range <code>[start,end)</code>,\n         *         After decoding the region through the specified character set.\n         */\n\t\tpublic static string decode(Encoding cs, byte[] buffer, int start, int end)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn decodeNoFallback(cs, buffer, start, end);\n\t\t\t}\n\t\t\tcatch (DecoderFallbackException)\n\t\t\t{\n\t\t\t\t// Fall back to an ISO-8859-1 style encoding. At least all of\n\t\t\t\t// the bytes will be present in the output.\n\t\t\t\t//\n\t\t\t\treturn extractBinaryString(buffer, start, end);\n\t\t\t}\n\t\t}\n\n\t\t/**\n         * Decode a region of the buffer under the specified character set if\n         * possible.\n         *\n         * If the byte stream cannot be decoded that way, the platform default is\n         * tried and if that too fails, an exception is thrown.\n         *\n         * @param cs\n         *            character set to use when decoding the buffer.\n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @param start\n         *            first position within the buffer to take data from.\n         * @param end\n         *            one position past the last location within the buffer to take\n         *            data from.\n         * @return a string representation of the range <code>[start,end)</code>,\n         *         After decoding the region through the specified character set.\n         * @throws CharacterCodingException\n         *             the input is not in any of the tested character sets.\n         */\n\t\tpublic static string decodeNoFallback(Encoding cs, byte[] buffer, int start, int end)\n\t\t{\n\t\t\t// ByteBuffer b = ByteBuffer.wrap(buffer, start, end - start);\n\t\t\t//b.mark();\n\t\t\tbyte[] b = new byte[end - start];\n\t\t\tfor (int i = 0; i < end - start; i++)\n\t\t\t\tb[i] = buffer[start + i];\n\n\n              // Try our built-in favorite. The assumption here is that\n                 // decoding will fail if the data is not actually encoded\n                 // using that encoder.\n                 //\n                 try {\n                         return decode(b, Constants.CHARSET);\n                 } catch (DecoderFallbackException) {\n                         //b.reset();\n                 }\n\n                 if (!cs.Equals(Constants.CHARSET)) {\n                         // Try the suggested encoding, it might be right since it was\n                         // provided by the caller.\n                         //\n                         try {\n                                 return decode(b, cs);\n                         } catch (DecoderFallbackException) {\n                                 //b.reset();\n                         }\n                 }\n\n                 // Try the default character set. A small group of people\n                 // might actually use the same (or very similar) locale.\n                 //\n                 Encoding defcs = Encoding.Default;\n                 if (!defcs.Equals(cs) && !defcs.Equals(Constants.CHARSET)) {\n                         try {\n                                 return decode(b, defcs);\n                         }\n                         catch (DecoderFallbackException)\n                         {\n                                 //b.reset();\n                         }\n                 }\n\n                 throw new DecoderFallbackException(string.Format(\"Unable to decode provided buffer using encoder '{0}'.\", cs.WebName) );\n\t\t}\n\n\t\t/**\n         * Decode a region of the buffer under the ISO-8859-1 encoding.\n         *\n         * Each byte is treated as a single character in the 8859-1 character\n         * encoding, performing a raw binary->char conversion.\n         *\n         * @param buffer\n         *            buffer to pull raw bytes from.\n         * @param start\n         *            first position within the buffer to take data from.\n         * @param end\n         *            one position past the last location within the buffer to take\n         *            data from.\n         * @return a string representation of the range <code>[start,end)</code>.\n         */\n\t\tpublic static string extractBinaryString(byte[] buffer, int start, int end)\n\t\t{\n\t\t\tStringBuilder r = new StringBuilder(end - start);\n\t\t\tfor (int i = start; i < end; i++)\n\t\t\t\tr.Append((char)(buffer[i] & 0xff));\n\t\t\treturn r.ToString();\n\t\t}\n\n\t\t/**\n        * Locate the position of the commit message body.\n        * \n        * @param b\n        *            buffer to scan.\n        * @param ptr\n        *            position in buffer to start the scan at. Most callers should\n        *            pass 0 to ensure the scan starts from the beginning of the\n        *            commit buffer.\n        * @return position of the user's message buffer.\n        */\n\t\tpublic static int commitMessage(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\tif (ptr == 0)\n\t\t\t\tptr += 46; // skip the \"tree ...\" line.\n\t\t\twhile (ptr < sz && b[ptr] == (byte)'p')\n\t\t\t\tptr += 48; // skip this parent.\n\n\t\t\t// Skip any remaining header lines, ignoring what their actual\n\t\t\t// header line type is. This is identical to the logic for a tag.\n\t\t\t//\n\t\t\treturn tagMessage(b, ptr);\n\t\t}\n\n\t\t/**\n         * Locate the position of the tag message body.\n         *\n         * @param b\n         *            buffer to scan.\n         * @param ptr\n         *            position in buffer to start the scan at. Most callers should\n         *            pass 0 to ensure the scan starts from the beginning of the tag\n         *            buffer.\n         * @return position of the user's message buffer.\n         */\n\t\tpublic static int tagMessage(byte[] b, int ptr)\n\t\t{\n\t\t\tint sz = b.Length;\n\t\t\tif (ptr == 0)\n\t\t\t\tptr += 48; // skip the \"object ...\" line.\n\t\t\twhile (ptr < sz && b[ptr] != (byte)'\\n')\n\t\t\t\tptr = nextLF(b, ptr);\n\t\t\tif (ptr < sz && b[ptr] == (byte)'\\n')\n\t\t\t\treturn ptr + 1;\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n         * Locate the end of a paragraph.\n         * <para />\n         * A paragraph is ended by two consecutive LF bytes.\n         * \n         * @param b\n         *            buffer to scan.\n         * @param start\n         *            position in buffer to start the scan at. Most callers will\n         *            want to pass the first position of the commit message (as\n         *            found by {@link #commitMessage(byte[], int)}.\n         * @return position of the LF at the end of the paragraph;\n         *         <code>b.Length</code> if no paragraph end could be located.\n         */\n\t\tpublic static int endOfParagraph(byte[] b, int start)\n\t\t{\n\t\t\tint ptr = start;\n\t\t\tint sz = b.Length;\n\n\t\t\twhile (ptr < sz && b[ptr] != (byte)'\\n')\n\t\t\t{\n\t\t\t\tptr = nextLF(b, ptr);\n\t\t\t}\n\n\t\t\twhile (0 < ptr && start < ptr && b[ptr - 1] == (byte)'\\n')\n\t\t\t{\n\t\t\t\tptr--;\n\t\t\t}\n\n\t\t\treturn ptr;\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Core/Util/RawSubstringPattern.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Util\n{\n    /**\n     * Searches text using only substring search.\n     * <para />\n     * Instances are thread-safe. Multiple concurrent threads may perform matches on\n     * different character sequences at the same time.\n     */\n    public class RawSubStringPattern\n    {\n        private String needleString;\n\n        private byte[] needle;\n\n        /**\n         * Construct a new substring pattern.\n         * \n         * @param patternText\n         *            text to locate. This should be a literal string, as no\n         *            meta-characters are supported by this implementation. The\n         *            string may not be the empty string.\n         */\n        public RawSubStringPattern(string patternText)\n        {\n\t\t\tif (patternText == null)\n\t\t\t\tthrow new ArgumentNullException (\"patternText\");\n            if (patternText.Length == 0)\n                throw new ArgumentException(\"Cannot match on empty string.\",\"patternText\");\n            needleString = patternText;\n            byte[] b = Constants.encode(patternText);\n            needle = new byte[b.Length];\n            for (int i = 0; i < b.Length; i++)\n                needle[i] = lc(b[i]);\n        }\n\n        /**\n         * Match a character sequence against this pattern.\n         * \n         * @param rcs\n         *            the sequence to match. Must not be null but the Length of the\n         *            sequence is permitted to be 0.\n         * @return offset within <code>rcs</code> of the first occurrence of this\n         *         pattern; -1 if this pattern does not appear at any position of\n         *         <code>rcs</code>.\n         */\n        public int match(RawCharSequence rcs)\n        {\n\t\t\tif (rcs == null)\n\t\t\t\tthrow new ArgumentNullException (\"rcs\");\n\t\t\t\n            int needleLen = needle.Length;\n            byte first = needle[0];\n\n            byte[] text = rcs.buffer;\n            int matchPos = rcs.startPtr;\n            int maxPos = rcs.endPtr - needleLen;\n\n            for (; matchPos < maxPos; matchPos++)\n            {\n                if (neq(first, text[matchPos]))\n                {\n                    while (++matchPos < maxPos && neq(first, text[matchPos]))\n                    {\n                        /* skip */\n                    }\n                    if (matchPos == maxPos)\n                        return -1;\n                }\n\n                int si = ++matchPos;\n\n                bool outer_continue = false;\n                for (int j = 1; j < needleLen; j++, si++)\n                {\n                    if (neq(needle[j], text[si]))\n                        outer_continue = true;\n                }\n\n                if (outer_continue)\n                    continue;\n\n                return matchPos - 1;\n            }\n            return -1;\n        }\n\n        private static bool neq(byte a, byte b)\n        {\n            return a != b && a != lc(b);\n        }\n\n        private static byte lc(byte q)\n        {\n            return (byte)StringUtils.toLowerCase((char)(q & 0xff));\n        }\n\n        /**\n         * Get the literal pattern string this instance searches for.\n         * \n         * @return the pattern string given to our constructor.\n         */\n        public string pattern()\n        {\n            return needleString;\n        }\n\n        public override string ToString()\n        {\n            return pattern();\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/RefList.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Specialized variant of an ArrayList to support a {@code RefDatabase}.\n    /// <para/>\n    /// This list is a hybrid of a Map&lt;String,Ref&gt; and of a List&lt;Ref&gt;. It\n    /// tracks reference instances by name by keeping them sorted and performing\n    /// binary search to locate an entry. Lookup time is O(log N), but addition and\n    /// removal is O(N + log N) due to the list expansion or contraction costs.\n    /// <para/>\n    /// This list type is copy-on-write. Mutation methods return a new copy of the\n    /// list, leaving {@code this} unmodified. As a result we cannot easily implement\n    /// the {@link java.util.List} interface contract.\n    /// </summary>\n    /// <typeparam name=\"T\">the type of reference being stored in the collection.</typeparam>\n    public class RefList<T> : IIterable<T> where T : Ref\n    {\n        private static RefList<T> EMPTY = new RefList<T>(new Ref[0], 0);\n\n        /// <returns>an empty unmodifiable reference list.</returns>\n        public static RefList<T> emptyList()\n        {\n            return EMPTY;\n        }\n\n        private readonly Ref[] _list;\n\n        private readonly int _cnt;\n\n        public RefList(Ref[] list, int cnt)\n        {\n            this._list = list;\n            this._cnt = cnt;\n        }\n\n        /// <summary>\n        /// Initialize this list to use the same backing array as another list.\n        /// </summary>\n        /// <param name=\"src\">the source list</param>\n        public RefList(RefList<T> src)\n        {\n            this._list = src._list;\n            this._cnt = src._cnt;\n        }\n\n        public IteratorBase<T> iterator()\n        {\n            return new BasicIterator<T>(this);\n        }\n\n        /// <returns>this cast as an immutable, standard {@link java.util.List}.</returns>\n        public ICollection<Ref> asList()\n        {\n            List<Ref> r = new List<Ref>(_list).GetRange(0, _cnt);\n            return new ReadOnlyCollection<Ref>(r);\n        }\n\n        /// <returns>number of items in this list.</returns>\n        public int size()\n        {\n            return _cnt;\n        }\n\n        /// <returns>true if the size of this list is 0.</returns>\n        public bool isEmpty()\n        {\n            return _cnt == 0;\n        }\n\n        /// <summary>\n        /// Locate an entry by name.\n        /// </summary>\n        /// <param name=\"name\">the name of the reference to find.</param>\n        /// <returns>\n        /// the index the reference is at. If the entry is not present\n        /// returns a negative value. The insertion position for the given\n        /// name can be computed from {@code -(index + 1)}.\n        /// </returns>\n        public int find(string name)\n        {\n            int high = _cnt;\n            if (high == 0)\n                return -1;\n            int low = 0;\n            do\n            {\n                int mid = (int)((uint)(low + high)) >> 1;\n                int cmp = RefComparator.compareTo(_list[mid], name);\n                if (cmp < 0)\n                    low = mid + 1;\n                else if (cmp == 0)\n                    return mid;\n                else\n                    high = mid;\n            } while (low < high);\n            return -(low + 1);\n        }\n\n        /// <summary>\n        /// Determine if a reference is present.\n        /// </summary>\n        /// <param name=\"name\">name of the reference to find.</param>\n        /// <returns>true if the reference is present; false if it is not.</returns>\n        public bool contains(string name)\n        {\n            return 0 <= find(name);\n        }\n\n        /// <summary>\n        /// Get a reference object by name.\n        /// </summary>\n        /// <param name=\"name\">the name of the reference.</param>\n        /// <returns>the reference object; null if it does not exist in this list.</returns>\n        public T get(string name)\n        {\n            int idx = find(name);\n            return 0 <= idx ? get(idx) : default(T);\n        }\n\n        /// <summary>\n        /// Get the reference at a particular index.\n        /// </summary>\n        /// <param name=\"idx\">the index to obtain. Must be {@code 0 &lt;= idx &lt; size()}.</param>\n        /// <returns>the reference value, never null.</returns>\n        public T get(int idx)\n        {\n            return (T)_list[idx];\n        }\n\n        /// <summary>\n        /// Obtain a builder initialized with the first {@code n} elements.\n        /// <para/>\n        /// Copies the first {@code n} elements from this list into a new builder,\n        /// which can be used by the caller to add additional elements.\n        /// </summary>\n        /// <param name=\"n\">the number of elements to copy.</param>\n        /// <returns>a new builder with the first {@code n} elements already added.</returns>\n        public Builder<T> copy(int n)\n        {\n            Builder<T> r = new Builder<T>(Math.Max(16, n));\n            r.addAll(_list, 0, n);\n            return r;\n        }\n\n        /// <summary>\n        /// Obtain a new copy of the list after changing one element.\n        /// <para/>\n        /// This list instance is not affected by the replacement. Because this\n        /// method copies the entire list, it runs in O(N) time.\n        /// </summary>\n        /// <param name=\"idx\">index of the element to change.</param>\n        /// <param name=\"ref\">the new value, must not be null.</param>\n        /// <returns>copy of this list, after replacing {@code idx} with {@code ref}.</returns>\n        public RefList<T> set(int idx, T @ref)\n        {\n            Ref[] newList = new Ref[_cnt];\n            System.Array.Copy(_list, 0, newList, 0, _cnt);\n            newList[idx] = @ref;\n            return new RefList<T>(newList, _cnt);\n        }\n\n        /// <summary>\n        /// Add an item at a specific index.\n        /// <para/>\n        /// This list instance is not affected by the addition. Because this method\n        /// copies the entire list, it runs in O(N) time.\n        /// </summary>\n        /// <param name=\"idx\">\n        /// position to add the item at. If negative the method assumes it\n        /// was a direct return value from <see cref=\"find\"/> and will\n        /// adjust it to the correct position.\n        /// </param>\n        /// <param name=\"ref\">the new reference to insert.</param>\n        /// <returns>copy of this list, after making space for and adding {@code ref}.</returns>\n        public RefList<T> add(int idx, T @ref)\n        {\n            if (idx < 0)\n                idx = -(idx + 1);\n\n            Ref[] newList = new Ref[_cnt + 1];\n            if (0 < idx)\n                System.Array.Copy(_list, 0, newList, 0, idx);\n            newList[idx] = @ref;\n            if (idx < _cnt)\n                System.Array.Copy(_list, idx, newList, idx + 1, _cnt - idx);\n            return new RefList<T>(newList, _cnt + 1);\n        }\n\n        /// <summary>\n        /// Remove an item at a specific index.\n        /// <para/>\n        /// This list instance is not affected by the addition. Because this method\n        /// copies the entire list, it runs in O(N) time.\n        /// </summary>\n        /// <param name=\"idx\">position to remove the item from.</param>\n        /// <returns>copy of this list, after making removing the item at {@code idx}.</returns>\n        public RefList<T> remove(int idx)\n        {\n            if (_cnt == 1)\n                return emptyList();\n            var newList = new Ref[_cnt - 1];\n            if (0 < idx)\n                Array.Copy(_list, 0, newList, 0, idx);\n            if (idx + 1 < _cnt)\n                Array.Copy(_list, idx + 1, newList, idx, _cnt - (idx + 1));\n            return new RefList<T>(newList, _cnt - 1);\n        }\n\n        /// <summary>\n        /// Store a reference, adding or replacing as necessary.\n        /// <para/>\n        /// This list instance is not affected by the store. The correct position is\n        /// determined, and the item is added if missing, or replaced if existing.\n        /// Because this method copies the entire list, it runs in O(N + log N) time.\n        /// </summary>\n        /// <param name=\"ref\">the reference to store.</param>\n        /// <returns>copy of this list, after performing the addition or replacement.</returns>\n        public RefList<T> put(T @ref)\n        {\n            int idx = find(@ref.Name);\n            if (0 <= idx)\n                return set(idx, @ref);\n            return add(idx, @ref);\n        }\n\n\n        public IEnumerator<T> GetEnumerator()\n        {\n            return iterator();\n        }\n\n        public override String ToString()\n        {\n            var r = new StringBuilder();\n            r.Append('[');\n            if (_cnt > 0)\n            {\n                r.Append(_list[0]);\n                for (int i = 1; i < _cnt; i++)\n                {\n                    r.Append(\", \");\n                    r.Append(_list[i]);\n                }\n            }\n            r.Append(']');\n            return r.ToString();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        /// <summary>\n        /// Builder to facilitate fast construction of an immutable RefList.\n        /// </summary>\n        /// <typeparam name=\"TRef\">type of reference being stored.</typeparam>\n        public class Builder<TRef> where TRef : Ref\n        {\n            private Ref[] _list;\n\n            private int _size;\n\n            /// <summary>\n            /// Create an empty list ready for items to be added.\n            /// </summary>\n            public Builder() :\n                this(16)\n            { }\n\n            /// <summary>\n            /// Create an empty list with at least the specified capacity.\n            /// </summary>\n            /// <param name=\"capacity\">the new capacity.</param>\n            public Builder(int capacity)\n            {\n                _list = new Ref[capacity];\n            }\n\n            /// <returns>number of items in this builder's internal collection.</returns>\n            public int size()\n            {\n                return _size;\n            }\n\n            /// <summary>\n            /// Get the reference at a particular index.\n            /// </summary>\n            /// <param name=\"idx\">the index to obtain. Must be {@code 0 &lt;= idx &lt; size()}.</param>\n            /// <returns>the reference value, never null.</returns>\n            public TRef get(int idx)\n            {\n                return (TRef)_list[idx];\n            }\n\n            /// <summary>\n            /// Remove an item at a specific index.\n            /// </summary>\n            /// <param name=\"idx\">position to remove the item from.</param>\n            public void remove(int idx)\n            {\n                Array.Copy(_list, idx + 1, _list, idx, _size - (idx + 1));\n                _size--;\n            }\n\n            /// <summary>\n            /// Add the reference to the end of the array.\n            /// <para/>\n            /// References must be added in sort order, or the array must be sorted\n            /// after additions are complete using {@link #sort()}.\n            /// </summary>\n            /// <param name=\"ref\"></param>\n            public void add(TRef @ref)\n            {\n                if (_list.Length == _size)\n                {\n                    var n = new Ref[_size * 2];\n                    Array.Copy(_list, 0, n, 0, _size);\n                    _list = n;\n                }\n                _list[_size++] = @ref;\n            }\n\n            /// <summary>\n            /// Add all items from a source array.\n            /// <para/>\n            /// References must be added in sort order, or the array must be sorted\n            /// after additions are complete using <see cref=\"sort\"/>.\n            /// </summary>\n            /// <param name=\"src\">the source array.</param>\n            /// <param name=\"off\">position within {@code src} to start copying from.</param>\n            /// <param name=\"cnt\">number of items to copy from {@code src}.</param>\n            public void addAll(Ref[] src, int off, int cnt)\n            {\n                if (_list.Length < _size + cnt)\n                {\n                    var n = new Ref[Math.Max(_size * 2, _size + cnt)];\n                    Array.Copy(_list, 0, n, 0, _size);\n                    _list = n;\n                }\n                Array.Copy(src, off, _list, _size, cnt);\n                _size += cnt;\n            }\n\n            /// <summary>\n            /// Replace a single existing element.\n            /// </summary>\n            /// <param name=\"idx\">index, must have already been added previously.</param>\n            /// <param name=\"ref\">the new reference.</param>\n            public void set(int idx, TRef @ref)\n            {\n                _list[idx] = @ref;\n            }\n\n            /// <summary>\n            /// Sort the list's backing array in-place.\n            /// </summary>\n            public void sort()\n            {\n                Array.Sort(_list, 0, _size, RefComparator.INSTANCE);\n            }\n\n            /// <returns>an unmodifiable list using this collection's backing array.</returns>\n            public RefList<TRef> toRefList()\n            {\n                return new RefList<TRef>(_list, _size);\n            }\n\n            public override string ToString()\n            {\n                return toRefList().ToString();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/RefMap.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Specialized Map to present a {@code RefDatabase} namespace.\n    /// <para/>\n    /// Although not declared as a {@link java.util.SortedMap}, iterators from this\n    /// map's projections always return references in {@link RefComparator} ordering.\n    /// The map's internal representation is a sorted array of {@link Ref} objects,\n    /// which means lookup and replacement is O(log N), while insertion and removal\n    /// can be as expensive as O(N + log N) while the list expands or contracts.\n    /// Since this is not a general map implementation, all entries must be keyed by\n    /// the reference name.\n    /// <para/>\n    /// This class is really intended as a helper for {@code RefDatabase}, which\n    /// needs to perform a merge-join of three sorted {@link RefList}s in order to\n    /// present the unified namespace of the packed-refs file, the loose refs/\n    /// directory tree, and the resolved form of any symbolic references.\n    /// </summary>\n    public class RefMap : IDictionary<string, Ref>\n    {\n        /// <summary>\n        /// Prefix denoting the reference subspace this map contains.\n        /// <para/>\n        /// All reference names in this map must start with this prefix. If the\n        /// prefix is not the empty string, it must end with a '/'.\n        /// </summary>\n        private readonly string _prefix;\n\n        /// <summary>\n        /// Immutable collection of the packed references at construction time.\n        /// </summary>\n        private RefList<Ref> _packed;\n\n        /// <summary>\n        /// Immutable collection of the loose references at construction time.\n        /// <para/>\n        /// If an entry appears here and in {@link #packed}, this entry must take\n        /// precedence, as its more current. Symbolic references in this collection\n        /// are typically unresolved, so they only tell us who their target is, but\n        /// not the current value of the target.\n        /// </summary>\n        private RefList<Ref> _loose;\n\n        /// <summary>\n        /// Immutable collection of resolved symbolic references.\n        /// <para/>\n        /// This collection contains only the symbolic references we were able to\n        /// resolve at map construction time. Other loose references must be read\n        /// from {@link #loose}. Every entry in this list must be matched by an entry\n        /// in {@code loose}, otherwise it might be omitted by the map.\n        /// </summary>\n        private RefList<Ref> _resolved;\n\n        private int _size;\n\n        private bool _sizeIsValid;\n\n        private EntrySet _entrySet;\n\n        /// <summary>\n        /// Construct an empty map with a small initial capacity.\n        /// </summary>\n        public RefMap()\n        {\n            _prefix = \"\";\n            _packed = RefList<Ref>.emptyList();\n            _loose = RefList<Ref>.emptyList();\n            _resolved = RefList<Ref>.emptyList();\n        }\n\n        /// <summary>\n        /// Construct a map to merge 3 collections together.\n        /// </summary>\n        /// <param name=\"prefix\">\n        /// prefix used to slice the lists down. Only references whose\n        /// names start with this prefix will appear to reside in the map.\n        /// Must not be null, use {@code \"\"} (the empty string) to select\n        /// all list items.\n        /// </param>\n        /// <param name=\"packed\">\n        /// items from the packed reference list, this is the last list\n        /// searched.\n        /// </param>\n        /// <param name=\"loose\">\n        /// items from the loose reference list, this list overrides\n        /// {@code packed} if a name appears in both.\n        /// </param>\n        /// <param name=\"resolved\">\n        /// resolved symbolic references. This list overrides the prior\n        /// list {@code loose}, if an item appears in both. Items in this\n        /// list <b>must</b> also appear in {@code loose}.\n        /// </param>\n        public RefMap(string prefix, RefList<Ref> packed, RefList<Ref> loose,\n                      RefList<Ref> resolved)\n        {\n            this._prefix = prefix;\n            this._packed = packed;\n            this._loose = loose;\n            this._resolved = resolved;\n        }\n\n        public bool containsKey(string name)\n        {\n            return get(name) != null;\n        }\n\n        public Ref get(string key)\n        {\n            string name = toRefName(key);\n            Ref @ref = _resolved.get(name);\n            if (@ref == null)\n                @ref = _loose.get(name);\n            if (@ref == null)\n                @ref = _packed.get(name);\n            return @ref;\n        }\n\n        public Ref put(string keyName, Ref value)\n        {\n            string name = toRefName(keyName);\n\n            if (!name.Equals(value.Name))\n                throw new ArgumentException(\"keyName\");\n\n            if (!_resolved.isEmpty())\n            {\n                // Collapse the resolved list into the loose list so we\n                // can discard it and stop joining the two together.\n                foreach (Ref @ref in _resolved)\n                    _loose = _loose.put(@ref);\n                _resolved = RefList<Ref>.emptyList();\n            }\n\n            int idx = _loose.find(name);\n            if (0 <= idx)\n            {\n                Ref prior = _loose.get(name);\n                _loose = _loose.set(idx, value);\n                return prior;\n            }\n            else\n            {\n                Ref prior = get(keyName);\n                _loose = _loose.add(idx, value);\n                _sizeIsValid = false;\n                return prior;\n            }\n        }\n\n        public Ref remove(string key)\n        {\n            string name = toRefName(key);\n            Ref res = null;\n            int idx;\n            if (0 <= (idx = _packed.find(name)))\n            {\n                res = _packed.get(name);\n                _packed = _packed.remove(idx);\n                _sizeIsValid = false;\n            }\n            if (0 <= (idx = _loose.find(name)))\n            {\n                res = _loose.get(name);\n                _loose = _loose.remove(idx);\n                _sizeIsValid = false;\n            }\n            if (0 <= (idx = _resolved.find(name)))\n            {\n                res = _resolved.get(name);\n                _resolved = _resolved.remove(idx);\n                _sizeIsValid = false;\n            }\n            return res;\n        }\n\n        public bool isEmpty()\n        {\n            return entrySet().isEmpty();\n        }\n\n        public EntrySet entrySet()\n        {\n            if (_entrySet == null)\n            {\n                _entrySet = new EntrySet(this);\n            }\n\n            return _entrySet;\n        }\n\n        public class RefSet : IIterable<Ref>\n        {\n            private readonly EntrySet _entrySet;\n\n            public RefSet(EntrySet entrySet)\n            {\n                _entrySet = entrySet;\n            }\n\n            public IEnumerator<Ref> GetEnumerator()\n            {\n                return iterator();\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return GetEnumerator();\n            }\n\n            public IteratorBase<Ref> iterator()\n            {\n                return new LambdaConverterIterator<Ent, Ref>(_entrySet.iterator(), ent => ent.getValue());\n            }\n\n            public int size()\n            {\n                return _entrySet.size();\n            }\n\n            public Ref get(int index)\n            {\n                Ent ent = _entrySet.get(index);\n                return ent.getValue();\n            }\n        }\n\n        public class EntrySet : IIterable<Ent>\n        {\n            private readonly RefMap _refMap;\n\n            public EntrySet(RefMap refMap)\n            {\n                _refMap = refMap;\n            }\n\n            public IEnumerator<Ent> GetEnumerator()\n            {\n                return iterator();\n            }\n\n            public IteratorBase<Ent> iterator()\n            {\n                return new SetIterator(_refMap);\n            }\n\n            public int size()\n            {\n                if (!_refMap._sizeIsValid)\n                {\n                    _refMap._size = 0;\n                    IteratorBase<Ent> i = _refMap.entrySet().iterator();\n                    for (; i.hasNext(); i.next())\n                        _refMap._size++;\n                    _refMap._sizeIsValid = true;\n                }\n                return _refMap._size;\n            }\n\n            public bool isEmpty()\n            {\n                if (_refMap._sizeIsValid)\n                    return 0 == _refMap._size;\n                return !iterator().hasNext();\n            }\n\n            public void clear()\n            {\n                _refMap._packed = RefList<Ref>.emptyList();\n                _refMap._loose = RefList<Ref>.emptyList();\n                _refMap._resolved = RefList<Ref>.emptyList();\n                _refMap._size = 0;\n                _refMap._sizeIsValid = true;\n            }\n\n            public Ent get(int index)\n            {\n                throw new NotImplementedException();\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return GetEnumerator();\n            }\n        }\n\n        public IEnumerator<KeyValuePair<string, Ref>> GetEnumerator()\n        {\n            return new LambdaConverterIterator<Ent, KeyValuePair<string, Ref>>(entrySet().iterator(), (ent) => new KeyValuePair<string, Ref>(ent.getKey(), ent.getValue()));\n        }\n\n        public override string ToString()\n        {\n            var r = new StringBuilder();\n            bool first = true;\n            r.Append('[');\n            foreach (Ref @ref in values())\n            {\n                if (first)\n                    first = false;\n                else\n                    r.Append(\", \");\n                r.Append(@ref);\n            }\n            r.Append(']');\n            return r.ToString();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public IIterable<Ref> values()\n        {\n            return new RefSet(entrySet());\n        }\n\n        private string toRefName(string name)\n        {\n            if (0 < _prefix.Length)\n                name = _prefix + name;\n            return name;\n        }\n\n        private string toMapKey(Ref @ref)\n        {\n            string name = @ref.Name;\n            if (0 < _prefix.Length)\n                name = name.Substring(_prefix.Length);\n            return name;\n        }\n\n        private class SetIterator : IteratorBase<Ent>\n        {\n            private readonly RefMap _refMap;\n            private int packedIdx;\n\n            private int looseIdx;\n\n            private int resolvedIdx;\n\n            private Ent _next;\n\n            public SetIterator(RefMap refMap)\n            {\n                _refMap = refMap;\n                if (0 < _refMap._prefix.Length)\n                {\n                    packedIdx = -(_refMap._packed.find(_refMap._prefix) + 1);\n                    looseIdx = -(_refMap._loose.find(_refMap._prefix) + 1);\n                    resolvedIdx = -(_refMap._resolved.find(_refMap._prefix) + 1);\n                }\n            }\n\n            public override bool hasNext()\n            {\n                if (_next == null)\n                    _next = peek();\n                return _next != null;\n            }\n\n            protected override Ent InnerNext()\n            {\n                if (hasNext())\n                {\n                    Ent r = _next;\n                    _next = peek();\n                    return r;\n                }\n                throw new IndexOutOfRangeException();\n            }\n\n            private Ent peek()\n            {\n                if (packedIdx < _refMap._packed.size() && looseIdx < _refMap._loose.size())\n                {\n                    Ref p = _refMap._packed.get(packedIdx);\n                    Ref l = _refMap._loose.get(looseIdx);\n                    int cmp = RefComparator.compareTo(p, l);\n                    if (cmp < 0)\n                    {\n                        packedIdx++;\n                        return toEntry(p);\n                    }\n\n                    if (cmp == 0)\n                        packedIdx++;\n                    looseIdx++;\n                    return toEntry(resolveLoose(l));\n                }\n\n                if (looseIdx < _refMap._loose.size())\n                    return toEntry(resolveLoose(_refMap._loose.get(looseIdx++)));\n                if (packedIdx < _refMap._packed.size())\n                    return toEntry(_refMap._packed.get(packedIdx++));\n                return null;\n            }\n\n            private Ref resolveLoose(Ref l)\n            {\n                if (resolvedIdx < _refMap._resolved.size())\n                {\n                    Ref r = _refMap._resolved.get(resolvedIdx);\n                    int cmp = RefComparator.compareTo(l, r);\n                    if (cmp == 0)\n                    {\n                        resolvedIdx++;\n                        return r;\n                    }\n                    else if (cmp > 0)\n                    {\n                        // WTF, we have a symbolic entry but no match\n                        // in the loose collection. That's an error.\n                        throw new InvalidOperationException();\n                    }\n                }\n                return l;\n            }\n\n            private Ent toEntry(Ref p)\n            {\n                if (p.Name.StartsWith(_refMap._prefix))\n                    return new Ent(_refMap, p);\n                packedIdx = _refMap._packed.size();\n                looseIdx = _refMap._loose.size();\n                resolvedIdx = _refMap._resolved.size();\n                return null;\n            }\n        }\n\n        public class Ent// implements Entry<string, Ref> \n        {\n            private readonly RefMap _refMap;\n            private Ref @ref;\n\n            public Ent(RefMap refMap, Ref @ref)\n            {\n                _refMap = refMap;\n                this.@ref = @ref;\n            }\n\n            public string getKey()\n            {\n                return _refMap.toMapKey(@ref);\n            }\n\n            public Ref getValue()\n            {\n                return @ref;\n            }\n\n            public Ref setValue(Ref value)\n            {\n                Ref prior = _refMap.put(getKey(), value);\n                @ref = value;\n                return prior;\n            }\n\n            public override int GetHashCode()\n            {\n                return getKey().GetHashCode();\n            }\n\n            public override bool Equals(Object obj)\n            {\n                if (obj is Ent)\n                {\n                    Object key = ((Ent)obj).getKey();\n                    Object val = ((Ent)obj).getValue();\n                    if (key is string && val is Ref)\n                    {\n                        Ref r = (Ref)val;\n                        if (r.Name.Equals(@ref.Name))\n                        {\n                            ObjectId a = r.ObjectId;\n                            ObjectId b = @ref.ObjectId;\n                            if (a != null && b != null && AnyObjectId.equals(a, b))\n                                return true;\n                        }\n                    }\n                }\n\n                return false;\n            }\n\n            public override string ToString()\n            {\n                return @ref.ToString();\n            }\n        }\n\n        public int size()\n        {\n            return entrySet().size();\n        }\n\n        public void clear()\n        {\n            entrySet().clear();\n        }\n\n        public IIterable<string> keySet()\n        {\n            var keys = new List<string>();\n\n            foreach (Ent ent in entrySet())\n            {\n                keys.Add(ent.getKey());\n            }\n\n            return new BasicIterable<string>(keys);\n        }\n\n        public void Add(KeyValuePair<string, Ref> item)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void Clear()\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool Contains(KeyValuePair<string, Ref> item)\n        {\n            throw new NotImplementedException();\n        }\n\n        public void CopyTo(KeyValuePair<string, Ref>[] array, int arrayIndex)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool Remove(KeyValuePair<string, Ref> item)\n        {\n            throw new NotImplementedException();\n        }\n\n        public int Count\n        {\n            get { return size(); }\n        }\n\n        public bool IsReadOnly\n        {\n            get { throw new NotImplementedException(); }\n        }\n\n        public bool ContainsKey(string key)\n        {\n            return containsKey(key);\n        }\n\n        public void Add(string key, Ref value)\n        {\n            throw new NotImplementedException();\n        }\n\n        public bool Remove(string key)\n        {\n        \tRef val;\n\n\t\t\tif(TryGetValue(key, out val))\n\t\t\t{\n\t\t\t\tremove(key);\n\t\t\t\treturn true;\n\t\t\t}\n\n        \treturn false;\n        }\n\n        public bool TryGetValue(string key, out Ref value)\n        {\n            value = get(key);\n            return (value != null);\n        }\n\n        public Ref this[string key]\n        {\n            get { return get(key); }\n            set { throw new NotImplementedException(); }\n        }\n\n        public ICollection<string> Keys\n        {\n            get { throw new NotImplementedException(); }\n        }\n\n        public ICollection<Ref> Values\n        {\n            get { return new List<Ref>(values()).AsReadOnly(); }\n        }\n\n    }\n\n\n}"
  },
  {
    "path": "GitSharp.Core/Util/Stream.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* Note: jgit has implemented its own FileStream in WalkRemoteObjectDatabase */\n\nusing System;\nusing System.IO;\n\nnamespace GitSharp.Core.Util\n{\n    public static class FileStreamExtensions\n    {\n        public static byte[] toArray(this Stream stream)\n        {\n            try\n            {\n                // Note: if we can seek, it's likely we have a length\n                if (stream.CanSeek)\n                {\n                    if (stream.Length >= 0)\n                    {\n                        byte[] r = new byte[stream.Length];\n                        IO.ReadFully(stream, r, 0, r.Length);\n                        return r;\n                    }\n                }\n\n                var m = new MemoryStream();\n                var buf = new byte[2048];\n                int n;\n                while ((n = stream.Read(buf, 0, buf.Length)) > 0)\n                    m.Write(buf, 0, n);\n                return m.ToArray();\n            }\n            finally\n            {\n                stream.Dispose(); // [nulltoken] Why the heck is the stream disposed here instead of in the caller method ? Weird.\n            }\n        }\n\n        public static void Clear(this MemoryStream ms)\n        {\n            ms.Seek(0, SeekOrigin.Begin);\n            ms.Write(new byte[ms.Length], 0, Convert.ToInt32(ms.Length));\n            ms.Seek(0, SeekOrigin.Begin);\n        }\n\n        public static long available(this Stream stream)\n        {\n            if (!stream.CanSeek)\n            {\n                throw new NotSupportedException();\n            }\n\n            return stream.Length - stream.Position;\n        }\n\n        public static long skip(this Stream stream, long numberOfBytesToSkip)\n        {\n            if (numberOfBytesToSkip < 0)\n            {\n                return 0;\n            }\n\n            int totalReadBytes = 0;\n\n            int bufSize = numberOfBytesToSkip <= int.MaxValue ? (int)numberOfBytesToSkip : int.MaxValue;\n\n            var buf = new byte[bufSize];\n\n            int readBytes;\n\n            do\n            {\n                var numberOfBytesToRead = (int) Math.Min(bufSize, numberOfBytesToSkip);\n                readBytes = stream.Read(buf, totalReadBytes, numberOfBytesToRead);\n\n                totalReadBytes += readBytes;\n                numberOfBytesToSkip -= readBytes;\n            } while (numberOfBytesToSkip > 0 && readBytes > 0);\n\n\n            return totalReadBytes;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/StringExtension.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core.Util\n{\n    public static class StringExtension\n    {\n        /// <summary>\n        ///   Helper function to easily replace all occurences of the incompatible string.Substring method in ported java code\n        /// </summary>\n        /// <param name=\"longstring\">\n        ///   The string from which a part has to extracted.\n        /// </param>\n        /// <param name=\"beginIndex\">\n        ///   The beginning index, inclusive.\n        /// </param>\n        /// <param name=\"endIndex\">\n        ///   The ending index, exclusive.\n        /// </param>\n        /// <returns>\n        ///   The specified substring.\n        /// </returns>\n        public static string Slice(this string longstring, int beginIndex, int endIndex)\n        {\n            #region Parameters Validation\n\n            if (beginIndex > endIndex)\n            {\n                throw new ArgumentOutOfRangeException(\"beginIndex\",\n                                                      string.Format(\n                                                          \"beginIndex has to be less or equal than endIndex. Actual values were beginIndex={0} and endIndex={1}\",\n                                                          beginIndex, endIndex));\n            }\n\n            #endregion\n\n            return longstring.Substring(beginIndex, endIndex - beginIndex);\n        }\n\n        public static byte[] getBytes(this string plainString, string encodingAlias)\n        {\n            Encoding encoder = Charset.forName(encodingAlias);\n\n            try\n            {\n                return encoder.GetBytes(plainString);\n            }\n            catch (EncoderFallbackException e)\n            {\n                throw new EncoderFallbackException(\n                    string.Format(\"A problem occured while encoding '{0}' using encoder '{1}'.\", plainString,\n                                  encoder.WebName), e);\n            }\n        }\n\n        public static byte[] getBytes(this string plainString)\n        {\n            return plainString.getBytes(\"UTF-8\");\n        }\n\n        /// <summary>\n        /// Compares two strings lexicographically. (cf. http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#compareTo(java.lang.String))\n        /// </summary>\n        /// <param name=\"inputString\">the reference string</param>\n        /// <param name=\"stringToCompareTo\">the string to be compared</param>\n        /// <returns>the value 0 if the string to compared with is equal to this string; a value less than 0 if this string is lexicographically less than the string to compare with; and a value greater than 0 if this string is lexicographically greater than the string to compare with.</returns>\n        public static int compareTo(this string inputString, string stringToCompareTo)\n        {\n            int aLength = inputString.Length;\n            int anotherLength = stringToCompareTo.Length;\n\n            for (int i = 0; i < Math.Min(aLength, anotherLength); i++)\n            {\n                char aChar = inputString[i];\n                char anotherChar = stringToCompareTo[i];\n\n                if (aChar == anotherChar)\n                {\n                    continue;\n                }\n\n                return aChar - anotherChar;\n            }\n\n            if (aLength != anotherLength)\n            {\n                return (aLength - anotherLength);\n            }\n\n            return 0;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/StringUtils.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    /// Miscellaneous string comparison utility methods.\n    /// </summary>\n    public static class StringUtils\n    {\n        private static readonly char[] LC;\n\n        static StringUtils()\n        {\n            LC = new char['Z' + 1];\n            for (char c = '\\0'; c < LC.Length; c++)\n                LC[c] = c;\n            for (char c = 'A'; c <= 'Z'; c++)\n                LC[c] = (char)('a' + (c - 'A'));\n        }\n\n        /// <summary>\n        /// Convert the input to lowercase.\n        /// <para>\n        /// This method does not honor the JVM locale, but instead always behaves as\n        /// though it is in the US-ASCII locale. Only characters in the range 'A'\n        /// through 'Z' are converted. All other characters are left as-is, even if\n        /// they otherwise would have a lowercase character equivalent.\n        /// </para>\n        /// </summary>\n        /// <param name=\"c\">the input character.</param>\n        /// <returns>lowercase version of the input.</returns>\n        public static char toLowerCase(char c)\n        {\n            return c <= 'Z' ? LC[c] : c;\n        }\n\n        /// <summary>\n        /// Convert the input string to lower case, according to the \"C\" locale.\n        /// <para>\n        /// This method does not honor the JVM locale, but instead always behaves as\n        /// though it is in the US-ASCII locale. Only characters in the range 'A'\n        /// through 'Z' are converted, all other characters are left as-is, even if\n        /// they otherwise would have a lowercase character equivalent.\n        /// </para>\n        /// </summary>\n        /// <param name=\"in\">the input string. Must not be null.</param>\n        /// <returns>a copy of the input string, After converting characters in the range 'A'..'Z' to 'a'..'z'.</returns>\n        public static string toLowerCase(string @in)\n        {\n            StringBuilder r = new StringBuilder(@in.Length);\n            for (int i = 0; i < @in.Length; i++)\n                r.Append(toLowerCase(@in[i]));\n            return r.ToString();\n        }\n\n        /// <summary>\n        /// Test if two strings are equal, ignoring case.\n        /// <para>\n        /// This method does not honor the JVM locale, but instead always behaves as\n        /// though it is in the US-ASCII locale.\n        /// </para>\n        /// </summary>\n        /// <param name=\"a\">first string to compare.</param>\n        /// <param name=\"b\">second string to compare.</param>\n        /// <returns>true if a equals b</returns>\n        public static bool equalsIgnoreCase(string a, string b)\n        {\n            if (a == b)\n                return true;\n            if (a.Length != b.Length)\n                return false;\n            for (int i = 0; i < a.Length; i++)\n            {\n                if (toLowerCase(a[i]) != toLowerCase(b[i]))\n                    return false;\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Parse a string as a standard Git boolean value.\n        /// <para/>\n        /// The terms {@code yes}, {@code true}, {@code 1}, {@code on} can all be\n        /// used to mean {@code true}.\n        /// <para/>\n        /// The terms {@code no}, {@code false}, {@code 0}, {@code off} can all be\n        /// used to mean {@code false}.\n        /// <para/>\n        /// Comparisons ignore case, via <see cref=\"equalsIgnoreCase\"/>.\n        /// </summary>\n        /// <param name=\"stringValue\">the string to parse.</param>\n        /// <returns>the boolean interpretation of <paramref name=\"stringValue\"/>.</returns>\n        public static bool toBoolean(string stringValue)\n        {\n            if (stringValue == null)\n                throw new ArgumentNullException(\"stringValue\", \"Expected boolean string value\");\n\n            if (equalsIgnoreCase(\"yes\", stringValue)\n                    || equalsIgnoreCase(\"true\", stringValue)\n                    || equalsIgnoreCase(\"1\", stringValue)\n                    || equalsIgnoreCase(\"on\", stringValue))\n            {\n                return true;\n\n            }\n            else if (equalsIgnoreCase(\"no\", stringValue)\n                    || equalsIgnoreCase(\"false\", stringValue)\n                    || equalsIgnoreCase(\"0\", stringValue)\n                    || equalsIgnoreCase(\"off\", stringValue))\n            {\n                return false;\n\n            }\n            else\n            {\n                throw new ArgumentException(\"Not a boolean: \" + stringValue);\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/Util/TemporaryBuffer.cs",
    "content": "/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Tamir.SharpSsh.java.io;\n\nnamespace GitSharp.Core.Util\n{\n    /// <summary>\n    ///   A fully buffered output stream.\n    ///   <para />\n    ///   Subclasses determine the behavior when the in-memory buffer capacity has been\n    ///   exceeded and additional bytes are still being received for output.\n    /// </summary>\n    public abstract class TemporaryBuffer : IDisposable\n    {\n        public static int DEFAULT_IN_CORE_LIMIT = 1024 * 1024;\n\n        // Chain of data, if we are still completely in-core; otherwise null.\n        private List<Block> _blocks;\n\n        /// <summary>\n        ///   Maximum number of bytes we will permit storing in memory.\n        ///   <para />\n        ///   When this limit is reached the data will be shifted to a file on disk,\n        ///   preventing the JVM heap from growing out of control.\n        /// </summary>\n        private readonly int inCoreLimit;\n\n        /// <summary>\n        ///   If\n        ///   <see cref=\"inCoreLimit\" />\n        ///   has been reached, remainder goes here.\n        /// </summary>\n        private Stream _overflow;\n\n\n        /// <summary>\n        ///   Create a new empty temporary buffer.\n        /// </summary>\n        /// <param name=\"limit\">\n        ///   maximum number of bytes to store in memory before entering the overflow output path.\n        /// </param>\n        protected TemporaryBuffer(int limit)\n        {\n            inCoreLimit = limit;\n            reset();\n        }\n\n        public void write(int b)\n        {\n            if (_overflow != null)\n            {\n                _overflow.WriteByte((byte)b);\n                return;\n            }\n\n            Block s = last();\n            if (s.isFull())\n            {\n                if (reachedInCoreLimit())\n                {\n                    _overflow.WriteByte((byte)b);\n                    return;\n                }\n\n                s = new Block();\n                _blocks.Add(s);\n            }\n            s.buffer[s.count++] = (byte)b;\n        }\n\n        public void write(byte[] b, int off, int len)\n        {\n            if (_overflow == null)\n            {\n                while (len > 0)\n                {\n                    Block s = last();\n                    if (s.isFull())\n                    {\n                        if (reachedInCoreLimit())\n                            break;\n\n                        s = new Block();\n                        _blocks.Add(s);\n                    }\n\n                    int n = Math.Min(Block.SZ - s.count, len);\n                    Array.Copy(b, off, s.buffer, s.count, n);\n                    s.count += n;\n                    len -= n;\n                    off += n;\n                }\n            }\n\n            if (len > 0)\n                _overflow.Write(b, off, len);\n        }\n\n\n        public void write(byte[] bytes)\n        {\n            if (bytes == null)\n                throw new ArgumentNullException(\"bytes\");\n\n            write(bytes, 0, bytes.Length);\n        }\n\n        /// <summary>\n        /// Copy all bytes remaining on the input stream into this buffer.\n        /// </summary>\n        /// <param name=\"in\">the stream to Read from, until EOF is reached.</param>\n        public void copy(Stream @in)\n        {\n            if (@in == null)\n                throw new ArgumentNullException(\"in\");\n\n            if (_blocks != null)\n            {\n                for (; ; )\n                {\n                    Block s = last();\n                    if (s.isFull())\n                    {\n                        if (reachedInCoreLimit())\n                            break;\n                        s = new Block();\n                        _blocks.Add(s);\n                    }\n\n                    int n = @in.Read(s.buffer, s.count, Block.SZ - s.count);\n                    if (n < 1)\n                        return;\n                    s.count += n;\n                }\n            }\n\n            byte[] tmp = new byte[Block.SZ];\n            int nn;\n            while ((nn = @in.Read(tmp, 0, tmp.Length)) > 0)\n                _overflow.Write(tmp, 0, nn);\n        }\n\n        /// <summary>\n        /// Obtain the length (in bytes) of the buffer.\n        /// <para />\n        /// The length is only accurate After <see cref=\"close()\"/> has been invoked.\n        /// </summary>\n        public virtual long Length\n        {\n            get\n            {\n                Block last = this.last();\n                return ((long)_blocks.Count) * Block.SZ - (Block.SZ - last.count);\n            }\n        }\n\n        /// <summary>\n        /// Convert this buffer's contents into a contiguous byte array.\n        /// <para />\n        /// The buffer is only complete After {@link #close()} has been invoked.\n        /// </summary>\n        /// <returns>the complete byte array; length matches <see cref=\"Length\"/>.</returns>\n        public virtual byte[] ToArray()\n        {\n            long len = Length;\n            if (int.MaxValue < len)\n                throw new OutOfMemoryException(\"Length exceeds maximum array size\");\n\n            byte[] @out = new byte[(int)len];\n            int outPtr = 0;\n            foreach (Block b in _blocks)\n            {\n                Array.Copy(b.buffer, 0, @out, outPtr, b.count);\n                outPtr += b.count;\n            }\n            return @out;\n        }\n\n        /// <summary>\n        /// Send this buffer to an output stream.\n        /// <para />\n        /// This method may only be invoked After {@link #close()} has completed\n        /// normally, to ensure all data is completely transferred.\n        /// </summary>\n        /// <param name=\"os\">stream to send this buffer's complete content to.</param>\n        /// <param name=\"pm\">\n        /// if not null progress updates are sent here. Caller should\n        /// initialize the task and the number of work units to\n        /// <code><see cref=\"Length\"/>/1024</code>.\n        /// </param>\n        public virtual void writeTo(Stream os, ProgressMonitor pm)\n        {\n            if (os == null)\n                throw new ArgumentNullException(\"os\");\n            if (pm == null)\n                pm = new NullProgressMonitor();\n            foreach (Block b in _blocks)\n            {\n                os.Write(b.buffer, 0, b.count);\n                pm.Update(b.count / 1024);\n            }\n        }\n\n\n        /// <summary>\n        /// Reset this buffer for reuse, purging all buffered content.\n        /// </summary>\n        public void reset()\n        {\n            if (_overflow != null)\n            {\n                destroy();\n            }\n            _blocks = new List<Block>(inCoreLimit / Block.SZ);\n            _blocks.Add(new Block());\n        }\n\n\n        /// <summary>\n        /// Open the overflow output stream, so the remaining output can be stored.\n        /// </summary>\n        /// <returns>\n        /// the output stream to receive the buffered content, followed by\n        /// the remaining output.\n        /// </returns>\n        protected abstract Stream overflow();\n\n        private Block last()\n        {\n            return _blocks[_blocks.Count - 1];\n        }\n\n        private bool reachedInCoreLimit()\n        {\n            if (_blocks.Count * Block.SZ < inCoreLimit)\n                return false;\n\n            _overflow = overflow();\n\n            Block last = _blocks[_blocks.Count - 1];\n            _blocks.RemoveAt(_blocks.Count - 1);\n            foreach (Block b in _blocks)\n                _overflow.Write(b.buffer, 0, b.count);\n            _blocks = null;\n\n            _overflow = new BufferedStream(_overflow, Block.SZ);\n            _overflow.Write(last.buffer, 0, last.count);\n            return true;\n        }\n\n        public virtual void close()\n        {\n            if (_overflow != null)\n            {\n                try\n                {\n                    _overflow.Close();\n                }\n                finally\n                {\n                    _overflow = null;\n                }\n            }\n#if DEBUG\n            GC.SuppressFinalize(this); // Disarm lock-release checker\n#endif\n        }\n\n        public void Dispose()\n        {\n            close();\n        }\n\n#if DEBUG\n        // A debug mode warning if the type has not been disposed properly\n        ~TemporaryBuffer()\n        {\n            Console.Error.WriteLine(GetType().Name + \" has not been properly disposed.\");\n        }\n#endif\n\n        /// <summary>\n        ///   Clear this buffer so it has no data, and cannot be used again.\n        /// </summary>\n        public virtual void destroy()\n        {\n            _blocks = null;\n\n            close();\n\n            if (_overflow != null)\n            {\n                try\n                {\n                    _overflow.Close();\n                }\n                catch (IOException)\n                {\n                    // We shouldn't encounter an error closing the file.\n                }\n                finally\n                {\n                    _overflow = null;\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    ///   A fully buffered output stream using local disk storage for large data.\n    ///   <para />\n    ///   Initially this output stream buffers to memory and is therefore similar\n    ///   to ByteArrayOutputStream, but it shifts to using an on disk temporary\n    ///   file if the output gets too large.\n    ///   <para />\n    ///   The content of this buffered stream may be sent to another OutputStream\n    ///   only after this stream has been properly closed by\n    ///   <see cref=\"TemporaryBuffer.close\" />\n    ///   .\n    /// </summary>\n    public class LocalFileBuffer : TemporaryBuffer\n    {\n        /// <summary>\n        ///   Location of our temporary file if we are on disk; otherwise null.\n        ///   <para />\n        ///   If we exceeded the {@link #inCoreLimit} we nulled out {@link #blocks}\n        ///   and created this file instead. All output goes here through\n        ///   {@link #overflow}.\n        /// </summary>\n        private FileInfo onDiskFile;\n\n        /// <summary>\n        ///   Create a new temporary buffer.\n        /// </summary>\n        public LocalFileBuffer()\n            : this(DEFAULT_IN_CORE_LIMIT)\n        {\n        }\n\n        /// <summary>\n        ///   Create a new temporary buffer, limiting memory usage.\n        /// </summary>\n        /// <param name=\"inCoreLimit\">\n        ///   maximum number of bytes to store in memory. Storage beyond\n        ///   this limit will use the local file.\n        /// </param>\n        public LocalFileBuffer(int inCoreLimit)\n            : base(inCoreLimit)\n        {\n        }\n\n        protected override Stream overflow()\n        {\n            onDiskFile = new FileInfo(\"gitsharp_\" + Path.GetRandomFileName() + \".buffer\");\n            return new FileStream(onDiskFile.FullName, System.IO.FileMode.CreateNew, FileAccess.Write);\n        }\n\n        public override long Length\n        {\n            get\n            {\n                if (onDiskFile == null)\n                {\n                    return base.Length;\n                }\n                return onDiskFile.Length;\n            }\n        }\n\n        public override byte[] ToArray()\n        {\n            if (onDiskFile == null)\n            {\n                return base.ToArray();\n            }\n\n            long len = Length;\n            if (int.MaxValue < len)\n                throw new OutOfMemoryException(\"Length exceeds maximum array size\");\n            byte[] @out = new byte[(int)len];\n\n            using (var @in = new FileInputStream(onDiskFile.FullName))\n            {\n                IO.ReadFully(@in, @out, 0, (int)len);\n            }\n\n            return @out;\n        }\n\n        public override void writeTo(Stream os, ProgressMonitor pm)\n        {\n            if (onDiskFile == null)\n            {\n                base.writeTo(os, pm);\n                return;\n            }\n            if (pm == null)\n                pm = NullProgressMonitor.Instance;\n            using (FileStream @in = new FileStream(onDiskFile.FullName, System.IO.FileMode.Open, FileAccess.Read))\n            {\n                int cnt;\n                byte[] buf = new byte[Block.SZ];\n                while ((cnt = @in.Read(buf, 0, buf.Length)) > 0)\n                {\n                    os.Write(buf, 0, cnt);\n                    pm.Update(cnt / 1024);\n                }\n            }\n        }\n\n        public override void destroy()\n        {\n            base.destroy();\n\n            if (onDiskFile != null)\n            {\n                try\n                {\n                    onDiskFile.DeleteFile();\n                }\n                finally\n                {\n                    onDiskFile = null;\n                }\n            }\n        }\n    }\n\n    /// <summary>\n    ///   A temporary buffer that will never exceed its in-memory limit.\n    ///   <para />\n    ///   If the in-memory limit is reached an IOException is thrown, rather than\n    ///   attempting to spool to local disk.\n    /// </summary>\n    public class HeapBuffer : TemporaryBuffer\n    {\n        /// <summary>\n        ///   Create a new heap buffer with a maximum storage limit.\n        /// </summary>\n        /// <param name=\"limit\">\n        ///   maximum number of bytes that can be stored in this buffer.\n        ///   Storing beyond this many will cause an IOException to be\n        ///   thrown during write.\n        /// </param>\n        public HeapBuffer(int limit)\n            : base(limit)\n        {\n        }\n\n        protected override Stream overflow()\n        {\n            throw new IOException(\"In-memory buffer limit exceeded\");\n        }\n    }\n\n    public class Block\n    {\n        public static int SZ = 8 * 1024;\n\n        public byte[] buffer = new byte[SZ];\n\n        public int count;\n\n        public bool isFull()\n        {\n            return count == SZ;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/Util/WeakReference.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n */\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Util\n{\n    public class WeakReference<T> : System.WeakReference\n    {\n        public WeakReference(T target)\n            : base(target)\n        {\n\n        }\n        public WeakReference(T target, bool trackResurrection)\n            : base(target, trackResurrection)\n        {\n\n        }\n\n        public new T Target\n        {\n            get\n            {\n                return (T)base.Target;\n            }\n            set\n            {\n                base.Target = value;\n            }\n        }\n\n        public T get()\n        {\n            return Target;\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/WholePackedObjectLoader.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n\t/// Reader for a non-delta (just deflated) object in a pack file.\n    /// </summary>\n    public class WholePackedObjectLoader : PackedObjectLoader\n    {\n        private const int ObjCommit = Constants.OBJ_COMMIT;\n\n        public WholePackedObjectLoader(PackFile pr, long dataOffset, long objectOffset, int type, int size)\n            : base(pr, dataOffset, objectOffset)\n        {\n            Type = type;\n            Size = size;\n        }\n\n        public override void Materialize(WindowCursor curs)\n        {\n            if (CachedBytes != null)\n            {\n                return;\n            }\n\n            if (Type != ObjCommit)\n            {\n                UnpackedObjectCache.Entry cache = PackFile.readCache(DataOffset);\n                if (cache != null)\n                {\n                    curs.Release();\n                    CachedBytes = cache.data;\n                    return;\n                }\n            }\n\n            try\n            {\n\t\t\t\tCachedBytes = PackFile.decompress(DataOffset, Size, curs);\n                curs.Release();\n                if (Type != ObjCommit)\n                {\n\t\t\t\t\tPackFile.saveCache(DataOffset, CachedBytes, Type);\n                }\n            }\n            catch (IOException dfe)\n            {\n                throw new CorruptObjectException(\"object at \" + DataOffset + \" in \"\n\t\t\t\t\t+ PackFile.File.FullName + \" has bad zlib stream\", dfe);\n            }\n        }\n\n    \tpublic override ObjectId DeltaBase\n    \t{\n    \t\tget { return null; }\n    \t}\n\n    \t#region Overrides of ObjectLoader\n\n    \tpublic override int RawType\n    \t{\n    \t\tget { return Type; }\n    \t}\n\n    \tpublic override long RawSize\n    \t{\n    \t\tget { return Size; }\n    \t}\n\n    \t#endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/WindowCache.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Caches slices of a <see cref=\"PackFile\" /> in memory for faster read access.\n\t/// <para />\n    /// The WindowCache serves as a Java based \"buffer cache\", loading segments of a\n    /// <see cref=\"PackFile\" /> into the JVM heap prior to use. As JGit often wants to do reads of\n    /// only tiny slices of a file, the WindowCache tries to smooth out these tiny\n    /// reads into larger block-sized IO operations.\n    /// </summary>\n    internal class WindowCache : OffsetCache<ByteWindow, WindowCache.WindowRef>\n    {\n        private static volatile WindowCache _cache;\n\n        private readonly int _maxFiles;\n        private readonly long _maxBytes;\n        private readonly bool _memoryMap;\n        private readonly int _windowSizeShift;\n        private readonly int _windowSize;\n        private readonly AtomicInteger _openFiles;\n        private readonly AtomicLong _openBytes;\n\n        static WindowCache()\n        {\n            reconfigure(new WindowCacheConfig());\n        }\n\n        private static int Bits(int newSize)\n        {\n            if (newSize < 4096)\n            {\n                throw new ArgumentException(\"Invalid window size\");\n            }\n\n            if (newSize.BitCount() != 1)\n            {\n                throw new ArgumentException(\"Window size must be power of 2\");\n            }\n\n            return newSize.NumberOfTrailingZeros();\n        }\n\n        /// <summary>\n        /// Modify the configuration of the window cache.\n\t\t/// <para />\n        /// The new configuration is applied immediately. If the new limits are\n        /// smaller than what what is currently cached, older entries will be purged\n        /// as soon as possible to allow the cache to meet the new limit.\n        /// </summary>\n        /// <param name=\"packedGitLimit\">\n        /// Maximum number of bytes to hold within this instance.\n        /// </param>\n        /// <param name=\"packedGitWindowSize\">\n        /// Number of bytes per window within the cache.\n        /// </param>\n        /// <param name=\"packedGitMMAP\">\n        /// True to enable use of mmap when creating windows.\n        /// </param>\n        /// <param name=\"deltaBaseCacheLimit\">\n        /// Number of bytes to hold in the delta base cache.\n        /// </param>\n        [Obsolete(\"Use WindowCache.reconfigure(WindowCacheConfig) instead.\")]\n        public static void reconfigure(int packedGitLimit, int packedGitWindowSize, bool packedGitMMAP, int deltaBaseCacheLimit)\n        {\n            var c = new WindowCacheConfig\n                        {\n                            PackedGitLimit = packedGitLimit,\n                            PackedGitWindowSize = packedGitWindowSize,\n                            PackedGitMMAP = packedGitMMAP,\n                            DeltaBaseCacheLimit = deltaBaseCacheLimit\n                        };\n            reconfigure(c);\n        }\n\n        /// <summary>\n        /// Modify the configuration of the window cache.\n\t\t/// <para />\n        /// The new configuration is applied immediately. If the new limits are\n        /// smaller than what what is currently cached, older entries will be purged\n        /// as soon as possible to allow the cache to meet the new limit.\n        /// </summary>\n        /// <param name=\"cfg\">\n        /// The new window cache configuration.\n        /// </param>\n        public static void reconfigure(WindowCacheConfig cfg)\n        {\n            var newCache = new WindowCache(cfg);\n            WindowCache oldCache = _cache;\n\n            if (oldCache != null)\n            {\n                oldCache.removeAll();\n            }\n\n            _cache = newCache;\n\n            UnpackedObjectCache.Reconfigure(cfg);\n        }\n\n        internal static WindowCache Instance\n        {\n            get { return _cache; }\n        }\n\n        public static ByteWindow get(PackFile pack, long offset)\n        {\n            WindowCache c = _cache;\n            ByteWindow r = c.getOrLoad(pack, c.ToStart(offset));\n            if (c != _cache)\n            {\n                // The cache was reconfigured while we were using the old one\n                // to load this window. The window is still valid, but our\n                // cache may think its still live. Ensure the window is removed\n                // from the old cache so resources can be released.\n                //\n                c.removeAll();\n            }\n            return r;\n        }\n\n        public static void Purge(PackFile pack)\n        {\n            _cache.removeAll(pack);\n        }\n\n        private WindowCache(WindowCacheConfig cfg)\n            : base(TableSize(cfg), LockCount(cfg))\n        {\n            _maxFiles = cfg.PackedGitOpenFiles;\n            _maxBytes = cfg.PackedGitLimit;\n            _memoryMap = cfg.PackedGitMMAP;\n            _windowSizeShift = Bits(cfg.PackedGitWindowSize);\n            _windowSize = 1 << _windowSizeShift;\n\n            _openFiles = new AtomicInteger();\n            _openBytes = new AtomicLong();\n\n            if (_maxFiles < 1)\n            {\n                throw new ArgumentException(\"Open files must be >= 1\");\n            }\n\n            if (_maxBytes < _windowSize)\n            {\n                throw new ArgumentException(\"Window size must be < limit\");\n            }\n        }\n\n        public int getOpenFiles()\n        {\n            return _openFiles.get();\n        }\n\n        public long getOpenBytes()\n        {\n            return _openBytes.get();\n        }\n\n        internal override int hash(int packHash, long position)\n        {\n            return packHash + (int)((ulong)position >> _windowSizeShift);\n        }\n\n        internal override ByteWindow load(PackFile pack, long offset)\n        {\n            if (pack.beginWindowCache())\n            {\n                _openFiles.incrementAndGet();\n            }\n            try\n            {\n                if (_memoryMap)\n                {\n                    return pack.MemoryMappedByteWindow(offset, _windowSize);\n                }\n\n                return pack.Read(offset, _windowSize);\n            }\n            catch (Exception)\n            {\n                Close(pack);\n                throw;\n            }\n        }\n\n        internal override WindowRef createRef(PackFile p, long o, ByteWindow v)\n        {\n            var @ref = new WindowRef(p, o, v, queue);\n            _openBytes.addAndGet(@ref.Size);\n            return @ref;\n        }\n\n        internal override void clear(WindowRef @ref)\n        {\n            _openBytes.addAndGet(-@ref.Size);\n            Close(@ref.pack);\n        }\n\n        private void Close(PackFile pack)\n        {\n            if (!pack.endWindowCache()) return;\n            _openFiles.decrementAndGet();\n        }\n\n        internal override bool isFull()\n        {\n            return _maxFiles < _openFiles.get() || _maxBytes < _openBytes.get();\n        }\n\n        private long ToStart(long offset)\n        {\n            return (long)((ulong)offset >> _windowSizeShift) << _windowSizeShift;\n        }\n\n        private static int TableSize(WindowCacheConfig cfg)\n        {\n            int wsz = cfg.PackedGitWindowSize;\n            long limit = cfg.PackedGitLimit;\n            \n            if (wsz <= 0)\n            {\n                throw new ArgumentException(\"Invalid window size\");\n            }\n\n            if (limit < wsz)\n            {\n                throw new ArgumentException(\"Window size must be < limit\");\n            }\n\n            return (int) Math.Min(5*(limit/wsz)/2, 2000000000);\n        }\n\n        private static int LockCount(WindowCacheConfig cfg)\n        {\n            return Math.Max(cfg.PackedGitOpenFiles, 32);\n        }\n\n        #region Nested Types\n\n        internal class WindowRef : OffsetCache<ByteWindow, WindowCache.WindowRef>.Ref<ByteWindow>\n        {\n            public WindowRef(PackFile pack, long position, ByteWindow v, Queue queue)\n                : base(pack, position, v, queue)\n            {\n                Size = v.Size;\n            }\n\n            public int Size { get; private set; }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Core/WindowCacheConfig.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Configuration parameters for <see cref=\"WindowCache\" />.\n    /// </summary>\n    public class WindowCacheConfig\n    {\n        /// <summary>\n        /// 1024 (number of bytes in one kibibyte/kilobyte)\n        /// </summary>\n        public const int Kb = 1024;\n\n        /// <summary>\n        /// 1024 <see cref=\"Kb\" /> (number of bytes in one mebibyte/megabyte)\n        /// </summary>\n        public const int Mb = 1024 * 1024;\n\n        /// <summary>\n        /// Create a default configuration.\n        /// </summary>\n        public WindowCacheConfig()\n        {\n            PackedGitOpenFiles = 128;\n            PackedGitLimit = 10 * Mb;\n            PackedGitWindowSize = 8 * Kb;\n            PackedGitMMAP = false;\n            DeltaBaseCacheLimit = 10 * Mb;\n        }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <returns> \n        /// The maximum number of streams to open at a time. Open packs count\n        /// against the process limits. <b>Default is 128.</b>\n        /// </returns>\n        public int PackedGitOpenFiles { get; set; }\n\n        /// <summary>\n        /// \n        /// </summary>\n        /// <returns> maximum number bytes of heap memory to dedicate to caching pack\n        /// file data. <b>Default is 10 MB.</b></returns>\n        public long PackedGitLimit { get; set; }\n\n        /// <summary>\n        /// Gets/Sets the size in bytes of a single window read in from the pack file.\n        /// </summary>\n        public int PackedGitWindowSize { set; get; }\n\n        /// <summary>\n        /// Gets/sets the use of Java NIO virtual memory mapping for\n        /// windows; false reads entire window into a byte[] with standard\n        /// read calls.\n        /// </summary>\n        public bool PackedGitMMAP { set; get; }\n\n        /// <summary>\n        /// Gets/Sets the maximum number of bytes to cache in <see cref=\"UnpackedObjectCache\" />\n        /// for inflated, recently accessed objects, without delta chains.\n        /// <para><b>Default 10 MB.</b></para>\n        /// </summary>\n        public int DeltaBaseCacheLimit { set; get; }\n\n        /// <summary>\n        /// Update properties by setting fields from the configuration.\n\t\t/// <para />\n        /// If a property is not defined in the configuration, then it is left\n        /// unmodified.\n        /// </summary>\n        /// <param name=\"rc\">Configuration to read properties from.</param>\n        public void FromConfig(RepositoryConfig rc)\n        {\n            PackedGitOpenFiles = rc.getInt(\"core\", null, \"packedgitopenfiles\", PackedGitOpenFiles);\n            PackedGitLimit = rc.getLong(\"core\", null, \"packedgitlimit\", PackedGitLimit);\n            PackedGitWindowSize = rc.getInt(\"core\", null, \"packedgitwindowsize\", PackedGitWindowSize);\n            PackedGitMMAP = rc.getBoolean(\"core\", null, \"packedgitmmap\", PackedGitMMAP);\n            DeltaBaseCacheLimit = rc.getInt(\"core\", null, \"deltabasecachelimit\", DeltaBaseCacheLimit);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/WindowCursor.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyrigth (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing ICSharpCode.SharpZipLib.Zip.Compression;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// Active handle to a ByteWindow.\n    /// </summary>\n    public class WindowCursor\n    {\n        private Inflater _inflater;\n        private ByteWindow _byteWindow;\n\n        public WindowCursor()\n        {\n            TempId = new byte[Constants.OBJECT_ID_LENGTH];\n        }\n\n        /// <summary>\n        /// Temporary buffer large enough for at least one raw object id.\n        /// </summary>\n        internal byte[] TempId { get; private set; }\n\n        /// <summary>\n        /// Copy bytes from the window to a caller supplied buffer.\n        /// </summary>\n        /// <param name=\"pack\">The file the desired window is stored within.</param>\n        /// <param name=\"position\">Position within the file to read from.</param>\n        /// <param name=\"dstbuf\">Destination buffer to copy into.</param>\n        /// <param name=\"dstoff\">Offset within <paramref name=\"dstbuf\"/> to start copying into.</param>\n        /// <param name=\"cnt\">\n        /// The number of bytes to copy. This value may exceed the number of\n        /// bytes remaining in the window starting at offset <paramref name=\"position\"/>.\n        /// </param>\n        /// <returns>\n        /// number of bytes actually copied; this may be less than\n        /// <paramref name=\"cnt\"/> if <paramref name=\"cnt\"/> exceeded the number of\n        /// bytes available.\n        /// </returns>\n        /// <remarks>\n        /// This cursor does not match the provider or id and the proper \n        /// window could not be acquired through the provider's cache.\n        /// </remarks>\n        public int Copy(PackFile pack, long position, byte[] dstbuf, int dstoff, int cnt)\n        {\n            long length = pack.Length;\n            int need = cnt;\n            while (need > 0 && position < length)\n            {\n                Pin(pack, position);\n                int r = _byteWindow.copy(position, dstbuf, dstoff, need);\n                position += r;\n                dstoff += r;\n                need -= r;\n            }\n            return cnt - need;\n        }\n\n        /// <summary>\n        /// Pump bytes into the supplied inflater as input.\n        /// </summary>\n        /// <param name=\"pack\">The file the desired window is stored within.</param>\n        /// <param name=\"position\">Position within the file to read from.</param>\n        /// <param name=\"dstbuf\">\n        /// Destination buffer the inflater should output decompressed\n        /// data to.\n        /// </param>\n        /// <param name=\"dstoff\">Current offset within <paramref name=\"dstbuf\"/> to inflate into.</param>\n        /// <returns>\n        /// Updated <paramref name=\"dstoff\"/> based on the number of bytes\n        /// successfully inflated into <paramref name=\"dstbuf\"/>.\n        /// </returns>\n        /// <remarks>\n        /// this cursor does not match the provider or id and the proper\n        /// window could not be acquired through the provider's cache.\n        /// </remarks>\n        public int Inflate(PackFile pack, long position, byte[] dstbuf, int dstoff)\n        {\n            if (_inflater == null)\n            {\n                _inflater = InflaterCache.Instance.get();\n            }\n            else\n            {\n                _inflater.Reset();\n            }\n\n            while (true)\n            {\n                Pin(pack, position);\n                dstoff = _byteWindow.Inflate(position, dstbuf, dstoff, _inflater);\n                if (_inflater.IsFinished)\n                {\n                    return dstoff;\n                }\n                position = _byteWindow.End;\n            }\n        }\n\n        public void InflateVerify(PackFile pack, long position)\n        {\n            if (_inflater == null)\n            {\n                _inflater = InflaterCache.Instance.get();\n            }\n            else\n            {\n                _inflater.Reset();\n            }\n\n            while (true)\n            {\n                Pin(pack, position);\n                _byteWindow.inflateVerify(position, _inflater);\n                \n\t\t\t\tif (_inflater.IsFinished)\n                {\n                    return;\n                }\n                \n\t\t\t\tposition = _byteWindow.End;\n            }\n        }\n\n        private void Pin(PackFile pack, long position)\n        {\n            ByteWindow w = _byteWindow;\n            if (w == null || !w.contains(pack, position))\n            {\n                // If memory is low, we may need what is in our window field to\n                // be cleaned up by the GC during the get for the next window.\n                // So we always clear it, even though we are just going to set\n                // it again.\n                //\n                _byteWindow = null;\n                _byteWindow = WindowCache.get(pack, position);\n            }\n        }\n\n        /// <summary>\n        /// Release the current window cursor.\n        /// </summary>\n        public void Release()\n        {\n            _byteWindow = null;\n            try\n            {\n                InflaterCache.Instance.release(_inflater);\n            }\n            finally\n            {\n                _inflater = null;\n            }\n        }\n\n        /// <summary>\n        /// Release the window cursor.\n        /// </summary>\n        /// <param name=\"cursor\">cursor to Release; may be null.\n        /// </param>\n        /// <returns>always null</returns>\n        public static WindowCursor Release(WindowCursor cursor)\n        {\n            if (cursor != null)\n            {\n                cursor.Release();\n            }\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Core/WorkDirCheckout.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core\n{\n    /// <summary>\n    /// This class handles checking out one or two trees merging\n    /// with the index (actually a tree too).\n    /// <para />\n    /// Three-way merges are no performed. See <seealso cref=\"FailOnConflict\"/>.\n    /// </summary>\n    public class WorkDirCheckout\n    {\n        private readonly Dictionary<string, ObjectId> _updated;\n        private readonly Tree _head;\n        private readonly GitIndex _index;\n        private readonly Tree _merge;\n        private readonly DirectoryInfo _root;\n        private Repository _repo;\n\n        internal WorkDirCheckout(Repository repo, DirectoryInfo workDir, GitIndex oldIndex, GitIndex newIndex)\n            : this()\n        {\n            _repo = repo;\n            _root = workDir;\n            _index = oldIndex;\n            _merge = repo.MapTree(newIndex.writeTree());\n        }\n\n        ///\t<summary>\n        /// Create a checkout class for checking out one tree, merging with the index\n        ///\t</summary>\n        ///\t<param name=\"repo\"> </param>\n        ///\t<param name=\"root\"> workdir </param>\n        ///\t<param name=\"index\"> current index </param>\n        ///\t<param name=\"merge\"> tree to check out </param>\n        public WorkDirCheckout(Repository repo, DirectoryInfo root, GitIndex index, Tree merge)\n            : this()\n        {\n            this._repo = repo;\n            this._root = root;\n            this._index = index;\n            this._merge = merge;\n        }\n\n        ///\t<summary>\n        /// Create a checkout class for merging and checking our two trees and the index.\n        ///\t</summary>\n        ///\t<param name=\"repo\"> </param>\n        ///\t<param name=\"root\"> workdir </param>\n        ///\t<param name=\"head\"> </param>\n        ///\t<param name=\"index\"> </param>\n        ///\t<param name=\"merge\"> </param>\n        public WorkDirCheckout(Repository repo, DirectoryInfo root, Core.Tree head, GitIndex index, Core.Tree merge)\n            : this(repo, root, index, merge)\n        {\n            this._head = head;\n        }\n\n        private WorkDirCheckout()\n        {\n            Conflicts = new List<string>();\n            Removed = new List<string>();\n            _updated = new Dictionary<string, ObjectId>();\n            FailOnConflict = true;\n        }\n\n        ///\t<summary>\n        /// If <code>true</code>, will scan first to see if it's possible to check out, \n        /// otherwise throw <seealso cref=\"CheckoutConflictException\"/>. If <code>false</code>,\n        /// it will silently deal with the problem.\n        /// </summary>\n        public bool FailOnConflict { get; set; }\n\n        /// <summary>\n        /// The list of conflicts created by this checkout\n        /// </summary>\n        /// <returns></returns>\n        public List<string> Conflicts { get; private set; }\n\n        /// <summary>\n        /// The list of all files removed by this checkout\n        /// </summary>\n        /// <returns></returns>\n        public List<string> Removed { get; private set; }\n\n        public Dictionary<string, ObjectId> Updated\n        {\n            get { return _updated; }\n        }\n\n        ///\t<summary>\n        /// Execute this checkout\n        /// </summary>\n        /// <exception cref=\"IOException\"></exception>\n        public void checkout()\n        {\n            if (_head == null)\n            {\n                PrescanOneTree();\n            }\n            else\n            {\n                PrescanTwoTrees();\n            }\n\n            if (Conflicts.Count != 0)\n            {\n                if (FailOnConflict)\n                {\n                    string[] entries = Conflicts.ToArray();\n                    throw new CheckoutConflictException(entries);\n                }\n            }\n\n            CleanUpConflicts();\n            if (_head == null)\n            {\n                CheckoutOutIndexNoHead();\n            }\n            else\n            {\n                CheckoutTwoTrees();\n            }\n        }\n\n        private void CheckoutTwoTrees()\n        {\n            foreach (string path in Removed)\n            {\n                _index.remove(_root, new FileInfo(Path.Combine(_root.FullName, path)));\n            }\n\n            foreach (KeyValuePair<string, ObjectId> entry in _updated)\n            {\n                GitIndex.Entry newEntry = _index.addEntry(_merge.FindBlobMember(entry.Key));\n                _index.checkoutEntry(_root, newEntry);\n            }\n        }\n\n        private void CheckoutOutIndexNoHead()\n        {\n            var visitor = new AbstractIndexTreeVisitor\n                              {\n                                  VisitEntry = (m, i, f) =>\n                                                   {\n                                                       if (m == null)\n                                                       {\n                                                           _index.remove(_root, f);\n                                                           return;\n                                                       }\n\n                                                       bool needsCheckout = false;\n                                                       if (i == null)\n                                                       {\n                                                           needsCheckout = true;\n                                                       }\n                                                       else if (i.ObjectId.Equals(m.Id))\n                                                       {\n                                                           if (i.IsModified(_root, true))\n                                                           {\n                                                               needsCheckout = true;\n                                                           }\n                                                       }\n                                                       else\n                                                       {\n                                                           needsCheckout = true;\n                                                       }\n\n                                                       if (needsCheckout)\n                                                       {\n                                                           GitIndex.Entry newEntry = _index.addEntry(m);\n                                                           _index.checkoutEntry(_root, newEntry);\n                                                       }\n                                                   }\n                              };\n\n            new IndexTreeWalker(_index, _merge, _root, visitor).Walk();\n        }\n\n        private void CleanUpConflicts()\n        {\n            foreach (string conflictFile in Conflicts)\n            {\n                var conflict = new FileInfo(Path.Combine(_root.DirectoryName(), conflictFile));\n\n                try\n                {\n                    conflict.Delete();\n                }\n                catch (IOException)\n                {\n                    throw new CheckoutConflictException(\"Cannot delete file: \" + conflict);\n                }\n\n                RemoveEmptyParents(conflict);\n            }\n\n            foreach (string removedFile in Removed)\n            {\n                var file = new FileInfo(Path.Combine(_root.DirectoryName(), removedFile));\n                file.Delete();\n                RemoveEmptyParents(file);\n            }\n        }\n\n        private void RemoveEmptyParents(FileSystemInfo f)\n        {\n            FileSystemInfo parentFile = Directory.GetParent(f.FullName);\n            if (parentFile == null) return;\n\n            while (parentFile.FullName != _root.FullName)\n            {\n                if (parentFile.IsDirectory() && Directory.GetFiles(parentFile.FullName).Length == 0)\n                {\n                    parentFile.Delete();\n                }\n                else\n                {\n                    break;\n                }\n\n                parentFile = Directory.GetParent(parentFile.FullName);\n                if (parentFile == null) return;\n            }\n        }\n\n        internal void PrescanOneTree()\n        {\n            var visitor = new AbstractIndexTreeVisitor\n                              {\n                                  VisitEntry = (m, i, f) =>\n                                                   {\n                                                       if (m != null)\n                                                       {\n                                                           if (!f.IsFile())\n                                                           {\n                                                               CheckConflictsWithFile(f);\n                                                           }\n                                                       }\n                                                       else\n                                                       {\n                                                           if (f.Exists)\n                                                           {\n                                                               Removed.Add(i.Name);\n                                                               Conflicts.Remove(i.Name);\n                                                           }\n                                                       }\n                                                   }\n                              };\n\n            new IndexTreeWalker(_index, _merge, _root, visitor).Walk();\n\n            Conflicts.RemoveAll(conflict => Removed.Contains(conflict));\n        }\n\n\n         private List<string> ListFiles(FileSystemInfo file)\n        {\n            var list = new List<string>();\n            ListFiles(file, list);\n            return list;\n        }\n\n         private void ListFiles(FileSystemInfo dir, ICollection<string> list)\n         {\n             foreach (FileInfo f in dir.ListFiles())\n             {\n                 if (f.IsDirectory())\n                     ListFiles(f, list);\n                 else\n                 {\n                     list.Add(Repository.StripWorkDir(_root, new FileInfo(f.FullName)));\n                 }\n             }\n         }\n\n        internal void PrescanTwoTrees()\n        {\n            var visitor = new AbstractIndexTreeVisitor\n                              {\n                                  VisitEntryAux = (treeEntry, auxEntry, indexEntry, file) =>\n                                                   {\n                                                       if (treeEntry is Tree || auxEntry is Tree)\n                                                       {\n                                                           throw new ArgumentException(\"Can't pass me a tree!\");\n                                                       }\n\n                                                       ProcessEntry(treeEntry, auxEntry, indexEntry);\n                                                   },\n\n                                  FinishVisitTree = (tree, auxTree, currentDirectory) =>\n                                                        {\n                                                            if (currentDirectory.Length == 0) return;\n                                                            if (auxTree == null) return;\n\n                                                            if (_index.GetEntry(currentDirectory) != null)\n                                                            {\n                                                                Removed.Add(currentDirectory);\n                                                            }\n                                                        }\n                              };\n\n            new IndexTreeWalker(_index, _head, _merge, _root, visitor).Walk();\n\n            // if there's a conflict, don't list it under\n            // to-be-removed, since that messed up our next\n            // section\n            Removed.RemoveAll(removed => Conflicts.Contains(removed));\n\n            foreach (string path in _updated.Keys)\n            {\n                if (_index.GetEntry(path) == null)\n                {\n                    FileSystemInfo file = new FileInfo(Path.Combine(_root.DirectoryName(), path));\n                    if (file.IsFile())\n                    {\n                        Conflicts.Add(path);\n                    }\n                    else if (file.IsDirectory())\n                    {\n                        CheckConflictsWithFile(file);\n                    }\n                }\n            }\n\n            Conflicts.RemoveAll(conflict => Removed.Contains(conflict));\n        }\n\n        private void ProcessEntry(TreeEntry h, TreeEntry m, GitIndex.Entry i)\n        {\n            ObjectId iId = (i == null ? null : i.ObjectId);\n            ObjectId mId = (m == null ? null : m.Id);\n            ObjectId hId = (h == null ? null : h.Id);\n\n            string name = (i != null ? i.Name : (h != null ? h.FullName : m.FullName));\n\n            if (i == null)\n            {\n                //                    \n                //\t\t\t\t    I (index)                H        M        Result\n                //\t\t\t        -------------------------------------------------------\n                //\t\t\t        0 nothing             nothing  nothing  (does not happen)\n                //\t\t\t        1 nothing             nothing  exists   use M\n                //\t\t\t        2 nothing             exists   nothing  remove path from index\n                //\t\t\t        3 nothing             exists   exists   use M \n\n                if (h == null)\n                {\n                    _updated.Add(name, mId);\n                }\n                else if (m == null)\n                {\n                    Removed.Add(name);\n                }\n                else\n                {\n                    _updated.Add(name, mId);\n                }\n            }\n            else if (h == null)\n            {\n                //                    \n                //\t\t\t\t\t  clean I==H  I==M       H        M        Result\n                //\t\t\t         -----------------------------------------------------\n                //\t\t\t        4 yes   N/A   N/A     nothing  nothing  keep index\n                //\t\t\t        5 no    N/A   N/A     nothing  nothing  keep index\n                //\t\t\t\n                //\t\t\t        6 yes   N/A   yes     nothing  exists   keep index\n                //\t\t\t        7 no    N/A   yes     nothing  exists   keep index\n                //\t\t\t        8 yes   N/A   no      nothing  exists   fail\n                //\t\t\t        9 no    N/A   no      nothing  exists   fail       \n\n                if (m == null || mId.Equals(iId))\n                {\n                    if (HasParentBlob(_merge, name))\n                    {\n                        if (i.IsModified(_root, true))\n                        {\n                            Conflicts.Add(name);\n                        }\n                        else\n                        {\n                            Removed.Add(name);\n                        }\n                    }\n                }\n                else\n                {\n                    Conflicts.Add(name);\n                }\n            }\n            else if (m == null)\n            {\n                //                    \n                //\t\t\t\t\t10 yes   yes   N/A     exists   nothing  remove path from index\n                //\t\t\t        11 no    yes   N/A     exists   nothing  fail\n                //\t\t\t        12 yes   no    N/A     exists   nothing  fail\n                //\t\t\t        13 no    no    N/A     exists   nothing  fail\n                //\t\t\t\t\t \n\n                if (hId.Equals(iId))\n                {\n                    if (i.IsModified(_root, true))\n                    {\n                        Conflicts.Add(name);\n                    }\n                    else\n                    {\n                        Removed.Add(name);\n                    }\n                }\n                else\n                {\n                    Conflicts.Add(name);\n                }\n            }\n            else\n            {\n                if (!hId.Equals(mId) && !hId.Equals(iId) && !mId.Equals(iId))\n                {\n                    Conflicts.Add(name);\n                }\n                else if (hId.Equals(iId) && !mId.Equals(iId))\n                {\n                    if (i.IsModified(_root, true))\n                    {\n                        Conflicts.Add(name);\n                    }\n                    else\n                    {\n                        _updated.Add(name, mId);\n                    }\n                }\n            }\n        }\n\n        private static bool HasParentBlob(Tree t, string name)\n        {\n            if (name.IndexOf('/') == -1)\n            {\n                return false;\n            }\n\n            string parent = name.Slice(0, name.LastIndexOf('/'));\n            return t.FindBlobMember(parent) != null || HasParentBlob(t, parent);\n        }\n\n        private void CheckConflictsWithFile(FileSystemInfo file)\n        {\n            if (file.IsDirectory())\n            {\n                List<string> childFiles = ListFiles(file);\n                Conflicts.AddRange(childFiles);\n            }\n            else\n            {\n                FileSystemInfo parent = Directory.GetParent(file.FullName);\n                if (parent == null) return;\n\n                while (!parent.Equals(_root))\n                {\n                    if (parent.IsDirectory())\n                    {\n                        break;\n                    }\n\n                    if (parent.IsFile())\n                    {\n                        Conflicts.Add(Repository.StripWorkDir(_root, parent));\n                        break;\n                    }\n\n                    parent = Directory.GetParent(parent.FullName);\n                    if (parent == null) return;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Core/WriteTree.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Exceptions;\n\nnamespace GitSharp.Core\n{\n\t/// <summary>\n\t/// A tree visitor for writing a directory tree to the git object database.\n\t/// Blob data is fetched from the files, not the cached blobs.\n\t/// </summary>\n    public class WriteTree : TreeVisitorWithCurrentDirectory\n    {\n        private readonly ObjectWriter ow;\n\n\t\t///\t<summary>\n\t\t/// Construct a WriteTree for a given directory\n\t\t///\t</summary>\n\t\t///\t<param name=\"sourceDirectory\"> </param>\n\t\t///\t<param name=\"db\"> </param>\n        public WriteTree(DirectoryInfo sourceDirectory, Repository db)\n            : base(sourceDirectory)\n        {\n            ow = new ObjectWriter(db);\n        }\n\n        public override void VisitFile(FileTreeEntry f)\n        {\n            f.Id = ow.WriteBlob(PathUtil.CombineFilePath(GetCurrentDirectory(), f.Name));\n        }\n\n        public override void VisitSymlink(SymlinkTreeEntry s)\n        {\n            if (s.IsModified)\n            {\n                throw new SymlinksNotSupportedException(\"Symlink \\\"\"\n                        + s.FullName\n                        + \"\\\" cannot be written as the link target\"\n                        + \" cannot be read from within Java.\");\n            }\n        }\n\n\t\tpublic override void EndVisitTree(Tree t)\n\t\t{\n\t\t\tbase.EndVisitTree(t);\n\t\t\tt.Id = ow.WriteTree(t);\n\t\t}\n\n\t\tpublic override void VisitGitlink(GitLinkTreeEntry e)\n\t\t{\n\t\t\tif (e.IsModified)\n\t\t\t{\n\t\t\t\tthrow new GitlinksNotSupportedException(e.FullName);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/Git/CLI/CustomOptionTests.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NDesk.Options;\nusing NUnit.Framework;\nusing GitSharp.CLI;\n\nnamespace Git.Tests.CLI\n{\n\t[TestFixture]\n\tpublic class CustomOptionTests\n\t{\n\t\t[Test]\n\t\tpublic void CanParseOptions()\n\t\t{\n\t\t\tstring[] args = { \"--quiet\", \"--unused\", \"--verbose\", \"--\", \"path1\", \"path2\" };\n\n\t\t\t//Test without multi-path option\n\t\t\t//Simulates method that uses: argumentsRemaining = ParseOptions(args);\n\t\t\tvar cmd = new UnitTest { ProcessMultiplePaths = false };\n\t\t\tcmd.Run(args);\n\t\t\tAssert.AreEqual(new List<String> { \"--unused\" }, cmd.ArgumentsRemaining);\n\t\t\tAssert.IsNull(cmd.FilePaths);\n\n\t\t\t//Test with multi-path option\n\t\t\t//Simulates method that uses: ParseOptions(args, out filePaths, out argumentsRemaining)\n\t\t\tcmd = new UnitTest { ProcessMultiplePaths = true };\n\t\t\tcmd.Run(args);\n\t\t\tAssert.AreEqual(new List<String> { \"--unused\" }, cmd.ArgumentsRemaining);\n\t\t\tAssert.AreEqual(new List<String> { \"path1\", \"path2\" }, cmd.FilePaths);\n\t\t}\n\t}\n\n\tpublic class UnitTest : TextBuiltin\n\t{\n\n\t\tprivate bool isQuiet = false;\n\t\tprivate bool isVerbose = false;\n\t\tprivate bool processMultiplePaths = false;\n\t\tList<String> argumentsRemaining = new List<String>();\n\t\tList<String> filePaths = null;\n\n\t\tpublic List<String> ArgumentsRemaining\n\t\t{\n\t\t\tget { return argumentsRemaining; }\n\t\t\tset { argumentsRemaining = value; }\n\t\t}\n\n\t\tpublic List<String> FilePaths\n\t\t{\n\t\t\tget { return filePaths; }\n\t\t\tset { filePaths = value; }\n\t\t}\n\n\t\tpublic bool ProcessMultiplePaths\n\t\t{\n\t\t\tget { return processMultiplePaths; }\n\t\t\tset { processMultiplePaths = value; }\n\t\t}\n\n\t\toverride public void Run(string[] args)\n\t\t{\n\t\t\toptions = new CmdParserOptionSet()\n            {\n\t\t\t\t{ \"v|verbose\", \"Be verbose\", v=>{isVerbose = true;}},\n\t\t\t\t{ \"q|quiet\", \"Be quiet\", v=>{isQuiet = true;}},\n\t\t\t};\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (isVerbose || isQuiet)\n\t\t\t\t{\n\t\t\t\t\t//Do something \n\t\t\t\t}\n\n\t\t\t\tif (processMultiplePaths)\n\t\t\t\t\tParseOptions(args, out filePaths, out argumentsRemaining);\n\t\t\t\telse\n\t\t\t\t\targumentsRemaining = ParseOptions(args);\n\n\t\t\t}\n\t\t\tcatch (OptionException e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(e.Message);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/Git/CLI/OptionContextTest.cs",
    "content": "//\n// OptionContextTest.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\n\n//#if NDESK_OPTIONS\nusing NDesk.Options;\n//#else\n//using Mono.Options;\n//#endif\n\nusing NUnit.Framework;\n\n//#if NDESK_OPTIONS\n//namespace Tests.NDesk.Options\n//#else\n//namespace Tests.Mono.Options\n//#endif\nnamespace Git.Tests.CLI\n{\n\t[TestFixture]\n\tpublic class OptionContextTest {\n\t\t[Test]\n\t\tpublic void Exceptions ()\n\t\t{\n\t\t\tOptionSet p = new OptionSet () {\n\t\t\t\t{ \"a=\", v => { /* ignore */ } },\n\t\t\t};\n\t\t\tOptionContext c = new OptionContext (p);\n\t\t\tUtils.AssertException (typeof(InvalidOperationException),\n\t\t\t\t\t\"OptionContext.Option is null.\",\n\t\t\t\t\tc, v => { string ignore = v.OptionValues [0]; });\n\t\t\tc.Option = p [0];\n\t\t\tUtils.AssertException (typeof(ArgumentOutOfRangeException),\n\t\t\t\t\t\"Argument is out of range.\\nParameter name: index\",\n\t\t\t\t\tc, v => { string ignore = v.OptionValues [2]; });\n\t\t\tc.OptionName = \"-a\";\n\t\t\tUtils.AssertException (typeof(OptionException),\n\t\t\t\t\t\"Missing required value for option '-a'.\",\n\t\t\t\t\tc, v => { string ignore = v.OptionValues [0]; });\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp.Tests/Git/CLI/OptionSetTest.cs",
    "content": "//\n// OptionSetTest.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.IO;\n\n//#if NDESK_OPTIONS\nusing NDesk.Options;\n//#else\n//using Mono.Options;\n//#endif\n\nusing NUnit.Framework;\n\n//#if NDESK_OPTIONS\n//namespace Tests.NDesk.Options\n//#else\n//namespace Tests.Mono.Options\n//#endif\nnamespace Git.Tests.CLI\n{\n\tclass FooConverter : TypeConverter {\n\t\tpublic override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)\n\t\t{\n\t\t\tif (sourceType == typeof (string))\n\t\t\t\treturn true;\n\t\t\treturn base.CanConvertFrom (context, sourceType);\n\t\t}\n\n\t\tpublic override object ConvertFrom (ITypeDescriptorContext context,\n\t\t\t\tCultureInfo culture, object value)\n\t\t{\n\t\t\tstring v = value as string;\n\t\t\tif (v != null) {\n\t\t\t\tswitch (v) {\n\t\t\t\t\tcase \"A\": return Foo.A;\n\t\t\t\t\tcase \"B\": return Foo.B;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.ConvertFrom (context, culture, value);\n\t\t}\n\t}\n\n\t[TypeConverter (typeof(FooConverter))]\n\tclass Foo {\n\t\tpublic static readonly Foo A = new Foo (\"A\");\n\t\tpublic static readonly Foo B = new Foo (\"B\");\n\t\tstring s;\n\t\tFoo (string s) { this.s = s; }\n\t\tpublic override string ToString () {return s;}\n\t}\n\n\t[TestFixture]\n\tpublic class OptionSetTest {\n\t\tstatic IEnumerable<string> _ (params string[] a)\n\t\t{\n\t\t\treturn a;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BundledValues ()\n\t\t{\n\t\t\tvar defines = new List<string> ();\n\t\t\tvar libs    = new List<string> ();\n\t\t\tbool debug  = false;\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"D|define=\",  v => defines.Add (v) },\n\t\t\t\t{ \"L|library:\", v => libs.Add (v) },\n\t\t\t\t{ \"Debug\",      v => debug = v != null },\n\t\t\t\t{ \"E\",          v => { /* ignore */ } },\n\t\t\t};\n\t\t\tp.Parse (_(\"-DNAME\", \"-D\", \"NAME2\", \"-Debug\", \"-L/foo\", \"-L\", \"/bar\", \"-EDNAME3\"));\n\t\t\tAssert.AreEqual (defines.Count, 3);\n\t\t\tAssert.AreEqual (defines [0], \"NAME\");\n\t\t\tAssert.AreEqual (defines [1], \"NAME2\");\n\t\t\tAssert.AreEqual (defines [2], \"NAME3\");\n\t\t\tAssert.AreEqual (debug, true);\n\t\t\tAssert.AreEqual (libs.Count, 2);\n\t\t\tAssert.AreEqual (libs [0], \"/foo\");\n\t\t\tAssert.AreEqual (libs [1], null);\n\n\t\t\tUtils.AssertException (typeof(OptionException), \n\t\t\t\t\t\"Cannot bundle unregistered option '-V'.\",\n\t\t\t\t\tp, v => { v.Parse (_(\"-EVALUENOTSUP\")); });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RequiredValues ()\n\t\t{\n\t\t\tstring a = null;\n\t\t\tint n = 0;\n\t\t\tOptionSet p = new OptionSet () {\n\t\t\t\t{ \"a=\", v => a = v },\n\t\t\t\t{ \"n=\", (int v) => n = v },\n\t\t\t};\n\t\t\tList<string> extra = p.Parse (_(\"a\", \"-a\", \"s\", \"-n=42\", \"n\"));\n\t\t\tAssert.AreEqual (extra.Count, 2);\n\t\t\tAssert.AreEqual (extra [0], \"a\");\n\t\t\tAssert.AreEqual (extra [1], \"n\");\n\t\t\tAssert.AreEqual (a, \"s\");\n\t\t\tAssert.AreEqual (n, 42);\n\n\t\t\textra = p.Parse (_(\"-a=\"));\n\t\t\tAssert.AreEqual (extra.Count, 0);\n\t\t\tAssert.AreEqual (a, \"\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OptionalValues ()\n\t\t{\n\t\t\tstring a = null;\n\t\t\tint? n = -1;\n\t\t\tFoo f = null;\n\t\t\tOptionSet p = new OptionSet () {\n\t\t\t\t{ \"a:\", v => a = v },\n\t\t\t\t{ \"n:\", (int? v) => n = v },\n\t\t\t\t{ \"f:\", (Foo v) => f = v },\n\t\t\t};\n\t\t\tp.Parse (_(\"-a=s\"));\n\t\t\tAssert.AreEqual (a, \"s\");\n\t\t\tp.Parse (_(\"-a\"));\n\t\t\tAssert.AreEqual (a, null);\n\t\t\tp.Parse (_(\"-a=\"));\n\t\t\tAssert.AreEqual (a, \"\");\n\n\t\t\tp.Parse (_(\"-f\", \"A\"));\n\t\t\tAssert.AreEqual (f, null);\n\t\t\tp.Parse (_(\"-f\"));\n\t\t\tAssert.AreEqual (f, null);\n\t\t\tp.Parse (_(\"-f=A\"));\n\t\t\tAssert.AreEqual (f, Foo.A);\n\t\t\tf = null;\n\t\t\tp.Parse (_(\"-fA\"));\n\t\t\tAssert.AreEqual (f, Foo.A);\n\n\t\t\tp.Parse (_(\"-n42\"));\n\t\t\tAssert.AreEqual (n.Value, 42);\n\t\t\tp.Parse (_(\"-n\", \"42\"));\n\t\t\tAssert.AreEqual (n.HasValue, false);\n\t\t\tp.Parse (_(\"-n=42\"));\n\t\t\tAssert.AreEqual (n.Value, 42);\n\t\t\tp.Parse (_(\"-n\"));\n\t\t\tAssert.AreEqual (n.HasValue, false);\n\t\t\tUtils.AssertException (typeof(OptionException),\n\t\t\t\t\t\"Could not convert string `' to type Int32 for option `-n'.\",\n\t\t\t\t\tp, v => { v.Parse (_(\"-n=\")); });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BooleanValues ()\n\t\t{\n\t\t\tbool a = false;\n\t\t\tOptionSet p = new OptionSet () {\n\t\t\t\t{ \"a\", v => a = v != null },\n\t\t\t};\n\t\t\tp.Parse (_(\"-a\"));\n\t\t\tAssert.AreEqual (a, true);\n\t\t\tp.Parse (_(\"-a+\"));\n\t\t\tAssert.AreEqual (a, true);\n\t\t\tp.Parse (_(\"-a-\"));\n\t\t\tAssert.AreEqual (a, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CombinationPlatter ()\n\t\t{\n\t\t\tint a = -1, b = -1;\n\t\t\tstring av = null, bv = null;\n\t\t\tFoo f = null;\n\t\t\tint help = 0;\n\t\t\tint verbose = 0;\n\t\t\tOptionSet p = new OptionSet () {\n\t\t\t\t{ \"a=\", v => { a = 1; av = v; } },\n\t\t\t\t{ \"b\", \"desc\", v => {b = 2; bv = v;} },\n\t\t\t\t{ \"f=\", (Foo v) => f = v },\n\t\t\t\t{ \"v\", v => { ++verbose; } },\n\t\t\t\t{ \"h|?|help\", (v) => { switch (v) {\n\t\t\t\t\tcase \"h\": help |= 0x1; break; \n\t\t\t\t\tcase \"?\": help |= 0x2; break;\n\t\t\t\t\tcase \"help\": help |= 0x4; break;\n\t\t\t\t} } },\n\t\t\t};\n\t\t\tList<string> e = p.Parse (new string[]{\"foo\", \"-v\", \"-a=42\", \"/b-\",\n\t\t\t\t\"-a\", \"64\", \"bar\", \"--f\", \"B\", \"/h\", \"-?\", \"--help\", \"-v\"});\n\n\t\t\tAssert.AreEqual (e.Count, 2);\n\t\t\tAssert.AreEqual (e[0], \"foo\");\n\t\t\tAssert.AreEqual (e[1], \"bar\");\n\t\t\tAssert.AreEqual (a, 1);\n\t\t\tAssert.AreEqual (av, \"64\");\n\t\t\tAssert.AreEqual (b, 2);\n\t\t\tAssert.AreEqual (bv, null);\n\t\t\tAssert.AreEqual (verbose, 2);\n\t\t\tAssert.AreEqual (help, 0x7);\n\t\t\tAssert.AreEqual (f, Foo.B);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Exceptions ()\n\t\t{\n\t\t\tstring a = null;\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"a=\", v => a = v },\n\t\t\t\t{ \"b\",  v => { } },\n\t\t\t\t{ \"c\",  v => { } },\n\t\t\t\t{ \"n=\", (int v) => { } },\n\t\t\t\t{ \"f=\", (Foo v) => { } },\n\t\t\t};\n\t\t\t// missing argument\n\t\t\tUtils.AssertException (typeof(OptionException), \n\t\t\t\t\t\"Missing required value for option '-a'.\", \n\t\t\t\t\tp, v => { v.Parse (_(\"-a\")); });\n\t\t\t// another named option while expecting one -- follow Getopt::Long\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => { v.Parse (_(\"-a\", \"-a\")); });\n\t\t\tAssert.AreEqual (a, \"-a\");\n\t\t\t// no exception when an unregistered named option follows.\n\t\t\tUtils.AssertException (null, null, \n\t\t\t\t\tp, v => { v.Parse (_(\"-a\", \"-b\")); });\n\t\t\tAssert.AreEqual (a, \"-b\");\n\t\t\tUtils.AssertException (typeof(ArgumentNullException),\n\t\t\t\t\t\"Argument cannot be null.\\nParameter name: option\",\n\t\t\t\t\tp, v => { v.Add (null); });\n\n\t\t\t// bad type\n\t\t\tUtils.AssertException (typeof(OptionException),\n\t\t\t\t\t\"Could not convert string `value' to type Int32 for option `-n'.\",\n\t\t\t\t\tp, v => { v.Parse (_(\"-n\", \"value\")); });\n\t\t\tUtils.AssertException (typeof(OptionException),\n\t\t\t\t\t\"Could not convert string `invalid' to type Foo for option `--f'.\",\n\t\t\t\t\tp, v => { v.Parse (_(\"--f\", \"invalid\")); });\n\n\t\t\t// try to bundle with an option requiring a value\n\t\t\tUtils.AssertException (typeof(OptionException), \n\t\t\t\t\t\"Cannot bundle unregistered option '-z'.\", \n\t\t\t\t\tp, v => { v.Parse (_(\"-cz\", \"extra\")); });\n\n\t\t\tUtils.AssertException (typeof(ArgumentNullException), \n\t\t\t\t\t\"Argument cannot be null.\\nParameter name: action\",\n\t\t\t\t\tp, v => { v.Add (\"foo\", (Action<string>) null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException), \n\t\t\t\t\t\"Cannot provide maxValueCount of 2 for OptionValueType.None.\\nParameter name: maxValueCount\",\n\t\t\t\t\tp, v => { v.Add (\"foo\", (k, val) => {/* ignore */}); });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WriteOptionDescriptions ()\n\t\t{\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"p|indicator-style=\", \"append / indicator to directories\",    v => {} },\n\t\t\t\t{ \"color:\",             \"controls color info\",                  v => {} },\n\t\t\t\t{ \"color2:\",            \"set {color}\",                          v => {} },\n\t\t\t\t{ \"rk=\",                \"required key/value option\",            (k, v) => {} },\n\t\t\t\t{ \"rk2=\",               \"required {{foo}} {0:key}/{1:value} option\",    (k, v) => {} },\n\t\t\t\t{ \"ok:\",                \"optional key/value option\",            (k, v) => {} },\n\t\t\t\t{ \"long-desc\",\n\t\t\t\t\t\"This has a really\\nlong, multi-line description that also\\ntests\\n\" +\n\t\t\t\t\t\t\"the-builtin-supercalifragilisticexpialidicious-break-on-hyphen.  \" + \n\t\t\t\t\t\t\"Also, a list:\\n\" +\n\t\t\t\t\t\t\"  item 1\\n\" +\n\t\t\t\t\t\t\"  item 2\",\n\t\t\t\t\tv => {} },\n\t\t\t\t{ \"long-desc2\",\n\t\t\t\t\t\"IWantThisDescriptionToBreakInsideAWordGeneratingAutoWordHyphenation.\",\n\t\t\t\t\tv => {} },\n\t\t\t\t{ \"long-desc3\",\n\t\t\t\t\t\"OnlyOnePeriod.AndNoWhitespaceShouldBeSupportedEvenWithLongDescriptions\",\n\t\t\t\t\tv => {} },\n\t\t\t\t{ \"long-desc4\",\n\t\t\t\t\t\"Lots of spaces in the middle 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 and more until the end.\",\n\t\t\t\t\tv => {} },\n\t\t\t\t{ \"long-desc5\",\n\t\t\t\t\t\"Lots of spaces in the middle - . - . - . - . - . - . - . - and more until the end.\",\n\t\t\t\t\tv => {} },\n\t\t\t\t{ \"h|?|help\",           \"show help text\",                       v => {} },\n\t\t\t\t{ \"version\",            \"output version information and exit\",  v => {} },\n\t\t\t\t{ \"<>\", v => {} },\n\t\t\t};\n\n\t\t\tStringWriter expected = new StringWriter ();\n\t\t\texpected.WriteLine (\"  -p, --indicator-style=VALUE\");\n\t\t\texpected.WriteLine (\"                             append / indicator to directories\");\n\t\t\texpected.WriteLine (\"      --color[=VALUE]        controls color info\");\n\t\t\texpected.WriteLine (\"      --color2[=color]       set color\");\n\t\t\texpected.WriteLine (\"      --rk=VALUE1:VALUE2     required key/value option\");\n\t\t\texpected.WriteLine (\"      --rk2=key:value        required {foo} key/value option\");\n\t\t\texpected.WriteLine (\"      --ok[=VALUE1:VALUE2]   optional key/value option\");\n\t\t\texpected.WriteLine (\"      --long-desc            This has a really\");\n\t\t\texpected.WriteLine (\"                               long, multi-line description that also\");\n\t\t\texpected.WriteLine (\"                               tests\");\n\t\t\texpected.WriteLine (\"                               the-builtin-supercalifragilisticexpialidicious-\");\n\t\t\texpected.WriteLine (\"                               break-on-hyphen.  Also, a list:\");\n\t\t\texpected.WriteLine (\"                                 item 1\");\n\t\t\texpected.WriteLine (\"                                 item 2\");\n\t\t\texpected.WriteLine (\"      --long-desc2           IWantThisDescriptionToBreakInsideAWordGeneratingAu-\");\n\t\t\texpected.WriteLine (\"                               toWordHyphenation.\");\n\t\t\texpected.WriteLine (\"      --long-desc3           OnlyOnePeriod.\");\n\t\t\texpected.WriteLine (\"                               AndNoWhitespaceShouldBeSupportedEvenWithLongDesc-\");\n\t\t\texpected.WriteLine (\"                               riptions\");\n\t\t\texpected.WriteLine (\"      --long-desc4           Lots of spaces in the middle 1 2 3 4 5 6 7 8 9 0\");\n\t\t\texpected.WriteLine (\"                               1 2 3 4 5 and more until the end.\");\n\t\t\texpected.WriteLine (\"      --long-desc5           Lots of spaces in the middle - . - . - . - . - . -\");\n\t\t\texpected.WriteLine (\"                                . - . - and more until the end.\");\n\t\t\texpected.WriteLine (\"  -h, -?, --help             show help text\");\n\t\t\texpected.WriteLine (\"      --version              output version information and exit\");\n\n\t\t\tStringWriter actual = new StringWriter ();\n\t\t\tp.WriteOptionDescriptions (actual);\n\n\t\t\tAssert.AreEqual (actual.ToString (), expected.ToString ());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OptionBundling ()\n\t\t{\n\t\t\tstring a, b, c, f;\n\t\t\ta = b = c = f = null;\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"a\", v => a = \"a\" },\n\t\t\t\t{ \"b\", v => b = \"b\" },\n\t\t\t\t{ \"c\", v => c = \"c\" },\n\t\t\t\t{ \"f=\", v => f = v },\n\t\t\t};\n\t\t\tList<string> extra = p.Parse (_ (\"-abcf\", \"foo\", \"bar\"));\n\t\t\tAssert.AreEqual (extra.Count, 1);\n\t\t\tAssert.AreEqual (extra [0], \"bar\");\n\t\t\tAssert.AreEqual (a, \"a\");\n\t\t\tAssert.AreEqual (b, \"b\");\n\t\t\tAssert.AreEqual (c, \"c\");\n\t\t\tAssert.AreEqual (f, \"foo\");\n\t\t}\n\n\t\t[Test]\n        [Ignore]\n\t\tpublic void HaltProcessing ()\n\t\t{\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"a\", v => {} },\n\t\t\t\t{ \"b\", v => {} },\n\t\t\t};\n\t\t\tList<string> e = p.Parse (_ (\"-a\", \"-b\", \"--\", \"-a\", \"-b\"));\n\t\t\tAssert.AreEqual (e.Count, 2);\n\t\t\tAssert.AreEqual (e [0], \"-a\");\n\t\t\tAssert.AreEqual (e [1], \"-b\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KeyValueOptions ()\n\t\t{\n\t\t\tvar a = new Dictionary<string, string> ();\n\t\t\tvar b = new Dictionary<int, char> ();\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"a=\", (k,v) => a.Add (k, v) },\n\t\t\t\t{ \"b=\", (int k, char v) => b.Add (k, v) },\n\t\t\t\t{ \"c:\", (k, v) => {if (k != null) a.Add (k, v);} },\n\t\t\t\t{ \"d={=>}{-->}\", (k, v) => a.Add (k, v) },\n\t\t\t\t{ \"e={}\", (k, v) => a.Add (k, v) },\n\t\t\t\t{ \"f=+/\", (k, v) => a.Add (k, v) },\n\t\t\t};\n\t\t\tp.Parse (_(\"-a\", \"A\", \"B\", \"-a\", \"C\", \"D\", \"-a=E=F\", \"-a:G:H\", \"-aI=J\", \"-b\", \"1\", \"a\", \"-b\", \"2\", \"b\"));\n\t\t\tAssertDictionary (a, \n\t\t\t\t\t\"A\", \"B\", \n\t\t\t\t\t\"C\", \"D\", \n\t\t\t\t\t\"E\", \"F\", \n\t\t\t\t\t\"G\", \"H\", \n\t\t\t\t\t\"I\", \"J\");\n\t\t\tAssertDictionary (b,\n\t\t\t\t\t\"1\", \"a\",\n\t\t\t\t\t\"2\", \"b\");\n\n\t\t\ta.Clear ();\n\t\t\tp.Parse (_(\"-c\"));\n\t\t\tAssert.AreEqual (a.Count, 0);\n\t\t\tp.Parse (_(\"-c\", \"a\"));\n\t\t\tAssert.AreEqual (a.Count, 0);\n\t\t\tp.Parse (_(\"-ca\"));\n\t\t\tAssertDictionary (a, \"a\", null);\n\t\t\ta.Clear ();\n\t\t\tp.Parse (_(\"-ca=b\"));\n\t\t\tAssertDictionary (a, \"a\", \"b\");\n\n\t\t\ta.Clear ();\n\t\t\tp.Parse (_(\"-dA=>B\", \"-d\", \"C-->D\", \"-d:E\", \"F\", \"-d\", \"G\", \"H\", \"-dJ-->K\"));\n\t\t\tAssertDictionary (a,\n\t\t\t\t\t\"A\", \"B\",\n\t\t\t\t\t\"C\", \"D\", \n\t\t\t\t\t\"E\", \"F\",\n\t\t\t\t\t\"G\", \"H\",\n\t\t\t\t\t\"J\", \"K\");\n\n\t\t\ta.Clear ();\n\t\t\tp.Parse (_(\"-eA=B\", \"-eC=D\", \"-eE\", \"F\", \"-e:G\", \"H\"));\n\t\t\tAssertDictionary (a,\n\t\t\t\t\t\"A=B\", \"-eC=D\",\n\t\t\t\t\t\"E\", \"F\", \n\t\t\t\t\t\"G\", \"H\");\n\n\t\t\ta.Clear ();\n\t\t\tp.Parse (_(\"-f1/2\", \"-f=3/4\", \"-f:5+6\", \"-f7\", \"8\", \"-f9=10\", \"-f11=12\"));\n\t\t\tAssertDictionary (a,\n\t\t\t\t\t\"1\", \"2\",\n\t\t\t\t\t\"3\", \"4\",\n\t\t\t\t\t\"5\", \"6\", \n\t\t\t\t\t\"7\", \"8\", \n\t\t\t\t\t\"9=10\", \"-f11=12\");\n\t\t}\n\n\t\tstatic void AssertDictionary<TKey, TValue> (Dictionary<TKey, TValue> dict, params string[] set)\n\t\t{\n\t\t\tTypeConverter k = TypeDescriptor.GetConverter (typeof (TKey));\n\t\t\tTypeConverter v = TypeDescriptor.GetConverter (typeof (TValue));\n\n\t\t\tAssert.AreEqual (dict.Count, set.Length / 2);\n\t\t\tfor (int i = 0; i < set.Length; i += 2) {\n\t\t\t\tTKey key = (TKey) k.ConvertFromString (set [i]);\n\t\t\t\tAssert.AreEqual (dict.ContainsKey (key), true);\n\t\t\t\tif (set [i+1] == null)\n\t\t\t\t\tAssert.AreEqual (dict [key], default (TValue));\n\t\t\t\telse\n\t\t\t\t\tAssert.AreEqual (dict [key], (TValue) v.ConvertFromString (set [i+1]));\n\t\t\t}\n\t\t}\n\n\t\tclass CustomOption : Option {\n\t\t\tAction<OptionValueCollection> action;\n\n\t\t\tpublic CustomOption (string p, string d, int c, Action<OptionValueCollection> a)\n\t\t\t\t: base (p, d, c)\n\t\t\t{\n\t\t\t\tthis.action = a;\n\t\t\t}\n\n\t\t\tprotected override void OnParseComplete (OptionContext c)\n\t\t\t{\n\t\t\t\taction (c.OptionValues);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CustomKeyValue ()\n\t\t{\n\t\t\tvar a = new Dictionary<string, string> ();\n\t\t\tvar b = new Dictionary<string, string[]> ();\n\t\t\tvar p = new OptionSet () {\n\t\t\t\tnew CustomOption (\"a==:\", null, 2, v => a.Add (v [0], v [1])),\n\t\t\t\tnew CustomOption (\"b==:\", null, 3, v => b.Add (v [0], new string[]{v [1], v [2]})),\n\t\t\t};\n\t\t\tp.Parse (_(\"-a=b=c\", \"-a=d\", \"e\", \"-a:f=g\", \"-a:h:i\", \"-a\", \"j=k\", \"-a\", \"l:m\"));\n\t\t\tAssert.AreEqual (a.Count, 6);\n\t\t\tAssert.AreEqual (a [\"b\"], \"c\");\n\t\t\tAssert.AreEqual (a [\"d\"], \"e\");\n\t\t\tAssert.AreEqual (a [\"f\"], \"g\");\n\t\t\tAssert.AreEqual (a [\"h\"], \"i\");\n\t\t\tAssert.AreEqual (a [\"j\"], \"k\");\n\t\t\tAssert.AreEqual (a [\"l\"], \"m\");\n\n\t\t\tUtils.AssertException (typeof(OptionException),\n\t\t\t\t\t\"Missing required value for option '-a'.\",\n\t\t\t\t\tp, v => {v.Parse (_(\"-a=b\"));});\n\n\t\t\tp.Parse (_(\"-b\", \"a\", \"b\", \"c\", \"-b:d:e:f\", \"-b=g=h:i\", \"-b:j=k:l\"));\n\t\t\tAssert.AreEqual (b.Count, 4);\n\t\t\tAssert.AreEqual (b [\"a\"][0], \"b\");\n\t\t\tAssert.AreEqual (b [\"a\"][1], \"c\");\n\t\t\tAssert.AreEqual (b [\"d\"][0], \"e\");\n\t\t\tAssert.AreEqual (b [\"d\"][1], \"f\");\n\t\t\tAssert.AreEqual (b [\"g\"][0], \"h\");\n\t\t\tAssert.AreEqual (b [\"g\"][1], \"i\");\n\t\t\tAssert.AreEqual (b [\"j\"][0], \"k\");\n\t\t\tAssert.AreEqual (b [\"j\"][1], \"l\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Localization ()\n\t\t{\n\t\t\tvar p = new OptionSet (f => \"hello!\") {\n\t\t\t\t{ \"n=\", (int v) => { } },\n\t\t\t};\n\t\t\tUtils.AssertException (typeof(OptionException), \"hello!\",\n\t\t\t\t\tp, v => { v.Parse (_(\"-n=value\")); });\n\n\t\t\tStringWriter expected = new StringWriter ();\n\t\t\texpected.WriteLine (\"  -nhello!                   hello!\");\n\n\t\t\tStringWriter actual = new StringWriter ();\n\t\t\tp.WriteOptionDescriptions (actual);\n\n\t\t\tAssert.AreEqual (actual.ToString (), expected.ToString ());\n\t\t}\n\n\t\tclass CiOptionSet : OptionSet {\n\t\t\tprotected override void InsertItem (int index, Option item)\n\t\t\t{\n\t\t\t\tif (item.Prototype.ToLower () != item.Prototype)\n\t\t\t\t\tthrow new ArgumentException (\"prototypes must be null!\");\n\t\t\t\tbase.InsertItem (index, item);\n\t\t\t}\n\n\t\t\tprotected override bool Parse (string option, OptionContext c)\n\t\t\t{\n\t\t\t\tif (c.Option != null)\n\t\t\t\t\treturn base.Parse (option, c);\n\t\t\t\tstring f, n, s, v;\n\t\t\t\tif (!GetOptionParts (option, out f, out n, out s, out v)) {\n\t\t\t\t\treturn base.Parse (option, c);\n\t\t\t\t}\n\t\t\t\treturn base.Parse (f + n.ToLower () + (v != null && s != null ? s + v : \"\"), c);\n\t\t\t}\n\n\t\t\tpublic new Option GetOptionForName (string n)\n\t\t\t{\n\t\t\t\treturn base.GetOptionForName (n);\n\t\t\t}\n\n\t\t\tpublic void CheckOptionParts (string option, bool er, string ef, string en, string es, string ev)\n\t\t\t{\n\t\t\t\tstring f, n, s, v;\n\t\t\t\tbool r = GetOptionParts (option, out f, out n, out s, out v);\n\t\t\t\tAssert.AreEqual (r, er);\n\t\t\t\tAssert.AreEqual (f, ef);\n\t\t\t\tAssert.AreEqual (n, en);\n\t\t\t\tAssert.AreEqual (s, es);\n\t\t\t\tAssert.AreEqual (v, ev);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DerivedType ()\n\t\t{\n\t\t\tbool help = false;\n\t\t\tvar p = new CiOptionSet () {\n\t\t\t\t{ \"h|help\", v => help = v != null },\n\t\t\t};\n\t\t\tp.Parse (_(\"-H\"));\n\t\t\tAssert.AreEqual (help, true);\n\t\t\thelp = false;\n\t\t\tp.Parse (_(\"-HELP\"));\n\t\t\tAssert.AreEqual (help, true);\n\n\t\t\tAssert.AreEqual (p.GetOptionForName (\"h\"), p [0]);\n\t\t\tAssert.AreEqual (p.GetOptionForName (\"help\"), p [0]);\n\t\t\tAssert.AreEqual (p.GetOptionForName (\"invalid\"), null);\n\n\t\t\tUtils.AssertException (typeof(ArgumentException), \"prototypes must be null!\",\n\t\t\t\t\tp, v => { v.Add (\"N|NUM=\", (int n) => {}); });\n\t\t\tUtils.AssertException (typeof(ArgumentNullException),\n\t\t\t\t\t\"Argument cannot be null.\\nParameter name: option\",\n\t\t\t\t\tp, v => { v.GetOptionForName (null); });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OptionParts ()\n\t\t{\n\t\t\tvar p = new CiOptionSet ();\n\t\t\tp.CheckOptionParts (\"A\",        false,  null, null, null, null);\n\t\t\tp.CheckOptionParts (\"A=B\",      false,  null, null, null, null);\n\t\t\tp.CheckOptionParts (\"-A=B\",     true,   \"-\",  \"A\",  \"=\",  \"B\");\n\t\t\tp.CheckOptionParts (\"-A:B\",     true,   \"-\",  \"A\",  \":\",  \"B\");\n\t\t\tp.CheckOptionParts (\"--A=B\",    true,   \"--\", \"A\",  \"=\",  \"B\");\n\t\t\tp.CheckOptionParts (\"--A:B\",    true,   \"--\", \"A\",  \":\",  \"B\");\n\t\t\tp.CheckOptionParts (\"/A=B\",     true,   \"/\",  \"A\",  \"=\",  \"B\");\n\t\t\tp.CheckOptionParts (\"/A:B\",     true,   \"/\",  \"A\",  \":\",  \"B\");\n\t\t\tp.CheckOptionParts (\"-A=B=C\",   true,   \"-\",  \"A\",  \"=\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"-A:B=C\",   true,   \"-\",  \"A\",  \":\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"-A:B:C\",   true,   \"-\",  \"A\",  \":\",  \"B:C\");\n\t\t\tp.CheckOptionParts (\"--A=B=C\",  true,   \"--\", \"A\",  \"=\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"--A:B=C\",  true,   \"--\", \"A\",  \":\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"--A:B:C\",  true,   \"--\", \"A\",  \":\",  \"B:C\");\n\t\t\tp.CheckOptionParts (\"/A=B=C\",   true,   \"/\",  \"A\",  \"=\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"/A:B=C\",   true,   \"/\",  \"A\",  \":\",  \"B=C\");\n\t\t\tp.CheckOptionParts (\"/A:B:C\",   true,   \"/\",  \"A\",  \":\",  \"B:C\");\n\t\t\tp.CheckOptionParts (\"-AB=C\",    true,   \"-\",  \"AB\", \"=\",  \"C\");\n\t\t\tp.CheckOptionParts (\"-AB:C\",    true,   \"-\",  \"AB\", \":\",  \"C\");\n\t\t}\n\n\t\tclass ContextCheckerOption : Option {\n\t\t\tstring eName, eValue;\n\t\t\tint index;\n\n\t\t\tpublic ContextCheckerOption (string p, string d, string eName, string eValue, int index)\n\t\t\t\t: base (p, d)\n\t\t\t{\n\t\t\t\tthis.eName  = eName;\n\t\t\t\tthis.eValue = eValue;\n\t\t\t\tthis.index  = index;\n\t\t\t}\n\n\t\t\tprotected override void OnParseComplete (OptionContext c)\n\t\t\t{\n\t\t\t\tAssert.AreEqual (c.OptionValues.Count, 1);\n\t\t\t\tAssert.AreEqual (c.OptionValues [0], eValue);\n\t\t\t\tAssert.AreEqual (c.OptionName, eName);\n\t\t\t\tAssert.AreEqual (c.OptionIndex, index);\n\t\t\t\tAssert.AreEqual (c.Option, this);\n\t\t\t\tAssert.AreEqual (c.Option.Description, base.Description);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OptionContext ()\n\t\t{\n\t\t\tvar p = new OptionSet () {\n\t\t\t\tnew ContextCheckerOption (\"a=\", \"a desc\", \"/a\",   \"a-val\", 1),\n\t\t\t\tnew ContextCheckerOption (\"b\",  \"b desc\", \"--b+\", \"--b+\",  2),\n\t\t\t\tnew ContextCheckerOption (\"c=\", \"c desc\", \"--c\",  \"C\",     3),\n\t\t\t\tnew ContextCheckerOption (\"d\",  \"d desc\", \"/d-\",  null,    4),\n\t\t\t};\n\t\t\tAssert.AreEqual (p.Count, 4);\n\t\t\tp.Parse (_(\"/a\", \"a-val\", \"--b+\", \"--c=C\", \"/d-\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DefaultHandler ()\n\t\t{\n\t\t\tvar extra = new List<string> ();\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"<>\", v => extra.Add (v) },\n\t\t\t};\n\t\t\tvar e = p.Parse (_(\"-a\", \"b\", \"--c=D\", \"E\"));\n\t\t\tAssert.AreEqual (e.Count, 0);\n\t\t\tAssert.AreEqual (extra.Count, 4);\n\t\t\tAssert.AreEqual (extra [0], \"-a\");\n\t\t\tAssert.AreEqual (extra [1], \"b\");\n\t\t\tAssert.AreEqual (extra [2], \"--c=D\");\n\t\t\tAssert.AreEqual (extra [3], \"E\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MixedDefaultHandler ()\n\t\t{\n\t\t\tvar tests = new List<string> ();\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"t|<>=\", v => tests.Add (v) },\n\t\t\t};\n\t\t\tvar e = p.Parse (_(\"-tA\", \"-t:B\", \"-t=C\", \"D\", \"--E=F\"));\n\t\t\tAssert.AreEqual (e.Count, 0);\n\t\t\tAssert.AreEqual (tests.Count, 5);\n\t\t\tAssert.AreEqual (tests [0], \"A\");\n\t\t\tAssert.AreEqual (tests [1], \"B\");\n\t\t\tAssert.AreEqual (tests [2], \"C\");\n\t\t\tAssert.AreEqual (tests [3], \"D\");\n\t\t\tAssert.AreEqual (tests [4], \"--E=F\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DefaultHandlerRuns ()\n\t\t{\n\t\t\tvar formats = new Dictionary<string, List<string>> ();\n\t\t\tstring format = \"foo\";\n\t\t\tvar p = new OptionSet () {\n\t\t\t\t{ \"f|format=\", v => format = v },\n\t\t\t\t{ \"<>\", \n\t\t\t\t\tv => {\n\t\t\t\t\t\tList<string> f;\n\t\t\t\t\t\tif (!formats.TryGetValue (format, out f)) {\n\t\t\t\t\t\t\tf = new List<string> ();\n\t\t\t\t\t\t\tformats.Add (format, f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf.Add (v);\n\t\t\t\t} },\n\t\t\t};\n\t\t\tvar e = p.Parse (_(\"a\", \"b\", \"-fbar\", \"c\", \"d\", \"--format=baz\", \"e\", \"f\"));\n\t\t\tAssert.AreEqual (e.Count, 0);\n\t\t\tAssert.AreEqual (formats.Count, 3);\n\t\t\tAssert.AreEqual (formats [\"foo\"].Count, 2);\n\t\t\tAssert.AreEqual (formats [\"foo\"][0], \"a\");\n\t\t\tAssert.AreEqual (formats [\"foo\"][1], \"b\");\n\t\t\tAssert.AreEqual (formats [\"bar\"].Count, 2);\n\t\t\tAssert.AreEqual (formats [\"bar\"][0], \"c\");\n\t\t\tAssert.AreEqual (formats [\"bar\"][1], \"d\");\n\t\t\tAssert.AreEqual (formats [\"baz\"].Count, 2);\n\t\t\tAssert.AreEqual (formats [\"baz\"][0], \"e\");\n\t\t\tAssert.AreEqual (formats [\"baz\"][1], \"f\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp.Tests/Git/CLI/OptionTest.cs",
    "content": "//\n// OptionTest.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\n\n//#if NDESK_OPTIONS\nusing NDesk.Options;\n//#else\n//using Mono.Options;\n//#endif\n\nusing NUnit.Framework;\n\n//#if NDESK_OPTIONS\n//namespace Tests.NDesk.Options\n//#else\n//namespace Tests.Mono.Options\n//#endif\nnamespace Git.Tests.CLI\n{\n\tclass DefaultOption : Option {\n\t\tpublic DefaultOption (string prototypes, string description)\n\t\t\t: base (prototypes, description)\n\t\t{\n\t\t}\n\n\t\tpublic DefaultOption (string prototypes, string description, int c)\n\t\t\t: base (prototypes, description, c)\n\t\t{\n\t\t}\n\n\t\tprotected override void OnParseComplete (OptionContext c)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\n\t[TestFixture]\n\tpublic class OptionTest {\n\t\t[Test]\n\t\tpublic void Exceptions ()\n\t\t{\n\t\t\tobject p = null;\n\t\t\tUtils.AssertException (typeof(ArgumentNullException), \n\t\t\t\t\t\"Argument cannot be null.\\nParameter name: prototype\", \n\t\t\t\t\tp, v => { new DefaultOption (null, null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException), \n\t\t\t\t\t\"Cannot be the empty string.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Empty option names are not supported.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a|b||c=\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Conflicting option types: '=' vs. ':'.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a=|b:\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"The default option handler '<>' cannot require values.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"<>=\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"The default option handler '<>' cannot require values.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"<>:\", null); });\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => { new DefaultOption (\"t|<>=\", null, 1); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"The default option handler '<>' cannot require values.\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"t|<>=\", null, 2); });\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => { new DefaultOption (\"a|b=\", null, 2); });\n\t\t\tUtils.AssertException (typeof(ArgumentOutOfRangeException),\n\t\t\t\t\t\"Argument is out of range.\\nParameter name: maxValueCount\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a\", null, -1); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Cannot provide maxValueCount of 0 for OptionValueType.Required or \" +\n\t\t\t\t\t\t\"OptionValueType.Optional.\\nParameter name: maxValueCount\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a=\", null, 0); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Ill-formed name/value separator found in \\\"a={\\\".\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a={\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Ill-formed name/value separator found in \\\"a=}\\\".\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a=}\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Ill-formed name/value separator found in \\\"a={{}}\\\".\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a={{}}\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Ill-formed name/value separator found in \\\"a={}}\\\".\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a={}}\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Ill-formed name/value separator found in \\\"a={}{\\\".\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a={}{\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Cannot provide key/value separators for Options taking 1 value(s).\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a==\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Cannot provide key/value separators for Options taking 1 value(s).\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a={}\", null); });\n\t\t\tUtils.AssertException (typeof(ArgumentException),\n\t\t\t\t\t\"Cannot provide key/value separators for Options taking 1 value(s).\\nParameter name: prototype\",\n\t\t\t\t\tp, v => { new DefaultOption (\"a=+-*/\", null); });\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => { new DefaultOption (\"a\", null, 0); });\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => { new DefaultOption (\"a\", null, 0); });\n\t\t\tUtils.AssertException (null, null, \n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a\", null);\n\t\t\t\t\t\tAssert.AreEqual (d.GetValueSeparators ().Length, 0);\n\t\t\t\t\t});\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a=\", null, 1);\n\t\t\t\t\t\tstring[] s = d.GetValueSeparators ();\n\t\t\t\t\t\tAssert.AreEqual (s.Length, 0);\n\t\t\t\t\t});\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a=\", null, 2);\n\t\t\t\t\t\tstring[] s = d.GetValueSeparators ();\n\t\t\t\t\t\tAssert.AreEqual (s.Length, 2);\n\t\t\t\t\t\tAssert.AreEqual (s [0], \":\");\n\t\t\t\t\t\tAssert.AreEqual (s [1], \"=\");\n\t\t\t\t\t});\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a={}\", null, 2);\n\t\t\t\t\t\tstring[] s = d.GetValueSeparators ();\n\t\t\t\t\t\tAssert.AreEqual (s.Length, 0);\n\t\t\t\t\t});\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a={-->}{=>}\", null, 2);\n\t\t\t\t\t\tstring[] s = d.GetValueSeparators ();\n\t\t\t\t\t\tAssert.AreEqual (s.Length, 2);\n\t\t\t\t\t\tAssert.AreEqual (s [0], \"-->\");\n\t\t\t\t\t\tAssert.AreEqual (s [1], \"=>\");\n\t\t\t\t\t});\n\t\t\tUtils.AssertException (null, null,\n\t\t\t\t\tp, v => {\n\t\t\t\t\t\tvar d = new DefaultOption (\"a=+-*/\", null, 2);\n\t\t\t\t\t\tstring[] s = d.GetValueSeparators ();\n\t\t\t\t\t\tAssert.AreEqual (s.Length, 4);\n\t\t\t\t\t\tAssert.AreEqual (s [0], \"+\");\n\t\t\t\t\t\tAssert.AreEqual (s [1], \"-\");\n\t\t\t\t\t\tAssert.AreEqual (s [2], \"*\");\n\t\t\t\t\t\tAssert.AreEqual (s [3], \"/\");\n\t\t\t\t\t});\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp.Tests/Git/CLI/Utils.cs",
    "content": "//\n// Utils.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Linq;\nusing System.Reflection;\nusing GitSharp.Tests.GitSharp.Core.Util;\n\n//#if NDESK_OPTIONS\n//namespace Tests.NDesk.Options\n//#else\n//namespace Tests.Mono.Options\n//#endif\nnamespace Git.Tests.CLI\n{\n\tstatic class Utils {\n\t\tpublic static void AssertException<T> (Type exception, string message, T a, Action<T> action)\n\t\t{\n            if (exception == null)\n            {\n                action(a);\n                return;\n            }\n\n            MethodInfo method = typeof(AssertHelper).GetMethods(BindingFlags.Public | BindingFlags.Static).Single(m => m.Name == \"Throws\" && m.GetParameters().Count() == 1);\n            MethodInfo methodInfo = method.MakeGenericMethod(new[] { exception });\n\n\t\t    Action codeBlock = () => action(a);\n\n            methodInfo.Invoke(null, new object[] { codeBlock });\n\n            /*\n\t\t\tType actualType = null;\n\t\t\tstring stack = null;\n\t\t\tstring actualMessage = null;\n\t\t\ttry {\n\t\t\t\taction (a);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tactualType    = e.GetType ();\n\t\t\t\tactualMessage = e.Message;\n\t\t\t\tif (!object.Equals (actualType, exception))\n\t\t\t\t\tstack = e.ToString ();\n\t\t\t}\n\t\t\tif (!object.Equals (actualType, exception)) {\n\t\t\t\tthrow new InvalidOperationException (\n\t\t\t\t\tstring.Format (\"Assertion failed: Expected Exception Type {0}, got {1}.\\n\" +\n\t\t\t\t\t\t\"Actual Exception: {2}\", exception, actualType, stack));\n\t\t\t}\n\t\t\tif (!object.Equals (actualMessage, message))\n\t\t\t\tthrow new InvalidOperationException (\n\t\t\t\t\tstring.Format (\"Assertion failed:\\n\\tExpected: {0}\\n\\t  Actual: {1}\",\n\t\t\t\t\t\tmessage, actualMessage));\n\t\t*/\n        }\n\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/AbstractTreeNodeTests.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\t[TestFixture]\n\tpublic class AbstractTreeNodeTests : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void NameAndPath()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"master.txt\", repo.Get<Leaf>(\"master.txt\").Name);\n\t\t\t\tAssert.AreEqual(\"master.txt\", repo.Get<Leaf>(\"master.txt\").Path);\n\t\t\t\tAssert.AreEqual(\"\", repo.CurrentBranch.CurrentCommit.Tree.Name);\n\t\t\t\tAssert.AreEqual(\"\", repo.CurrentBranch.CurrentCommit.Tree.Path);\n\t\t\t\tAssert.AreEqual(\"a\", repo.Get<Tree>(\"a\").Name);\n\t\t\t\tAssert.AreEqual(\"a\", repo.Get<Tree>(\"a\").Path);\n\t\t\t\tAssert.AreEqual(\"a1.txt\", repo.Get<Leaf>(\"a/a1.txt\").Name);\n\t\t\t\tAssert.AreEqual(\"a/a1.txt\", repo.Get<Leaf>(\"a/a1.txt\").Path);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetHistory()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\t// history of master.txt\n\t\t\t\tvar master_txt = repo.Get<Leaf>(\"master.txt\");\n\t\t\t\tvar commits = master_txt.GetHistory().ToArray();\n\t\t\t\tvar history = commits.Select(c => c.Hash).ToArray();\n\t\t\t\tAssert.AreEqual(new[] { \"58be4659bb571194ed4562d04b359d26216f526e\", \"6c8b137b1c652731597c89668f417b8695f28dd7\" }, history);\n\n\t\t\t\t// history of a/a1.txt\n\t\t\t\tcommits = repo.Get<Leaf>(\"a/a1.txt\").GetHistory().ToArray();\n\t\t\t\thistory = commits.Select(c => c.Hash).ToArray();\n\t\t\t\tAssert.AreEqual(new[] { \"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", \"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\" }, history);\n\n\t\t\t\t// history of a/a2.txt\n\t\t\t\tcommits = repo.Get<Leaf>(\"a/a2.txt\").GetHistory().ToArray();\n\t\t\t\thistory = commits.Select(c => c.Hash).ToArray();\n\t\t\t\tAssert.AreEqual(new[] { \"6db9c2ebf75590eef973081736730a9ea169a0c4\", \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\" }, history);\n\n\t\t\t}\n\t\t}\n\n\t\t[Ignore(\"this test fails because cgit (for some reason) selects a different commit out of two possible candidates\")]\n\t\t[Test]\n\t\tpublic void GetHistory1()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\t// history of a/a1\n\t\t\t\tvar commits = repo.Get<Leaf>(\"a/a1\").GetHistory().ToArray();\n\t\t\t\tvar history = commits.Select(c => c.Hash).ToArray();\n\t\t\t\tAssert.AreEqual(new[] { \"f73b95671f326616d66b2afb3bdfcdbbce110b44\" }, history);\n\t\t\t}\n\t\t}\n\n\t\t[Ignore(\"this test fails because cgit filters out one duplicate change which gitsharp doesn't yet\")] // d0114ab8ac326bab30e3a657a0397578c5a1af88 and f73b95671f326616d66b2afb3bdfcdbbce110b44 are the same change merged together\n\t\t[Test]\n\t\tpublic void GetHistory2()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\t// history of a/\n\t\t\t\tvar commits = repo.Get<Tree>(\"a/\").GetHistory().ToArray();\n\t\t\t\tvar history = commits.Select(c => c.Hash).ToArray();\n\t\t\t\tAssert.AreEqual(new[] { \"f73b95671f326616d66b2afb3bdfcdbbce110b44\",\n\t\t\t\t\t\"6db9c2ebf75590eef973081736730a9ea169a0c4\",\n\t\t\t\t\t\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\",\n\t\t\t\t\t\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n\t\t\t\t\t\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\", \n\t\t\t\t}, history);\n\n\t\t\t}\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/ApiTestCase.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\t\t\t\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.IO;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\tpublic class ApiTestCase : SampleDataRepositoryTestCase\n\t{\n\t\tprotected Repository GetTrashRepository()\n\t\t{\n\t\t\treturn new Repository(db.WorkingDirectory.FullName);\n\t\t}\n\n\t\tprotected void AssertFileExistsInWD(string path)\n\t\t{\n\t\t\tvar wd = db.WorkingDirectory.FullName;\n\t\t\tAssert.IsTrue(new FileInfo(Path.Combine(wd, path)).Exists, \"Path '\" + path + \"' should exist in the working directory\");\n\t\t}\n\n\t\tprotected void AssertFileNotExistentInWD(string path)\n\t\t{\n\t\t\tvar wd = db.WorkingDirectory.FullName;\n\t\t\tAssert.IsFalse(new FileInfo(Path.Combine(wd, path)).Exists, \"Path '\" + path + \"' should *not* exist in the working directory\");\n\t\t}\n\n\t\tprotected void AssertFileContentInWDEquals(string path, string content)\n\t\t{\n\t\t\tvar wd = db.WorkingDirectory.FullName;\n\t\t\tAssert.AreEqual(content, File.ReadAllText(Path.Combine(wd, path)));\n\t\t}\n\n\t\tprotected void AssertRepoIsClean(Repository r)\n\t\t{\n\t\t\tvar status = r.Status;\n\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/BlobTests.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Text;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class BlobTests : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void WriteBlob() // corresponds to T0003_Basic_Write.Write_Blob\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar blob = Blob.CreateFromFile(repo, \"Resources/single_file_commit/i-am-a-file\");\n\t\t\t\tAssert.AreEqual(\"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\", blob.Hash);\n\t\t\t\tAssert.AreEqual(File.ReadAllText(\"Resources/single_file_commit/i-am-a-file\"), blob.Data);\n\t\t\t\tvar same_blob = new Blob(repo, blob.Hash);\n\t\t\t\tAssert.AreEqual(File.ReadAllBytes(\"Resources/single_file_commit/i-am-a-file\"), same_blob.RawData);\n\n\t\t\t\tblob = Blob.Create(repo, \"and this is the data in me\\r\\n\\r\\n\");\n\t\t\t\tAssert.AreEqual(\"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\", blob.Hash);\n\n\t\t\t\tblob = Blob.Create(repo, Encoding.UTF8.GetBytes(\"and this is the data in me\\r\\n\\r\\n\"));\n\t\t\t\tAssert.AreEqual(\"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\", blob.Hash);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/BranchTest.cs",
    "content": "/*\n * Copyright (C) 2009, Paupaw <paupawsan@gmail.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\t[TestFixture]\n\tpublic class BranchTest : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void Branch_from_HEAD()\n\t\t{\n\t\t\tusing (Repository repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar b = Branch.Create(repo, \"foo\");\n\t\t\t\tAssert.AreEqual(\"foo\", b.Name);\n\t\t\t\tAssert.AreEqual(\"master\", repo.CurrentBranch.Name); // creating a new branch does not switch to it by default.\n\t\t\t\tAssert.AreEqual(repo.Head.CurrentCommit, b.CurrentCommit);\n\t\t\t\tAssert.IsTrue(repo.Branches.ContainsKey(\"foo\"));\n\t\t\t\tBranch b2 = repo.Branches[\"foo\"];\n\t\t\t\tAssert.AreEqual(b.Name, b2.Name);\n\t\t\t\tAssert.AreEqual(new Branch(repo, \"foo\"), b);\n\t\t\t\tAssert.AreEqual(b, b2);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Branch_from_a_commit_in_history()\n\t\t{\n\t\t\tusing (Repository repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar c = new Commit(repo, \"master^^\");\n\t\t\t\tvar b = Branch.Create(repo, \"foo\", c);\n\t\t\t\tAssert.AreEqual(c, b.CurrentCommit);\n\t\t\t\tAssert.AreEqual(\"master\", repo.CurrentBranch.Name); // creating a new branch does not switch to it by default.\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Switch_to_Branch()\n\t\t{\n\t\t\tusing (Repository repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar master = repo.Branches[\"master\"];\n\t\t\t\tAssert.IsTrue(master.IsCurrent);\n\t\t\t\tmaster.Reset(ResetBehavior.Hard);\n\t\t\t\tvar a = repo.Branches[\"a\"];\n\t\t\t\tvar b = repo.Branches[\"b\"];\n\t\t\t\tvar c = repo.Branches[\"c\"];\n\t\t\t\tvar d = repo.Branches[\"d\"];\n\t\t\t\tvar e = repo.Branches[\"e\"];\n\t\t\t\tvar f = repo.Branches[\"f\"];\n\t\t\t\tvar g = repo.Branches[\"g\"];\n\t\t\t\tvar prefix_a = repo.Branches[\"prefix/a\"];\n\t\t\t\tvar gitlink = repo.Branches[\"gitlink\"];\n\t\t\t\tvar symlink = repo.Branches[\"symlink\"];\n\t\t\t\tvar pa = repo.Branches[\"pa\"];\n\t\t\t\tAssert.AreEqual(12, repo.Branches.Count);\n\n\t\t\t\ta.Checkout();\n\t\t\t\tAssert.IsTrue(a.IsCurrent);\n\t\t\t\tAssert.IsFalse(master.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\tb.Checkout();\n\t\t\t\tAssert.IsTrue(b.IsCurrent);\n\t\t\t\tAssert.IsFalse(a.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"b/b1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"b/b2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\trepo.SwitchToBranch(\"c\");\n\t\t\t\tAssert.IsTrue(c.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"b/b1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"b/b2.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"c/c1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"c/c2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\trepo.SwitchToBranch(d);\n\t\t\t\tAssert.IsTrue(d.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\trepo.SwitchToBranch(e);\n\n\t\t\t\trepo.SwitchToBranch(f);\n\t\t\t\tAssert.IsTrue(f.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"f/f\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\trepo.SwitchToBranch(prefix_a);\n\t\t\t\tAssert.IsTrue(prefix_a.IsCurrent);\n\t\t\t\tAssert.IsFalse(f.IsCurrent);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"master.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"f/f\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a1.txt\").Exists);\n\t\t\t\tAssert.IsTrue(GetFile(repo, \"a/a2.txt\").Exists);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\trepo.SwitchToBranch(g);\n\t\t\t\trepo.SwitchToBranch(pa);\n\t\t\t\tAssertRepoIsClean(repo);\n\n\t\t\t\t// [henon] not checking branches gitlink and symlink as there are obviously problems with them. these should be moved into their own test, once we understand gitlink and symlink better.\n\n\t\t\t\t//repo.CheckoutBranch(gitlink);\n\t\t\t\t//Assert.IsTrue(GetFile(repo, \".gitmodules\").Exists);\n\t\t\t\t//AssertRepoIsClean(repo);\n\n\t\t\t\t//repo.CheckoutBranch(\"symlink\");\n\t\t\t\t//Assert.IsTrue(GetFile(repo, \"symlink.txt\").Exists);\n\t\t\t\t//AssertRepoIsClean(repo);\n\t\t\t}\n\t\t}\n\n\t\tprivate FileInfo GetFile(Repository r, string relative_path)\n\t\t{\n\t\t\treturn new FileInfo(Path.Combine(r.WorkingDirectory, relative_path));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ResetHard()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tstring filepath = Path.Combine(repo.WorkingDirectory, \"a present for paupaw.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"hey, paupaw gets new shoes!\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\tvar commit = repo.Commit(\"You feeling lucky punk!?\", new Author(\"IronHide\", \"transformers@cybertron.com\"));\n\n\t\t\t\t// now changing file from first commit\n\t\t\t\tFile.AppendAllText(filepath, \"... and a new hat too.\");\n\t\t\t\t// and add new file\n\t\t\t\tstring filepath1 = Path.Combine(repo.WorkingDirectory, \"Bintang Kecil.txt\");\n\t\t\t\tFile.WriteAllText(filepath1, \"Bintang Kecil, di langit yang biru, amat banyak menghias angkasa.\");\n\t\t\t\trepo.Index.Add(filepath, filepath1);\n\t\t\t\tvar commit2 = repo.Commit(\"Nyanyian anak bangsa\", new Author(\"Legend\", \"hist@jakarta.id\"));\n\n\t\t\t\t// adding an untracked file which should not be removed by reset hard\n\t\t\t\tvar filepath2 = Path.Combine(repo.WorkingDirectory, \"some untracked file\");\n\t\t\t\tFile.WriteAllText(filepath2, \"untracked content\");\n\n\t\t\t\t// git reset --hard\n\t\t\t\trepo.CurrentBranch.Reset(commit.Hash, ResetBehavior.Hard);\n\n\t\t\t\tAssert.AreEqual(commit.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.IsFalse(new FileInfo(filepath1).Exists);\n\t\t\t\tAssert.AreEqual(\"hey, paupaw gets new shoes!\", File.ReadAllText(filepath));\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(1, status.Untracked.Count);\n\t\t\t\tAssert.IsTrue(new FileInfo(filepath2).Exists);\n\n\t\t\t\tvar filepath3 = Path.Combine(repo.WorkingDirectory, \"for me.txt\");\n\t\t\t\tFile.WriteAllText(filepath3, \"This should be fine if reset hard was working fine.\");\n\t\t\t\trepo.Index.Add(filepath3);\n\t\t\t\tvar commit3 = repo.Commit(\"commit after hard reset\", new Author(\"paupaw\", \"paupaw@home.jp\"));\n\n\t\t\t\tAssert.AreEqual(commit3.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.AreEqual(commit3.Parent, commit);\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ResetHard1()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.AreEqual(8, repo.Status.Removed.Count);\n\t\t\t\trepo.Head.Reset(ResetBehavior.Hard);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Untracked.Count);\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ResetSoft()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tstring filepath = Path.Combine(repo.WorkingDirectory, \"a present for paupaw.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"hey, paupaw gets new shoes!\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\tvar commit = repo.Commit(\"You feeling lucky punk!?\", new Author(\"IronHide\", \"transformers@cybertron.com\"));\n\n\t\t\t\t// now changing file from first commit\n\t\t\t\tFile.AppendAllText(filepath, \"... and a new hat too.\");\n\t\t\t\t// and add new file\n\t\t\t\tstring filepath1 = Path.Combine(repo.WorkingDirectory, \"Bintang Kecil.txt\");\n\t\t\t\tFile.WriteAllText(filepath1, \"Bintang Kecil, di langit yang biru, amat banyak menghias angkasa.\");\n\t\t\t\trepo.Index.Add(filepath, filepath1);\n\t\t\t\tvar commit2 = repo.Commit(\"Nyanyian anak bangsa\", new Author(\"Legend\", \"hist@jakarta.id\"));\n\n\t\t\t\t// adding an untracked file which should not be removed by reset soft\n\t\t\t\tvar filepath2 = Path.Combine(repo.WorkingDirectory, \"some untracked file\");\n\t\t\t\tFile.WriteAllText(filepath2, \"untracked content\");\n\n\t\t\t\t// git reset --soft ...\n\t\t\t\trepo.CurrentBranch.Reset(commit.Hash, ResetBehavior.Soft);\n\n\t\t\t\tAssert.AreEqual(commit.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.IsTrue(new FileInfo(filepath1).Exists);\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"Bintang Kecil.txt\"));\n\t\t\t\tAssert.IsTrue(status.Staged.Contains(\"a present for paupaw.txt\"));\n\t\t\t\tAssert.AreEqual(1, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(1, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(1, status.Untracked.Count);\n\t\t\t\tAssert.IsTrue(new FileInfo(filepath2).Exists);\n\n\t\t\t\tvar filepath3 = Path.Combine(repo.WorkingDirectory, \"for me.txt\");\n\t\t\t\tFile.WriteAllText(filepath3, \"This should be fine if reset soft was working fine.\");\n\t\t\t\trepo.Index.Add(filepath3);\n\t\t\t\tvar commit3 = repo.Commit(\"commit after soft reset\", new Author(\"paupaw\", \"paupaw@home.jp\"));\n\n\t\t\t\tAssert.AreEqual(commit3.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.AreEqual(commit3.Parent, commit);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ResetSoft1()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\trepo.Head.CurrentCommit.Checkout();\n\t\t\t\tvar c1 = repo.Head.CurrentCommit;\n\t\t\t\tAssert.AreEqual(0, repo.Status.Untracked.Count);\n\t\t\t\trepo.Head.Reset(c1.Parent.Parent, ResetBehavior.Soft);\n\t\t\t\tAssert.AreEqual(3, repo.Status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(c1.Parent.Parent, repo.Head.CurrentCommit);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ResetMixed()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tstring filepath = Path.Combine(repo.WorkingDirectory, \"a present for paupaw.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"hey, paupaw gets new shoes!\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\tvar commit = repo.Commit(\"You feeling lucky punk!?\", new Author(\"IronHide\", \"transformers@cybertron.com\"));\n\n\t\t\t\t// now changing file from first commit\n\t\t\t\tFile.AppendAllText(filepath, \"... and a new hat too.\");\n\t\t\t\t// and add new file\n\t\t\t\tstring filepath1 = Path.Combine(repo.WorkingDirectory, \"Bintang Kecil.txt\");\n\t\t\t\tFile.WriteAllText(filepath1, \"Bintang Kecil, di langit yang biru, amat banyak menghias angkasa.\");\n\t\t\t\trepo.Index.Add(filepath, filepath1);\n\t\t\t\tvar commit2 = repo.Commit(\"Nyanyian anak bangsa\", new Author(\"Legend\", \"hist@jakarta.id\"));\n\n\t\t\t\t// adding an untracked file which should not be removed by reset soft\n\t\t\t\tvar filepath2 = Path.Combine(repo.WorkingDirectory, \"some untracked file\");\n\t\t\t\tFile.WriteAllText(filepath2, \"untracked content\");\n\n\t\t\t\t// git reset --mixed ...\n\t\t\t\trepo.CurrentBranch.Reset(commit.Hash, ResetBehavior.Mixed);\n\n\t\t\t\tAssert.AreEqual(commit.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.IsTrue(new FileInfo(filepath1).Exists);\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"Bintang Kecil.txt\"));\n\t\t\t\tAssert.IsTrue(status.Modified.Contains(\"a present for paupaw.txt\"));\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(1, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(2, status.Untracked.Count);\n\t\t\t\tAssert.IsTrue(new FileInfo(filepath2).Exists);\n\n\t\t\t\tvar filepath3 = Path.Combine(repo.WorkingDirectory, \"for me.txt\");\n\t\t\t\tFile.WriteAllText(filepath3, \"This should be fine if reset soft was working fine.\");\n\t\t\t\trepo.Index.Add(filepath1, filepath2, filepath3);\n\t\t\t\tvar commit3 = repo.Commit(\"commit after mixed reset\", new Author(\"paupaw\", \"paupaw@home.jp\"));\n\n\t\t\t\tAssert.AreEqual(commit3.Hash, repo.CurrentBranch.CurrentCommit.Hash);\n\t\t\t\tAssert.AreEqual(commit3.Parent, commit);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ResetMixed1()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\trepo.Head.CurrentCommit.Checkout();\n\t\t\t\tvar c1 = repo.Head.CurrentCommit;\n\t\t\t\tAssert.AreEqual(0, repo.Status.Untracked.Count);\n\t\t\t\trepo.Head.Reset(c1.Parent.Parent, ResetBehavior.Mixed);\n\t\t\t\tAssert.AreEqual(3, repo.Status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, repo.Status.Staged.Count);\n\t\t\t\tAssert.AreEqual(c1.Parent.Parent, repo.Head.CurrentCommit);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Rename()\n\t\t{\n\t\t\tusing (Repository repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar foo = Branch.Create(repo, \"foo\");\n\t\t\t\tAssert.AreEqual(\"foo\", foo.Name);\n\t\t\t\t\n\t\t\t\tfoo.Rename (\"bar\");\n\t\t\t\tAssert.AreEqual(\"bar\", foo.Name);\n\t\t\t\tAssert.IsFalse (repo.Branches.ContainsKey (\"foo\"));\n\t\t\t\tAssert.IsTrue (repo.Branches.ContainsKey (\"bar\"));\n\t\t\t\t\n\t\t\t\tBranch bar = repo.Branches [\"bar\"];\n\t\t\t\tAssert.AreEqual(\"bar\", bar.Name);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Delete()\n\t\t{\n\t\t\tusing (Repository repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar foo = Branch.Create(repo, \"foo\");\n\t\t\t\tAssert.AreEqual(\"foo\", foo.Name);\n\t\t\t\tAssert.IsTrue (repo.Branches.ContainsKey (\"foo\"));\n\t\t\t\t\n\t\t\t\tfoo.Delete ();\n\t\t\t\t\n\t\t\t\tAssert.IsFalse (repo.Branches.ContainsKey (\"foo\"));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/CloneTests.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing System.IO;\nusing GitSharp.Core.Tests;\n\nnamespace GitSharp.Tests.GitSharp\n{\n    [TestFixture]\n    public class CloneTests : RepositoryTestCase\n    {\n        [Test]\n        public void Check_cloned_bare_repo()\n        {\n            Assert.Ignore(\"This test has not been implemented yet.\");\n        }\n\n        [Test]\n        public void Check_cloned_repo_git()\n        {\n            string toPath = Path.Combine(trash.FullName, \"test\");\n            string fromUrl = \"git://github.com/henon/TestGitRepository.git\";\n\n            using (Repository repo = Git.Clone(fromUrl, toPath))\n            {\n                var status = new RepositoryStatus(repo, new RepositoryStatusOptions { ForceContentCheck = false });\n                Assert.IsFalse(status.AnyDifferences);\n\n                status = new RepositoryStatus(repo, new RepositoryStatusOptions { ForceContentCheck = true });\n                Assert.IsFalse(status.AnyDifferences);\n\n                Assert.IsTrue(Repository.IsValid(repo.Directory));\n                //Verify content is in the proper location\n                var readme = Path.Combine(repo.WorkingDirectory, \"master.txt\");\n                Assert.IsTrue(new FileInfo(readme).Exists);\n            }\n        }\n\n        [Test]\n        public void Try_cloning_non_existing_repo_git()\n        {\n            string toPath = Path.Combine(trash.FullName, \"test\");\n            string fromUrl = \"git://github.com/henon/nonExistingRepo.git\";\n            AssertHelper.Throws<NoRemoteRepositoryException>(() => { using (Repository repo = Git.Clone(fromUrl, toPath)) { } }, \"Repository shouldn't exist.\");\n        }\n\n        [Test]\n        [Ignore(\"TransportLocal is not completely ported yet.\")]\n        public void Checked_cloned_local_dotGit_suffixed_repo()\n        {\n            //setup of .git directory\n            var resource =\n                new DirectoryInfo(PathUtil.Combine(Path.Combine(Environment.CurrentDirectory, \"Resources\"),\n                                               \"OneFileRepository\"));\n            var tempRepository =\n                new DirectoryInfo(Path.Combine(trash.FullName, \"OneFileRepository\" + Path.GetRandomFileName() + Constants.DOT_GIT_EXT));\n            CopyDirectory(resource.FullName, tempRepository.FullName);\n\n            var repositoryPath = new DirectoryInfo(Path.Combine(tempRepository.FullName, Constants.DOT_GIT));\n            Directory.Move(repositoryPath.FullName + \"ted\", repositoryPath.FullName);\n\n\n            using (var repo = new Repository(repositoryPath.FullName))\n            {\n                Assert.IsTrue(Repository.IsValid(repo.Directory));\n                Commit headCommit = repo.Head.CurrentCommit;\n                Assert.AreEqual(\"f3ca78a01f1baa4eaddcc349c97dcab95a379981\", headCommit.Hash);\n            }\n\n            string toPath = Path.Combine(trash.FullName, \"to.git\");\n\n            using (var repo = Git.Clone(repositoryPath.FullName, toPath))\n            {\n                Assert.IsTrue(Repository.IsValid(repo.Directory));\n                Commit headCommit = repo.Head.CurrentCommit;\n                Assert.AreEqual(\"f3ca78a01f1baa4eaddcc349c97dcab95a379981\", headCommit.Hash);\n            }\n        }\n\n        [Test]\n        [Ignore]\n        public void Check_cloned_repo_http()\n        {\n            string toPath = Path.Combine(trash.FullName, \"test\");\n            string fromUrl = \"http://github.com/henon/TestGitRepository.git\";\n\n            using (Repository repo = Git.Clone(fromUrl, toPath))\n            {\n                Assert.IsTrue(Repository.IsValid(repo.Directory));\n                //Verify content is in the proper location\n                var readme = Path.Combine(repo.WorkingDirectory, \"master.txt\");\n                Assert.IsTrue(new FileInfo(readme).Exists);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/CommitDateTests.cs",
    "content": "/*\n * Copyright (C) 2009, James Gregory\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class CommitDateTests : ApiTestCase\n\t{\n\t\tprivate const string KnownCommit = \"49322bb17d3acc9146f98c97d078513228bbf3c0\";\n\t\tprivate static readonly DateTimeOffset _expectedDate = new DateTimeOffset(2005, 04, 07, 15, 32, 13, new TimeSpan(-7, 0, 0));\n\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToReadAuthorDate()\n\t\t{\n\t\t\tvar expectedDate = new DateTimeOffset();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\texpectedDate = DateTimeOffset.Parse(\"2005-04-07 15:32:13 -07:00\");\n\t\t\t}\n\t\t\tcatch (NotImplementedException)\n\t\t\t{\n\t\t\t\tAssert.Ignore(\"Doesn't pass on Mono because of 'System.NotImplementedException : The requested feature is not implemented.at System.DateTimeOffset.Parse'.\");\n\t\t\t}\n\n\t\t\tusing (var repos = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar commit = new Commit(repos, KnownCommit);\n\n\t\t\t\tAssert.AreEqual(expectedDate, commit.AuthorDate);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToReadAuthorDate2()\n\t\t{\n\t\t\tusing (var repos = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar commit = new Commit(repos, KnownCommit);\n\n\t\t\t\tAssert.AreEqual(_expectedDate, commit.AuthorDate);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToReadCommitDate()\n\t\t{\n\t\t\tusing (var repos = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar commit = new Commit(repos, KnownCommit);\n\n\t\t\t\tAssert.AreEqual(_expectedDate, commit.CommitDate);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/CommitTests.cs",
    "content": "using System;\nusing System.Linq;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.IO;\nusing System.Text;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class CommitTests : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void Commit_into_empty_repository()\n\t\t{\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (Repository repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"for henon.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"Weibier\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\tstring filepath1 = Path.Combine(workingDirectory, \"for nulltoken.txt\");\n\t\t\t\tFile.WriteAllText(filepath1, \"Rotwein\");\n\t\t\t\trepo.Index.Add(filepath1);\n\t\t\t\tvar commit = repo.Commit(\"Hello World!\", new Author(\"A. U. Thor\", \"au@thor.com\"));\n\t\t\t\tAssert.NotNull(commit);\n\t\t\t\tAssert.IsTrue(commit.IsCommit);\n\t\t\t\tAssert.IsNull(commit.Parent);\n\t\t\t\tAssert.AreEqual(\"A. U. Thor\", commit.Author.Name);\n\t\t\t\tAssert.AreEqual(\"au@thor.com\", commit.Author.EmailAddress);\n\t\t\t\tAssert.AreEqual(\"Hello World!\", commit.Message);\n\t\t\t\t// TODO: check if tree contains for henon and for nulltoken, get the blobs and check  the content.\n\t\t\t\tAssert.AreEqual(commit, repo.Head.CurrentCommit);\n\t\t\t\tvar changes = commit.Changes.ToDictionary(change => change.Name);\n\t\t\t\tAssert.AreEqual(ChangeType.Added, changes[\"for henon.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Added, changes[\"for nulltoken.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(\"Weibier\", (changes[\"for henon.txt\"].ComparedObject as Blob).Data);\n\t\t\t\tAssert.AreEqual(\"Rotwein\", (changes[\"for nulltoken.txt\"].ComparedObject as Blob).Data);\n\t\t\t\tAssert.AreEqual(2, changes.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Commit_changes_to_existing_commit()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar workingDirectory = repo.WorkingDirectory;\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"README\");\n\t\t\t\tFile.WriteAllText(filepath, \"This is a really short readme file\\n\\nWill write up some text here.\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\t//repo.Index.Remove(Path.Combine(workingDirectory, \"a/a1\"));\n\t\t\t\tvar commit = repo.Commit(\"Adding  README\\n\\n\", new Author(\"mller\", \"mller@gitsharp.org\"));\n\t\t\t\tAssert.NotNull(commit);\n\t\t\t\tAssert.IsTrue(commit.IsCommit);\n\t\t\t\tAssert.AreEqual(commit.Parent.Hash, \"49322bb17d3acc9146f98c97d078513228bbf3c0\");\n\t\t\t\tAssert.AreEqual(\"mller\", commit.Author.Name);\n\t\t\t\tAssert.AreEqual(\"mller@gitsharp.org\", commit.Author.EmailAddress);\n\t\t\t\tAssert.AreEqual(\"Adding  README\\n\\n\", commit.Message);\n\t\t\t\t// check if tree contains the new file, get the blob and check  the content.\n\t\t\t\tAssert.AreEqual(commit, repo.Head.CurrentCommit);\n\t\t\t\tvar previous = new Commit(repo, \"HEAD^\");\n\t\t\t\tAssert.IsTrue(previous.IsCommit);\n\t\t\t\tAssert.AreEqual(previous, commit.Parent);\n\t\t\t\tvar changes = commit.CompareAgainst(previous).ToDictionary(change => change.Name);\n\t\t\t\tAssert.AreEqual(ChangeType.Added, changes[\"README\"].ChangeType);\n\t\t\t\tAssert.AreEqual(\"This is a really short readme file\\n\\nWill write up some text here.\",\n\t\t\t\t\t\t\t\t\t (changes[\"README\"].ComparedObject as Blob).Data);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"a1\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"a1.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"a2.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"b1.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"b2.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"c1.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"c2.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(ChangeType.Deleted, changes[\"master.txt\"].ChangeType);\n\t\t\t\tAssert.AreEqual(9, changes.Count);\n\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Commit_changes_to_existing_commit1()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar commit = repo.Get<Commit>(\"f73b95671f326616d66b2afb3bdfcdbbce110b44\");\n\t\t\t\tvar changes = commit.Changes.ToDictionary(change => change.Name);\n\t\t\t\tAssert.AreEqual(ChangeType.Added, changes[\"a1\"].ChangeType);\n\t\t\t\tAssert.AreEqual(1, changes.Count);\n\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Commit_changes_against_multiple_parents()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{ \n\t\t\t\t// this commit has three parents (three branches were merged together but actually nothing has changed!\n\t\t\t\tvar commit = repo.Get<Branch>(\"master\").CurrentCommit;\n\t\t\t\tAssert.AreEqual(3, commit.Parents.Count());\n\t\t\t\tvar changes = commit.Changes.ToArray();\n\t\t\t\tAssert.AreEqual(0, changes.Length);\n\n\t\t\t\t// two parents\n\t\t\t\tcommit = repo.Get<Commit>(\"0966a434eb1a025db6b71485ab63a3bfbea520b6\");\n\t\t\t\tAssert.AreEqual(2, commit.Parents.Count());\n\t\t\t\tchanges = commit.Changes.ToArray();\n\t\t\t\tAssert.AreEqual(0, changes.Length);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Checkout_Commit()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\trepo.Head.CurrentCommit.Checkout();\n\t\t\t\tAssertFileExistsInWD(\"a/a1\");\n\t\t\t\tAssertFileExistsInWD(\"a/a1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"a/a2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"b/b1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"b/b2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"c/c1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"c/c2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"master.txt\");\n\t\t\t\trepo.Head.CurrentCommit.Parent.Parent.Checkout();\n\t\t\t\tAssertFileNotExistentInWD(\"a/a1\");\n\t\t\t\tAssertFileExistsInWD(\"a/a1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"a/a2.txt\");\n\t\t\t\tAssertFileNotExistentInWD(\"b/b1.txt\");\n\t\t\t\tAssertFileNotExistentInWD(\"b/b2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"c/c1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"c/c2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"master.txt\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Checkout_Paths()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\t//repo.Head.CurrentCommit.Checkout();\n\t\t\t\tvar c = repo.Head.CurrentCommit;\n\t\t\t\tc.Checkout(\"a/a1\", \"a/a1.txt\", \"a/a2.txt\", \"master.txt\");\n\t\t\t\tAssertFileExistsInWD(\"a/a1\");\n\t\t\t\tAssertFileExistsInWD(\"a/a1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"a/a2.txt\");\n\t\t\t\tAssertFileExistsInWD(\"master.txt\");\n\t\t\t\tvar c1 = repo.Head.CurrentCommit.Parent.Parent;\n\t\t\t\tAssert.Throws(typeof(ArgumentException), () => c1.Checkout(\"b/b1.txt\"));\n\t\t\t\tAssert.Throws(typeof(ArgumentException), () => c1.Checkout(\"blahblah\"));\n\t\t\t\tc1.Checkout(\"c/c1.txt\");\n\t\t\t\tAssertFileExistsInWD(\"c/c1.txt\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Commit_ancestors()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar commit = repo.Get<Branch>(\"master\").CurrentCommit;\n\t\t\t\tvar ancestors = commit.Ancestors;\n\t\t\t\tAssert.AreNotEqual(ancestors.First().Hash, commit.Hash);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Commit_file_list()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar workingDirectory = repo.WorkingDirectory;\n\t\t\t\tstring file1 = Path.Combine(workingDirectory, \"file1\");\n\t\t\t\tstring file2 = Path.Combine(workingDirectory, \"file2\");\n\t\t\t\tFile.WriteAllText(file1, \"This is a really short readme file\\n\\nWill write up some text here.\");\n\t\t\t\tFile.WriteAllText(file2, \"This is a really short readme file\\n\\nWill write up some text here.\");\n\t\t\t\trepo.Index.Add(file1);\n\t\t\t\trepo.Index.Add(file2);\n\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue (status.Added.Contains(\"file1\"));\n\t\t\t\tAssert.IsTrue (status.Added.Contains(\"file2\"));\n\t\t\t\t\n\t\t\t\tvar commit = repo.Commit(\"Adding  README\\n\\n\", new Author(\"mller\", \"mller@gitsharp.org\"), file2);\n\t\t\t\tAssert.NotNull(commit);\n\t\t\t\tAssert.IsTrue(commit.IsCommit);\n\t\t\t\tAssert.AreEqual(commit.Parent.Hash, \"49322bb17d3acc9146f98c97d078513228bbf3c0\");\n\t\t\t\tAssert.AreEqual(\"mller\", commit.Author.Name);\n\t\t\t\tAssert.AreEqual(\"mller@gitsharp.org\", commit.Author.EmailAddress);\n\t\t\t\tAssert.AreEqual(\"Adding  README\\n\\n\", commit.Message);\n\t\t\t\t\n\t\t\t\t// Check that file1 was not committed\n\t\t\t\tstatus = repo.Status;\n\t\t\t\tAssert.IsTrue (status.Added.Contains(\"file1\"));\n\t\t\t\tAssert.IsFalse (status.Added.Contains(\"file2\"));\n\t\t\t\t\n\t\t\t\t// check if tree contains the new file, get the blob and check  the content.\n\t\t\t\tAssert.AreEqual(commit, repo.Head.CurrentCommit);\n\t\t\t\tvar previous = new Commit(repo, \"HEAD^\");\n\t\t\t\tAssert.IsTrue(previous.IsCommit);\n\t\t\t\tAssert.AreEqual(previous, commit.Parent);\n\t\t\t\tvar changes = commit.CompareAgainst(previous).ToDictionary(change => change.Name);\n\t\t\t\tAssert.AreEqual(ChangeType.Added, changes[\"file2\"].ChangeType);\n\t\t\t\tAssert.IsFalse(changes.ContainsKey (\"file1\"));\n\t\t\t\tAssert.AreEqual(\"This is a really short readme file\\n\\nWill write up some text here.\",\n\t\t\t\t\t\t\t\t\t (changes[\"file2\"].ComparedObject as Blob).Data);\n\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/DiffTests.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\t[TestFixture]\n\tpublic class DiffTests : ApiTestCase\n\t{\n\t\tconst string TEXT = @\"Player Queen:\nBoth here and hence pursue me lasting strife,\nIf once I be a widow, ever I be a wife!\n\nPlayer King:\n'Tis deeply sworn. Sweet, leave me here a while,\nMy spirits grow dull, and fain I would beguile\nThe tedious day with sleep.\n\nPlayer Queen:\nSleep rock thy brain,\nAnd never come mischance between us twain!\n\nHamlet:\nMadam, how like you this play?\n\nQueen:\nThe lady doth protest too much, methinks.\";\n\n\t\tprivate static readonly Text Text = new Text(TEXT);\n\n\t\t[Test]\n\t\tpublic void EmptyDiffTest()\n\t\t{\n\t\t\tvar diff = new Diff(\"\", \"\");\n\t\t\tAssert.IsFalse(diff.HasDifferences);\n\t\t\tAssert.AreEqual(0, diff.Sections.Count());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnchangedTest()\n\t\t{\n\t\t\tvar diff = new Diff(TEXT, TEXT);\n\t\t\tAssert.IsFalse(diff.HasDifferences);\n\t\t\tAssert.AreEqual(1, diff.Sections.Count());\n\t\t\tvar section = diff.Sections.First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Unchanged, section.Status);\n\t\t\tAssert.AreEqual(1, section.BeginA);\n\t\t\tAssert.AreEqual(1, section.BeginB);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NothingAgainstEverythingTest()\n\t\t{\n\t\t\tvar diff = new Diff(\"\", TEXT);\n\t\t\tAssert.IsTrue(diff.HasDifferences);\n\t\t\tAssert.AreEqual(1, diff.Sections.Count());\n\t\t\tvar section = diff.Sections.First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Different, section.Status);\n\t\t\tAssert.AreEqual(1, section.BeginA);\n\t\t\tAssert.AreEqual(1, section.BeginB);\n\t\t\tAssert.AreEqual(1, section.EndA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndB);\n\t\t\tAssert.AreEqual(\"\", section.TextA);\n\t\t\tAssert.AreEqual(TEXT, section.TextB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DifferenceAtTheBeginning()\n\t\t{\n\t\t\tvar diff = new Diff(TEXT, \"Quote from Hamlet:\\n\\n\" + TEXT);\n\t\t\t//DumpSections(diff);\n\t\t\tAssert.IsTrue(diff.HasDifferences);\n\t\t\tAssert.AreEqual(2, diff.Sections.Count());\n\t\t\tvar section = diff.Sections.First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Different, section.Status);\n\t\t\tAssert.AreEqual(1, section.BeginA);\n\t\t\tAssert.AreEqual(1, section.BeginB);\n\t\t\tAssert.AreEqual(1, section.EndA);\n\t\t\tAssert.AreEqual(3, section.EndB);\n\t\t\tsection = diff.Sections.Skip(1).First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Unchanged, section.Status);\n\t\t\tAssert.AreEqual(1, section.BeginA);\n\t\t\tAssert.AreEqual(3, section.BeginB);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1 + 2, section.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DifferenceAtTheEnd()\n\t\t{\n\t\t\tvar diff = new Diff(TEXT, TEXT + \"X\");\n\t\t\t//DumpSections(diff);\n\t\t\tAssert.IsTrue(diff.HasDifferences);\n\t\t\tAssert.AreEqual(2, diff.Sections.Count());\n\t\t\tvar section = diff.Sections.First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Unchanged, section.Status);\n\t\t\tAssert.AreEqual(1, section.BeginA);\n\t\t\tAssert.AreEqual(1, section.BeginB);\n\t\t\tAssert.AreEqual(Text.NumberOfLines, section.EndA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines, section.EndB);\n\t\t\tsection = diff.Sections.Skip(1).First();\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Different, section.Status);\n\t\t\tAssert.AreEqual(Text.NumberOfLines, section.BeginA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines, section.BeginB);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndA);\n\t\t\tAssert.AreEqual(Text.NumberOfLines + 1, section.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultipleReplacements()\n\t\t{\n\t\t\tvar blahblah = @\"Player Queen:\nblah blah\n\nPlayer King:\nblah blah\n   \nPlayer Queen:\nblah blah\n\nHamlet:\nblah blah\n\nQueen:\nblah blah.\";\n\t\t\tvar diff = new Diff(TEXT, blahblah);\n\t\t\t//DumpSections(diff);\n\t\t\tAssert.IsTrue(diff.HasDifferences);\n\t\t\tAssert.AreEqual(10, diff.Sections.Count());\n\t\t\tvar secs = diff.Sections.ToArray();\n\t\t\tvar section = secs[0];\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Unchanged, section.Status);\n\t\t\tAssert.AreEqual(@\"Player Queen:\n\", section.TextA);\n\t\t\tAssert.AreEqual(@\"Player Queen:\n\", section.TextB);\n\t\t\tsection = secs[1];\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Different, section.Status);\n\t\t\tAssert.AreEqual(@\"Both here and hence pursue me lasting strife,\nIf once I be a widow, ever I be a wife!\n\", section.TextA);\n\t\t\tAssert.AreEqual(@\"blah blah\n\", section.TextB);\n\t\t\tsection = secs[9];\n\t\t\tAssert.AreEqual(Diff.SectionStatus.Different, section.Status);\n\t\t\tAssert.AreEqual(\"The lady doth protest too much, methinks.\", section.TextA);\n\t\t\tAssert.AreEqual(\"blah blah.\", section.TextB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EditType()\n\t\t{\n\t\t\tvar a = \"1\\n2\\n3\\n5\\n7\\n8\\n9\\n\";\n\t\t\tvar b = \"1\\n3\\n4\\n5\\n6\\n8\\n9\\n\";\n\t\t\tvar diff = new Diff(a, b);\n\t\t\tDumpSections(diff);\n\t\t\tvar secs = diff.Sections.ToArray();\n\t\t\tvar section = secs[0];\n\t\t\tAssert.AreEqual(Diff.EditType.Unchanged, section.EditWithRespectToA);\n\t\t\tAssert.AreEqual(Diff.EditType.Unchanged, section.EditWithRespectToB);\n\t\t\tsection = secs[1];\n\t\t\tAssert.AreEqual(Diff.EditType.Deleted, section.EditWithRespectToA);\n\t\t\tAssert.AreEqual(Diff.EditType.Inserted, section.EditWithRespectToB);\n\t\t\tsection = secs[3];\n\t\t\tAssert.AreEqual(Diff.EditType.Inserted, section.EditWithRespectToA);\n\t\t\tAssert.AreEqual(Diff.EditType.Deleted, section.EditWithRespectToB);\n\t\t\tsection = secs[5];\n\t\t\tAssert.AreEqual(Diff.EditType.Replaced, section.EditWithRespectToA);\n\t\t\tAssert.AreEqual(Diff.EditType.Replaced, section.EditWithRespectToB);\n\t\t}\n\n\t\tprivate static void DumpSections(Diff diff)\n\t\t{\n\t\t\tforeach (var s in diff.Sections)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(s.Status);\n\t\t\t\tConsole.WriteLine(\"==== A ====\");\n\t\t\t\tConsole.WriteLine(\"\\\"\" + s.TextA + \"\\\"\");\n\t\t\t\tConsole.WriteLine(\"==== B ====\");\n\t\t\t\tConsole.WriteLine(\"\\\"\" + s.TextB + \"\\\"\");\n\t\t\t\tConsole.WriteLine(\"-------------------\\n\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsBinary()\n\t\t{\n\t\t\tAssert.AreEqual(true, Diff.IsBinary(\"GitSharp.dll\"));\n\t\t\tAssert.AreEqual(true, Diff.IsBinary(\"GitSharp.Core.dll\"));\n\t\t\tAssert.AreEqual(true, Diff.IsBinary(\"Resources/pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12.idx\"));\n\t\t\tAssert.AreEqual(false, Diff.IsBinary(\"Resources/Diff/E.patch\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/EncodingTests.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class EncodingTests : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void Chinese_UTF8()\n\t\t{\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"汉语repo\"); // a chinese repository\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"henon喜欢什么.txt\"); // what henon likes.txt\n\t\t\t\tFile.WriteAllText(filepath, \"我爱写汉字。\"); // i love writing chinese characters.\n\t\t\t\tstring filepath1 = Path.Combine(workingDirectory, \"nulltoken喜欢什么.txt\"); // what nulltoken likes.txt\n\t\t\t\tFile.WriteAllText(filepath1, \"他爱法国红酒。\"); // he loves french red wine.\n\t\t\t\tvar dir = Directory.CreateDirectory(Path.Combine(workingDirectory, \"啤酒\")).FullName; // creating a folder called \"beer\" \n\t\t\t\tstring filepath2 = Path.Combine(dir, \"好喝的啤酒.txt\"); // creating a file called \"good beer.txt\" in folder \"beer\"\n\t\t\t\tFile.WriteAllText(filepath2, \"青岛啤酒\"); // the file contains a chinese beer called QingDao beer \n\n\t\t\t\t// adding the files and directories we created.\n\t\t\t\tindex.Add(filepath, filepath1, dir);\n\n\t\t\t\t// checking index\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"henon喜欢什么.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"nulltoken喜欢什么.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"啤酒/好喝的啤酒.txt\"));\n\n\t\t\t\t// committing, with the message; \"China is very large. The great wall is very long. Shanghai is very pretty.\", Author: \"a student of the chinese language\"\n\t\t\t\tvar c = repo.Commit(\"中国很大。长城很长。上海很漂亮。\", new Author(\"汉语学生\", \"meinrad.recheis@gmail.com\"));\n\n\t\t\t\t// loading the commit from the repository and inspecting its contents\n\t\t\t\tvar commit = new Commit(repo, c.Hash);\n\t\t\t\tAssert.AreEqual(\"中国很大。长城很长。上海很漂亮。\", commit.Message);\n\t\t\t\tAssert.AreEqual(\"汉语学生\", commit.Author.Name);\n\t\t\t\tvar dict = commit.Tree.Leaves.ToDictionary(leaf => leaf.Name);\n\t\t\t\tAssert.AreEqual(\"我爱写汉字。\", dict[\"henon喜欢什么.txt\"].Data);\n\t\t\t\tAssert.AreEqual(\"他爱法国红酒。\", dict[\"nulltoken喜欢什么.txt\"].Data);\n\t\t\t\tTree tree = commit.Tree.Trees.First();\n\t\t\t\tAssert.AreEqual(\"啤酒\", tree.Name);\n\t\t\t\tLeaf good_beer = tree.Leaves.First();\n\t\t\t\tAssert.AreEqual(\"好喝的啤酒.txt\", good_beer.Name);\n\t\t\t\tAssert.AreEqual(Encoding.UTF8.GetBytes(\"青岛啤酒\"), good_beer.RawData);\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void French_UTF8()\n\t\t{\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"repo français\"); // a french repository\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"Émeric.txt\"); // Emeric.txt\n\t\t\t\tFile.WriteAllText(filepath, \"était ici...\"); // was here.\n\t\t\t\tvar dir = Directory.CreateDirectory(Path.Combine(workingDirectory, \"À moins\")).FullName; // unless... \n\t\t\t\tstring filepath2 = Path.Combine(dir, \"qu'il ne fût là.txt\"); // he's been there.txt\n\t\t\t\tFile.WriteAllText(filepath2, \"éèçàù\"); // the file contains a some random letters with accents \n\n\t\t\t\t// adding the files and directories we created.\n\t\t\t\tindex.Add(filepath, dir);\n\n\t\t\t\t// checking index\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"Émeric.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"À moins/qu'il ne fût là.txt\"));\n\n\t\t\t\t// committing, with the message; \"A little french touch.\", Author: \"Emeric\"\n\t\t\t\tvar c = repo.Commit(\"Une petite note française.\", new Author(\"Émeric\", \"emeric.fermas@gmail.com\"));\n\n\t\t\t\t// loading the commit from the repository and inspecting its contents\n\t\t\t\tvar commit = new Commit(repo, c.Hash);\n\t\t\t\tAssert.AreEqual(\"Une petite note française.\", commit.Message);\n\t\t\t\tAssert.AreEqual(\"Émeric\", commit.Author.Name);\n\t\t\t\tvar dict = commit.Tree.Leaves.ToDictionary(leaf => leaf.Name);\n\t\t\t\tAssert.AreEqual(\"était ici...\", dict[\"Émeric.txt\"].Data);\n\t\t\t\tTree tree = commit.Tree.Trees.First();\n\t\t\t\tAssert.AreEqual(\"À moins\", tree.Name);\n\t\t\t\tLeaf file3 = tree.Leaves.First();\n\t\t\t\tAssert.AreEqual(\"qu'il ne fût là.txt\", file3.Name);\n\t\t\t\tAssert.AreEqual(Encoding.UTF8.GetBytes(\"éèçàù\"), file3.RawData);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Japanese_ShiftJIS()\n\t\t{\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"Shift_JIS_Repo\");\n\t\t\tusing (Repository repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\t//repo.PreferredEncoding = Encoding.GetEncoding(\"Shift_JIS\");\n\t\t\t\tEncoding shiftJIS = Encoding.GetEncoding(\"Shift_JIS\");\n\n\t\t\t\tvar e = Encoding.Default;\n\n\t\t\t\t//var rabbit = UTF8_to_ShiftJIS_filename(\"ウサギちゃん/Rabbitはウサギです.txt\");\n\t\t\t\t//var filepath = Path.Combine(workingDirectory, rabbit);\n\t\t\t\t//Directory.CreateDirectory(Path.GetDirectoryName(filepath));\n\t\t\t\t//File.Copy(Path.Combine(@\"Resources\\encodingTestData\\Shift_JIS\", rabbit), filepath);\n\n\t\t\t\t// Adding an encoded file to the index without relying on the filesystem\n\t\t\t\trepo.Index.AddContent(UTF8_to_ShiftJIS(\"ウサギちゃん/Rabbitはウサギです.txt\"), new byte[0]);\n\n\t\t\t\tvar shinjuku_sanchome = UTF8_to_ShiftJIS_filename(\"東京都/新宿三丁目.txt\");\n\t\t\t\tvar filepath1 = Path.Combine(workingDirectory, shinjuku_sanchome);\n\t\t\t\tDirectory.CreateDirectory(Path.GetDirectoryName(filepath1));\n\t\t\t\tFile.WriteAllText(filepath1, \"ラビットis usagi desu.\", shiftJIS);\n\n\t\t\t\t// Adding an encoded file to the index from the filesystem\n\t\t\t\trepo.Index.Add(filepath1);\n\n\t\t\t\tvar msg = \"Hello World!日本からShift_JISのためをコミットしました\";\n\t\t\t\tvar name = \"ポウルス\";\n\t\t\t\tvar commit = repo.Commit(msg, new Author(name, \"paupaw@tokyo-dome.com\"));\n\n\t\t\t\t// TODO: set the breakpoint here and check out the test repository. Is it readable on your system with msysgit?\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CanReadFromMsysGitJapaneseRepository()\n\t\t{\n\t\t\t//setup of .git directory\n\t\t\tvar resource =\n\t\t\t\t new DirectoryInfo(Path.Combine(Path.Combine(Environment.CurrentDirectory, \"Resources\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \"JapaneseRepo\"));\n\t\t\tvar tempRepository =\n\t\t\t\t new DirectoryInfo(Path.Combine(trash.FullName, \"JapaneseRepo\" + Path.GetRandomFileName()));\n\t\t\tCopyDirectory(resource.FullName, tempRepository.FullName);\n\n\t\t\tvar repositoryPath = new DirectoryInfo(Path.Combine(tempRepository.FullName, Constants.DOT_GIT));\n\t\t\tDirectory.Move(repositoryPath.FullName + \"ted\", repositoryPath.FullName);\n\t\t\tusing (Repository repo = new Repository(tempRepository.FullName))\n\t\t\t{\n\t\t\t\tstring commitHash = \"24ed0e20ceff5e2cdf768345b6853213f840ff8f\";\n\n\t\t\t\tvar commit = new Commit(repo, commitHash);\n\t\t\t\tAssert.AreEqual(\"コミットのメッセージも日本語でやてみました。\\n\", commit.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CommitHonorsConfigCommitEncoding()\n\t\t{\n\t\t\tstring workingDirectory = Path.Combine(trash.FullName, Path.GetRandomFileName());\n\n\t\t\t// Creating a new repo\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\t// Setting the in-memory commitencoding configuration entry\n\t\t\t\trepo.Config[\"i18n.commitencoding\"] = \"ISO-8859-2\";\n\n\t\t\t\t// Adding a new file to the filesystem\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"a file.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"content\");\n\n\t\t\t\t// Adding the new file to index\n\t\t\t\trepo.Index.Add(filepath);\n\n\t\t\t\t// Committing\n\t\t\t\tstring message = \"Jak se máš?\\n\\nMám se dobře.\";\n\t\t\t\tCommit c = repo.Commit(message, new Author(\"nulltoken\", \"emeric.fermas@gmail.com\")); //How are you? I'm fine.\n\n\t\t\t\t// Loading the commit\n\t\t\t\tvar commit = new Commit(repo, c.Hash);\n\n\t\t\t\tAssert.AreEqual(\"ISO-8859-2\", commit.Encoding.WebName.ToUpperInvariant());\n\n\t\t\t\tvar blob = new Blob(repo, c.Hash);\n\t\t\t\tvar messageBytes = new byte[message.Length];\n\t\t\t\tArray.Copy(blob.RawData, 190, messageBytes, 0, message.Length);\n\n\t\t\t\tAssert.IsTrue(Encoding.GetEncoding(\"ISO-8859-2\").GetBytes(message).SequenceEqual(messageBytes));\n\t\t\t}\n\t\t}\n\n\t\t/* ... [henon] commented out because the shiftJIS encoded resource filenames are not portable accross cultures \n\t\t\t\t  [Test]\n\t\t\t\t  public void Commit_into_empty_repository_forShiftJIS()\n\t\t\t\t  {\n\t\t\t\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"Shift_JISEncodingTest\");\n\t\t\t\t\t\tusing (Repository repo = Repository.Init(workingDirectory))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t Encoding shiftJISEncoding = Encoding.GetEncoding(\"Shift_JIS\");\n\n\t\t\t\t\t\t\t string filepath = Path.Combine(workingDirectory, @\"Resources\\encodingTestData\\Shift_JIS\\ウサギちゃん\\Rabbitはウサギです.txt\");\n\t\t\t\t\t\t\t System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filepath));\n\t\t\t\t\t\t\t System.IO.File.Copy(@\"Resources\\encodingTestData\\Shift_JIS\\ウサギちゃん\\Rabbitはウサギです.txt\", filepath);\n\t\t\t\t\t\t\t repo.Index.Add(filepath); //Add using UTF-8 params, but the file itself is Shift_JIS.. heh!?\n\n\t\t\t\t\t\t\t string filepath1 = Path.Combine(workingDirectory, @\"Resources\\encodingTestData\\Shift_JIS\\東京都\\新宿三丁目.txt\");\n\t\t\t\t\t\t\t System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filepath1));\n\t\t\t\t\t\t\t System.IO.File.Copy(@\"Resources\\encodingTestData\\Shift_JIS\\東京都\\新宿三丁目.txt\", filepath1);\n\t\t\t\t\t\t\t repo.Index.Add(filepath1); //Add using UTF-8 params, but the file itself is Shift_JIS.. heh!?\n\n\t\t\t\t\t\t\t var commit = repo.Commit(\"Hello World!日本からShift_JISのためをコミットしました\", new Author(\"ポウルス\", \"paupaw@tokyo-dome.com\"));\n\t\t\t\t\t\t\t Assert.NotNull(commit);\n\t\t\t\t\t\t\t Assert.IsTrue(commit.IsCommit);\n\t\t\t\t\t\t\t Assert.IsNull(commit.Parent);\n\t\t\t\t\t\t\t Assert.AreEqual(\"ポウルス\", commit.Author.Name);\n\t\t\t\t\t\t\t Assert.AreEqual(\"paupaw@tokyo-dome.com\", commit.Author.EmailAddress);\n\t\t\t\t\t\t\t Assert.AreEqual(\"Hello World!日本からShift_JISのためをコミットしました\", commit.Message);\n\t\t\t\t\t\t\t // TODO: check if tree contains for henon and for nulltoken, get the blobs and check  the content.\n\t\t\t\t\t\t\t Assert.AreEqual(commit, repo.Head.CurrentCommit);\n\t\t\t\t\t\t\t var changes = commit.Changes.ToDictionary(change => change.Name);\n\t\t\t\t\t\t\t Assert.AreEqual(ChangeType.Added, changes[\"Rabbitはウサギです.txt\"].ChangeType);\n\t\t\t\t\t\t\t Assert.AreEqual(ChangeType.Added, changes[\"新宿三丁目.txt\"].ChangeType);\n\t\t\t\t\t\t\t Assert.AreEqual(Encoding.UTF8.GetBytes(\"ラビットis usagi desu.\"), Encoding.Convert(shiftJISEncoding, Encoding.UTF8, (changes[\"Rabbitはウサギです.txt\"].ComparedObject as Blob).RawData)); //Convert from Shift_JIS to UTF-8\n\t\t\t\t\t\t\t Assert.AreEqual(Encoding.UTF8.GetBytes(\"電車で行きます。\"), Encoding.Convert(shiftJISEncoding, Encoding.UTF8, (changes[\"新宿三丁目.txt\"].ComparedObject as Blob).RawData)); //Convert from Shift_JIS to UTF-8\n\t\t\t\t\t\t\t Assert.AreEqual(2, changes.Count);\n\t\t\t\t\t\t}\n\t\t\t\t  }\n\n\t\t */\n\t\t//[Test]\n\t\t//public void Commit_into_empty_repository_forShiftJis1()\n\t\t//{\n\t\t//    var workingDirectory = Path.Combine(trash.FullName, \"test1\");\n\t\t//    using (Repository repo = Repository.Init(workingDirectory))\n\t\t//    {\n\t\t//        //GitSharp.Core.Constants.setCHARSET(\"Shift_JIS\");\n\t\t//        string filepath = Path.Combine(workingDirectory, \"for henon.txt\");\n\t\t//        File.WriteAllText(filepath, \"Weißbier\");\n\t\t//        repo.Index.Add(filepath);\n\t\t//        string filepath1 = Path.Combine(workingDirectory, \"for nulltoken.txt\");\n\t\t//        File.WriteAllText(filepath1, \"Rotwein\");\n\t\t//        repo.Index.Add(filepath1);\n\t\t//        string filepath2 = Path.Combine(workingDirectory, \"俺のためだ.txt\");\n\t\t//        File.WriteAllText(filepath2, \"西東京市\");\n\t\t//        repo.Index.Add(filepath2);\n\t\t//        var commit = repo.Commit(\"Hello World!日本からShift_JISのためをコミットしました\", new Author(\"ポウルス\", \"paupaw@tokyo-dome.com\"));\n\t\t//        Assert.NotNull(commit);\n\t\t//        Assert.IsTrue(commit.IsCommit);\n\t\t//        Assert.IsNull(commit.Parent);\n\t\t//        Assert.AreEqual(\"ポウルス\", commit.Author.Name);\n\t\t//        Assert.AreEqual(\"paupaw@tokyo-dome.com\", commit.Author.EmailAddress);\n\t\t//        Assert.AreEqual(\"Hello World!日本からShift_JISのためをコミットしました\", commit.Message);\n\t\t//        // TODO: check if tree contains for henon and for nulltoken, get the blobs and check  the content.\n\t\t//        Assert.AreEqual(commit, repo.Head.CurrentCommit);\n\t\t//        var changes = commit.Changes.ToDictionary(change => change.Name);\n\t\t//        Assert.AreEqual(ChangeType.Added, changes[\"for henon.txt\"].ChangeType);\n\t\t//        Assert.AreEqual(ChangeType.Added, changes[\"for nulltoken.txt\"].ChangeType);\n\t\t//        Assert.AreEqual(ChangeType.Added, changes[\"俺のためだ.txt\"].ChangeType);\n\t\t//        Assert.AreEqual(\"Weißbier\", (changes[\"for henon.txt\"].ComparedObject as Blob).Data);\n\t\t//        Assert.AreEqual(\"Rotwein\", (changes[\"for nulltoken.txt\"].ComparedObject as Blob).Data);\n\t\t//        Assert.AreEqual(\"西東京市\", (changes[\"俺のためだ.txt\"].ComparedObject as Blob).Data);\n\t\t//        Assert.AreEqual(3, changes.Count);\n\t\t//    }\n\t\t//}\n\n\t\tprivate static string UTF8_to_ShiftJIS_filename(string utf8_japanese)\n\t\t{\n\t\t\tEncoding shiftJISEncoding = Encoding.GetEncoding(\"Shift_JIS\");\n\t\t\treturn Encoding.Default.GetString(Encoding.Convert(Encoding.UTF8, shiftJISEncoding, Encoding.UTF8.GetBytes(utf8_japanese)));\n\t\t}\n\n\t\tprivate static byte[] UTF8_to_ShiftJIS(string utf8_japanese)\n\t\t{\n\t\t\treturn Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding(\"Shift_JIS\"), Encoding.UTF8.GetBytes(utf8_japanese));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/FindGitDirectoryTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Commands;\nusing GitSharp.Core;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n    [TestFixture]\n    public class FindGitDirectoryTests : GitSharp.Core.Tests.RepositoryTestCase\n    {\n        [Test]\n        public void Honors_environment_variable_GIT_DIR()\n        {\n            //Store GIT_DIR value temporarily\n            string tempGitDir = System.Environment.GetEnvironmentVariable(\"GIT_DIR\");\n            try\n            {\n                var path = Path.Combine(Directory.GetCurrentDirectory(), \"test1\");\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", path);\n                Git.DefaultGitDirectory = null; // override fallback\n                Assert.AreEqual(path + Constants.DOT_GIT_EXT, AbstractCommand.FindGitDirectory(null, false, true));\n                Assert.AreEqual(Path.Combine(path, Constants.DOT_GIT), AbstractCommand.FindGitDirectory(null, false, false));\n            }\n            finally\n            {\n                //Reset GIT_DIR value to initial value before the test\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", tempGitDir);\n            }\n        }\n\n        [Test]\n        public void Honors_CurrentDirectory()\n        {\n            string tempGitDir = System.Environment.GetEnvironmentVariable(\"GIT_DIR\");\n            try\n            {\n                //current directory is returned only if path, global fallback and envvar are all null\n                Git.DefaultGitDirectory = null; // override fallback\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", null); // override environment\n                var path = Directory.GetCurrentDirectory();\n                Assert.IsFalse(path.EndsWith(\"git\")); // <--- this should be the case anyway, but if not the next assertion would not pass correctly\n                Assert.AreEqual(Directory.GetCurrentDirectory() + Constants.DOT_GIT_EXT, AbstractCommand.FindGitDirectory(null, false, true));\n                Assert.AreEqual(Path.Combine(Directory.GetCurrentDirectory(), Constants.DOT_GIT), AbstractCommand.FindGitDirectory(null, false, false));\n            }\n            finally\n            {\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", tempGitDir);\n            }\n        }\n\n        [Test]\n        public void Explicit_path_is_preferred()\n        {\n            // it should override global fallback\n            Git.DefaultGitDirectory = \"abc/def/ghi\";\n            Assert.AreEqual(\"xyz.git\", AbstractCommand.FindGitDirectory(\"xyz\", false, true));\n            Assert.AreEqual(Path.Combine(\"xyz\",Constants.DOT_GIT), AbstractCommand.FindGitDirectory(\"xyz\", false, false));\n\n            // it should override env var\n            Git.DefaultGitDirectory = null;\n            string tempGitDir = System.Environment.GetEnvironmentVariable(\"GIT_DIR\");\n            try\n            {\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", \"uvw\");\n                Assert.AreEqual(\"xyz.git\", AbstractCommand.FindGitDirectory(\"xyz\", false, true));\n                Assert.AreEqual(Path.Combine(\"xyz\", Constants.DOT_GIT), AbstractCommand.FindGitDirectory(\"xyz\", false, false));\n            }\n            finally\n            {\n                System.Environment.SetEnvironmentVariable(\"GIT_DIR\", tempGitDir);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/IgnoreTests.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Matt DeKrey <mattdekrey@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class IgnoreTests\n\t{\n\t\t[Test]\n\t\tpublic void TestIgnore()\n\t\t{\n\t\t\tIgnoreRules rules = GetRules();\n\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/Documentation/foo.html\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/Documentation/gitignore.html\"));\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/src/Documentation/index.html\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/Documentation/index.html\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/gitignore.html\"));\n\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/file.o\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/lib.a\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreFile(\"project/\", \"project/src/internal.o\"));\n\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/Program.cs\"));\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/Program.suo\"));\n\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/bin\"));\n\t\t\tAssert.AreEqual(false, rules.IgnoreDir(\"project/\", \"project/bin\"));\n\t\t\tAssert.AreEqual(false, rules.IgnoreFile(\"project/\", \"project/data/bin\"));\n\t\t}\n\n\t\t[Ignore(\"we need to improve IgnoreRules or IgnoreHandler to handle such cases\")]\n\t\t[Test]\n\t\tpublic void TestIgnore1()\n\t\t{\n\t\t\tIgnoreRules rules = GetRules();\n\t\t\tAssert.AreEqual(true, rules.IgnoreDir(\"project/\", \"project/src/bin\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreDir(\"project/\", \"project/src/bin/Project.dll\"));\n\t\t\tAssert.AreEqual(true, rules.IgnoreDir(\"project/\", \"project/src/bin/Project.pdb\"));\n\t\t}\n\n\n\t\tprivate static IgnoreRules GetRules()\n\t\t{\n\t\t\treturn new GitSharp.IgnoreRules(new string[] {\n\t\t\t\t\"*.[oa]\", // ignore all *.o and *.a files\n\t\t\t\t\"#!*.[oa]\", // make sure comments are followed\n\t\t\t\t\"*.html\", // ignore all *.html\n\t\t\t\t\"!foo.html\", // except when they're foo.html\n\t\t\t\t\"!Documentation/index.html\", // and except when they're the index file in any Documentation directory\n\t\t\t\t\"/Documentation/index.html\", // unless it's the root's Documentation/index.html\n\t\t\t\t\"bin/\", // ignore bin directories and all paths under them\n\t\t\t\t\"!/bin/\", // except if it's in the root\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/IndexTest.cs",
    "content": "/*\n * Copyright (C) 2009, nulltoken <emeric.fermas@gmail.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing GitSharp.Core.Tests;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class IndexTest : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void IndexAdd()\n\t\t{\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar index_path = Path.Combine(repo.Directory, \"index\");\n\t\t\t\tvar old_index = Path.Combine(repo.Directory, \"old_index\");\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Write(); // write empty index\n\t\t\t\tnew FileInfo(index_path).CopyTo(old_index);\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"for henon.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"Weibier\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\t// now verify\n\t\t\t\tAssert.IsTrue(new FileInfo(index_path).Exists);\n\t\t\t\tAssert.AreNotEqual(File.ReadAllBytes(old_index), File.ReadAllBytes(index_path));\n\n\t\t\t\t// make another addition\n\t\t\t\tvar index_1 = Path.Combine(repo.Directory, \"index_1\");\n\t\t\t\tnew FileInfo(index_path).CopyTo(index_1);\n\t\t\t\tstring filepath1 = Path.Combine(workingDirectory, \"for nulltoken.txt\");\n\t\t\t\tFile.WriteAllText(filepath1, \"Rotwein\");\n\t\t\t\tindex = new Index(repo);\n\t\t\t\tindex.Add(filepath1);\n\t\t\t\tAssert.AreNotEqual(File.ReadAllBytes(index_1), File.ReadAllBytes(index_path));\n\t\t\t\tAssert.DoesNotThrow(() => repo.Index.Read());\n\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"for henon.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"for nulltoken.txt\"));\n\t\t\t\tAssert.AreEqual(2, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Read_write_empty_index()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index_path = Path.Combine(repo.Directory, \"index\");\n\t\t\t\tvar old_index = Path.Combine(repo.Directory, \"old_index\");\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Write(); // write empty index\n\t\t\t\tAssert.IsTrue(new FileInfo(index_path).Exists);\n\t\t\t\tnew FileInfo(index_path).MoveTo(old_index);\n\t\t\t\tAssert.IsFalse(new FileInfo(index_path).Exists);\n\n\t\t\t\tusing (var repo2 = new Repository(repo.Directory))\n\t\t\t\t{\n\t\t\t\t\tIndex new_index = repo2.Index;\n\t\t\t\t\tnew_index.Write(); // see if the read index is rewritten identitcally\n\t\t\t\t}\n\n\t\t\t\tAssert.IsTrue(new FileInfo(index_path).Exists);\n\t\t\t\tAssert.AreEqual(File.ReadAllBytes(old_index), File.ReadAllBytes(index_path));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Diff_special_msysgit_index()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index_path = Path.Combine(repo.Directory, \"index\");\n\t\t\t\tnew FileInfo(\"Resources/index_originating_from_msysgit\").CopyTo(index_path);\n\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tvar added = new HashSet<string>\n                                {\n                                    \"New Folder/New Ruby Program.rb\",\n                                    \"for henon.txt\",\n                                    \"test.cmd\",\n                                };\n\t\t\t\tvar removed = new HashSet<string>\n                                  {\n                                      \"a/a1\",\n                                      \"a/a1.txt\",\n                                      \"a/a2.txt\",\n                                      \"b/b1.txt\",\n                                      \"b/b2.txt\",\n                                      \"c/c1.txt\",\n                                      \"c/c2.txt\",\n                                      \"master.txt\"\n                                  };\n\n\t\t\t\tAssert.IsTrue(added.SetEquals(status.Added));\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.IsTrue(added.SetEquals(status.Missing));\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.IsTrue(removed.SetEquals(status.Removed));\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This testcase shows how to interact with the index without a working directory\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Add_and_Commit_directly()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.AddContent(\"I/am/a.file\", \"and this is the content\\nin me.\");\n\t\t\t\tAssert.AreEqual(\"and this is the content\\nin me.\", index.GetContent(\"I/am/a.file\"));\n\t\t\t\tAssert.AreEqual(new[] { \"I/am/a.file\" }, index.Entries);\n\t\t\t\tAssert.IsTrue(index[\"I/am/a.file\"].IsBlob);\n\n\t\t\t\tstring iAmAFile = string.Format(\"I{0}am{0}a.file\", Path.DirectorySeparatorChar);\n\t\t\t\tAssert.AreEqual(index[\"I/am/a.file\"], index[iAmAFile]); // internal git slash conversion\n\n\t\t\t\trepo.Commit(\"committing our new file which is not actually present in the working directory.\");\n\t\t\t\tAssert.AreEqual(new[] { \"I/am/a.file\" }, index.Entries);\n\t\t\t\trepo.SwitchToBranch(repo.CurrentBranch);\n\t\t\t\tAssert.IsTrue(new FileInfo(Path.Combine(repo.WorkingDirectory, \"I/am/a.file\")).Exists);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Access_Index_Members()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\trepo.SwitchToBranch(\"master\");\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tAssert.AreEqual(new[] { \"a/a1\", \"a/a1.txt\", \"a/a2.txt\", \"b/b1.txt\", \"b/b2.txt\", \"c/c1.txt\", \"c/c2.txt\", \"master.txt\" }, index.Entries);\n\t\t\t\tAssert.IsTrue(index[\"a/a1\"].IsBlob);\n\t\t\t\tAssert.IsTrue(index[\"master.txt\"].IsBlob);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Stage_Unstage()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar foo_bar = \"foo/bar\" + Path.GetRandomFileName();\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.AddContent(foo_bar, \"baz\");\n\t\t\t\tAssert.AreEqual(\"baz\", index.GetContent(foo_bar));\n\t\t\t\trepo.Commit(\"committing ... \", Author.Anonymous);\n\t\t\t\tindex.StageContent(foo_bar, \"buzz\");\n\t\t\t\tAssert.AreEqual(\"buzz\", index.GetContent(foo_bar));\n\t\t\t\tindex.Unstage(foo_bar);\n\t\t\t\tAssert.AreEqual(\"baz\", index.GetContent(foo_bar));\n\t\t\t\tindex.Unstage(foo_bar); // <--- unstage on committed file has no effect. to remove a file completely from the index we need to use remove\n\t\t\t\tAssert.AreEqual(\"baz\", index.GetContent(foo_bar));\n\t\t\t\tindex.Remove(foo_bar);\n\t\t\t\tAssert.IsNull(index.GetContent(foo_bar));\n\t\t\t\tvar added_file = \"some/new/content/Added.txt\";\n\t\t\t\tindex.AddContent(added_file, \"\");\n\t\t\t\tindex.Unstage(added_file);\n\t\t\t\tAssert.IsNull(index.GetContent(added_file));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Checkout_From_Index()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\t// first adding content to the index without relying on the file system\n\t\t\t\tindex.AddContent(\"foo/bar\", \"baz\");\n\t\t\t\tindex.StageContent(\"foo/bar\", \"buzz\");\n\t\t\t\tindex.AddContent(\"hmm.txt\", \"\");\n\t\t\t\t// then check out and see if the files exist in the working directory\n\t\t\t\tindex.Checkout();\n\t\t\t\tAssertFileExistsInWD(\"foo/bar\");\n\t\t\t\tAssertFileContentInWDEquals(\"foo/bar\", \"buzz\");\n\t\t\t\tAssertFileExistsInWD(\"hmm.txt\");\n\t\t\t\tAssertFileContentInWDEquals(\"hmm.txt\", \"\");\n\t\t\t\t// check out again, nothing should change\n\t\t\t\tindex.Checkout();\n\t\t\t\tAssertFileExistsInWD(\"foo/bar\");\n\t\t\t\tAssertFileContentInWDEquals(\"foo/bar\", \"buzz\");\n\t\t\t\tAssertFileExistsInWD(\"hmm.txt\");\n\t\t\t\tAssertFileContentInWDEquals(\"hmm.txt\", \"\");\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void Checkout_Single_Files_From_Index()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\t// first adding content to the index without relying on the file system\n\t\t\t\tindex.AddContent(\"foo/bar\", \"baz\");\n\t\t\t\tindex.StageContent(\"foo/bar\", \"buzz\");\n\t\t\t\tindex.AddContent(\"hmm.txt\", \"\");\n\t\t\t\tindex.Checkout(\"foo/bar\");\n\t\t\t\tAssertFileExistsInWD(\"foo/bar\");\n\t\t\t\tAssertFileNotExistentInWD(\"hmm.txt\");\n\t\t\t\tAssertFileContentInWDEquals(\"foo/bar\", \"buzz\");\n\t\t\t\tindex.Checkout(\"hmm.txt\");\n\t\t\t\tAssertFileExistsInWD(\"hmm.txt\");\n\t\t\t\tAssertFileContentInWDEquals(\"hmm.txt\", \"\");\n\t\t\t}\n\t\t}\n\n\t\t// AddAll tests\n\n\t\t[Test]\n\t\tpublic void AddAll_No_New_Files()\n\t\t{\n\t\t\t// test AddAll with empty directory results in no differences\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsFalse(status.AnyDifferences);\n\t\t\t\t// verify AddAll does nothing as there have been no changes made\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tAssert.IsFalse(status.AnyDifferences);\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_New_Files()\n\t\t{\n\t\t\t// test AddAll with one new file in the directory retults in one added file and is flagged as a difference\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar filePath = Path.Combine(repo.WorkingDirectory, \"testfile.txt\");\n\t\t\t\tFile.WriteAllText(filePath, \"Unadded file\");\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\t// there should be 1 added file\n\t\t\t\tAssert.AreEqual(1, status.Added.Count);\n\t\t\t\t// the added file must be the file that was just added\n\t\t\t\tstatus.Added.Contains(filePath);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_New_Directory()\n\t\t{\n\t\t\t// test AddAll with one new direcotry is flagged as a new add\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar dirPath = Path.Combine(repo.WorkingDirectory, \"testdir\");\n\t\t\t\tDirectory.CreateDirectory(dirPath);\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsFalse(status.AnyDifferences);\n\t\t\t\t// there should be 0 added file\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\t// the added direcotry must be the directory that was just added\n\t\t\t\tstatus.Added.Contains(dirPath);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_New_Directory_With_File()\n\t\t{\n\t\t\t// test AddAll with one new directory and a new file inside the directory\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar dirPath = Path.Combine(repo.WorkingDirectory, \"testdir\");\n\t\t\t\tDirectory.CreateDirectory(dirPath);\n\t\t\t\tvar filePath = Path.Combine(dirPath, \"testfile.txt\");\n\t\t\t\tFile.WriteAllText(filePath, \"Unadded file\");\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\t// there should be 1 added files\n\t\t\t\tAssert.AreEqual(1, status.Added.Count);\n\t\t\t\t// the added file must be the file that was just added\n\t\t\t\tstatus.Added.Contains(filePath);\n\t\t\t\tstatus.Added.Contains(dirPath);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_New_File_And_New_Directory_With_File()\n\t\t{\n\t\t\t// test AddAll with one file, one new directory and a new file inside that directory\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar filePath = Path.Combine(repo.WorkingDirectory, \"testfile.txt\");\n\t\t\t\tvar dirPath = Path.Combine(repo.WorkingDirectory, \"testdir\");\n\t\t\t\tvar filePath2 = Path.Combine(dirPath, \"testfile.txt\");\n\t\t\t\tFile.WriteAllText(filePath, \"Unadded file\");\n\t\t\t\tDirectory.CreateDirectory(dirPath);\n\t\t\t\tFile.WriteAllText(filePath2, \"Unadded file\");\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\t// there should be 2 added files\n\t\t\t\tAssert.AreEqual(2, status.Added.Count);\n\t\t\t\t// the added file must be the file that was just added\n\t\t\t\tstatus.Added.Contains(filePath);\n\t\t\t\tstatus.Added.Contains(filePath2);\n\t\t\t\tstatus.Added.Contains(dirPath);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_Directory_Recursive()\n\t\t{\n\t\t\t// test AddAll with one new directory with a directory within it and each these directories containing a new file within it\n\t\t\t// root folder also contains one new file\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar dirPath = Path.Combine(repo.WorkingDirectory, \"testdir\");\n\t\t\t\tvar dirPath2 = Path.Combine(dirPath, \"testdir2\");\n\t\t\t\tvar filePath = Path.Combine(repo.WorkingDirectory, \"testfile.txt\");\n\t\t\t\tvar filePath2 = Path.Combine(dirPath, \"testfile.txt\");\n\t\t\t\tvar filePath3 = Path.Combine(dirPath2, \"testfile.txt\");\n\t\t\t\tDirectory.CreateDirectory(dirPath);\n\t\t\t\tDirectory.CreateDirectory(dirPath2);\n\t\t\t\tFile.WriteAllText(filePath, \"Unadded file\");\n\t\t\t\tFile.WriteAllText(filePath2, \"Unadded file\");\n\t\t\t\tFile.WriteAllText(filePath3, \"Unadded file\");\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\t// there should be 3 added files\n\t\t\t\tAssert.AreEqual(3, status.Added.Count);\n\t\t\t\t// the added file must be the file that was just added\n\t\t\t\tstatus.Added.Contains(dirPath);\n\t\t\t\tstatus.Added.Contains(dirPath2);\n\t\t\t\tstatus.Added.Contains(filePath);\n\t\t\t\tstatus.Added.Contains(filePath2);\n\t\t\t\tstatus.Added.Contains(filePath3);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAll_Ignore_Files()\n\t\t{\n\t\t\t// test AddAll files added to the DOT_IGNORE file\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\tvar ignoreFilePath = Path.Combine(repo.WorkingDirectory, GitSharp.Core.Constants.GITIGNORE_FILENAME);\n\t\t\t\t// add the name of the test file to the ignore list\n\t\t\t\tFile.WriteAllText(ignoreFilePath, \"*.txt\");\n\t\t\t\trepo.Index.Add(ignoreFilePath);\n\t\t\t\trepo.Commit(\"Committing .gitignore file so it won't show up as untracked file\");\n\t\t\t\tvar filePath = Path.Combine(repo.WorkingDirectory, \"testfile.txt\");\n\t\t\t\tFile.WriteAllText(filePath, \"Unadded file\");\n\t\t\t\trepo.Index.AddAll();\n\t\t\t\tvar status = new RepositoryStatus(repo);\n\t\t\t\t// no changes are the file should be ignored\n\t\t\t\tAssert.IsFalse(status.AnyDifferences);\n\t\t\t\t// there should be 0 added file\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\t// no other changes\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t// TODO: test add's behavior on wrong input data\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/InitTests.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n    [TestFixture]\n    public class InitTests : GitSharp.Core.Tests.RepositoryTestCase\n    {\n\n        [Test]\n        public void IsBare()\n        {\n            //Test bare repository\n            bool bare = true;\n            var path = Path.Combine(trash.FullName, \"test.git\");\n            using (var repo = Repository.Init(path, bare))\n            {\n                Assert.IsTrue(repo.IsBare);\n            }\n        }\n\n        [Test]\n        public void IsNonBare()\n        {\n            //Test non-bare repository\n            bool bare = false;\n            var path = Path.Combine(trash.FullName, \"test\");\n            using (var repo = Repository.Init(path, bare))\n            {\n                Assert.IsFalse(repo.IsBare);\n            }\n        }\n\n\n        [Test]\n        public void IsBareValid()\n        {\n            //Test bare repository\n            bool bare = true;\n            var path = Path.Combine(trash.FullName, \"test.git\");\n            using (var repo = Repository.Init(path, bare))\n            {\n                Assert.IsTrue(repo.IsBare);\n                Assert.IsTrue(Repository.IsValid(repo.Directory, bare));\n            }\n        }\n\n        [Test]\n        public void IsNonBareValid()\n        {\n            //Test non-bare repository\n            bool bare = false;\n            var path = Path.Combine(trash.FullName, \"test\");\n            using (var repo = Repository.Init(path, bare))\n            {\n                Assert.IsFalse(repo.IsBare);\n                Assert.IsTrue(Repository.IsValid(repo.Directory, bare));\n            }\n        }\n\t\t\n\t\t[Test]\n\t\tpublic void ReinitializeDoesNotResetHead()\n\t\t{\n\t\t\tsetUp();\n\t\t\tvar workingDirectory = Path.Combine(trash.FullName, \"test\");\n\t\t\tusing (var repo = Repository.Init(workingDirectory, false))\n\t\t\t{\n\t\t\t\tstring filepath = Path.Combine(workingDirectory, \"for henon.txt\");\n\t\t\t\tFile.WriteAllText(filepath, \"Weißbier\");\n\t\t\t\trepo.Index.Add(filepath);\n\t\t\t\trepo.Commit(\"yargbots\", new Author(\"test author\", \"test_author@example.com\"));\n\t\t\t\tAssert.IsNotNull(repo.Head.CurrentCommit);\n\t\t\t\tvar b = Branch.Create(repo, \"foo\");\n\t\t\t\t\n\t\t\t\trepo.SwitchToBranch(\"foo\");\n\t\t\t\t\n\t\t\t\tAssert.AreEqual(repo.CurrentBranch.Name, \"foo\");\n\t\t\t\t\n\t\t\t\tusing (var repo2 = Repository.Init(workingDirectory, false))\n\t\t\t\t{\n\t\t\t\t\tAssert.AreEqual(repo2.CurrentBranch.Name, \"foo\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/MergeTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Commands;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\t[TestFixture]\n\tpublic class MergeTests : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void MergeStrategyOurs()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar a = repo.Get<Branch>(\"a\");\n\t\t\t\tvar c = repo.Get<Branch>(\"c\");\n\t\t\t\tvar result = a.Merge(c, MergeStrategy.Ours);\n\t\t\t\tAssert.IsTrue(result.Success);\n\t\t\t\tAssert.AreEqual(repo.Get<Branch>(\"a^\").CurrentCommit.Tree, a.CurrentCommit.Tree);\n\t\t\t\tAssert.AreEqual(2, a.CurrentCommit.Parents.Count());\n\t\t\t\tAssert.AreEqual(\"Merge branch 'c' into a\", result.Commit.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MergeStrategyTheirs()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar a = repo.Get<Branch>(\"a\");\n\t\t\t\tvar c = repo.Get<Branch>(\"c\");\n\t\t\t\tvar result = a.Merge(c, MergeStrategy.Theirs);\n\t\t\t\tAssert.IsTrue(result.Success);\n\t\t\t\tAssert.AreEqual(repo.Get<Branch>(\"c\").CurrentCommit.Tree, a.CurrentCommit.Tree);\n\t\t\t\tAssert.AreEqual(2, a.CurrentCommit.Parents.Count());\n\t\t\t\tAssert.AreEqual(\"Merge branch 'c' into a\", result.Commit.Message);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When not allowing a fast forward merge, a new commit is created the merged commits as parent.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void MergeStrategyRecursive_FastForwardOff()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar a = repo.Get<Branch>(\"a\");\n\t\t\t\tvar c = repo.Get<Branch>(\"c\");\n\t\t\t\tvar result = Git.Merge(new MergeOptions { NoFastForward = true, Branches = new[]{ a, c }, MergeStrategy = MergeStrategy.Recursive }); \n\t\t\t\tAssert.IsTrue(result.Success);\n\t\t\t\tAssert.AreEqual(repo.Get<Branch>(\"c\").CurrentCommit.Tree, a.CurrentCommit.Tree);\n\t\t\t\tvar a_commit = repo.Get<Branch>(\"a\").CurrentCommit;\n\t\t\t\tvar c_commit = repo.Get<Branch>(\"c\").CurrentCommit;\n\t\t\t\tAssert.IsTrue(a_commit.Parents.Contains(c_commit));\n\t\t\t\tAssert.IsTrue(a_commit.Parents.Contains(repo.Tags[\"A\"].Target as Commit));\n\t\t\t\tAssert.AreEqual(2, a.CurrentCommit.Parents.Count());\n\t\t\t\tAssert.AreEqual(\"Merge branch 'c' into a\", result.Commit.Message);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/ObjectEqualityTests.cs",
    "content": "/*\n * Copyright (C) 2009, James Gregory\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class ObjectEqualityTests : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToCompareNullObjects()\n\t\t{\n\t\t\tAbstractObject obj = null;\n\n\t\t\tAssert.IsTrue(obj == null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToCompareNullObjectsInverse()\n\t\t{\n\t\t\tAbstractObject obj = null;\n\n\t\t\tAssert.IsTrue(null == obj);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SameInstanceShouldBeEqual()\n\t\t{\n\t\t\tusing (var repos = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar obj = repos.CurrentBranch.CurrentCommit;\n#pragma warning disable 1718\n\t\t\t\tAssert.IsTrue(obj == obj); // [henon] this equality comparison of the same instance is intended\n#pragma warning restore 1718\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DifferentInstancesShouldntBeEqual()\n\t\t{\n\t\t\tusing (var repos = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar obj = repos.CurrentBranch.CurrentCommit;\n\t\t\t\tvar obj2 = repos.CurrentBranch.CurrentCommit.Parent;\n\n\t\t\t\tAssert.IsTrue(obj != obj2);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/RefModelTests.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing GitSharp.Core.Tests;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class RefModelTests : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void UpdateBranch()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar master = new Branch(repo, \"refs/heads/master\");\n\t\t\t\tvar origin_master = new Branch(repo, \"refs/remotes/origin/master\");\n\t\t\t\torigin_master.Update(master);\n\t\t\t\tAssert.AreEqual(master.CurrentCommit.Hash, origin_master.CurrentCommit.Hash);\n\t\t\t\tvar remote_head = repo.Refs[\"refs/remotes/origin/master\"];\n\t\t\t\tAssert.AreEqual(master.CurrentCommit.Hash, remote_head.Target.Hash);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RefNameResolution()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar master = new Ref(repo, \"refs/heads/master\");\n\t\t\t\tvar previous = new Ref(repo, \"refs/heads/master^\");\n\t\t\t\tAssert.AreNotEqual(master.Target.Hash, previous.Target.Hash);\n\t\t\t\tAssert.AreEqual((master.Target as Commit).Parent.Hash, previous.Target.Hash);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RefEquality()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.IsTrue(new Ref(repo, \"a\") == new Ref(repo, \"refs/heads/a\"));\n\t\t\t\tAssert.IsTrue(new Ref(repo, \"HEAD\") == new Ref(repo, \"refs/heads/master\"));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/RepositoryConfigTest.cs",
    "content": "using System.IO;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class RepositoryConfigTest : ApiTestCase\n\t{\n\t\t[Test]\n\t\tpublic void PersistsSavesConfigChangesToDisk()\n\t\t{\n\t\t\tstring workingDirectory = Path.Combine(trash.FullName, Path.GetRandomFileName());\n\n\t\t\t// Creating a new repo\n\t\t\tusing (var repo = Repository.Init(workingDirectory))\n\t\t\t{\n\t\t\t\t// Setting the in-memory commitencoding configuration entry\n\t\t\t\trepo.Config[\"section.key\"] = \"value\";\n\n\t\t\t\t// Saving to disk\n\t\t\t\trepo.Config.Persist();\n\t\t\t}\n\n\t\t\tusing (var repo = new Repository(workingDirectory))\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"value\", repo.Config[\"section.key\"]);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/RepositoryStatusTests.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class RepositoryStatusTests : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void StatusEvenWorksWithHeadLessRepo()\n\t\t{\n\t\t\tusing (var repo = Repository.Init(Path.Combine(trash.FullName, \"test\")))\n\t\t\t{\n\t\t\t\tRepositoryStatus status = null;\n\t\t\t\tAssert.DoesNotThrow(() => status = repo.Status);\n\t\t\t\tAssert.IsFalse(repo.Status.AnyDifferences);\n\t\t\t\tAssert.AreEqual(0,\n\t\t\t\t\t\t\t\t\t status.Added.Count + status.Staged.Count + status.Missing.Count + status.Modified.Count +\n\t\t\t\t\t\t\t\t\t status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TracksAddedFiles()\n\t\t{\n\t\t\t//setup of .git directory\n\t\t\tvar resource =\n\t\t\t\t new DirectoryInfo(Path.Combine(Path.Combine(Environment.CurrentDirectory, \"Resources\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \"CorruptIndex\"));\n\t\t\tvar tempRepository =\n\t\t\t\t new DirectoryInfo(Path.Combine(trash.FullName, \"CorruptIndex\" + Path.GetRandomFileName()));\n\t\t\tCopyDirectory(resource.FullName, tempRepository.FullName);\n\n\t\t\tvar repositoryPath = new DirectoryInfo(Path.Combine(tempRepository.FullName, Constants.DOT_GIT));\n\t\t\tDirectory.Move(repositoryPath.FullName + \"ted\", repositoryPath.FullName);\n\n\t\t\tusing (var repository = new Repository(repositoryPath.FullName))\n\t\t\t{\n\t\t\t\tvar status = repository.Status;\n\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\tAssert.AreEqual(1, status.Added.Count);\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"b.txt\")); // the file already exists in the index (eg. has been previously git added)\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\n\t\t\t\tstring filepath = Path.Combine(repository.WorkingDirectory, \"c.txt\");\n\t\t\t\twriteTrashFile(filepath, \"c\");\n\t\t\t\trepository.Index.Add(filepath);\n\n\t\t\t\tstatus.Update();\n\n\t\t\t\tAssert.IsTrue(status.AnyDifferences);\n\t\t\t\tAssert.AreEqual(2, status.Added.Count);\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"b.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"c.txt\"));\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\n\t\t\t\trepository.Commit(\"after that no added files should remain\", Author.Anonymous);\n\t\t\t\tstatus.Update();\n\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UntrackedFiles()\n\t\t{\n\t\t\tusing (var repo = new Repository(trash.FullName))\n\t\t\t{\n\t\t\t\tvar a = writeTrashFile(\"untracked.txt\", \"\");\n\t\t\t\tvar b = writeTrashFile(\"someDirectory/untracked2.txt\", \"\");\n\t\t\t\trepo.Index.Add(writeTrashFile(\"untracked2.txt\", \"\").FullName); // <-- adding a file with same name in higher directory to test the file name comparison.\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.AreEqual(2, status.Untracked.Count);\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"untracked.txt\"));\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"someDirectory/untracked2.txt\"));\n\t\t\t\tAssert.IsTrue(status.Added.Contains(\"untracked2.txt\"));\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(8, status.Removed.Count);\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void Modified_and_Staged()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Add(writeTrashFile(\"file2\", \"file2\").FullName, writeTrashFile(\"dir/file3\", \"dir/file3\").FullName);\n\t\t\t\trepo.Commit(\"committing file2 and dir/file2\", Author.Anonymous);\n\t\t\t\tindex.Add(writeTrashFile(\"file2\", \"file2 changed\").FullName, writeTrashFile(\"dir/file3\", \"dir/file3 changed\").FullName);\n\t\t\t\twriteTrashFile(\"dir/file3\", \"modified\");\n\n\t\t\t\tvar status = repo.Status;\n\n\t\t\t\tAssert.AreEqual(2, status.Staged.Count);\n\t\t\t\tAssert.IsTrue(status.Staged.Contains(\"file2\"));\n\t\t\t\tAssert.IsTrue(status.Staged.Contains(\"dir/file3\"));\n\t\t\t\tAssert.AreEqual(1, status.Modified.Count);\n\t\t\t\tAssert.IsTrue(status.Modified.Contains(\"dir/file3\"));\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Untracked.Count);\n\n\t\t\t\trepo.Commit(\"committing staged changes, modified files should still be modified\", Author.Anonymous);\n\t\t\t\tstatus.Update();\n\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(1, status.Modified.Count);\n\t\t\t\tAssert.IsTrue(status.Modified.Contains(\"dir/file3\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Removed()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Stage(writeTrashFile(\"file2\", \"file2\").FullName, writeTrashFile(\"dir/file3\", \"dir/file3\").FullName);\n\t\t\t\tindex.CommitChanges(\"...\", Author.Anonymous);\n\t\t\t\tindex.Remove(Path.Combine(trash.FullName, \"file2\"), Path.Combine(trash.FullName, \"dir\"));\n\n\t\t\t\tvar diff = index.Status;\n\t\t\t\tAssert.AreEqual(2, diff.Removed.Count);\n\t\t\t\tAssert.IsTrue(diff.Removed.Contains(\"file2\"));\n\t\t\t\tAssert.IsTrue(diff.Removed.Contains(\"dir/file3\"));\n\t\t\t\tAssert.AreEqual(0, diff.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t\t\tAssert.AreEqual(2, diff.Untracked.Count);\n\t\t\t\tAssert.IsTrue(diff.Untracked.Contains(\"file2\"));\n\t\t\t\t//Assert.IsTrue(diff.Untracked.Contains(\"dir/\")); // <--- verified this against msysgit.\n\n\t\t\t\trepo.Commit(\"committing staged changes, this does not delete removed files from the working directory. they should be untracked now.\", Author.Anonymous);\n\t\t\t\tdiff = repo.Status;\n\n\t\t\t\tAssert.AreEqual(0, diff.Removed.Count);\n\t\t\t\tAssert.AreEqual(2, diff.Untracked.Count);\n\t\t\t\tAssert.IsTrue(diff.Untracked.Contains(\"file2\")); // note: this looks like a bug (actually the file is tracked but only missing in the index) but complies to cgit\n\t\t\t\t//Assert.IsTrue(diff.Untracked.Contains(\"dir/\")); // <--- verified this against msysgit.\n\t\t\t}\n\t\t}\n\n\t\t[Ignore(\"Gitsharp is not yet clever enough to collapse directories containing only untracked files!\")]\n\t\t[Test]\n\t\tpublic void UntrackedDirectory()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Stage(writeTrashFile(\"file2\", \"file2\").FullName, writeTrashFile(\"dir/file3\", \"dir/file3\").FullName);\n\t\t\t\tindex.CommitChanges(\"...\", Author.Anonymous);\n\t\t\t\tindex.Remove(Path.Combine(trash.FullName, \"file2\"), Path.Combine(trash.FullName, \"dir\"));\n\n\t\t\t\tvar diff = index.Status;\n\t\t\t\tAssert.IsTrue(diff.Untracked.Contains(\"file2\"));\n\t\t\t\tAssert.IsTrue(diff.Untracked.Contains(\"dir/\")); // <--- verified this against msysgit.\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Missing()\n\t\t{\n\t\t\tusing (var repo = GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar index = repo.Index;\n\t\t\t\tindex.Stage(writeTrashFile(\"file2\", \"file2\").FullName, writeTrashFile(\"dir/file3\", \"dir/file3\").FullName);\n\t\t\t\tindex.CommitChanges(\"...\", Author.Anonymous);\n\t\t\t\tindex.Stage(writeTrashFile(\"file4\", \"file4\").FullName, writeTrashFile(\"dir/file4\", \"dir/file4\").FullName);\n\n\t\t\t\tnew FileInfo(Path.Combine(repo.WorkingDirectory, \"file2\")).Delete();\n\t\t\t\tnew FileInfo(Path.Combine(repo.WorkingDirectory, \"file4\")).Delete();\n\t\t\t\tnew DirectoryInfo(Path.Combine(repo.WorkingDirectory, \"dir\")).Delete(true);\n\n\t\t\t\tvar diff = index.Status;\n\t\t\t\tAssert.AreEqual(2, diff.Added.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Untracked.Count);\n\t\t\t\tAssert.AreEqual(4, diff.Missing.Count);\n\t\t\t\tAssert.IsTrue(diff.Missing.Contains(\"file2\"));\n\t\t\t\tAssert.IsTrue(diff.Missing.Contains(\"file4\"));\n\t\t\t\tAssert.IsTrue(diff.Missing.Contains(\"dir/file3\"));\n\t\t\t\tAssert.IsTrue(diff.Missing.Contains(\"dir/file4\"));\n\n\n\t\t\t\trepo.Commit(\"committing the added files which are missing in the working directory\", Author.Anonymous);\n\t\t\t\tdiff = repo.Status;\n\n\t\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, diff.Untracked.Count);\n\t\t\t\tAssert.AreEqual(4, diff.Missing.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoreUntrackedFilesAndDirectories()\n\t\t{\n\t\t\tusing (var repo = new Repository(trash.FullName))\n\t\t\t{\n\t\t\t\trepo.Head.Reset(ResetBehavior.Hard);\n\t\t\t\twriteTrashFile(\"untracked.txt\", \"\");\n\t\t\t\twriteTrashFile(\"image.png\", \"\");\n\t\t\t\twriteTrashFile(\"someDirectory/untracked2.txt\", \"\");\n\t\t\t\twriteTrashFile(\"someDirectory/untracked\", \"\");\n\t\t\t\twriteTrashFile(\"some/other/directory/.svn/format\", \"\");\n\t\t\t\twriteTrashFile(\"some/other/README\", \"\");\n\t\t\t\twriteTrashFile(\"some/other/directory/README\", \"\");\n\t\t\t\t// ignore patterns:\n\t\t\t\twriteTrashFile(\".gitignore\", \"*.txt\\n.svn\");\n\t\t\t\twriteTrashFile(\"some/other/.gitignore\", \"README\\n\");\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"image.png\"));\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"someDirectory/untracked\"));\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.MergeConflict.Count);\n\t\t\t\tAssert.AreEqual(4, status.Untracked.Count);\n\t\t\t\twriteTrashFile(\".gitignore\", \"other\");\n\t\t\t\twriteTrashFile(\"some/other/.gitignore\", \"\");\n\t\t\t\tstatus.Update();\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"untracked.txt\"));\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"someDirectory/untracked2.txt\"));\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"someDirectory/untracked\"));\n\t\t\t\tAssert.IsTrue(status.Untracked.Contains(\"image.png\"));\n\t\t\t\tAssert.AreEqual(0, status.Added.Count);\n\t\t\t\tAssert.AreEqual(0, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(0, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(0, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(0, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(0, status.MergeConflict.Count);\n\t\t\t\tAssert.AreEqual(5, status.Untracked.Count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlternativeCallbackApiTest()\n\t\t{\n\t\t\tusing (var repo = new Repository(trash.FullName))\n\t\t\t{\n\t\t\t\trepo.Head.Reset(ResetBehavior.Mixed);\n\t\t\t\twriteTrashFile(\"untracked\", \"\");\n\t\t\t\twriteTrashFile(\"added\", \"\");\n\t\t\t\trepo.Index.Add(\"added\");\n\t\t\t\twriteTrashFile(\"a/a1\", \"modified\");\n\t\t\t\trepo.Index.AddContent(\"a/a1.txt\", \"staged\");\n\t\t\t\trepo.Index.Remove(\"b/b2.txt\");\n\t\t\t\tvar status = repo.Status;\n\t\t\t\tAssert.AreEqual(1, status.Added.Count);\n\t\t\t\tAssert.AreEqual(1, status.Staged.Count);\n\t\t\t\tAssert.AreEqual(6, status.Missing.Count);\n\t\t\t\tAssert.AreEqual(1, status.Modified.Count);\n\t\t\t\tAssert.AreEqual(1, status.Removed.Count);\n\t\t\t\tAssert.AreEqual(1, status.Untracked.Count);\n\t\t\t\tvar stati = new List<PathStatus>();\n\t\t\t\tvar s = new RepositoryStatus(repo, new RepositoryStatusOptions\n\t\t\t\t{\n\t\t\t\t\tPerPathNotificationCallback = path_status =>\n\t\t\t\t\t{\n\t\t\t\t\t\tstati.Add(path_status);\n\t\t\t\t\t\tswitch (path_status.WorkingPathStatus)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase WorkingPathStatus.Missing:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Missing.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase WorkingPathStatus.Modified:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Modified.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase WorkingPathStatus.Untracked:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Untracked.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (path_status.IndexPathStatus)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase IndexPathStatus.Added:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Added.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase IndexPathStatus.Removed:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Removed.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase IndexPathStatus.Staged:\n\t\t\t\t\t\t\t\tAssert.IsTrue(status.Staged.Contains(path_status.Path));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tvar dict = stati.ToDictionary(p => p.Path);\n\t\t\t\tAssert.IsTrue(dict.ContainsKey(\"untracked\"));\n\t\t\t\tAssert.IsTrue(dict.ContainsKey(\"added\"));\n\t\t\t\tAssert.IsTrue(dict.ContainsKey(\"a/a1\"));\n\t\t\t\tAssert.IsTrue(dict.ContainsKey(\"a/a1.txt\"));\n\t\t\t\tAssert.IsTrue(dict.ContainsKey(\"b/b2.txt\"));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/RepositoryTests.cs",
    "content": "/*\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class RepositoryTests : ApiTestCase\n\t{\n\n\t\t[Test]\n\t\tpublic void ImplicitConversionToCoreRepo()\n\t\t{\n\t\t\tusing (var repo = this.GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.IsTrue(repo is Repository);\n\t\t\t\tGitSharp.Core.Repository core_repo = repo;\n\t\t\t\tAssert.IsTrue(core_repo is GitSharp.Core.Repository);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindRepository()\n\t\t{\n\t\t\tvar was_here = Directory.GetCurrentDirectory();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var repo = this.GetTrashRepository())\n\t\t\t\t{\n\t\t\t\t\tAssert.AreEqual(repo.Directory, Repository.FindRepository(repo.WorkingDirectory));\n\t\t\t\t\tAssert.AreEqual(repo.Directory, Repository.FindRepository(repo.Directory));\n\t\t\t\t\tvar root = repo.WorkingDirectory;\n\t\t\t\t\tvar hmm = Path.Combine(root, \"hmm\");\n\t\t\t\t\tDirectory.CreateDirectory(hmm);\n\t\t\t\t\tAssert.AreEqual(repo.Directory, Repository.FindRepository(hmm));\n\t\t\t\t\tDirectory.SetCurrentDirectory(hmm);\n\t\t\t\t\tAssert.AreEqual(repo.Directory, Repository.FindRepository(null));\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tDirectory.SetCurrentDirectory(was_here);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindRepositoryReturnsNullInNonGitTree()\n\t\t{\n\t\t\tusing (var repo = this.GetTrashRepository())\n\t\t\t{\n\t\t\t\tvar path = Path.GetRandomFileName();\n\t\t\t\tvar directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), path));\n\n\t\t\t\tAssert.AreEqual(null, Repository.FindRepository(directory.FullName));\n\n\t\t\t\tdirectory.Delete();\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AccessGitObjects()\n\t\t{\n\t\t\t// standard access of git objects, supported by gitsharp.core\n\t\t\tusing (var repo = this.GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"master\").IsCommit);\n\t\t\t\tAssert.NotNull(repo.Get<Branch>(\"master\"));\n\t\t\t\tAssert.NotNull(repo.Get<Branch>(\"master\").Target);\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"HEAD^^\").IsCommit);\n\t\t\t\tAssert.IsTrue(repo.Get<Tag>(\"A\").IsTag);\n\t\t\t\tAssert.IsTrue(repo.Get<Branch>(\"a\").Target.IsCommit);\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"a\").IsCommit);\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"prefix/a\").IsCommit);\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"68cb1f232964f3cd698afc1dafe583937203c587\").IsCommit);\n\t\t\t\tAssert.NotNull(repo.Get<Blob>(\"a\")); // <--- returns a blob containing the raw representation of tree \"a\" on master\n\t\t\t\tAssert.IsTrue(repo.Get<Tree>(\"a\").IsTree); // <--- there is a directory \"a\" on master\n\t\t\t\tAssert.IsTrue(repo.Get<Tree>(\"a/\").IsTree);\n\t\t\t\tAssert.NotNull(repo.Get<Blob>(\"a/a1\"));\n\t\t\t\tAssert.NotNull(repo.Get<Leaf>(\"a/a1\"));\n\t\t\t}\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void AccessGitObjectsMagic()\n\t\t{\n\t\t\t// not currently supported by gitsharp.core. requires some magic to resolve these cases\n\t\t\tusing (var repo = this.GetTrashRepository())\n\t\t\t{\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"49322bb1\").IsCommit); // abbrev. hashes are not yet supported!\n\t\t\t\tAssert.IsTrue(repo.Get<Commit>(\"68cb1f2\").IsCommit);\n\t\t\t\tAssert.IsTrue(repo.Get<Tree>(\"HEAD^^\").IsTree); // some magic is required for this\n\t\t\t\tAssert.IsNotNull(repo.Get<Blob>(\"68cb1f232964f3cd698afc1dafe583937203c587\")); // <--- returns the commit as blob (i.e. for inspection of the raw contents)\n\t\t\t\tAssert.IsTrue(repo.Get<Tree>(\"68cb1f232964f3cd698afc1dafe583937203c587\").IsTree); // <--- returns the commit as blob (i.e. for inspection of the raw contents)\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp/StatusTests.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Rolenun <rolenun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core.Tests;\nusing GitSharp.Commands;\nusing GitSharp.Tests.GitSharp;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System;\nusing System.Collections;\n\nnamespace GitSharp.API.Tests\n{\n\t[TestFixture]\n\tpublic class StatusTests : ApiTestCase\n\t{\n\t\tconst string filename = \"newfile.txt\";\n\t\tconst string filenameSubdir1 = \"subdir1/newfile.txt\";\n\t\tconst string filenameSubdir2 = \"subdir1/subdir2/newfile.txt\";\n\t\t\n\t\tint repCount;\n\t\t\n\t\tdelegate RepositoryStatus StatusOperation (Repository repo, List<string> outFilesToCheck);\n\n\t\tvoid RunStatusTests(StatusOperation oper)\n\t\t{\n            //Due to the cumulative nature of these tests, rather than recreate the same \n            // conditions multiple times, all StatusResult testing has been rolled into one test.\n\t\t\t\n\t\t\tvar path = Path.Combine(trash.FullName, \"test\" + ++repCount);\n\t\t\tif (Directory.Exists (path)) {\n\t\t\t\tDirectory.Delete (path, true);\n\t\t\t\tDirectory.CreateDirectory (path);\n\t\t\t}\n            using (var repo = Repository.Init(path, false))\n            {\n\t\t\t\tList<string> filesToCheck = new List<string> ();\n\t\t\t\t\n                //Verify the file has not already been created\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tRepositoryStatus results = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename);\n                AssertStatus (results, filesToCheck, filenameSubdir1);\n                AssertStatus (results, filesToCheck, filenameSubdir2);\n\n\t            //Create the files and verify the files are untracked\n\t\t\t\tif (!Directory.Exists (repo.FromGitPath (\"subdir1/subdir2\")))\n\t\t\t\t\tDirectory.CreateDirectory (repo.FromGitPath (\"subdir1/subdir2\"));\n\t            File.WriteAllText(repo.FromGitPath (filename), \"Just a simple test.\");\n\t            File.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Just a simple test.\");\n\t            File.WriteAllText(repo.FromGitPath (filenameSubdir2), \"Just a simple test.\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\t\t\t\t\n\t\t\t\t// Modify a file\n\t\t\t\tFile.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Just a simple modified test.\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\t\t\t\t\n\t\t\t\t//Add an unmodified file to the index\n\t            File.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Just a simple test.\");\n\t\t\t\tIndex index = new Index(repo);\n\t\t\t\tindex.Add(filenameSubdir1);\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Added);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t//Modify file in the index\n\t\t\t\tFile.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Just a simple modified test.\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Modified, results.Added);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t// Commit the added file\n\t\t\t\trepo.Commit (\"test 1\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Modified);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t// Commit the modification\n\t\t\t\tindex.Add (filenameSubdir1);\n\t\t\t\trepo.Commit (\"test 2\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t// Modify the committed file\n\t\t\t\tFile.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Modified after commit.\");\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Modified);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t// Remove the committed file\n\t\t\t\tFile.Delete (repo.FromGitPath (filenameSubdir1));\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Missing);  // FIXME: should be Removed??\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\n\t\t\t\t// Stage the file removal\n\t\t\t\tindex.Remove (filenameSubdir1);\n\t\t\t\t\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Removed);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\t\t\t\t\n\t\t\t\t// Commit changes\n\t\t\t\trepo.Commit (\"test 3\");\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1);\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\t\t\t\t\n\t\t\t\t// Modify the committed file, stage it and delete it\n\t\t\t\tFile.WriteAllText(repo.FromGitPath (filenameSubdir1), \"Modified before delete.\");\n\t\t\t\tindex.Add (filenameSubdir1);\n\t\t\t\tFile.Delete (repo.FromGitPath (filenameSubdir1));\n\t\t\t\tfilesToCheck.Clear ();\n\t\t\t\tresults = oper (repo, filesToCheck);\n                AssertStatus (results, filesToCheck, filename, results.Untracked);\n                AssertStatus (results, filesToCheck, filenameSubdir1, results.Added, results.Missing);  // FIXME: should be Removed??\n                AssertStatus (results, filesToCheck, filenameSubdir2, results.Untracked);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid AssertStatus (RepositoryStatus results, List<string> filesToCheck, string file, params HashSet<string>[] fileStatuses)\n\t\t{\n\t\t\tAssert.IsNotNull(results);\n\t\t\t\n\t\t\tvar allStatus = new HashSet<string> [] {\n\t\t\t\tresults.Added,\n\t\t\t\tresults.MergeConflict,\n\t\t\t\tresults.Missing,\n\t\t\t\tresults.Modified,\n\t\t\t\tresults.Removed,\n\t\t\t\tresults.Staged,\n\t\t\t\tresults.Untracked\n\t\t\t};\n\t\t\t\n\t\t\tvar allStatusName = new string[] {\n\t\t\t\t\"Added\",\n\t\t\t\t\"MergeConflict\",\n\t\t\t\t\"Missing\",\n\t\t\t\t\"Modified\",\n\t\t\t\t\"Removed\",\n\t\t\t\t\"Staged\",\n\t\t\t\t\"Untracked\"\n\t\t\t};\n\t\t\t\n\t\t\tif (!filesToCheck.Contains (file))\n\t\t\t\tfileStatuses = new HashSet<string>[0];\n\t\t\t\n\t\t\tfor (int n=0; n<allStatus.Length; n++) {\n\t\t\t\tvar status = allStatus [n];\n\t\t\t\tif (((IList)fileStatuses).Contains (status))\n\t\t\t\t\tAssert.IsTrue (status.Contains (file), \"File \" + file + \" not found in \" + allStatusName[n] + \" collection\");\n\t\t\t\telse\n\t\t\t\t\tAssert.IsFalse (status.Contains (file), \"File \" + file + \" should no be in \" + allStatusName[n] + \" collection\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRecursiveDirectoryRoot ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filename);\n\t\t\t\toutFilesToCheck.Add (filenameSubdir1);\n\t\t\t\toutFilesToCheck.Add (filenameSubdir2);\n\t\t\t\treturn repo.GetDirectoryStatus (\"\", true);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursiveDirectorySubdir1 ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir1);\n\t\t\t\toutFilesToCheck.Add (filenameSubdir2);\n\t\t\t\treturn repo.GetDirectoryStatus (\"subdir1\", true);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursiveDirectorySubdir2 ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir2);\n\t\t\t\treturn repo.GetDirectoryStatus (\"subdir1/subdir2\", true);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonrecursiveDirectoryRoot ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filename);\n\t\t\t\treturn repo.GetDirectoryStatus (\"\", false);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonrecursiveDirectorySubdir1 ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir1);\n\t\t\t\treturn repo.GetDirectoryStatus (\"subdir1\", false);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonrecursiveDirectorySubdir2 ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir2);\n\t\t\t\treturn repo.GetDirectoryStatus (\"subdir1/subdir2\", false);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFileStatus ()\n\t\t{\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filename);\n\t\t\t\treturn repo.GetFileStatus (filename);\n\t\t\t});\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir1);\n\t\t\t\treturn repo.GetFileStatus (filenameSubdir1);\n\t\t\t});\n\t\t\tRunStatusTests (delegate (Repository repo, List<string> outFilesToCheck) {\n\t\t\t\toutFilesToCheck.Add (filenameSubdir2);\n\t\t\t\treturn repo.GetFileStatus (filenameSubdir2);\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp/TextTests.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp\n{\n\t[TestFixture]\n\tpublic class TextTests : ApiTestCase\n\t{\n\t\tprivate readonly string TEXT = string.Join(\"\\r\\n\", new[] { \"Player Queen:\",\n\"Both here and hence pursue me lasting strife,\",\n\"If once I be a widow, ever I be a wife!\",\n\"\",\n\"Player King:\",\n\"'Tis deeply sworn. Sweet, leave me here a while,\",\n\"My spirits grow dull, and fain I would beguile\",\n\"The tedious day with sleep.\",\n\"\",\n\"Player Queen:\",\n\"Sleep rock thy brain,\",\n\"And never come mischance between us twain!\",\n\"\",\n\"Hamlet:\",\n\"Madam, how like you this play?\",\n\"\",\n\"Queen:\",\n\"The lady doth protest too much, methinks.\" });\n\n\t\t[Test]\n\t\tpublic void GetLineTest()\n\t\t{\n\t\t\tvar text = new Text(TEXT);\n\t\t\tAssert.AreEqual(\"Player Queen:\\r\\n\", text.GetLine(1));\n\t\t\tAssert.AreEqual(\"\\r\\n\", text.GetLine(4));\n\t\t\tAssert.AreEqual(new[] { (byte)'P', (byte)'l', (byte)'a', (byte)'y', (byte)'e', (byte)'r', (byte)' ', (byte)'Q', (byte)'u', (byte)'e', (byte)'e', (byte)'n', (byte)':', (byte)'\\r', (byte)'\\n' }, text.GetRawLine(1));\n\t\t\tAssert.AreEqual(new[] { (byte)'\\r', (byte)'\\n' }, text.GetRawLine(4));\n\t\t\tAssert.AreEqual(\"The lady doth protest too much, methinks.\", text.GetLine(18));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => text.GetLine(-1));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => text.GetLine(0));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => text.GetLine(19));\n\t\t\tAssert.AreEqual(18, text.NumberOfLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EncodingTest()\n\t\t{\n\t\t\tconst string s = \"üöäß\\nÖÄÜ\\n\";\n\t\t\tvar t = new Text(s, Encoding.GetEncoding(\"latin1\"));\n\t\t\tAssert.AreEqual(\"üöäß\\n\", t.GetLine(1));\n\t\t\tAssert.AreEqual(\"ÖÄÜ\\n\", t.GetLine(2));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => t.GetLine(3));\n\t\t\tAssert.AreEqual(2, t.NumberOfLines);\n\t\t\tAssert.AreEqual(Encoding.UTF8, new Text(\"hmm\").Encoding);\n\t\t\tAssert.AreEqual(Encoding.GetEncoding(\"latin1\"), new Text(\"hmm\", Encoding.GetEncoding(\"latin1\")).Encoding);\n\t\t\tAssert.AreEqual(s, t.ToString());\n\t\t\tAssert.AreEqual(9, t.Length);\n\t\t\tAssert.AreEqual(9, new Text(s).Length);\n\t\t\tAssert.AreEqual(2, new Text(\"你好\").Length);\n\t\t\tAssert.AreEqual(6, new Text(\"你好\").RawLength);\n\t\t\tAssert.AreEqual(2, new Text(\"你好\", Encoding.UTF32).Length);\n\t\t\tAssert.AreEqual(8, new Text(\"你好\", Encoding.UTF32).RawLength);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetBlockTest()\n\t\t{\n\t\t\tconst string block = \"Hamlet:\\r\\nMadam, how like you this play?\\r\\n\";\n\t\t\tvar text = new Text(TEXT);\n\t\t\tAssert.AreEqual(\"\", text.GetBlock(14, 14));\n\t\t\tAssert.AreEqual(\"Hamlet:\\r\\n\", text.GetBlock(14, 15));\n\t\t\tAssert.AreEqual(block, text.GetBlock(14, 16));\n\t\t\tAssert.AreEqual(Encoding.UTF8.GetBytes(TEXT), text.GetRawBlock(1, 19));\n\t\t\tAssert.AreEqual(TEXT, text.GetBlock(1, 19));\n\t\t\tAssert.Throws(typeof(ArgumentException), () => text.GetBlock(14, 13));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => text.GetBlock(0, 14));\n\t\t\tAssert.Throws(typeof(ArgumentOutOfRangeException), () => text.GetBlock(14, 20));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/AbbreviatedObjectIdTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class AbbreviatedObjectIdTest\n    {\n\n        [Test]\n        public void testEmpty_FromByteArray()\n        {\n        \tAbbreviatedObjectId i = AbbreviatedObjectId.FromString(new byte[] { }, 0, 0);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(0, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(string.Empty, i.name());\n        }\n\n        [Test]\n        public void testEmpty_FromString()\n        {\n\t\t\tAbbreviatedObjectId i = AbbreviatedObjectId.FromString(string.Empty);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(0, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(string.Empty, i.name());\n        }\n\n        [Test]\n        public void testFull_FromByteArray()\n        {\n            const string s = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            byte[] b = Constants.encodeASCII(s);\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(b, 0, b.Length);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsTrue(i.isComplete());\n            Assert.AreEqual(s, i.name());\n\n            ObjectId f = i.ToObjectId();\n            Assert.IsNotNull(f);\n            Assert.AreEqual(ObjectId.FromString(s), f);\n            Assert.AreEqual(f.GetHashCode(), i.GetHashCode());\n        }\n\n        [Test]\n        public void testFull_FromString()\n        {\n            const string s = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsTrue(i.isComplete());\n            Assert.AreEqual(s, i.name());\n\n            ObjectId f = i.ToObjectId();\n            Assert.IsNotNull(f);\n            Assert.AreEqual(ObjectId.FromString(s), f);\n            Assert.AreEqual(f.GetHashCode(), i.GetHashCode());\n        }\n\n        [Test]\n        public void test1_FromString()\n        {\n            const string s = \"7\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test2_FromString()\n        {\n            const string s = \"7b\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test3_FromString()\n        {\n            const string s = \"7b6\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test4_FromString()\n        {\n            const string s = \"7b6e\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test5_FromString()\n        {\n            const string s = \"7b6e8\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test6_FromString()\n        {\n            const string s = \"7b6e80\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test7_FromString()\n        {\n            const string s = \"7b6e806\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test8_FromString()\n        {\n            const string s = \"7b6e8067\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test9_FromString()\n        {\n            const string s = \"7b6e8067e\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void test17_FromString()\n        {\n            const string s = \"7b6e8067ec96acef9\";\n            AbbreviatedObjectId i = AbbreviatedObjectId.FromString(s);\n            Assert.IsNotNull(i);\n            Assert.AreEqual(s.Length, i.Length);\n            Assert.IsFalse(i.isComplete());\n            Assert.AreEqual(s, i.name());\n            Assert.IsNull(i.ToObjectId());\n        }\n\n        [Test]\n        public void testEquals_Short()\n        {\n            const string s = \"7b6e8067\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(s);\n            AbbreviatedObjectId b = AbbreviatedObjectId.FromString(s);\n            Assert.AreNotSame(a, b);\n            Assert.IsTrue(a.GetHashCode() == b.GetHashCode());\n            Assert.IsTrue(a.Equals(b));\n            Assert.IsTrue(b.Equals(a));\n        }\n\n        [Test]\n        public void testEquals_Full()\n        {\n            const string s = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(s);\n            AbbreviatedObjectId b = AbbreviatedObjectId.FromString(s);\n            Assert.AreNotSame(a, b);\n            Assert.IsTrue(a.GetHashCode() == b.GetHashCode());\n            Assert.IsTrue(a.Equals(b));\n            Assert.IsTrue(b.Equals(a));\n        }\n\n        [Test]\n        public void testNotEquals_SameLength()\n        {\n            const string sa = \"7b6e8067\";\n            const string sb = \"7b6e806e\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n            AbbreviatedObjectId b = AbbreviatedObjectId.FromString(sb);\n            Assert.IsFalse(a.Equals(b));\n            Assert.IsFalse(b.Equals(a));\n        }\n\n        [Test]\n        public void testNotEquals_DiffLength()\n        {\n            const string sa = \"7b6e8067abcd\";\n            const string sb = \"7b6e8067\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n            AbbreviatedObjectId b = AbbreviatedObjectId.FromString(sb);\n            Assert.IsFalse(a.Equals(b));\n            Assert.IsFalse(b.Equals(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_Full()\n        {\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(s1);\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99b\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"7b6e8067ec96acef9a4184b43210d583b6d2f999\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_1()\n        {\n            const string sa = \"7\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"8b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"6b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_7()\n        {\n            const string sa = \"7b6e806\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"7b6e8167ec86acef9a4184b43210d583b6d2f99a\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"7b6e8057eca6acef9a4184b43210d583b6d2f99a\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_8()\n        {\n            const string sa = \"7b6e8067\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"7b6e8167ec86acef9a4184b43210d583b6d2f99a\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"7b6e8057eca6acef9a4184b43210d583b6d2f99a\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_9()\n        {\n            const string sa = \"7b6e8067e\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"7b6e8167ec86acef9a4184b43210d583b6d2f99a\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"7b6e8057eca6acef9a4184b43210d583b6d2f99a\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n\n        [Test]\n        public void testPrefixCompare_17()\n        {\n            const string sa = \"7b6e8067ec96acef9\";\n            AbbreviatedObjectId a = AbbreviatedObjectId.FromString(sa);\n\n            const string s1 = \"7b6e8067ec96acef9a4184b43210d583b6d2f99a\";\n            ObjectId i1 = ObjectId.FromString(s1);\n            Assert.AreEqual(0, a.prefixCompare(i1));\n            Assert.IsTrue(i1.startsWith(a));\n\n            const string s2 = \"7b6e8067eca6acef9a4184b43210d583b6d2f99a\";\n            ObjectId i2 = ObjectId.FromString(s2);\n            Assert.IsTrue(a.prefixCompare(i2) < 0);\n            Assert.IsFalse(i2.startsWith(a));\n\n            const string s3 = \"7b6e8067ec86acef9a4184b43210d583b6d2f99a\";\n            ObjectId i3 = ObjectId.FromString(s3);\n            Assert.IsTrue(a.prefixCompare(i3) > 0);\n            Assert.IsFalse(i3.startsWith(a));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/CanReadMsysgitIndexFixture.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class CanReadMsysgitIndexFixture : RepositoryTestCase\n    {\n        [Test]\n        public void CanReadMsysgitIndex()\n        {\n            //setup of .git directory\n            var resource =\n                new DirectoryInfo(Path.Combine(Path.Combine(Environment.CurrentDirectory, \"Resources\"),\n                                               \"OneFileRepository\"));\n            var tempRepository =\n                new DirectoryInfo(Path.Combine(trash.FullName, \"OneFileRepository\" + Path.GetRandomFileName()));\n            CopyDirectory(resource.FullName, tempRepository.FullName);\n\n            var repositoryPath = new DirectoryInfo(Path.Combine(tempRepository.FullName, Constants.DOT_GIT));\n            Directory.Move(repositoryPath.FullName + \"ted\", repositoryPath.FullName);\n\n\n\n            using (var repository = new Core.Repository(repositoryPath))\n            {\n                GitIndex index = repository.Index;\n\n                Assert.IsNotNull(index);\n                List<GitIndex.Entry> entries = index.Members.ToList();\n                Assert.AreEqual(1, entries.Count);\n\n                GitIndex.Entry entry = entries[0];\n                Assert.AreEqual(\"dummy.txt\", entry.Name);\n\n                Core.Ref headRef = repository.Head;\n                Assert.AreEqual(\"refs/heads/master\", headRef.Target.Name);\n                Assert.AreEqual(\"f3ca78a01f1baa4eaddcc349c97dcab95a379981\", headRef.ObjectId.Name);\n\n                object obj = repository.MapObject(headRef.ObjectId, headRef.Name);\n#pragma warning disable 0612\n                Assert.IsInstanceOfType(typeof (Core.Commit), obj); // [henon] IsInstanceOfType is obsolete\n#pragma warning restore 0612\n                var commit = (Core.Commit) obj;\n\n                Assert.AreEqual(\"f3ca78a01f1baa4eaddcc349c97dcab95a379981\", commit.CommitId.Name);\n                Assert.AreEqual(commit.Committer, commit.Author);\n                Assert.AreEqual(\"nulltoken <emeric.fermas@gmail.com> 1255117188 +0200\",\n                                commit.Committer.ToExternalString());\n\n                Assert.AreEqual(0, commit.ParentIds.Length);\n            }\n        }\n\n        [Test]\n        public void CanAddAFileToAMSysGitIndexWhereAFileIsAlreadyWaitingToBeCommitted()\n        {\n            //setup of .git directory\n            var resource =\n                new DirectoryInfo(Path.Combine(Path.Combine(Environment.CurrentDirectory, \"Resources\"),\n                                               \"CorruptIndex\"));\n            var tempRepository =\n                new DirectoryInfo(Path.Combine(trash.FullName, \"CorruptIndex\" + Path.GetRandomFileName()));\n            CopyDirectory(resource.FullName, tempRepository.FullName);\n\n            var repositoryPath = new DirectoryInfo(Path.Combine(tempRepository.FullName, Constants.DOT_GIT));\n            Directory.Move(repositoryPath.FullName + \"ted\", repositoryPath.FullName);\n\n\n\n            using (var repository = new Core.Repository(repositoryPath))\n            {\n                GitIndex index = repository.Index;\n\n                Assert.IsNotNull(index);\n\n                writeTrashFile(Path.Combine(repository.WorkingDirectory.FullName, \"c.txt\"), \"c\");\n\n                var tree = repository.MapTree(repository.Head.ObjectId);\n\n                index.add(repository.WorkingDirectory,\n                          new FileInfo(Path.Combine(repository.WorkingDirectory.FullName, \"c.txt\")));\n\n                var diff = new IndexDiff(tree, index);\n                diff.Diff();\n\n                index.write();\n\n\n                Assert.AreEqual(2, diff.Added.Count);\n                Assert.IsFalse(diff.Added.Contains(\"a.txt\"), \"Should not contain a.txt because it is already committed.\");\n                Assert.IsTrue(diff.Added.Contains(\"b.txt\"),\n                              \"Should contain b.txt since it was added by msysgit, but not committed\");\n                Assert.IsTrue(diff.Added.Contains(\"c.txt\"),\n                              \"Should contain c.txt since it was added by this test, but not committed\");\n                Assert.AreEqual(0, diff.Changed.Count);\n                Assert.AreEqual(0, diff.Modified.Count);\n                Assert.AreEqual(0, diff.Removed.Count);\n            }\n        }\n\n\n        [Test]\n        public void Check_entries_of_msysgit_index()\n        {\n            using (var repo = new Core.Repository(db.Directory))\n            {\n                var index_path = Path.Combine(repo.Directory.FullName, \"index\");\n                new FileInfo(\"Resources/index_originating_from_msysgit\").CopyTo(index_path);\n\n                var index = repo.Index;\n                index.RereadIfNecessary();\n\n                var paths = new[]\n                                {\n                                    \"New Folder/New Ruby Program.rb\",\n                                    \"for henon.txt\",\n                                    \"test.cmd\",\n                                };\n\n                var dict = index.Members.ToDictionary(entry => entry.Name);\n                Assert.AreEqual(3, dict.Count);\n                foreach (var path in paths)\n                    Assert.IsTrue(dict.ContainsKey(path));\n            }\n        }\n    }\n}\n\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ConcurrentRepackTest.cs",
    "content": "/*\n * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class ConcurrentRepackTest : RepositoryTestCase\n    {\n        public override void setUp()\n        {\n            var windowCacheConfig = new WindowCacheConfig { PackedGitOpenFiles = 1 };\n            WindowCache.reconfigure(windowCacheConfig);\n            base.setUp();\n        }\n\n        public override void tearDown()\n        {\n            base.tearDown();\n            var windowCacheConfig = new WindowCacheConfig();\n            WindowCache.reconfigure(windowCacheConfig);\n        }\n\n        [Test]\n        public void testObjectInNewPack()\n        {\n            // Create a new object in a new pack, and test that it is present.\n            //\n            Core.Repository eden = createBareRepository();\n            RevObject o1 = WriteBlob(eden, \"o1\");\n            Pack(eden, o1);\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n        }\n\n        [Test]\n        public void testObjectMovedToNewPack1()\n        {\n            // Create an object and pack it. Then remove that pack and put the\n            // object into a different pack file, with some other object. We\n            // still should be able to access the objects.\n            //\n            Core.Repository eden = createBareRepository();\n            RevObject o1 = WriteBlob(eden, \"o1\");\n            FileInfo[] out1 = Pack(eden, o1);\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n\n            RevObject o2 = WriteBlob(eden, \"o2\");\n            Pack(eden, o2, o1);\n\n            // Force close, and then delete, the old pack.\n            //\n            WhackCache();\n            Delete(out1);\n\n            // Now here is the interesting thing. Will git figure the new\n            // object exists in the new pack, and not the old one.\n            //\n            Assert.AreEqual(o2.Name, Parse(o2).Name);\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n        }\n\n        [Test]\n        public void testObjectMovedWithinPack()\n        {\n            // Create an object and pack it.\n            //\n            Core.Repository eden = createBareRepository();\n            RevObject o1 = WriteBlob(eden, \"o1\");\n            FileInfo[] out1 = Pack(eden, o1);\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n\n            // Force close the old pack.\n            //\n            WhackCache();\n\n            // Now overwrite the old pack in place. This method of creating a\n            // different pack under the same file name is partially broken. We\n            // should also have a different file name because the list of objects\n            // within the pack has been modified.\n            //\n            RevObject o2 = WriteBlob(eden, \"o2\");\n            var pw = new PackWriter(eden, NullProgressMonitor.Instance);\n            pw.addObject(o2);\n            pw.addObject(o1);\n            Write(out1, pw);\n\n            // Try the old name, then the new name. The old name should cause the\n            // pack to reload when it opens and the index and pack mismatch.\n            //\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n            Assert.AreEqual(o2.Name, Parse(o2).Name);\n        }\n\n        [Test]\n        public void testObjectMovedToNewPack2()\n        {\n            // Create an object and pack it. Then remove that pack and put the\n            // object into a different pack file, with some other object. We\n            // still should be able to access the objects.\n            //\n            Core.Repository eden = createBareRepository();\n            RevObject o1 = WriteBlob(eden, \"o1\");\n            FileInfo[] out1 = Pack(eden, o1);\n            Assert.AreEqual(o1.Name, Parse(o1).Name);\n\n            ObjectLoader load1 = db.OpenBlob(o1);\n            Assert.IsNotNull(load1);\n\n            RevObject o2 = WriteBlob(eden, \"o2\");\n            Pack(eden, o2, o1);\n\n            // Force close, and then delete, the old pack.\n            //\n            WhackCache();\n            Delete(out1);\n\n            // Now here is the interesting thing... can the loader we made\n            // earlier still resolve the object, even though its underlying\n            // pack is gone, but the object still exists.\n            //\n            ObjectLoader load2 = db.OpenBlob(o1);\n            Assert.IsNotNull(load2);\n            Assert.AreNotSame(load1, load2);\n\n            byte[] data2 = load2.CachedBytes;\n            byte[] data1 = load1.CachedBytes;\n            Assert.IsNotNull(data2);\n            Assert.IsNotNull(data1);\n            Assert.AreNotSame(data1, data2); // cache should be per-pack, not per object\n            Assert.IsTrue(data1.SequenceEqual(data2));\n            Assert.AreEqual(load2.Type, load1.Type);\n        }\n\n        private static void WhackCache()\n        {\n            var config = new WindowCacheConfig { PackedGitOpenFiles = 1 };\n            WindowCache.reconfigure(config);\n        }\n\n        private RevObject Parse(AnyObjectId id)\n        {\n            return new GitSharp.Core.RevWalk.RevWalk(db).parseAny(id);\n        }\n\n        private FileInfo[] Pack(Core.Repository src, params RevObject[] list)\n        {\n            var pw = new PackWriter(src, NullProgressMonitor.Instance);\n            foreach (RevObject o in list)\n            {\n                pw.addObject(o);\n            }\n\n            ObjectId name = pw.computeName();\n\t\t\tFileInfo packFile = FullPackFileName(name);\n            FileInfo idxFile = FullIndexFileName(name);\n            var files = new[] { packFile, idxFile };\n            Write(files, pw);\n            return files;\n        }\n\n        private static void Write(FileInfo[] files, PackWriter pw)\n        {\n            FileInfo file = files[0];\n            long begin = file.Directory.lastModified();\n\n            using (var stream = file.Create())\n            {\n\n                    pw.writePack(stream);\n\n            }\n\n            file = files[1];\n            using (var stream = file.Create())\n            {\n\n                    pw.writeIndex(stream);\n   \n            }\n\n            Touch(begin, files[0].Directory);\n        }\n\n        private static void Delete(FileInfo[] list)\n        {\n            long begin = list[0].Directory.lastModified();\n            foreach (var fi in list)\n            {\n                fi.Delete();\n                Assert.IsFalse(File.Exists(fi.FullName), fi + \" was not removed\");\n            }\n\n            Touch(begin, list[0].Directory);\n        }\n\n        private static void Touch(long begin, DirectoryInfo dir)\n        {\n            while (begin >= dir.lastModified())\n            {\n                Thread.Sleep(25);\n                dir.LastWriteTime = DateTime.Now;\n            }\n        }\n\n        private FileInfo FullPackFileName(AnyObjectId name)\n        {\n            var packdir = Path.Combine(db.ObjectDatabase.getDirectory().FullName, \"pack\");\n            return new FileInfo(Path.Combine(packdir, \"pack-\" + GitSharp.Core.Transport.IndexPack.GetPackFileName(name.Name)));\n        }\n\n        private FileInfo FullIndexFileName(AnyObjectId name)\n        {\n            var packdir = Path.Combine(db.ObjectDatabase.getDirectory().FullName, \"pack\");\n            return new FileInfo(Path.Combine(packdir, \"pack-\" + GitSharp.Core.Transport.IndexPack.GetIndexFileName(name.Name)));\n        }\n\n        private RevObject WriteBlob(Core.Repository repo, string data)\n        {\n            var revWalk = new GitSharp.Core.RevWalk.RevWalk(repo);\n            byte[] bytes = Constants.encode(data);\n            var ow = new ObjectWriter(repo);\n            ObjectId id = ow.WriteBlob(bytes);\n            try\n            {\n                Parse(id);\n                Assert.Fail(\"Object \" + id.Name + \" should not exist in test repository\");\n            }\n            catch (MissingObjectException)\n            {\n                // Ok\n            }\n\n            return revWalk.lookupBlob(id);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ConstantsEncodingTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class ConstantsEncodingTest\n    {\n        [Test]\n        public void testEncodeASCII_SimpleASCII()\n        {\n            const string src = \"abc\";\n            byte[] exp = { (byte)'a', (byte)'b', (byte)'c' };\n            byte[] res = Constants.encodeASCII(src);\n            Assert.IsTrue(exp.SequenceEqual(res));\n            Assert.AreEqual(src, Constants.CHARSET.GetString(res, 0, res.Length));\n        }\n\n        [Test]\n        public void testEncodeASCII_FailOnNonASCII()\n        {\n            const string src = \"Ūnĭcōde̽\";\n\n            var err = AssertHelper.Throws<ArgumentException>(() => Constants.encodeASCII(src));\n\n            Assert.AreEqual(\"Not ASCII string: \" + src, err.Message);\n        }\n\n    \t[Test]\n        public void testEncodeASCII_Number13()\n        {\n            const long src = 13;\n            byte[] exp = { (byte)'1', (byte)'3' };\n            byte[] res = Constants.encodeASCII(src);\n            Assert.IsTrue(exp.SequenceEqual(res));\n        }\n\n        [Test]\n        public void testEncode_SimpleASCII()\n        {\n            const string src = \"abc\";\n            byte[] exp = { (byte)'a', (byte)'b', (byte)'c' };\n            byte[] res = Constants.encode(src);\n            Assert.IsTrue(exp.SequenceEqual(res));\n            Assert.AreEqual(src, Constants.CHARSET.GetString(res, 0, res.Length));\n        }\n\n        [Test]\n        public void testEncode_Unicode()\n        {\n            const string src = \"Ūnĭcōde̽\"; \n            byte[] exp = { 0xC5, 0xAA, 0x6E, 0xC4,\n                0xAD, 0x63, 0xC5, 0x8D, 0x64, 0x65,\n                0xCC, 0xBD };\n\n            byte[] res = Constants.encode(src);\n            Assert.IsTrue(exp.SequenceEqual(res));\n            Assert.AreEqual(src, Constants.CHARSET.GetString(res, 0, res.Length));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Crc32Tests.cs",
    "content": "﻿using GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class Crc32Tests\n    {\n        [Test]\n        public void Tests()\n        {\n            var crc = new Crc32();\n            Assert.AreEqual(0, crc.Value);\n            crc.Update(145);\n            Assert.AreEqual(1426738271, crc.Value);\n            crc.Update(123456789);\n            Assert.AreEqual(1147030863, crc.Value);\n            var data = new byte[] { 145, 234, 156 };\n            crc.Update(data);\n            Assert.AreEqual(3967437022, crc.Value);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/DiffFormatterReflowTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Patch;\nusing GitSharp.Core.Tests.Patch;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Diff\n{\n\t[TestFixture]\n\tpublic class DiffFormatterReflowTest : BasePatchTest\n\t{\n\t\tprivate RawText a;\n\t\tprivate RawText b;\n\t\tprivate FileHeader file;\n\t\tprivate MemoryStream memoryStream;\n\t\tprivate DiffFormatter fmt;\n\n\t\t[SetUp]\n\t\tprotected void setUp()\n\t\t{\n\t\t\tmemoryStream = new MemoryStream();\n\t\t\tfmt = new DiffFormatter();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNegativeContextFails()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t    AssertHelper.Throws<ArgumentException>(() => fmt.setContext(-1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext0()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(0);\n            AssertFormatted(\"testContext0.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext1()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(1);\n            AssertFormatted(\"testContext1.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext3()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(3);\n            AssertFormatted(\"testContext3.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext5()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(5);\n            AssertFormatted(\"testContext5.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext10()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(10);\n            AssertFormatted(\"testContext10.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContext100()\n\t\t{\n\t\t\tInit(\"X\");\n\t\t\tfmt.setContext(100);\n            AssertFormatted(\"testContext100.out\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEmpty1()\n\t\t{\n\t\t\tInit(\"E\");\n\t\t\tAssertFormatted(\"E.patch\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoNewLine1()\n\t\t{\n\t\t\tInit(\"Y\");\n\t\t\tAssertFormatted(\"Y.patch\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoNewLine2()\n\t\t{\n\t\t\tInit(\"Z\");\n\t\t\tAssertFormatted(\"Z.patch\");\n\t\t}\n\n\t\tprivate void Init(string name)\n\t\t{\n\t\t\ta = new RawText(ReadFile(name + \"_PreImage\"));\n\t\t\tb = new RawText(ReadFile(name + \"_PostImage\"));\n\t\t\tfile = ParseTestPatchFile(DiffsDir + name + \".patch\").getFiles()[0];\n\t\t}\n\n\t\tprivate void AssertFormatted(string name)\n\t\t{\n\t\t\tfmt.format(memoryStream, file, a, b);\n\t\t\tstring exp = RawParseUtils.decode(ReadFile(name));\n\t\t\tAssert.AreEqual(exp, RawParseUtils.decode(memoryStream.ToArray()));\n\t\t}\n\n\t\tprivate static byte[] ReadFile(string patchFile)\n\t\t{\n            return File.ReadAllBytes(DiffsDir + patchFile);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/DiffTestDataGenerator.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.Text;\n\nnamespace GitSharp.Tests.GitSharp.Core.Diff\n{\n    public class DiffTestDataGenerator {\n    /*\n\t * Generate sequence of characters in ascending order. The first character\n\t * is a space. All subsequent characters have an ASCII code one greater then\n\t * the ASCII code of the preceding character. On exception: the character\n\t * following which follows '~' is again a ' '.\n\t *\n\t * @param len\n\t *            length of the String to be returned\n\t * @return the sequence of characters as String\n\t */\n        public static string generateSequence(int len) {\n            return generateSequence(len, 0, 0);\n        }\n\n    /*\n\t * Generate sequence of characters similar to the one returned by\n\t * {@link #generateSequence(int)}. But this time in each chunk of\n\t * <skipPeriod> characters the last <skipLength> characters are left out. By\n\t * calling this method twice with two different prime skipPeriod values and\n\t * short skipLength values you create test data which is similar to what\n\t * programmers do to their source code - huge files with only few\n\t * insertions/deletions/changes.\n\t *\n\t * @param len\n\t *            length of the String to be returned\n\t * @param skipPeriod\n\t * @param skipLength\n\t * @return the sequence of characters as String\n\t */\n        public static string generateSequence(int len, int skipPeriod,\n                                              int skipLength) {\n            StringBuilder text = new StringBuilder(len);\n            int skipStart = skipPeriod - skipLength;\n            int skippedChars = 0;\n            for (int i = 0; i - skippedChars < len; ++i) {\n                if (skipPeriod == 0 || i % skipPeriod < skipStart) {\n                    text.Append((char) (32 + i % 95));\n                } else {\n                    skippedChars++;\n                }\n            }\n            return text.ToString();\n                                              }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/EditListTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing NUnit.Framework;\nusing GitSharp.Core.Diff;\nusing System.Collections;\n\nnamespace GitSharp.Core.Tests.Diff\n{\n    [TestFixture]\n    public class EditListTest\n    {\n        [Test]\n        public void testEmpty()\n        {\n            EditList l = new EditList();\n            Assert.AreEqual(0, l.size());\n            Assert.IsTrue(l.isEmpty());\n            Assert.AreEqual(\"EditList[]\", l.ToString());\n\n            Assert.IsTrue(l.Equals(l));\n            Assert.IsTrue(l.Equals(new EditList()));\n            Assert.IsFalse(l.Equals(string.Empty));\n            Assert.AreEqual(l.GetHashCode(), new EditList().GetHashCode());\n        }\n\n        [Test]\n        public void testAddOne()\n        {\n            Edit e = new Edit(1, 2, 1, 1);\n            EditList l = new EditList();\n            l.Add(e);\n            Assert.AreEqual(1, l.size());\n            Assert.IsFalse(l.isEmpty());\n            Assert.AreSame(e, l.get(0));\n            IEnumerator i = l.GetEnumerator();\n            i.Reset();\n            i.MoveNext();\n            Assert.AreSame(e, i.Current);\n\n            Assert.IsTrue(l.Equals(l));\n            Assert.IsFalse(l.Equals(new EditList()));\n\n            EditList l2 = new EditList();\n            l2.Add(e);\n            Assert.IsTrue(l.Equals(l2));\n            Assert.IsTrue(l2.Equals(l));\n            Assert.AreEqual(l.GetHashCode(), l2.GetHashCode());\n        }\n\n        [Test]\n        public void testAddTwo()\n        {\n            Edit e1 = new Edit(1, 2, 1, 1);\n            Edit e2 = new Edit(8, 8, 8, 12);\n            EditList l = new EditList();\n            l.Add(e1);\n            l.Add(e2);\n            Assert.AreEqual(2, l.size());\n            Assert.AreSame(e1, l.get(0));\n            Assert.AreSame(e2, l.get(1));\n\n            IEnumerator i = l.GetEnumerator();\n            i.Reset();\n            i.MoveNext();\n            Assert.AreSame(e1, i.Current);\n            i.MoveNext();\n            Assert.AreSame(e2, i.Current);\n\n            Assert.IsTrue(l.Equals(l));\n            Assert.IsFalse(l.Equals(new EditList()));\n\n            EditList l2 = new EditList();\n            l2.Add(e1);\n            l2.Add(e2);\n            Assert.IsTrue(l.Equals(l2));\n            Assert.IsTrue(l2.Equals(l));\n            Assert.AreEqual(l.GetHashCode(), l2.GetHashCode());\n        }\n\n        [Test]\n        public void testSet()\n        {\n            Edit e1 = new Edit(1, 2, 1, 1);\n            Edit e2 = new Edit(3, 4, 3, 3);\n            EditList l = new EditList();\n            l.Add(e1);\n            Assert.AreSame(e1, l.get(0));\n            Assert.AreSame(e1, l.set(0, e2));\n            Assert.AreSame(e2, l.get(0));\n        }\n\n        [Test]\n        public void testRemove()\n        {\n            Edit e1 = new Edit(1, 2, 1, 1);\n            Edit e2 = new Edit(8, 8, 8, 12);\n            EditList l = new EditList();\n            l.Add(e1);\n            l.Add(e2);\n            l.Remove(e1);\n            Assert.AreEqual(1, l.size());\n            Assert.AreSame(e2, l.get(0));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/EditTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Diff;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Diff\n{\n\t[TestFixture]\n\tpublic class EditTest\n\t{\n\t\t[Test]\n\t\tpublic void testCreate()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 3, 4);\n\t\t\tAssert.AreEqual(1, e.BeginA);\n\t\t\tAssert.AreEqual(2, e.EndA);\n\t\t\tAssert.AreEqual(3, e.BeginB);\n\t\t\tAssert.AreEqual(4, e.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testCreateEmpty()\n\t\t{\n\t\t\tEdit e = new Edit(1, 3);\n\t\t\tAssert.AreEqual(1, e.BeginA);\n\t\t\tAssert.AreEqual(1, e.EndA);\n\t\t\tAssert.AreEqual(3, e.BeginB);\n\t\t\tAssert.AreEqual(3, e.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSwap()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 3, 4);\n\t\t\te.Swap();\n\t\t\tAssert.AreEqual(3, e.BeginA);\n\t\t\tAssert.AreEqual(4, e.EndA);\n\t\t\tAssert.AreEqual(1, e.BeginB);\n\t\t\tAssert.AreEqual(2, e.EndB);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testType_Insert()\n\t\t{\n\t\t\tEdit e = new Edit(1, 1, 1, 2);\n\t\t\tAssert.AreEqual(Edit.Type.INSERT, e.EditType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testType_Delete()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 1, 1);\n\t\t\tAssert.AreEqual(Edit.Type.DELETE, e.EditType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testType_Replace()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 1, 4);\n\t\t\tAssert.AreEqual(Edit.Type.REPLACE, e.EditType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testType_Empty() \n\t\t{\n\t\t\tAssert.AreEqual(Edit.Type.EMPTY, new Edit(1, 1, 2, 2).EditType);\n\t\t\tAssert.AreEqual(Edit.Type.EMPTY, new Edit(1, 2).EditType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testToString()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 1, 4);\n\t\t\tAssert.AreEqual(\"REPLACE(1-2,1-4)\", e.ToString());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEquals1()\n\t\t{\n\t\t\tEdit e1 = new Edit(1, 2, 3, 4);\n\t\t\tEdit e2 = new Edit(1, 2, 3, 4);\n\n\t\t\tAssert.IsTrue(e1.Equals(e1));\n\t\t\tAssert.IsTrue(e1.Equals(e2));\n\t\t\tAssert.IsTrue(e2.Equals(e1));\n\t\t\tAssert.AreEqual(e1.GetHashCode(), e2.GetHashCode());\n\t\t\tAssert.IsFalse(e1.Equals(\"\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNotEquals1()\n\t\t{\n\t\t\tAssert.IsFalse(new Edit(1, 2, 3, 4).Equals(new Edit(0, 2, 3, 4)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNotEquals2()\n\t\t{\n\t\t\tAssert.IsFalse(new Edit(1, 2, 3, 4).Equals(new Edit(1, 0, 3, 4)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNotEquals3()\n\t\t{\n\t\t\tAssert.IsFalse(new Edit(1, 2, 3, 4).Equals(new Edit(1, 2, 0, 4)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNotEquals4()\n\t\t{\n\t\t\tAssert.IsFalse(new Edit(1, 2, 3, 4).Equals(new Edit(1, 2, 3, 0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testExtendA()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 1, 1);\n\n\t\t\te.ExtendA();\n\t\t\tAssert.AreEqual(new Edit(1, 3, 1, 1), e);\n\n\t\t\te.ExtendA();\n\t\t\tAssert.AreEqual(new Edit(1, 4, 1, 1), e);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testExtendB()\n\t\t{\n\t\t\tEdit e = new Edit(1, 2, 1, 1);\n\n\t\t\te.ExtendB();\n\t\t\tAssert.AreEqual(new Edit(1, 2, 1, 2), e);\n\n\t\t\te.ExtendB();\n\t\t\tAssert.AreEqual(new Edit(1, 2, 1, 3), e);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/MyersDiffPerformanceTest.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing GitSharp.Core.Diff;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Diff\n{\n\t/*\n\t * Test cases for the performance of the diff implementation. The tests test\n\t * that the performance of the MyersDiff algorithm is really O(N*D). Means the\n\t * time for computing the diff between a and b should depend on the product of\n\t * a.length+b.length and the number of found differences. The tests compute\n\t * diffs between chunks of different length, measure the needed time and check\n\t * that time/(N*D) does not differ more than a certain factor (currently 10)\n\t */\n\t[TestFixture]\n\tpublic class MyersDiffPerformanceTest\n\t{\n\t\tprivate static long longTaskBoundary = 5000000000L;\n\n\t\tprivate static int minCPUTimerTicks = 10;\n\n\t\tprivate static int maxFactor = 15;\n\n\t\tprivate CPUTimeStopWatch stopwatch = CPUTimeStopWatch.createInstance();\n\n\t\tpublic class PerfData : IComparable<PerfData>\n\t\t{\n\t\t\tprivate Func<double, string> fmt = d => d.ToString(\"#.##E0\");\n\n\t\t\tpublic long runningTime;\n\n\t\t\tpublic long D;\n\n\t\t\tpublic long N;\n\n\t\t\tprivate double p1 = -1;\n\n\t\t\tprivate double p2 = -1;\n\n\t\t\tpublic double perf1()\n\t\t\t{\n\t\t\t\tif (p1 < 0)\n\t\t\t\t\tp1 = runningTime / ((double)N * D);\n\t\t\t\treturn p1;\n\t\t\t}\n\n\t\t\tpublic double perf2()\n\t\t\t{\n\t\t\t\tif (p2 < 0)\n\t\t\t\t\tp2 = runningTime / ((double)N * D * D);\n\t\t\t\treturn p2;\n\t\t\t}\n\n\t\t\tpublic string toString()\n\t\t\t{\n\t\t\t\treturn (\"diffing \" + N / 2 + \" bytes took \" + runningTime\n\t\t\t\t\t\t  + \" ns. N=\" + N + \", D=\" + D + \", time/(N*D):\"\n\t\t\t\t\t\t  + fmt(perf1()) + \", time/(N*D^2):\" + fmt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (perf2()));\n\t\t\t}\n\n\t\t\tpublic int CompareTo(PerfData o2)\n\t\t\t{\n\t\t\t\tint _whichPerf = 1;\n\t\t\t\tPerfData o1 = this;\n\n\t\t\t\tdouble p1 = (_whichPerf == 1) ? o1.perf1() : o1.perf2();\n\t\t\t\tdouble p2 = (_whichPerf == 1) ? o2.perf1() : o2.perf2();\n\t\t\t\treturn (p1 < p2) ? -1 : (p1 > p2) ? 1 : 0;\n\t\t\t}\n\t\t}\n\n\t\t[Ignore(\"This runs too long and hinders development. It can be run in case of changes to the diff algorithm.\")]\n\t\t[Test]\n\t\tpublic void test()\n\t\t{\n\t\t\tif (stopwatch != null)\n\t\t\t{\n\t\t\t\tvar perfData = new List<PerfData>();\n\t\t\t\tperfData.Add(test(10000));\n\t\t\t\tperfData.Add(test(20000));\n\t\t\t\tperfData.Add(test(50000));\n\t\t\t\tperfData.Add(test(80000));\n\t\t\t\tperfData.Add(test(99999));\n\t\t\t\tperfData.Add(test(999999));\n\n\t\t\t\tdouble factor = perfData.Max().perf1()\n\t\t\t\t\t\t\t\t\t / perfData.Min().perf1();\n\t\t\t\tAssert.IsTrue(factor < maxFactor,\n\t\t\t\t\t\t\t\t  \"minimun and maximum of performance-index t/(N*D) differed too much. Measured factor of \"\n\t\t\t\t\t\t\t\t  + factor\n\t\t\t\t\t\t\t\t  + \" (maxFactor=\"\n\t\t\t\t\t\t\t\t  + maxFactor\n\t\t\t\t\t\t\t\t  + \"). Perfdata=<\" + perfData.ToString() + \">\");\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t  * Tests the performance of MyersDiff for texts which are similar (not\n\t\t  * random data). The CPU time is measured and returned. Because of bad\n\t\t  * accuracy of CPU time information the diffs are repeated. During each\n\t\t  * repetition the interim CPU time is checked. The diff operation is\n\t\t  * repeated until we have seen the CPU time clock changed its value at least\n\t\t  * {@link #minCPUTimerTicks} times.\n\t\t  *\n\t\t  * @param characters\n\t\t  *            the size of the diffed character sequences.\n\t\t  * @return performance data\n\t\t  */\n\t\tprivate PerfData test(int characters)\n\t\t{\n\t\t\tPerfData ret = new PerfData();\n\t\t\tstring a = DiffTestDataGenerator.generateSequence(characters, 971, 3);\n\t\t\tstring b = DiffTestDataGenerator.generateSequence(characters, 1621, 5);\n\t\t\tCharArray ac = new CharArray(a);\n\t\t\tCharArray bc = new CharArray(b);\n\t\t\tMyersDiff myersDiff = null;\n\t\t\tint cpuTimeChanges = 0;\n\t\t\tlong lastReadout = 0;\n\t\t\tlong interimTime = 0;\n\t\t\tint repetitions = 0;\n\t\t\tstopwatch.start();\n\t\t\twhile (cpuTimeChanges < minCPUTimerTicks && interimTime < longTaskBoundary)\n\t\t\t{\n\t\t\t\tmyersDiff = new MyersDiff(ac, bc);\n\t\t\t\trepetitions++;\n\t\t\t\tinterimTime = stopwatch.readout();\n\t\t\t\tif (interimTime != lastReadout)\n\t\t\t\t{\n\t\t\t\t\tcpuTimeChanges++;\n\t\t\t\t\tlastReadout = interimTime;\n\t\t\t\t}\n\t\t\t}\n\t\t\tret.runningTime = stopwatch.stop() / repetitions;\n\t\t\tret.N = (ac.size() + bc.size());\n\t\t\tret.D = myersDiff.getEdits().size();\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tprivate class CharArray : Sequence\n\t\t{\n\t\t\tprivate char[] array;\n\n\t\t\tpublic CharArray(string s)\n\t\t\t{\n\t\t\t\tarray = s.ToCharArray();\n\t\t\t}\n\n\t\t\tpublic int size()\n\t\t\t{\n\t\t\t\treturn array.Length;\n\t\t\t}\n\n\t\t\tpublic bool equals(int i, Sequence other, int j)\n\t\t\t{\n\t\t\t\tCharArray o = (CharArray)other;\n\t\t\t\treturn array[i] == o.array[j];\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/MyersDiffTest.cs",
    "content": "/*\n * Copyright (C) 2009, Johannes E. Schindelin\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.Text;\nusing GitSharp.Core.Diff;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Diff\n{\n    public class MyersDiffTest  {\n        [Test]\n        public void testAtEnd()\n        {\n            assertDiff(\"HELLO\", \"HELL\", \" -4,1 +4,0\");\n        }\n\n        [Test]\n        public void testA()\n        {\n            assertDiff(\"A\", \"a\", \" -0,1 +0,1\");\n        }\n\n        [Test]\n        public void testB()\n        {\n            assertDiff(\"a\", \"A\", \" -0,1 +0,1\");\n        }\n\n        [Test]\n        public void testC()\n        {\n            assertDiff(\"aA\", \"A\", \" -0,1 +0,0\");\n        }\n\n        [Test]\n        public void testD()\n        {\n            assertDiff(\"Aa\", \"A\", \" -1,1 +1,0\");\n        }\n\n        [Test]\n        public void testE()\n        {\n            assertDiff(\"ABCDEFG\", \"BDF\", \" -0,1 +0,0 -2,1 +1,0 -4,1 +2,0 -6,1 +3,0\");\n        }\n\n        [Test]\n        public void testAtStart() {\n            assertDiff(\"Git\", \"JGit\", \" -0,0 +0,1\");\n        }\n\n        [Test]\n        public void testSimple()\n        {\n            assertDiff(\"HELLO WORLD\", \"LOW\",\n                       \" -0,3 +0,0 -5,1 +2,0 -7,4 +3,0\");\n            // is ambiguous, could be this, too:\n            // \" -0,2 +0,0 -3,1 +1,0 -5,1 +2,0 -7,4 +3,0\"\n        }\n\n        public void assertDiff(string a, string b, string edits) {\n            MyersDiff diff = new MyersDiff(toCharArray(a), toCharArray(b));\n            Assert.AreEqual(edits, toString(diff.getEdits()));\n        }\n\n        private static string toString(EditList list) {\n            StringBuilder builder = new StringBuilder();\n            foreach (Edit e in list)\n                builder.Append(\" -\" + e.BeginA\n                               + \",\" + (e.EndA - e.BeginA)\n                               + \" +\" + e.BeginB + \",\" + (e.EndB - e.BeginB));\n            return builder.ToString();\n        }\n\n        private static CharArray toCharArray(string s) {\n            return new CharArray(s);\n        }\n\n        protected static string toString(Sequence seq, int begin, int end) {\n            CharArray a = (CharArray)seq;\n            return new string(a.array, begin, end - begin);\n        }\n\n        protected static string toString(CharArray a, CharArray b,\n                                         int x, int k) {\n            return \"(\" + x + \",\" + (k + x)\n                   + (x < 0 ? '<' :\n                                      (x >= a.array.Length ?\n                                                               '>' : a.array[x]))\n                   + (k + x < 0 ? '<' :\n                                          (k + x >= b.array.Length ?\n                                                                       '>' : b.array[k + x]))\n                   + \")\";\n                                         }\n\n        protected class CharArray : Sequence {\n            internal char[] array;\n            public CharArray(string s) { array = s.ToCharArray(); }\n            public int size() { return array.Length; }\n            public bool equals(int i, Sequence other, int j) {\n                CharArray o = (CharArray)other;\n                return array[i] == o.array[j];\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Diff/RawTextTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Diff\n{\n    [TestFixture]\n    public class RawTextTest\n    {\n        [Test]\n        public void testEmpty()\n        {\n            var r = new RawText(new byte[0]);\n            Assert.AreEqual(0, r.size());\n        }\n\n        [Test]\n        public void testEquals()\n        {\n            var a = new RawText(Constants.encodeASCII(\"foo-a\\nfoo-b\\n\"));\n            var b = new RawText(Constants.encodeASCII(\"foo-b\\nfoo-c\\n\"));\n\n            Assert.AreEqual(2, a.size());\n            Assert.AreEqual(2, b.size());\n\n            // foo-a != foo-b\n            Assert.IsFalse(a.equals(0, b, 0));\n            Assert.IsFalse(b.equals(0, a, 0));\n\n            // foo-b == foo-b\n            Assert.IsTrue(a.equals(1, b, 0));\n            Assert.IsTrue(b.equals(0, a, 1));\n        }\n\n        [Test]\n        public void testWriteLine1()\n        {\n            var a = new RawText(Constants.encodeASCII(\"foo-a\\nfoo-b\\n\"));\n            var o = new MemoryStream();\n            a.writeLine(o, 0);\n            byte[] r = o.ToArray();\n            Assert.AreEqual(\"foo-a\", RawParseUtils.decode(r));\n        }\n\n        [Test]\n        public void testWriteLine2()\n        {\n            var a = new RawText(Constants.encodeASCII(\"foo-a\\nfoo-b\"));\n            var o = new MemoryStream();\n            a.writeLine(o, 1);\n            byte[] r = o.ToArray();\n            Assert.AreEqual(\"foo-b\", RawParseUtils.decode(r));\n        }\n\n        [Test]\n        public void testWriteLine3()\n        {\n            var a = new RawText(Constants.encodeASCII(\"a\\n\\nb\\n\"));\n            var o = new MemoryStream();\n            a.writeLine(o, 1);\n            byte[] r = o.ToArray();\n            Assert.AreEqual(string.Empty, RawParseUtils.decode(r));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheBasicTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheBasicTest : RepositoryTestCase\n    {\n        [Test]\n        public void testReadMissing_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n\n            DirCache dc = DirCache.read(db);\n            Assert.IsNotNull(dc);\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        [Test]\n        public void testReadMissing_TempIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/tmp_index\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n\n            DirCache dc = DirCache.read(idx);\n            Assert.IsNotNull(dc);\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        [Test]\n        public void testLockMissing_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            var lck = new FileInfo(db.Directory + \"/index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(db);\n            Assert.IsNotNull(dc);\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsTrue(File.Exists(lck.FullName));\n            Assert.AreEqual(0, dc.getEntryCount());\n\n            dc.unlock();\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n        }\n\n        [Test]\n        public void testLockMissing_TempIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/tmp_index\");\n            var lck = new FileInfo(db.Directory + \"/tmp_index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(idx);\n            Assert.IsNotNull(dc);\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsTrue(File.Exists(lck.FullName));\n            Assert.AreEqual(0, dc.getEntryCount());\n\n            dc.unlock();\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n        }\n\n        [Test]\n        public void testWriteEmptyUnlock_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            var lck = new FileInfo(db.Directory + \"/index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(db);\n            Assert.AreEqual(0, lck.Length);\n            dc.write();\n            Assert.AreEqual(12 + 20, new FileInfo(lck.FullName).Length);\n\n            dc.unlock();\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n        }\n\n        [Test]\n        public void testWriteEmptyCommit_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            var lck = new FileInfo(db.Directory + \"/index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(db);\n            Assert.AreEqual(0, lck.Length);\n            dc.write();\n            Assert.AreEqual(12 + 20, new FileInfo(lck.FullName).Length);\n\n            Assert.IsTrue(dc.commit());\n            Assert.IsTrue(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n            Assert.AreEqual(12 + 20, new FileInfo(idx.FullName).Length);\n        }\n\n        [Test]\n        public void testWriteEmptyReadEmpty_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            var lck = new FileInfo(db.Directory + \"/index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(db);\n            dc.write();\n            Assert.IsTrue(dc.commit());\n            Assert.IsTrue(File.Exists(idx.FullName));\n\n            dc = DirCache.read(db);\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        [Test]\n        public void testWriteEmptyLockEmpty_RealIndex()\n        {\n            var idx = new FileInfo(db.Directory + \"/index\");\n            var lck = new FileInfo(db.Directory + \"/index.lock\");\n            Assert.IsFalse(File.Exists(idx.FullName));\n            Assert.IsFalse(File.Exists(lck.FullName));\n\n            DirCache dc = DirCache.Lock(db);\n            dc.write();\n            Assert.IsTrue(dc.commit());\n            Assert.IsTrue(File.Exists(idx.FullName));\n\n            dc = DirCache.Lock(db);\n            Assert.AreEqual(0, dc.getEntryCount());\n            Assert.IsTrue(File.Exists(idx.FullName));\n            Assert.IsTrue(File.Exists(lck.FullName));\n            dc.unlock();\n        }\n\n        [Test]\n        public void testBuildThenClear()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a.b\", \"a/b\", \"a0b\" };\n\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n\n            b.finish();\n\n            Assert.AreEqual(paths.Length, dc.getEntryCount());\n            dc.clear();\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        [Test]\n        public void testFindOnEmpty()\n        {\n            DirCache dc = DirCache.newInCore();\n            byte[] path = Constants.encode(\"a\");\n            Assert.AreEqual(-1, dc.findEntry(path, path.Length));\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheBuilderIteratorTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.DirectoryCache\n{\n\t[TestFixture]\n\tpublic class DirCacheBuilderIteratorTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void testPathFilterGroup_DoesNotSkipTail()\n\t\t{\n\t\t\tDirCache dc = DirCache.read(db);\n\n\t\t\tvar mode = FileMode.RegularFile;\n\t\t\tstring[] paths = { \"a.\", \"a/b\", \"a/c\", \"a/d\", \"a0b\" };\n\t\t\tvar ents = new DirCacheEntry[paths.Length];\n\t\t\tfor (int i = 0; i < paths.Length; i++)\n\t\t\t{\n\t\t\t\tents[i] = new DirCacheEntry(paths[i]);\n\t\t\t\tents[i].setFileMode(mode);\n\t\t\t}\n\n\t\t\tDirCacheBuilder builder = dc.builder();\n\t\t\tfor (int i = 0; i < ents.Length; i++)\n\t\t\t{\n\t\t\t\tbuilder.add(ents[i]);\n\t\t\t}\n\t\t\tbuilder.finish();\n\n\t\t\tconst int expIdx = 2;\n\t\t\tDirCacheBuilder b = dc.builder();\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.addTree(new DirCacheBuildIterator(b));\n\t\t\ttw.Recursive = true;\n\t\t\ttw.setFilter(PathFilterGroup.createFromStrings(new[] { paths[expIdx] }));\n\n\t\t\tAssert.IsTrue(tw.next(), \"found \" + paths[expIdx]);\n\t\t\tvar c = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));\n\t\t\tAssert.IsNotNull(c);\n\t\t\tAssert.AreEqual(expIdx, c.Pointer);\n\t\t\tAssert.AreSame(ents[expIdx], c.getDirCacheEntry());\n\t\t\tAssert.AreEqual(paths[expIdx], tw.getPathString());\n\t\t\tAssert.AreEqual(mode.Bits, tw.getRawMode(0));\n\t\t\tAssert.AreSame(mode, tw.getFileMode(0));\n\t\t\tb.add(c.getDirCacheEntry());\n\n\t\t\tAssert.IsFalse(tw.next(), \"no more entries\");\n\n\t\t\tb.finish();\n\t\t\tAssert.AreEqual(ents.Length, dc.getEntryCount());\n\t\t\tfor (int i = 0; i < ents.Length; i++)\n\t\t\t{\n\t\t\t\tAssert.AreSame(ents[i], dc.getEntry(i));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheBuilderTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheBuilderTest : RepositoryTestCase\n    {\n\n        [Test]\n        public void testBuildEmpty()\n        {\n            DirCache dc = DirCache.Lock(db);\n            DirCacheBuilder b = dc.builder();\n            Assert.IsNotNull(b);\n            b.finish();\n            dc.write();\n            Assert.IsTrue(dc.commit());\n\n            dc = DirCache.read(db);\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        [Test]\n        public void testBuildRejectsUnsetFileMode()\n        {\n            DirCache dc = DirCache.newInCore();\n            DirCacheBuilder b = dc.builder();\n            Assert.IsNotNull(b);\n\n            DirCacheEntry e = new DirCacheEntry(\"a\");\n            Assert.AreEqual(0, e.getRawMode());\n            try\n            {\n                b.add(e);\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"FileMode not set for path a\", err.Message);\n            }\n        }\n\n        [Test]\n        public void testBuildOneFile_FinishWriteCommit()\n        {\n            string path = \"a-File-path\";\n            var mode = FileMode.RegularFile;\n            long lastModified = 1218123387057L;\n            int Length = 1342;\n            DirCacheEntry entOrig;\n\n            DirCache dc = DirCache.Lock(db);\n            DirCacheBuilder b = dc.builder();\n            Assert.IsNotNull(b);\n\n            entOrig = new DirCacheEntry(path);\n            entOrig.setFileMode(mode);\n            entOrig.setLastModified(lastModified);\n            entOrig.setLength(Length);\n\n            Assert.AreNotSame(path, entOrig.getPathString());\n            Assert.AreEqual(path, entOrig.getPathString());\n            Assert.AreEqual(ObjectId.ZeroId, entOrig.getObjectId());\n            Assert.AreEqual(mode.Bits, entOrig.getRawMode());\n            Assert.AreEqual(0, entOrig.getStage());\n            Assert.AreEqual(lastModified, entOrig.getLastModified());\n            Assert.AreEqual(Length, entOrig.getLength());\n            Assert.IsFalse(entOrig.isAssumeValid());\n            b.add(entOrig);\n\n            b.finish();\n            Assert.AreEqual(1, dc.getEntryCount());\n            Assert.AreSame(entOrig, dc.getEntry(0));\n\n            dc.write();\n            Assert.IsTrue(dc.commit());\n\n            dc = DirCache.read(db);\n            Assert.AreEqual(1, dc.getEntryCount());\n\n            DirCacheEntry entRead = dc.getEntry(0);\n            Assert.AreNotSame(entOrig, entRead);\n            Assert.AreEqual(path, entRead.getPathString());\n            Assert.AreEqual(ObjectId.ZeroId, entOrig.getObjectId());\n            Assert.AreEqual(mode.Bits, entOrig.getRawMode());\n            Assert.AreEqual(0, entOrig.getStage());\n            Assert.AreEqual(lastModified, entOrig.getLastModified());\n            Assert.AreEqual(Length, entOrig.getLength());\n            Assert.IsFalse(entOrig.isAssumeValid());\n        }\n\n        [Test]\n        public void testBuildOneFile_Commit()\n        {\n            string path = \"a-File-path\";\n            var mode = FileMode.RegularFile;\n            long lastModified = 1218123387057L;\n            int Length = 1342;\n            DirCacheEntry entOrig;\n\n            DirCache dc = DirCache.Lock(db);\n            DirCacheBuilder b = dc.builder();\n            Assert.IsNotNull(b);\n\n            entOrig = new DirCacheEntry(path);\n            entOrig.setFileMode(mode);\n            entOrig.setLastModified(lastModified);\n            entOrig.setLength(Length);\n\n            Assert.AreNotSame(path, entOrig.getPathString());\n            Assert.AreEqual(path, entOrig.getPathString());\n            Assert.AreEqual(ObjectId.ZeroId, entOrig.getObjectId());\n            Assert.AreEqual(mode.Bits, entOrig.getRawMode());\n            Assert.AreEqual(0, entOrig.getStage());\n            Assert.AreEqual(lastModified, entOrig.getLastModified());\n            Assert.AreEqual(Length, entOrig.getLength());\n            Assert.IsFalse(entOrig.isAssumeValid());\n            b.add(entOrig);\n\n            Assert.IsTrue(b.commit());\n            Assert.AreEqual(1, dc.getEntryCount());\n            Assert.AreSame(entOrig, dc.getEntry(0));\n            Assert.IsFalse(new FileInfo(db.Directory + \"/index.lock\").Exists);\n\n            dc = DirCache.read(db);\n            Assert.AreEqual(1, dc.getEntryCount());\n\n            DirCacheEntry entRead = dc.getEntry(0);\n            Assert.AreNotSame(entOrig, entRead);\n            Assert.AreEqual(path, entRead.getPathString());\n            Assert.AreEqual(ObjectId.ZeroId, entOrig.getObjectId());\n            Assert.AreEqual(mode.Bits, entOrig.getRawMode());\n            Assert.AreEqual(0, entOrig.getStage());\n            Assert.AreEqual(lastModified, entOrig.getLastModified());\n            Assert.AreEqual(Length, entOrig.getLength());\n            Assert.IsFalse(entOrig.isAssumeValid());\n        }\n\n        [Test]\n        public void testFindSingleFile()\n        {\n            string path = \"a-File-path\";\n            DirCache dc = DirCache.read(db);\n            DirCacheBuilder b = dc.builder();\n            Assert.IsNotNull(b);\n\n            DirCacheEntry entOrig = new DirCacheEntry(path);\n            entOrig.setFileMode(FileMode.RegularFile);\n            Assert.AreNotSame(path, entOrig.getPathString());\n            Assert.AreEqual(path, entOrig.getPathString());\n            b.add(entOrig);\n            b.finish();\n\n            Assert.AreEqual(1, dc.getEntryCount());\n            Assert.AreSame(entOrig, dc.getEntry(0));\n            Assert.AreEqual(0, dc.findEntry(path));\n\n            Assert.AreEqual(-1, dc.findEntry(\"@@-before\"));\n            Assert.AreEqual(0, real(dc.findEntry(\"@@-before\")));\n\n            Assert.AreEqual(-2, dc.findEntry(\"a-zoo\"));\n            Assert.AreEqual(1, real(dc.findEntry(\"a-zoo\")));\n\n            Assert.AreSame(entOrig, dc.getEntry(path));\n        }\n\n        [Test]\n        public void testAdd_InGitSortOrder()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a.b\", \"a/b\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n                b.add(ents[i]);\n            b.finish();\n\n            Assert.AreEqual(paths.Length, dc.getEntryCount());\n            for (int i = 0; i < paths.Length; i++)\n            {\n                Assert.AreSame(ents[i], dc.getEntry(i));\n                Assert.AreEqual(paths[i], dc.getEntry(i).getPathString());\n                Assert.AreEqual(i, dc.findEntry(paths[i]));\n                Assert.AreSame(ents[i], dc.getEntry(paths[i]));\n            }\n        }\n\n        [Test]\n        public void testAdd_ReverseGitSortOrder()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a.b\", \"a/b\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = ents.Length - 1; i >= 0; i--)\n                b.add(ents[i]);\n            b.finish();\n\n            Assert.AreEqual(paths.Length, dc.getEntryCount());\n            for (int i = 0; i < paths.Length; i++)\n            {\n                Assert.AreSame(ents[i], dc.getEntry(i));\n                Assert.AreEqual(paths[i], dc.getEntry(i).getPathString());\n                Assert.AreEqual(i, dc.findEntry(paths[i]));\n                Assert.AreSame(ents[i], dc.getEntry(paths[i]));\n            }\n        }\n\n        [Test]\n        public void testBuilderClear()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a.b\", \"a/b\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n            {\n                DirCacheBuilder b = dc.builder();\n                for (int i = 0; i < ents.Length; i++)\n                    b.add(ents[i]);\n                b.finish();\n            }\n            Assert.AreEqual(paths.Length, dc.getEntryCount());\n            {\n                DirCacheBuilder b = dc.builder();\n                b.finish();\n            }\n            Assert.AreEqual(0, dc.getEntryCount());\n        }\n\n        private static int real(int eIdx)\n        {\n            if (eIdx < 0)\n                eIdx = -(eIdx + 1);\n            return eIdx;\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheCGitCompatabilityTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheCGitCompatabilityTest : LocalDiskRepositoryTestCase\n    {\n        private readonly FileInfo _index = pathOf(\"gitgit.index\");\n\n        [Test]\n        public void testReadIndex_LsFiles()\n        {\n            List<CGitIndexRecord> ls = ReadLsFiles();\n            var dc = new DirCache(_index);\n            Assert.AreEqual(0, dc.getEntryCount());\n            dc.read();\n            Assert.AreEqual(ls.Count, dc.getEntryCount());\n\n            int i = 0;\n            foreach (var val in ls)\n            {\n                AssertAreEqual(val, dc.getEntry(i));\n                i++;\n            }\n        }\n\n        [Test]\n        public void testTreeWalk_LsFiles()\n        {\n            global::GitSharp.Core.Repository db = createBareRepository();\n            List<CGitIndexRecord> ls = ReadLsFiles();\n            var dc = new DirCache(_index);\n            Assert.AreEqual(0, dc.getEntryCount());\n            dc.read();\n            Assert.AreEqual(ls.Count, dc.getEntryCount());\n\n            var rItr = ls.GetEnumerator();\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.Recursive = true;\n            tw.addTree(new DirCacheIterator(dc));\n            while (rItr.MoveNext())\n            {\n                Assert.IsTrue(tw.next());\n                var dcItr = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));\n                Assert.IsNotNull(dcItr);\n                AssertAreEqual(rItr.Current, dcItr.getDirCacheEntry());\n            }\n        }\n\n        [Test]\n        public void testReadIndex_DirCacheTree()\n        {\n            List<CGitIndexRecord> cList = ReadLsFiles();\n            List<CGitLsTreeRecord> cTree = ReadLsTree();\n            var dc = new DirCache(_index);\n            Assert.AreEqual(0, dc.getEntryCount());\n            dc.read();\n            Assert.AreEqual(cList.Count, dc.getEntryCount());\n\n            DirCacheTree jTree = dc.getCacheTree(false);\n            Assert.IsNotNull(jTree);\n            Assert.AreEqual(string.Empty, jTree.getNameString());\n            Assert.AreEqual(string.Empty, jTree.getPathString());\n            Assert.IsTrue(jTree.isValid());\n            Assert.AreEqual(ObjectId.FromString(\"698dd0b8d0c299f080559a1cffc7fe029479a408\"), jTree.getObjectId());\n            Assert.AreEqual(cList.Count, jTree.getEntrySpan());\n\n            var subtrees = new List<CGitLsTreeRecord>();\n            foreach (CGitLsTreeRecord r in cTree)\n            {\n                if (FileMode.Tree.Equals(r.Mode))\n                    subtrees.Add(r);\n            }\n            Assert.AreEqual(subtrees.Count, jTree.getChildCount());\n\n            for (int i = 0; i < jTree.getChildCount(); i++)\n            {\n                DirCacheTree sj = jTree.getChild(i);\n                CGitLsTreeRecord sc = subtrees[i];\n                Assert.AreEqual(sc.Path, sj.getNameString());\n                Assert.AreEqual(sc.Path + \"/\", sj.getPathString());\n                Assert.IsTrue(sj.isValid());\n                Assert.AreEqual(sc.Id, sj.getObjectId());\n            }\n        }\n\n        [Test]\n        public void testUnsupportedOptionalExtension()\n        {\n            var dc = new DirCache(pathOf(\"gitgit.index.ZZZZ\"));\n            dc.read();\n            Assert.AreEqual(1, dc.getEntryCount());\n            Assert.AreEqual(\"A\", dc.getEntry(0).getPathString());\n        }\n\n        [Test]\n        public void testUnsupportedRequiredExtension()\n        {\n            var dc = new DirCache(pathOf(\"gitgit.index.aaaa\"));\n            try\n            {\n                dc.read();\n                Assert.Fail(\"Cache loaded an unsupported extension\");\n            }\n            catch (CorruptObjectException err)\n            {\n                Assert.AreEqual(\"DIRC extension 'aaaa'\"\n                        + \" not supported by this version.\", err.Message);\n            }\n        }\n\n        [Test]\n        public void testCorruptChecksumAtFooter()\n        {\n            var dc = new DirCache(pathOf(\"gitgit.index.badchecksum\"));\n            try\n            {\n                dc.read();\n                Assert.Fail(\"Cache loaded despite corrupt checksum\");\n            }\n            catch (CorruptObjectException err)\n            {\n                Assert.AreEqual(\"DIRC checksum mismatch\", err.Message);\n            }\n        }\n\n\n        private static void AssertAreEqual(CGitIndexRecord c, DirCacheEntry j)\n        {\n            Assert.IsNotNull(c);\n            Assert.IsNotNull(j);\n\n            Assert.AreEqual(c.Path, j.getPathString());\n            Assert.AreEqual(c.Id, j.getObjectId());\n            Assert.AreEqual(c.Mode, j.getRawMode());\n            Assert.AreEqual(c.Stage, j.getStage());\n        }\n\n        private static List<CGitIndexRecord> ReadLsFiles()\n        {\n            var r = new List<CGitIndexRecord>();\n            using (var br = new StreamReader(new FileStream(\"Resources/gitgit.lsfiles\", System.IO.FileMode.Open, FileAccess.Read), Constants.CHARSET))\n            {\n                string line;\n                while (!string.IsNullOrEmpty(line = br.ReadLine()))\n                {\n                    var cr = new CGitIndexRecord(line);\n                    r.Add(cr);\n                }\n            }\n            return r;\n        }\n\n        private static FileInfo pathOf(string name)\n        {\n            return new FileInfo(\"Resources/\" + name);\n        }\n        private static List<CGitLsTreeRecord> ReadLsTree()\n        {\n            var r = new List<CGitLsTreeRecord>();\n            using (var br = new StreamReader(new FileStream(\"Resources/gitgit.lstree\", System.IO.FileMode.Open, System.IO.FileAccess.Read), Constants.CHARSET))\n            {\n                string line;\n                while ((line = br.ReadLine()) != null)\n                {\n                    r.Add(new CGitLsTreeRecord(line));\n                }\n            }\n\n            return r;\n        }\n\n        #region Nested Types\n\n        private class CGitIndexRecord\n        {\n            public int Mode { get; private set; }\n            public ObjectId Id { get; private set; }\n            public int Stage { get; private set; }\n            public string Path { get; private set; }\n\n            public CGitIndexRecord(string line)\n            {\n                int tab = line.IndexOf('\\t');\n                int sp1 = line.IndexOf(' ');\n                int sp2 = line.IndexOf(' ', sp1 + 1);\n                Mode = NB.BaseToDecimal(line.Slice(0, sp1), 8);\n                Id = ObjectId.FromString(line.Slice(sp1 + 1, sp2));\n                Stage = int.Parse(line.Slice(sp2 + 1, tab));\n                Path = line.Substring(tab + 1);\n            }\n        }\n\n        private class CGitLsTreeRecord\n        {\n            public int Mode { get; private set; }\n            public ObjectId Id { get; private set; }\n            public string Path { get; private set; }\n\n            public CGitLsTreeRecord(string line)\n            {\n                int tab = line.IndexOf('\\t');\n                int sp1 = line.IndexOf(' ');\n                int sp2 = line.IndexOf(' ', sp1 + 1);\n                Mode = NB.BaseToDecimal(line.Slice(0, sp1), 8);\n                Id = ObjectId.FromString(line.Slice(sp2 + 1, tab));\n                Path = line.Substring(tab + 1);\n            }\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheEntryTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF TOSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing NUnit.Framework;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheEntryTest\n    {\n        [Test]\n        public void testIsValidPath()\n        {\n            Assert.IsTrue(isValidPath(\"a\"));\n            Assert.IsTrue(isValidPath(\"a/b\"));\n            Assert.IsTrue(isValidPath(\"ab/cd/ef\"));\n\n            Assert.IsFalse(isValidPath(\"\"));\n            Assert.IsFalse(isValidPath(\"/a\"));\n            Assert.IsFalse(isValidPath(\"a//b\"));\n            Assert.IsFalse(isValidPath(\"ab/cd//ef\"));\n            Assert.IsFalse(isValidPath(\"a/\"));\n            Assert.IsFalse(isValidPath(\"ab/cd/ef/\"));\n            Assert.IsFalse(isValidPath(\"a\\u0000b\"));\n        }\n\n        private static bool isValidPath(string path)\n        {\n            return DirCacheEntry.isValidPath(Constants.encode(path));\n        }\n\n        [Test]\n        public void testCreate_ByStringPath()\n        {\n            Assert.AreEqual(\"a\", new DirCacheEntry(\"a\").getPathString());\n            Assert.AreEqual(\"a/b\", new DirCacheEntry(\"a/b\").getPathString());\n\n            try\n            {\n                new DirCacheEntry(\"/a\");\n                Assert.Fail(\"Incorrectly created DirCacheEntry\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid path: /a\", err.Message);\n            }\n        }\n\n        [Test]\n        public void testCreate_ByStringPathAndStage()\n        {\n            DirCacheEntry e;\n\n            e = new DirCacheEntry(\"a\", 0);\n            Assert.AreEqual(\"a\", e.getPathString());\n            Assert.AreEqual(0, e.getStage());\n\n            e = new DirCacheEntry(\"a/b\", 1);\n            Assert.AreEqual(\"a/b\", e.getPathString());\n            Assert.AreEqual(1, e.getStage());\n\n            e = new DirCacheEntry(\"a/c\", 2);\n            Assert.AreEqual(\"a/c\", e.getPathString());\n            Assert.AreEqual(2, e.getStage());\n\n            e = new DirCacheEntry(\"a/d\", 3);\n            Assert.AreEqual(\"a/d\", e.getPathString());\n            Assert.AreEqual(3, e.getStage());\n\n            try\n            {\n                new DirCacheEntry(\"/a\", 1);\n                Assert.Fail(\"Incorrectly created DirCacheEntry\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid path: /a\", err.Message);\n            }\n\n            try\n            {\n                new DirCacheEntry(\"a\", -11);\n                Assert.Fail(\"Incorrectly created DirCacheEntry\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid stage -11 for path a\", err.Message);\n            }\n\n            try\n            {\n                new DirCacheEntry(\"a\", 4);\n                Assert.Fail(\"Incorrectly created DirCacheEntry\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid stage 4 for path a\", err.Message);\n            }\n        }\n\n        [Test]\n        public void testSetFileMode()\n        {\n            DirCacheEntry e = new DirCacheEntry(\"a\");\n\n            Assert.AreEqual(0, e.getRawMode());\n\n            e.setFileMode(FileMode.RegularFile);\n            Assert.AreSame(FileMode.RegularFile, e.getFileMode());\n            Assert.AreEqual(FileMode.RegularFile.Bits, e.getRawMode());\n\n            e.setFileMode(FileMode.ExecutableFile);\n            Assert.AreSame(FileMode.ExecutableFile, e.getFileMode());\n            Assert.AreEqual(FileMode.ExecutableFile.Bits, e.getRawMode());\n\n            e.setFileMode(FileMode.Symlink);\n            Assert.AreSame(FileMode.Symlink, e.getFileMode());\n            Assert.AreEqual(FileMode.Symlink.Bits, e.getRawMode());\n\n            e.setFileMode(FileMode.GitLink);\n            Assert.AreSame(FileMode.GitLink, e.getFileMode());\n            Assert.AreEqual(FileMode.GitLink.Bits, e.getRawMode());\n\n            try\n            {\n                e.setFileMode(FileMode.Missing);\n                Assert.Fail(\"incorrectly accepted FileMode.MISSING\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid mode 0 for path a\", err.Message);\n            }\n\n            try\n            {\n                e.setFileMode(FileMode.Tree);\n                Assert.Fail(\"incorrectly accepted FileMode.TREE\");\n            }\n            catch (ArgumentException err)\n            {\n                Assert.AreEqual(\"Invalid mode \" + FileMode.TYPE_TREE + \" for path a\", err.Message);\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheFindTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\nusing GitSharp.Core.DirectoryCache;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheFindTest : RepositoryTestCase\n    {\n        [Test]\n        public void testEntriesWithin()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a/b\", \"a/c\", \"a/d\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            int aFirst = 1;\n            int aLast = 3;\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            Assert.AreEqual(paths.Length, dc.getEntryCount());\n            for (int i = 0; i < ents.Length; i++)\n            {\n                Assert.AreSame(ents[i], dc.getEntry(i));\n            }\n\n            DirCacheEntry[] aContents = dc.getEntriesWithin(\"a\");\n            Assert.IsNotNull(aContents);\n            Assert.AreEqual(aLast - aFirst + 1, aContents.Length);\n            for (int i = aFirst, j = 0; i <= aLast; i++, j++)\n            {\n                Assert.AreSame(ents[i], aContents[j]);\n            }\n\n            aContents = dc.getEntriesWithin(\"a/\");\n            Assert.IsNotNull(aContents);\n            Assert.AreEqual(aLast - aFirst + 1, aContents.Length);\n            for (int i = aFirst, j = 0; i <= aLast; i++, j++)\n            {\n                Assert.AreSame(ents[i], aContents[j]);\n            }\n\n            Assert.IsNotNull(dc.getEntriesWithin(\"a.\"));\n            Assert.AreEqual(0, dc.getEntriesWithin(\"a.\").Length);\n\n            Assert.IsNotNull(dc.getEntriesWithin(\"a0b\"));\n            Assert.AreEqual(0, dc.getEntriesWithin(\"a0b.\").Length);\n\n            Assert.IsNotNull(dc.getEntriesWithin(\"zoo\"));\n            Assert.AreEqual(0, dc.getEntriesWithin(\"zoo.\").Length);\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheIteratorTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Tests;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheIteratorTest : RepositoryTestCase\n    {\n        [Test]\n        public void testEmptyTree_NoTreeWalk()\n        {\n            DirCache dc = DirCache.read(db);\n            Assert.AreEqual(0, dc.getEntryCount());\n\n            var i = new DirCacheIterator(dc);\n            Assert.IsTrue(i.eof());\n        }\n\n        [Test]\n        public void testEmptyTree_WithTreeWalk()\n        {\n            DirCache dc = DirCache.read(db);\n            Assert.AreEqual(0, dc.getEntryCount());\n\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.addTree(new DirCacheIterator(dc));\n            Assert.IsFalse(tw.next());\n        }\n\n        [Test]\n        public void testNoSubtree_NoTreeWalk()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a0b\" };\n            var ents = new DirCacheEntry[paths.Length];\n\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n\n            b.finish();\n\n            var iter = new DirCacheIterator(dc);\n            int pathIdx = 0;\n            for (; !iter.eof(); iter.next(1))\n            {\n                Assert.AreEqual(pathIdx, iter.Pointer);\n                Assert.AreSame(ents[pathIdx], iter.getDirCacheEntry());\n                pathIdx++;\n            }\n\n            Assert.AreEqual(paths.Length, pathIdx);\n        }\n\n        [Test]\n        public void testNoSubtree_WithTreeWalk()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a0b\" };\n            FileMode[] modes = { FileMode.ExecutableFile, FileMode.GitLink };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(modes[i]);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            var iter = new DirCacheIterator(dc);\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.addTree(iter);\n            int pathIdx = 0;\n            while (tw.next())\n            {\n                Assert.AreSame(iter, tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator)));\n                Assert.AreEqual(pathIdx, iter.Pointer);\n                Assert.AreSame(ents[pathIdx], iter.getDirCacheEntry());\n                Assert.AreEqual(paths[pathIdx], tw.getPathString());\n                Assert.AreEqual(modes[pathIdx].Bits, tw.getRawMode(0));\n                Assert.AreSame(modes[pathIdx], tw.getFileMode(0));\n                pathIdx++;\n            }\n            Assert.AreEqual(paths.Length, pathIdx);\n        }\n\n        [Test]\n        public void testSingleSubtree_NoRecursion()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a/b\", \"a/c\", \"a/d\", \"a0b\" };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            string[] expPaths = { \"a.\", \"a\", \"a0b\" };\n            FileMode[] expModes = { FileMode.RegularFile, FileMode.Tree, FileMode.RegularFile };\n            var expPos = new[] { 0, -1, 4 };\n\n            var iter = new DirCacheIterator(dc);\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.addTree(iter);\n            tw.Recursive = false;\n            int pathIdx = 0;\n            while (tw.next())\n            {\n                Assert.AreSame(iter, tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator)));\n                Assert.AreEqual(expModes[pathIdx].Bits, tw.getRawMode(0));\n                Assert.AreSame(expModes[pathIdx], tw.getFileMode(0));\n                Assert.AreEqual(expPaths[pathIdx], tw.getPathString());\n\n                if (expPos[pathIdx] >= 0)\n                {\n                    Assert.AreEqual(expPos[pathIdx], iter.Pointer);\n                    Assert.AreSame(ents[expPos[pathIdx]], iter.getDirCacheEntry());\n                }\n                else\n                {\n                    Assert.AreSame(FileMode.Tree, tw.getFileMode(0));\n                }\n\n                pathIdx++;\n            }\n            Assert.AreEqual(expPaths.Length, pathIdx);\n        }\n\n        [Test]\n        public void testSingleSubtree_Recursive()\n        {\n            DirCache dc = DirCache.read(db);\n\n            FileMode mode = FileMode.RegularFile;\n            string[] paths = { \"a.\", \"a/b\", \"a/c\", \"a/d\", \"a0b\" };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(mode);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            var iter = new DirCacheIterator(dc);\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.addTree(iter);\n            tw.Recursive = true;\n            int pathIdx = 0;\n            while (tw.next())\n            {\n                var c = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));\n                Assert.IsNotNull(c);\n                Assert.AreEqual(pathIdx, c.Pointer);\n                Assert.AreSame(ents[pathIdx], c.getDirCacheEntry());\n                Assert.AreEqual(paths[pathIdx], tw.getPathString());\n                Assert.AreEqual(mode.Bits, tw.getRawMode(0));\n                Assert.AreSame(mode, tw.getFileMode(0));\n                pathIdx++;\n            }\n\n            Assert.AreEqual(paths.Length, pathIdx);\n        }\n\n        [Test]\n        public void testTwoLevelSubtree_Recursive()\n        {\n            DirCache dc = DirCache.read(db);\n\n            FileMode mode = FileMode.RegularFile;\n            string[] paths = { \"a.\", \"a/b\", \"a/c/e\", \"a/c/f\", \"a/d\", \"a0b\" };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(mode);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            var tw = new TreeWalk(db);\n            tw.reset();\n            tw.addTree(new DirCacheIterator(dc));\n            tw.Recursive = true;\n            int pathIdx = 0;\n            while (tw.next())\n            {\n                var c = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));\n                Assert.IsNotNull(c);\n                Assert.AreEqual(pathIdx, c.Pointer);\n                Assert.AreSame(ents[pathIdx], c.getDirCacheEntry());\n                Assert.AreEqual(paths[pathIdx], tw.getPathString());\n                Assert.AreEqual(mode.Bits, tw.getRawMode(0));\n                Assert.AreSame(mode, tw.getFileMode(0));\n                pathIdx++;\n            }\n\n            Assert.AreEqual(paths.Length, pathIdx);\n        }\n\n        [Test]\n        public void testTwoLevelSubtree_FilterPath()\n        {\n            DirCache dc = DirCache.read(db);\n\n            FileMode mode = FileMode.RegularFile;\n            string[] paths = { \"a.\", \"a/b\", \"a/c/e\", \"a/c/f\", \"a/d\", \"a0b\" };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(mode);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n            b.finish();\n\n            var tw = new TreeWalk(db);\n            for (int victimIdx = 0; victimIdx < paths.Length; victimIdx++)\n            {\n                tw.reset();\n                tw.addTree(new DirCacheIterator(dc));\n                tw.setFilter(PathFilterGroup.createFromStrings(new[] { paths[victimIdx] }));\n                tw.Recursive = tw.getFilter().shouldBeRecursive();\n                Assert.IsTrue(tw.next());\n                var c = tw.getTree<DirCacheIterator>(0, typeof(DirCacheIterator));\n                Assert.IsNotNull(c);\n                Assert.AreEqual(victimIdx, c.Pointer);\n                Assert.AreSame(ents[victimIdx], c.getDirCacheEntry());\n                Assert.AreEqual(paths[victimIdx], tw.getPathString());\n                Assert.AreEqual(mode.Bits, tw.getRawMode(0));\n                Assert.AreSame(mode, tw.getFileMode(0));\n                Assert.IsFalse(tw.next());\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheLargePathTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheLargePathTest : RepositoryTestCase\n    {\n        [Test]\n        public void testPath_4090()\n        {\n            testLongPath(4090);\n        }\n\n        [Test]\n        public void testPath_4094()\n        {\n            testLongPath(4094);\n        }\n\n        [Test]\n        public void testPath_4095()\n        {\n            testLongPath(4095);\n        }\n\n        [Test]\n        public void testPath_4096()\n        {\n            testLongPath(4096);\n        }\n\n        [Test]\n        public void testPath_16384()\n        {\n            testLongPath(16384);\n        }\n\n        private void testLongPath(int len)\n        {\n            string longPath = makeLongPath(len);\n            string shortPath = \"~~~ shorter-path\";\n\n            DirCacheEntry longEnt = new DirCacheEntry(longPath);\n            DirCacheEntry shortEnt = new DirCacheEntry(shortPath);\n\n            longEnt.setFileMode(FileMode.RegularFile);\n            shortEnt.setFileMode(FileMode.RegularFile);\n\n            Assert.AreEqual(longPath, longEnt.getPathString());\n            Assert.AreEqual(shortPath, shortEnt.getPathString());\n\n            DirCache dc1 = DirCache.Lock(db);\n            DirCacheBuilder b = dc1.builder();\n            b.add(longEnt);\n            b.add(shortEnt);\n            Assert.IsTrue(b.commit());\n            Assert.AreEqual(2, dc1.getEntryCount());\n            Assert.AreSame(longEnt, dc1.getEntry(0));\n            Assert.AreSame(shortEnt, dc1.getEntry(1));\n\n            DirCache dc2 = DirCache.read(db);\n            Assert.AreEqual(2, dc2.getEntryCount());\n            Assert.AreNotSame(longEnt, dc2.getEntry(0));\n            Assert.AreEqual(longPath, dc2.getEntry(0).getPathString());\n            Assert.AreNotSame(shortEnt, dc2.getEntry(1));\n            Assert.AreEqual(shortPath, dc2.getEntry(1).getPathString());\n        }\n\n        private static string makeLongPath(int len)\n        {\n            StringBuilder r = new StringBuilder(len);\n            for (int i = 0; i < len; i++)\n            {\n                r.Append('a' + (i % 26));\n            }\n            return r.ToString();\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/DirectoryCache/DirCacheTreeTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.DirectoryCache\n{\n    [TestFixture]\n    public class DirCacheTreeTest : RepositoryTestCase\n    {\n        [Test]\n        public void testEmptyCache_NoCacheTree()\n        {\n            DirCache dc = DirCache.read(db);\n            Assert.IsNull(dc.getCacheTree(false));\n        }\n\n        [Test]\n        public void testEmptyCache_CreateEmptyCacheTree()\n        {\n            DirCache dc = DirCache.read(db);\n            DirCacheTree tree = dc.getCacheTree(true);\n            Assert.IsNotNull(tree);\n            Assert.AreSame(tree, dc.getCacheTree(false));\n            Assert.AreSame(tree, dc.getCacheTree(true));\n            Assert.AreEqual(string.Empty, tree.getNameString());\n            Assert.AreEqual(string.Empty, tree.getPathString());\n            Assert.AreEqual(0, tree.getChildCount());\n            Assert.AreEqual(0, tree.getEntrySpan());\n            Assert.IsFalse(tree.isValid());\n        }\n\n        [Test]\n        public void testEmptyCache_Clear_NoCacheTree()\n        {\n            DirCache dc = DirCache.read(db);\n            DirCacheTree tree = dc.getCacheTree(true);\n            Assert.IsNotNull(tree);\n            dc.clear();\n            Assert.IsNull(dc.getCacheTree(false));\n            Assert.AreNotSame(tree, dc.getCacheTree(true));\n        }\n\n        [Test]\n        public void testSingleSubtree()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a/b\", \"a/c\", \"a/d\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n            int aFirst = 1;\n            int aLast = 3;\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n                b.add(ents[i]);\n            b.finish();\n\n            Assert.IsNull(dc.getCacheTree(false));\n            DirCacheTree root = dc.getCacheTree(true);\n            Assert.IsNotNull(root);\n            Assert.AreSame(root, dc.getCacheTree(true));\n            Assert.AreEqual(string.Empty, root.getNameString());\n            Assert.AreEqual(string.Empty, root.getPathString());\n            Assert.AreEqual(1, root.getChildCount());\n            Assert.AreEqual(dc.getEntryCount(), root.getEntrySpan());\n            Assert.IsFalse(root.isValid());\n\n            DirCacheTree aTree = root.getChild(0);\n            Assert.IsNotNull(aTree);\n            Assert.AreSame(aTree, root.getChild(0));\n            Assert.AreEqual(\"a\", aTree.getNameString());\n            Assert.AreEqual(\"a/\", aTree.getPathString());\n            Assert.AreEqual(0, aTree.getChildCount());\n            Assert.AreEqual(aLast - aFirst + 1, aTree.getEntrySpan());\n            Assert.IsFalse(aTree.isValid());\n        }\n\n        [Test]\n        public void testTwoLevelSubtree()\n        {\n            DirCache dc = DirCache.read(db);\n\n            string[] paths = { \"a.\", \"a/b\", \"a/c/e\", \"a/c/f\", \"a/d\", \"a0b\" };\n            DirCacheEntry[] ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n            int aFirst = 1;\n            int aLast = 4;\n            int acFirst = 2;\n            int acLast = 3;\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n                b.add(ents[i]);\n            b.finish();\n\n            Assert.IsNull(dc.getCacheTree(false));\n            DirCacheTree root = dc.getCacheTree(true);\n            Assert.IsNotNull(root);\n            Assert.AreSame(root, dc.getCacheTree(true));\n            Assert.AreEqual(string.Empty, root.getNameString());\n            Assert.AreEqual(string.Empty, root.getPathString());\n            Assert.AreEqual(1, root.getChildCount());\n            Assert.AreEqual(dc.getEntryCount(), root.getEntrySpan());\n            Assert.IsFalse(root.isValid());\n\n            DirCacheTree aTree = root.getChild(0);\n            Assert.IsNotNull(aTree);\n            Assert.AreSame(aTree, root.getChild(0));\n            Assert.AreEqual(\"a\", aTree.getNameString());\n            Assert.AreEqual(\"a/\", aTree.getPathString());\n            Assert.AreEqual(1, aTree.getChildCount());\n            Assert.AreEqual(aLast - aFirst + 1, aTree.getEntrySpan());\n            Assert.IsFalse(aTree.isValid());\n\n            DirCacheTree acTree = aTree.getChild(0);\n            Assert.IsNotNull(acTree);\n            Assert.AreSame(acTree, aTree.getChild(0));\n            Assert.AreEqual(\"c\", acTree.getNameString());\n            Assert.AreEqual(\"a/c/\", acTree.getPathString());\n            Assert.AreEqual(0, acTree.getChildCount());\n            Assert.AreEqual(acLast - acFirst + 1, acTree.getEntrySpan());\n            Assert.IsFalse(acTree.isValid());\n        }\n\n        /// <summary>\n        /// We had bugs related to buffer size in the DirCache. This test creates an\n        /// index larger than the default BufferedInputStream buffer size. This made\n        /// the DirCache unable to Read the extensions when index size exceeded the\n        /// buffer size (in some cases at least).\n        /// </summary>\n        [Test]\n        public void testWriteReadTree()\n        {\n            DirCache dc = DirCache.Lock(db);\n\n            string A = string.Format(\"a%2000s\", \"a\");\n            string B = string.Format(\"b%2000s\", \"b\");\n            string[] paths = { A + \".\", A + \".\" + B, A + \"/\" + B, A + \"0\" + B };\n            var ents = new DirCacheEntry[paths.Length];\n            for (int i = 0; i < paths.Length; i++)\n            {\n                ents[i] = new DirCacheEntry(paths[i]);\n                ents[i].setFileMode(FileMode.RegularFile);\n            }\n\n            DirCacheBuilder b = dc.builder();\n            for (int i = 0; i < ents.Length; i++)\n            {\n                b.add(ents[i]);\n            }\n\n            b.commit();\n            DirCache read = DirCache.read(db);\n\n            Assert.AreEqual(paths.Length, read.getEntryCount());\n            Assert.AreEqual(1, read.getCacheTree(true).getChildCount());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/FnMatch/FileNameMatcherTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Florian Köberle <florianskarten@web.de>\n * Copyright (C) 2009, Adriano Machado <adriano.m.machado@hotmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.FnMatch;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.FnMatch\n{\n\t[TestFixture]\n\tpublic class FileNameMatcherTest\n\t{\n\t\tprivate static void AssertMatch(string pattern, string input, bool matchExpected, bool appendCanMatchExpected)\n\t\t{\n\t\t\tvar matcher = new FileNameMatcher(pattern, null);\n\t\t\tmatcher.Append(input);\n\t\t\tAssert.AreEqual(matchExpected, matcher.IsMatch());\n\t\t\tAssert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());\n\t\t}\n\n\t\tprivate static void AssertFileNameMatch(string pattern, string input, char excludedCharacter, bool matchExpected, bool appendCanMatchExpected)\n\t\t{\n\t\t\tvar matcher = new FileNameMatcher(pattern, excludedCharacter);\n\t\t\tmatcher.Append(input);\n\t\t\tAssert.AreEqual(matchExpected, matcher.IsMatch());\n\t\t\tAssert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimplePatternCase0()\n\t\t{\n\t\t\tAssertMatch(string.Empty, string.Empty, true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimplePatternCase1()\n\t\t{\n\t\t\tAssertMatch(\"ab\", \"a\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimplePatternCase2()\n\t\t{\n\t\t\tAssertMatch(\"ab\", \"ab\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimplePatternCase3()\n\t\t{\n\t\t\tAssertMatch(\"ab\", \"ac\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimplePatternCase4()\n\t\t{\n\t\t\tAssertMatch(\"ab\", \"abc\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleWirdcardCase0()\n\t\t{\n\t\t\tAssertMatch(\"?\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleWildCardCase1()\n\t\t{\n\t\t\tAssertMatch(\"??\", \"a\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleWildCardCase2()\n\t\t{\n\t\t\tAssertMatch(\"??\", \"ab\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleWildCardCase3()\n\t\t{\n\t\t\tAssertMatch(\"??\", \"abc\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleStarCase0()\n\t\t{\n\t\t\tAssertMatch(\"*\", string.Empty, true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleStarCase1()\n\t\t{\n\t\t\tAssertMatch(\"*\", \"a\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleStarCase2()\n\t\t{\n\t\t\tAssertMatch(\"*\", \"ab\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSimpleStarCase0()\n\t\t{\n\t\t\tAssertMatch(\"a*b\", \"a\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSimpleStarCase1()\n\t\t{\n\t\t\tAssertMatch(\"a*c\", \"ac\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSimpleStarCase2()\n\t\t{\n\t\t\tAssertMatch(\"a*c\", \"ab\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSimpleStarCase3()\n\t\t{\n\t\t\tAssertMatch(\"a*c\", \"abc\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testManySolutionsCase0()\n\t\t{\n\t\t\tAssertMatch(\"a*a*a\", \"aaa\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testManySolutionsCase1()\n\t\t{\n\t\t\tAssertMatch(\"a*a*a\", \"aaaa\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testManySolutionsCase2()\n\t\t{\n\t\t\tAssertMatch(\"a*a*a\", \"ababa\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testManySolutionsCase3()\n\t\t{\n\t\t\tAssertMatch(\"a*a*a\", \"aaaaaaaa\", true, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testManySolutionsCase4()\n\t\t{\n\t\t\tAssertMatch(\"a*a*a\", \"aaaaaaab\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[ab]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[ab]\", \"b\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[ab]\", \"ab\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase0()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase1()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"b\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase2()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"c\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase3()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"d\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase4()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"e\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testVerySimpleGroupRangeCase5()\n\t\t{\n\t\t\tAssertMatch(\"[b-d]\", \"-\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoGroupsCase0()\n\t\t{\n\t\t\tAssertMatch(\"[b-d][ab]\", \"bb\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoGroupsCase1()\n\t\t{\n\t\t\tAssertMatch(\"[b-d][ab]\", \"ca\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoGroupsCase2()\n\t\t{\n\t\t\tAssertMatch(\"[b-d][ab]\", \"fa\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoGroupsCase3()\n\t\t{\n\t\t\tAssertMatch(\"[b-d][ab]\", \"bc\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"b\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"c\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"d\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"e\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testTwoRangesInOneGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[b-ce-e]\", \"f\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testIncompleteRangesInOneGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"a[b-]\", \"ab\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testIncompleteRangesInOneGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"a[b-]\", \"ac\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testIncompleteRangesInOneGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"a[b-]\", \"a-\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCombinedRangesInOneGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[a-c-e]\", \"b\", true, false);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// The c belongs to the range a-c. \"-e\" is no valid range so d should not \tmatch.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"Exception\">for some reasons </exception>\n\t\t[Test]\n\t\tpublic virtual void testCombinedRangesInOneGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[a-c-e]\", \"d\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCombinedRangesInOneGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[a-c-e]\", \"e\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testInversedGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[!b-c]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testInversedGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[!b-c]\", \"b\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testInversedGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[!b-c]\", \"c\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testInversedGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[!b-c]\", \"d\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlphaGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:alpha:]]\", \"d\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlphaGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:alpha:]]\", \":\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlphaGroupCase2()\n\t\t{\n\t\t\t// \\u00f6 = 'o' with dots on it\n\t\t\tAssertMatch(\"[[:alpha:]]\", \"\\u00f6\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void test2AlphaGroupsCase0()\n\t\t{\n\t\t\t// \\u00f6 = 'o' with dots on it\n\t\t\tAssertMatch(\"[[:alpha:]][[:alpha:]]\", \"a\\u00f6\", true, false);\n\t\t\tAssertMatch(\"[[:alpha:]][[:alpha:]]\", \"a1\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlnumGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:alnum:]]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlnumGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:alnum:]]\", \"1\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testAlnumGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:alnum:]]\", \":\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBlankGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:blank:]]\", \" \", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBlankGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:blank:]]\", \"\\t\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBlankGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:blank:]]\", \"\\r\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBlankGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:blank:]]\", \"\\n\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBlankGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:blank:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCntrlGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:cntrl:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCntrlGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:cntrl:]]\", Convert.ToString((char)7), true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:digit:]]\", \"0\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:digit:]]\", \"5\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:digit:]]\", \"9\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase3()\n\t\t{\n\t\t\t// \\u06f9 = EXTENDED ARABIC-INDIC DIGIT NINE\n\t\t\tAssertMatch(\"[[:digit:]]\", \"\\u06f9\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:digit:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDigitGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[[:digit:]]\", \"]\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:graph:]]\", \"]\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:graph:]]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:graph:]]\", \".\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:graph:]]\", \"0\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:graph:]]\", \" \", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testGraphGroupCase5()\n\t\t{\n\t\t\t// \\u00f6 = 'o' with dots on it\n\t\t\tAssertMatch(\"[[:graph:]]\", \"\\u00f6\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:lower:]]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:lower:]]\", \"h\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:lower:]]\", \"A\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:lower:]]\", \"H\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase4()\n\t\t{\n\t\t\t// \\u00e4 = small 'a' with dots on it\n\t\t\tAssertMatch(\"[[:lower:]]\", \"\\u00e4\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testLowerGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[[:lower:]]\", \".\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:print:]]\", \"]\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:print:]]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:print:]]\", \".\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:print:]]\", \"0\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:print:]]\", \" \", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPrintGroupCase5()\n\t\t{\n\t\t\t// \\u00f6 = 'o' with dots on it\n\t\t\tAssertMatch(\"[[:print:]]\", \"\\u00f6\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPunctGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:punct:]]\", \".\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPunctGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:punct:]]\", \"@\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPunctGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:punct:]]\", \" \", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testPunctGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:punct:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpaceGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:space:]]\", \" \", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpaceGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:space:]]\", \"\\t\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpaceGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:space:]]\", \"\\r\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpaceGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:space:]]\", \"\\n\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpaceGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:space:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:upper:]]\", \"a\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:upper:]]\", \"h\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:upper:]]\", \"A\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:upper:]]\", \"H\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase4()\n\t\t{\n\t\t\t// \\u00c4 = 'A' with dots on it\n\t\t\tAssertMatch(\"[[:upper:]]\", \"\\u00c4\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUpperGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[[:upper:]]\", \".\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"d\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"f\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"0\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"5\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"9\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase6()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \"۹\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testXDigitGroupCase7()\n\t\t{\n\t\t\tAssertMatch(\"[[:xdigit:]]\", \".\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[:word:]]\", \"g\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase1()\n\t\t{\n\t\t\t// \\u00f6 = 'o' with dots on it\n\t\t\tAssertMatch(\"[[:word:]]\", \"\\u00f6\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[[:word:]]\", \"5\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[[:word:]]\", \"_\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[[:word:]]\", \" \", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testWordroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[[:word:]]\", \".\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"A\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"C\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"e\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"3\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"4\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"5\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase6()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"B\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase7()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"2\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase8()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \"6\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testMixedGroupCase9()\n\t\t{\n\t\t\tAssertMatch(\"[A[:lower:]C3-5]\", \".\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase0()\n\t\t{\n\t\t\tAssertMatch(\"[[]\", \"[\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase1()\n\t\t{\n\t\t\tAssertMatch(\"[]]\", \"]\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase2()\n\t\t{\n\t\t\tAssertMatch(\"[]a]\", \"]\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase3()\n\t\t{\n\t\t\tAssertMatch(\"[a[]\", \"[\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase4()\n\t\t{\n\t\t\tAssertMatch(\"[a[]\", \"a\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase5()\n\t\t{\n\t\t\tAssertMatch(\"[!]]\", \"]\", false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase6()\n\t\t{\n\t\t\tAssertMatch(\"[!]]\", \"x\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase7()\n\t\t{\n\t\t\tAssertMatch(\"[:]]\", \":]\", true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase8()\n\t\t{\n\t\t\tAssertMatch(\"[:]]\", \":\", false, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testSpecialGroupCase9()\n\t\t{\n            AssertHelper.Throws<InvalidPatternException>(() => AssertMatch(\"[[:]\", \":\", true, true));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUnsupportedGroupCase0()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tAssertMatch(\"[[=a=]]\", \"b\", false, false);\n\t\t\t}\n\t\t\tcatch (InvalidPatternException e)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(e.Message.Contains(\"[=a=]\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testUnsupportedGroupCase1()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tAssertMatch(\"[[.a.]]\", \"b\", false, false);\n\t\t\t}\n\t\t\tcatch (InvalidPatternException e)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(e.Message.Contains(\"[.a.]\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testFilePathSimpleCase()\n\t\t{\n\t\t\tAssertFileNameMatch(\"a/b\", \"a/b\", '/', true, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testFilePathCase0()\n\t\t{\n\t\t\tAssertFileNameMatch(\"a*b\", \"a/b\", '/', false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testFilePathCase1()\n\t\t{\n\t\t\tAssertFileNameMatch(\"a?b\", \"a/b\", '/', false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testFilePathCase2()\n\t\t{\n\t\t\tAssertFileNameMatch(\"a*b\", \"a\\\\b\", '\\\\', false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testFilePathCase3()\n\t\t{\n\t\t\tAssertFileNameMatch(\"a?b\", \"a\\\\b\", '\\\\', false, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testReset()\n\t\t{\n\t\t\tconst string pattern = \"helloworld\";\n\n\t\t\tvar matcher = new FileNameMatcher(pattern, null);\n\t\t\tmatcher.Append(\"helloworld\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tmatcher.Reset();\n\t\t\tmatcher.Append(\"hello\");\n\t\t\tAssert.AreEqual(false, matcher.IsMatch());\n\t\t\tAssert.AreEqual(true, matcher.CanAppendMatch());\n\t\t\tmatcher.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tmatcher.Append(\"to much\");\n\t\t\tAssert.AreEqual(false, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tmatcher.Reset();\n\t\t\tmatcher.Append(\"helloworld\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCreateMatcherForSuffix()\n\t\t{\n\t\t\tconst string pattern = \"helloworld\";\n\n\t\t\tvar matcher = new FileNameMatcher(pattern, null);\n\t\t\tmatcher.Append(\"hello\");\n\n\t\t\tFileNameMatcher childMatcher = matcher.CreateMatcherForSuffix();\n\t\t\tAssert.AreEqual(false, matcher.IsMatch());\n\t\t\tAssert.AreEqual(true, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, childMatcher.IsMatch());\n\t\t\tAssert.AreEqual(true, childMatcher.CanAppendMatch());\n\t\t\tmatcher.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, childMatcher.IsMatch());\n\t\t\tAssert.AreEqual(true, childMatcher.CanAppendMatch());\n\t\t\tchildMatcher.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(true, childMatcher.IsMatch());\n\t\t\tAssert.AreEqual(false, childMatcher.CanAppendMatch());\n\t\t\tchildMatcher.Reset();\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, childMatcher.IsMatch());\n\t\t\tAssert.AreEqual(true, childMatcher.CanAppendMatch());\n\t\t\tchildMatcher.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(true, childMatcher.IsMatch());\n\t\t\tAssert.AreEqual(false, childMatcher.CanAppendMatch());\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCopyConstructor()\n\t\t{\n\t\t\tconst string pattern = \"helloworld\";\n\n\t\t\tvar matcher = new FileNameMatcher(pattern, null);\n\t\t\tmatcher.Append(\"hello\");\n\n\t\t\tvar copy = new FileNameMatcher(matcher);\n\t\t\tAssert.AreEqual(false, matcher.IsMatch());\n\t\t\tAssert.AreEqual(true, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, copy.IsMatch());\n\t\t\tAssert.AreEqual(true, copy.CanAppendMatch());\n\t\t\tmatcher.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, copy.IsMatch());\n\t\t\tAssert.AreEqual(true, copy.CanAppendMatch());\n\t\t\tcopy.Append(\"world\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(true, copy.IsMatch());\n\t\t\tAssert.AreEqual(false, copy.CanAppendMatch());\n\t\t\tcopy.Reset();\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(false, copy.IsMatch());\n\t\t\tAssert.AreEqual(true, copy.CanAppendMatch());\n\t\t\tcopy.Append(\"helloworld\");\n\t\t\tAssert.AreEqual(true, matcher.IsMatch());\n\t\t\tAssert.AreEqual(false, matcher.CanAppendMatch());\n\t\t\tAssert.AreEqual(true, copy.IsMatch());\n\t\t\tAssert.AreEqual(false, copy.CanAppendMatch());\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/IgnoreHandlerTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\n\t[TestFixture]\n\tpublic class IgnoreHandlerTests : RepositoryTestCase\n\t{\n\t\tprivate IgnoreHandler _handler;\n\n\t\t[Test]\n\t\tpublic void HonorsExcludeFile()\n\t\t{\n\t\t\tWriteExclude(\"*.html\");\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"test.html\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HonorsConfigExcludes()\n\t\t{\n\t\t\tWriteConfigExcludes(\"ignoreHandler\", \"*.a\");\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"test.a\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HonorsTopLevelIgnore()\n\t\t{\n\t\t\tWriteIgnore(\".\", \"*.o\");\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"test.o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegated()\n\t\t{\n\t\t\tWriteIgnore(\".\", \"*.o\");\n\t\t\tWriteIgnore(\"test\", \"!*.o\");\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsFalse(_handler.IsIgnored(\"test/test.o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultipleIgnoreFiles()\n\t\t{\n\t\t\tWriteIgnore(\".\", \"*.o\");\n\t\t\tWriteIgnore(\"./foo/bar\", \"baz\");\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"test.o\"));\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"a/file/somewhere/down/the/hierarchy/test.o\"));\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"foo/bar/down/the/hierarchy/baz\"));\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"foo/bar/baz\"));\n\t\t\tAssert.IsFalse(_handler.IsIgnored(\"baz\"));\n\t\t\tAssert.IsFalse(_handler.IsIgnored(\"a/file/somewhere/down/the/hierarchy/baz\"));\n\t\t}\n\n\t\t[Ignore(\"Patterns with path components are not yet implemented!\")]\n\t\t[Test]\n\t\tpublic void PatternsWithPathComponent()\n\t\t{\n\t\t\tWriteIgnore(\".\", \"foo/bar/*.o\"); // <--- should ignore all o files only in foo/bar\n\t\t\t_handler = new IgnoreHandler(db);\n\n\t\t\tAssert.IsFalse(_handler.IsIgnored(\"test.o\"));\n\t\t\tAssert.IsFalse(_handler.IsIgnored(\"a/file/somewhere/down/the/hierarchy/test.o\"));\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"foo/bar/down/the/hierarchy/test.o\"));\n\t\t\tAssert.IsTrue(_handler.IsIgnored(\"foo/bar/baz.o\"));\n\t\t}\n\n\t\tprivate void WriteExclude(string data)\n\t\t{\n\t\t\twriteTrashFile(\".git/info/exclude\", data);\n\t\t}\n\n\t\tprivate void WriteConfigExcludes(string path, string data)\n\t\t{\n\t\t\tdb.Config.setString(\"core\", null, \"excludesfile\", path);\n\t\t\twriteTrashFile(path, data);\n\t\t}\n\n\t\tprivate void WriteIgnore(string dir, string data)\n\t\t{\n\t\t\twriteTrashFile(Path.Combine(dir, Constants.GITIGNORE_FILENAME), data);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/IndexDiffTest.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class IndexDiffTest : RepositoryTestCase\n\t{\n\t\t// Methods\n\t\t[Test]\n\t\tpublic void testAdded()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\t\t\twriteTrashFile(\"file1\", \"file1\");\n\t\t\twriteTrashFile(\"dir/subfile\", \"dir/subfile\");\n\t\t\tvar tree = new Core.Tree(db);\n\n\t\t\tindex.add(trash, new FileInfo(Path.Combine(trash.FullName, \"file1\")));\n\t\t\tindex.add(trash, new FileInfo(Path.Combine(trash.FullName, \"dir/subfile\")));\n\t\t\tvar diff = new IndexDiff(tree, index);\n\t\t\tdiff.Diff();\n\n\t\t\tAssert.AreEqual(2, diff.Added.Count);\n\t\t\tAssert.IsTrue(diff.Added.Contains(\"file1\"));\n\t\t\tAssert.IsTrue(diff.Added.Contains(\"dir/subfile\"));\n\t\t\tAssert.AreEqual(0, diff.Changed.Count);\n\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t\tAssert.AreEqual(0, diff.Removed.Count);\n\t\t}\n\n        [Test]\n        public void testAdded2()\n        {\n            var index = new GitIndex(db);\n            writeTrashFile(\"test/fr henon.txt\", \"Weiebier\");\n            var tree = new Core.Tree(db);\n\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"test/fr henon.txt\")));\n            var diff = new IndexDiff(tree, index);\n            diff.Diff();\n\n            Assert.AreEqual(1, diff.Added.Count);\n            Assert.IsTrue(diff.Added.Contains(\"test/fr henon.txt\"));\n            Assert.AreEqual(0, diff.Changed.Count);\n            Assert.AreEqual(0, diff.Modified.Count);\n            Assert.AreEqual(0, diff.Removed.Count);\n        }\n\n        [Test]\n        public void testUpdateExistingMsysgitIndex()\n        {\n            var index_path = Path.Combine(trash.FullName + \"/.git\", \"index\");\n            new FileInfo(\"Resources/index_originating_from_msysgit\").CopyTo(index_path); \n            \n            var index = new GitIndex(db);\n            index.Read();\n            var a = writeTrashFile(\"a.txt\", \"Data:a\");\n            index.add(trash, a);\n            index.write();\n            index.Read();\n\n            byte[] content = File.ReadAllBytes(index_path);\n\n            Assert.AreEqual(352, content.Length);\n        }\n\n\n\n\t\t[Test]\n\t\tpublic void testModified()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\n\t\t\tindex.add(trash, writeTrashFile(\"file2\", \"file2\"));\n\t\t\tindex.add(trash, writeTrashFile(\"dir/file3\", \"dir/file3\"));\n\n\t\t\twriteTrashFile(\"dir/file3\", \"changed\");\n\n\t\t\tvar t = new Core.Tree(db);\n\t\t\tt.AddFile(\"file2\").Id = ObjectId.FromString(\"0123456789012345678901234567890123456789\");\n\t\t\tt.AddFile(\"dir/file3\").Id = ObjectId.FromString(\"0123456789012345678901234567890123456789\");\n\t\t\tAssert.AreEqual(2, t.MemberCount);\n\n            var tree2 = (Core.Tree)t.findTreeMember(\"dir\");\n\t\t\ttree2.Id = new ObjectWriter(db).WriteTree(tree2);\n\t\t\tt.Id = new ObjectWriter(db).WriteTree(t);\n\t\t\tvar diff = new IndexDiff(t, index);\n\t\t\tdiff.Diff();\n\t\t\tAssert.AreEqual(2, diff.Changed.Count);\n\t\t\tAssert.IsTrue(diff.Changed.Contains(\"file2\"));\n\t\t\tAssert.IsTrue(diff.Changed.Contains(\"dir/file3\"));\n\t\t\tAssert.AreEqual(1, diff.Modified.Count);\n\t\t\tAssert.IsTrue(diff.Modified.Contains(\"dir/file3\"));\n\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t\tAssert.AreEqual(0, diff.Removed.Count);\n\t\t\tAssert.AreEqual(0, diff.Missing.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testRemoved()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\t\t\twriteTrashFile(\"file2\", \"file2\");\n\t\t\twriteTrashFile(\"dir/file3\", \"dir/file3\");\n\n            var t = new Core.Tree(db);\n\t\t\tt.AddFile(\"file2\");\n\t\t\tt.AddFile(\"dir/file3\");\n\t\t\tAssert.AreEqual(2, t.MemberCount);\n\t\t\tt.FindBlobMember(\"file2\").Id = ObjectId.FromString(\"30d67d4672d5c05833b7192cc77a79eaafb5c7ad\");\n            var tree2 = (Core.Tree)t.findTreeMember(\"dir\");\n\t\t\ttree2.FindBlobMember(\"file3\").Id = ObjectId.FromString(\"873fb8d667d05436d728c52b1d7a09528e6eb59b\");\n\t\t\ttree2.Id = new ObjectWriter(db).WriteTree(tree2);\n\t\t\tt.Id = new ObjectWriter(db).WriteTree(t);\n\n\t\t\tvar diff = new IndexDiff(t, index);\n\t\t\tdiff.Diff();\n\t\t\tAssert.AreEqual(2, diff.Removed.Count);\n\t\t\tAssert.IsTrue(diff.Removed.Contains(\"file2\"));\n\t\t\tAssert.IsTrue(diff.Removed.Contains(\"dir/file3\"));\n\t\t\tAssert.AreEqual(0, diff.Changed.Count);\n\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testUnchangedComplex()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\t\t\tindex.add(trash, writeTrashFile(\"a.b\", \"a.b\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a.c\", \"a.c\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a/b.b/b\", \"a/b.b/b\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a/b\", \"a/b\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a/c\", \"a/c\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a=c\", \"a=c\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a=d\", \"a=d\"));\n\n            var t = new Core.Tree(db);\n\t\t\tt.AddFile(\"a.b\").Id = ObjectId.FromString(\"f6f28df96c2b40c951164286e08be7c38ec74851\");\n\t\t\tt.AddFile(\"a.c\").Id = ObjectId.FromString(\"6bc0e647512d2a0bef4f26111e484dc87df7f5ca\");\n\t\t\tt.AddFile(\"a/b.b/b\").Id = ObjectId.FromString(\"8d840bd4e2f3a48ff417c8e927d94996849933fd\");\n\t\t\tt.AddFile(\"a/b\").Id = ObjectId.FromString(\"db89c972fc57862eae378f45b74aca228037d415\");\n\t\t\tt.AddFile(\"a/c\").Id = ObjectId.FromString(\"52ad142a008aeb39694bafff8e8f1be75ed7f007\");\n\t\t\tt.AddFile(\"a=c\").Id = ObjectId.FromString(\"06022365ddbd7fb126761319633bf73517770714\");\n\t\t\tt.AddFile(\"a=d\").Id = ObjectId.FromString(\"fa6414df3da87840700e9eeb7fc261dd77ccd5c2\");\n\n            var tree2 = (Core.Tree)t.findTreeMember(\"a/b.b\");\n\t\t\ttree2.Id = new ObjectWriter(db).WriteTree(tree2);\n\n            var tree3 = (Core.Tree)t.findTreeMember(\"a\");\n\t\t\ttree3.Id = new ObjectWriter(db).WriteTree(tree3);\n\t\t\tt.Id = new ObjectWriter(db).WriteTree(t);\n\n\t\t\tvar diff = new IndexDiff(t, index);\n\t\t\tdiff.Diff();\n\n\t\t\tAssert.AreEqual(0, diff.Changed.Count);\n\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t\tAssert.AreEqual(0, diff.Removed.Count);\n\t\t\tAssert.AreEqual(0, diff.Missing.Count);\n\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testUnchangedSimple()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\n\t\t\tindex.add(trash, writeTrashFile(\"a.b\", \"a.b\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a.c\", \"a.c\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a=c\", \"a=c\"));\n\t\t\tindex.add(trash, writeTrashFile(\"a=d\", \"a=d\"));\n\n            var t = new Core.Tree(db);\n\t\t\tt.AddFile(\"a.b\").Id = ObjectId.FromString(\"f6f28df96c2b40c951164286e08be7c38ec74851\");\n\t\t\tt.AddFile(\"a.c\").Id = ObjectId.FromString(\"6bc0e647512d2a0bef4f26111e484dc87df7f5ca\");\n\t\t\tt.AddFile(\"a=c\").Id = ObjectId.FromString(\"06022365ddbd7fb126761319633bf73517770714\");\n\t\t\tt.AddFile(\"a=d\").Id = ObjectId.FromString(\"fa6414df3da87840700e9eeb7fc261dd77ccd5c2\");\n\t\t\tt.Id = new ObjectWriter(db).WriteTree(t);\n\t\t\t\n\t\t\tvar diff = new IndexDiff(t, index);\n\t\t\tdiff.Diff();\n\n\t\t\tAssert.AreEqual(0, diff.Changed.Count);\n\t\t\tAssert.AreEqual(0, diff.Added.Count);\n\t\t\tAssert.AreEqual(0, diff.Removed.Count);\n\t\t\tAssert.AreEqual(0, diff.Missing.Count);\n\t\t\tAssert.AreEqual(0, diff.Modified.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/IndexModifiedTests.cs",
    "content": "using System;\nusing System.IO;\nusing System.Threading;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class IndexModifiedTests : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void ShouldSupportExtensionlessFiles()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\n\t\t\twriteTrashFile(\"extensionless-file\", \"contents\");\n\n\t\t\tvar file = new FileInfo(Path.Combine(trash.FullName, \"extensionless-file\"));\n\n\t\t\tindex.add(trash, file);\n\n\t\t\tvar entry = index.GetEntry(\"extensionless-file\");\n\n\t\t\tAssert.IsFalse(entry.IsModified(trash, true));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldSupportNotModifiedExtensionlessFilesWithoutContentChecking()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\n\t\t\twriteTrashFile(\"extensionless-file\", \"contents\");\n\n\t\t\tvar file = new FileInfo(Path.Combine(trash.FullName, \"extensionless-file\"));\n\n\t\t\tindex.add(trash, file);\n\n\t\t\tvar entry = index.GetEntry(\"extensionless-file\");\n\n\t\t\tAssert.IsFalse(entry.IsModified(trash));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldAllowComparingOfAlreadyOpenedFile()\n\t\t{\n\t\t\tvar index = new GitIndex(db);\n\t\t\tvar file = writeTrashFile(\"extensionless-file\", \"contents\");\n\n\t\t\tindex.add(trash, file);\n\n\t\t\tvar entry = index.GetEntry(\"extensionless-file\");\n\n\t\t\t// [henon] failed on my windows box (originally only observed on mono/unix) when executed in resharper or with nunit without waiting a second!\n\t\t\t// as the timing is not the point of the test here let's wait a sec anyway.\n\t\t\tThread.Sleep(TimeSpan.FromSeconds(1));\n\n\t\t\t// replace contents of file (with same size so it passes the size check)\n\t\t\tusing (var writer = file.CreateText())\n\t\t\t\twriter.Write(\"stnetnoc\");\n\n\t\t\t// opening the file for reading shoudn't block us from checking the contents\n\t\t\tusing (file.OpenRead())\n\t\t\t\tAssert.IsTrue(entry.IsModified(trash, true));\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/IndexTreeWalkerTest.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class IndexTreeWalkerTest : RepositoryTestCase\n    {\n        // Fields\n        private static readonly List<string> BothVisited = new List<string>();\n        private static readonly List<string> IndexOnlyEntriesVisited = new List<string>();\n        private static readonly AbstractIndexTreeVisitor TestIndexTreeVisitor;\n        private static readonly AbstractIndexTreeVisitor TestTreeOnlyOneLevelTreeVisitor;\n        private static readonly List<string> TreeOnlyEntriesVisited = new List<string>();\n\n        public override void tearDown()\n        {\n            TreeOnlyEntriesVisited.Clear();\n            BothVisited.Clear();\n            IndexOnlyEntriesVisited.Clear();\n\n            base.tearDown();\n        }\n\n        // Methods\n        static IndexTreeWalkerTest()\n        {\n            TestIndexTreeVisitor = new AbstractIndexTreeVisitor\n                          \t{\n                          \t\tVisitEntry = delegate(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file)\n                          \t\t             \t{\n                          \t\t             \t\tif (treeEntry == null)\n                          \t\t             \t\t{\n                          \t\t             \t\t\tIndexOnlyEntriesVisited.Add(indexEntry.Name);\n                          \t\t             \t\t}\n                          \t\t             \t\telse if (indexEntry == null)\n                          \t\t             \t\t{\n                          \t\t             \t\t\tTreeOnlyEntriesVisited.Add(treeEntry.FullName);\n                          \t\t             \t\t}\n                          \t\t             \t\telse\n                          \t\t             \t\t{\n                          \t\t             \t\t\tBothVisited.Add(indexEntry.Name);\n                          \t\t             \t\t}\n                          \t\t             \t}\n                          \t};\n\n\t\t\tTestTreeOnlyOneLevelTreeVisitor = new AbstractIndexTreeVisitor\n                           \t{\n                           \t\tVisitEntry = delegate(TreeEntry entry, GitIndex.Entry indexEntry, FileInfo f)\n                           \t\t             \t{\n                           \t\t             \t\tif ((entry == null) || (indexEntry == null))\n                           \t\t             \t\t{\n                           \t\t             \t\t\tAssert.Fail();\n                           \t\t             \t\t}\n                           \t\t             \t},\n                                FinishVisitTreeByIndex = delegate(Core.Tree tree, int i, string curDir)\n                           \t\t                         \t{\n                           \t\t                         \t\tif (tree.MemberCount == 0)\n                           \t\t                         \t\t{\n                           \t\t                         \t\t\tAssert.Fail();\n                           \t\t                         \t\t}\n                           \t\t                         \t\tif (i == 0)\n                           \t\t                         \t\t{\n                           \t\t                         \t\t\tAssert.Fail();\n                           \t\t                         \t\t}\n                           \t\t                         \t}\n                           \t};\n        }\n\n\n        [Test]\n        public void testTreeOnlyOneLevel()\n        {\n            var index = new GitIndex(db);\n            var mainTree = new Core.Tree(db);\n            mainTree.AddFile(\"foo\");\n            mainTree.AddFile(\"bar\");\n\n            new IndexTreeWalker(index, mainTree, trash, TestIndexTreeVisitor).Walk();\n\n            Assert.IsTrue(TreeOnlyEntriesVisited[0].Equals(\"bar\"));\n            Assert.IsTrue(TreeOnlyEntriesVisited[1].Equals(\"foo\"));\n        }\n\n        [Test]\n        public void testIndexOnlyOneLevel()\n        {\n            var index = new GitIndex(db);\n            var mainTree = new Core.Tree(db);\n\n            index.add(trash, writeTrashFile(\"foo\", \"foo\"));\n            index.add(trash, writeTrashFile(\"bar\", \"bar\"));\n            new IndexTreeWalker(index, mainTree, trash, TestIndexTreeVisitor).Walk();\n\n            Assert.AreEqual(2, IndexOnlyEntriesVisited.Count);\n            Assert.IsTrue(IndexOnlyEntriesVisited[0].Equals(\"bar\"));\n            Assert.IsTrue(IndexOnlyEntriesVisited[1].Equals(\"foo\"));\n        }\n\n        [Test]\n        public void testBoth()\n        {\n            var index = new GitIndex(db);\n            var mainTree = new Core.Tree(db);\n\n            index.add(trash, writeTrashFile(\"a\", \"a\"));\n            mainTree.AddFile(\"b/b\");\n            index.add(trash, writeTrashFile(\"c\", \"c\"));\n            mainTree.AddFile(\"c\");\n\n            new IndexTreeWalker(index, mainTree, trash, TestIndexTreeVisitor).Walk();\n            Assert.IsTrue(IndexOnlyEntriesVisited.Contains(\"a\"));\n            Assert.IsTrue(TreeOnlyEntriesVisited.Contains(\"b/b\"));\n            Assert.IsTrue(BothVisited.Contains(\"c\"));\n        }\n\n        [Test]\n        public void testIndexOnlySubDirs()\n        {\n            var index = new GitIndex(db);\n            var mainTree = new Core.Tree(db);\n\n            index.add(trash, writeTrashFile(\"foo/bar/baz\", \"foobar\"));\n            index.add(trash, writeTrashFile(\"asdf\", \"asdf\"));\n            new IndexTreeWalker(index, mainTree, trash, TestIndexTreeVisitor).Walk();\n\n            Assert.AreEqual(\"asdf\", IndexOnlyEntriesVisited[0]);\n            Assert.AreEqual(\"foo/bar/baz\", IndexOnlyEntriesVisited[1]);\n        }\n\n\n\n        [Test]\n        public void testLeavingTree()\n        {\n            var index = new GitIndex(db);\n            index.add(trash, writeTrashFile(\"foo/bar\", \"foo/bar\"));\n            index.add(trash, writeTrashFile(\"foobar\", \"foobar\"));\n\n            new IndexTreeWalker(index, db.MapTree(index.writeTree()), trash, TestTreeOnlyOneLevelTreeVisitor).Walk();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Merge/CherryPickTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2008, Robin Rosenberg\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Merge;\nusing NUnit.Framework;\n\nusing System;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.Merge\n{\n\t[TestFixture]\n\tpublic class CherryPickTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void TestPick()\n\t\t{\n\t\t\t// B---O\n\t\t\t// \\----P---T\n\t\t\t//\n\t\t\t// Cherry-pick \"T\" onto \"O\". This shouldn't introduce \"p-fail\", which\n\t\t\t// was created by \"P\", nor should it modify \"a\", which was done by \"P\".\n\t\t\t//\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeP = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder p = treeP.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"a\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"a\", FileMode.RegularFile));\n\t\t\t\to.add(MakeEntry(\"o\", FileMode.RegularFile));\n\n\t\t\t\tp.add(MakeEntry(\"a\", FileMode.RegularFile, \"q\"));\n\t\t\t\tp.add(MakeEntry(\"p-fail\", FileMode.RegularFile));\n\n\t\t\t\tt.add(MakeEntry(\"a\", FileMode.RegularFile));\n\t\t\t\tt.add(MakeEntry(\"t\", FileMode.RegularFile));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tp.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId P = Commit(ow, treeP, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { P });\n\n\t\t\tvar twm = (ThreeWayMerger)MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\ttwm.SetBase(P);\n\t\t\tbool merge = twm.Merge(new[] { O, T });\n\t\t\tAssert.IsTrue(merge);\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db) { Recursive = true };\n\t\t\ttw.reset(twm.GetResultTreeId());\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"a\", tw.getPathString());\n\t\t\tAssertCorrectId(treeO, tw);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"o\", tw.getPathString());\n\t\t\tAssertCorrectId(treeO, tw);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"t\", tw.getPathString());\n\t\t\tAssertCorrectId(treeT, tw);\n\n\t\t\tAssert.IsFalse(tw.next());\n\t\t}\n\n\t\tprivate static void AssertCorrectId(DirCache treeT, GitSharp.Core.TreeWalk.TreeWalk tw)\n\t\t{\n\t\t\tAssert.AreEqual(treeT.getEntry(tw.getPathString()).getObjectId(), tw.getObjectId(0));\n\t\t}\n\n\t\tprivate ObjectId Commit(ObjectWriter ow, DirCache treeB, ObjectId[] parentIds)\n\t\t{\n\t\t\tvar c = new Core.Commit(db) { TreeId = treeB.writeTree(ow), Author = new PersonIdent(\"A U Thor\", \"a.u.thor\", 1L, 0) };\n\t\t\tc.Committer = c.Author;\n\t\t\tc.ParentIds = parentIds;\n\t\t\tc.Message = \"Tree \" + c.TreeId.Name;\n\t\t\treturn ow.WriteCommit(c);\n\t\t}\n\n\t\tprivate DirCacheEntry MakeEntry(string path, FileMode mode)\n\t\t{\n\t\t\treturn MakeEntry(path, mode, path);\n\t\t}\n\n\t\tprivate DirCacheEntry MakeEntry(string path, FileMode mode, string content)\n\t\t{\n\t\t\tvar ent = new DirCacheEntry(path);\n\t\t\tent.setFileMode(mode);\n\t\t\tbyte[] contentBytes = Constants.encode(content);\n\t\t\tent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(contentBytes.Length, new MemoryStream(contentBytes)));\n\t\t\treturn ent;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Merge/MergeAlgorithmTest.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Merge;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Merge\n{\n    public class MergeAlgorithmTest {\n        MergeFormatter fmt=new MergeFormatter();\n\n        // the texts which are used in this merge-tests are constructed by\n        // concatenating fixed chunks of text defined by the string constants\n        // A..Y. The common base text is always the text A+B+C+D+E+F+G+H+I+J.\n        // The two texts being merged are constructed by deleting some chunks\n        // or inserting new chunks. Some of the chunks are one-liners, others\n        // contain more than one line.\n        private static string A = \"aaa\\n\";\n        private static string B = \"bbbbb\\nbb\\nbbb\\n\";\n        private static string C = \"c\\n\";\n        private static string D = \"dd\\n\";\n        private static string E = \"ee\\n\";\n        private static string F = \"fff\\nff\\n\";\n        private static string G = \"gg\\n\";\n        private static string H = \"h\\nhhh\\nhh\\n\";\n        private static string I = \"iiii\\n\";\n        private static string J = \"jj\\n\";\n        private static string Z = \"zzz\\n\";\n        private static string Y = \"y\\n\";\n\n        // constants which define how conflict-regions are expected to be reported.\n        private static string XXX_0 = \"<<<<<<< O\\n\";\n        private static string XXX_1 = \"=======\\n\";\n        private static string XXX_2 = \">>>>>>> T\\n\";\n\n        // the common base from which all merges texts derive from\n        string @base=A+B+C+D+E+F+G+H+I+J;\n\n        // the following constants define the merged texts. The name of the\n        // constants describe how they are created out of the common base. E.g.\n        // the constant named replace_XYZ_by_MNO stands for the text which is\n        // created from common base by replacing first chunk X by chunk M, then\n        // Y by N and then Z by O.\n        string replace_C_by_Z=A+B+Z+D+E+F+G+H+I+J;\n        string replace_A_by_Y=Y+B+C+D+E+F+G+H+I+J;\n        string replace_A_by_Z=Z+B+C+D+E+F+G+H+I+J;\n        string replace_J_by_Y=A+B+C+D+E+F+G+H+I+Y;\n        string replace_J_by_Z=A+B+C+D+E+F+G+H+I+Z;\n        string replace_BC_by_ZZ=A+Z+Z+D+E+F+G+H+I+J;\n        string replace_BCD_by_ZZZ=A+Z+Z+Z+E+F+G+H+I+J;\n        string replace_BD_by_ZZ=A+Z+C+Z+E+F+G+H+I+J;\n        string replace_BCDEGI_by_ZZZZZZ=A+Z+Z+Z+Z+F+Z+H+Z+J;\n        string replace_CEFGHJ_by_YYYYYY=A+B+Y+D+Y+Y+Y+Y+I+Y;\n        string replace_BDE_by_ZZY=A+Z+C+Z+Y+F+G+H+I+J;\n\n        /**\n\t * Check for a conflict where the second text was changed similar to the\n\t * first one, but the second texts modification covers one more line.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testTwoConflictingModifications()\n        {\n            Assert.AreEqual(A + XXX_0 + B + Z + XXX_1 + Z + Z + XXX_2 + D + E + F + G\n                            + H + I + J,\n                            merge(@base, replace_C_by_Z, replace_BC_by_ZZ));\n        }\n\n        /**\n\t * Test a case where we have three consecutive chunks. The first text\n\t * modifies all three chunks. The second text modifies the first and the\n\t * last chunk. This should be reported as one conflicting region.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testOneAgainstTwoConflictingModifications()\n        {\n            Assert.AreEqual(A + XXX_0 + Z + Z + Z + XXX_1 + Z + C + Z + XXX_2 + E + F\n                            + G + H + I + J,\n                            merge(@base, replace_BCD_by_ZZZ, replace_BD_by_ZZ));\n        }\n\n        /**\n\t * Test a merge where only the second text contains modifications. Expect as\n\t * merge result the second text.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testNoAgainstOneModification()\n        {\n            Assert.AreEqual(replace_BD_by_ZZ.ToString(),\n                            merge(@base, @base, replace_BD_by_ZZ));\n        }\n\n        /**\n\t * Both texts contain modifications but not on the same chunks. Expect a\n\t * non-conflict merge result.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testTwoNonConflictingModifications()\n        {\n            Assert.AreEqual(Y + B + Z + D + E + F + G + H + I + J,\n                            merge(@base, replace_C_by_Z, replace_A_by_Y));\n        }\n\n        /**\n\t * Merge two complicated modifications. The merge algorithm has to extend\n\t * and combine conflicting regions to get to the expected merge result.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testTwoComplicatedModifications()\n        {\n            Assert.AreEqual(A + XXX_0 + Z + Z + Z + Z + F + Z + H + XXX_1 + B + Y + D\n                            + Y + Y + Y + Y + XXX_2 + Z + Y,\n                            merge(@base,\n                                  replace_BCDEGI_by_ZZZZZZ,\n                                  replace_CEFGHJ_by_YYYYYY));\n        }\n\n        /**\n\t * Test a conflicting region at the very start of the text.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testConflictAtStart()\n        {\n            Assert.AreEqual(XXX_0 + Z + XXX_1 + Y + XXX_2 + B + C + D + E + F + G + H\n                            + I + J, merge(@base, replace_A_by_Z, replace_A_by_Y));\n        }\n\n        /**\n\t * Test a conflicting region at the very end of the text.\n\t *\n\t * @throws IOException\n\t */\n        [Test]\n        public void testConflictAtEnd()  {\n            Assert.AreEqual(A + B + C + D + E + F + G + H + I + XXX_0 + Z + XXX_1 + Y + XXX_2, merge(@base, replace_J_by_Z, replace_J_by_Y));\n        }\n\n        private string merge(string commonBase, string ours, string theirs)  {\n            MergeResult r=MergeAlgorithm.merge(new RawText(Constants.encode(commonBase)), new RawText(Constants.encode(ours)), new RawText(Constants.encode(theirs)));\n\t\t\n            using (var ms = new MemoryStream())\n            using (var bo = new BinaryWriter(ms))\n            {\n                fmt.formatMerge(bo, r, \"B\", \"O\", \"T\", Constants.CHARSET.WebName);\n                return Constants.CHARSET.GetString(ms.ToArray());\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Merge/SimpleMergeTest.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg\n * Copyright (C) 2009, Dan Rigby <dan@danrigby.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Merge;\nusing NUnit.Framework;\nusing FileMode=GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.Merge\n{\n\t[TestFixture]\n\tpublic class SimpleMergeTest : SampleDataRepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void TestOurs()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.Ours.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"a\"), db.Resolve(\"c\") });\n\t\t\tAssert.IsTrue(merge);\n\t\t\tAssert.AreEqual(db.MapTree(\"a\").Id, ourMerger.GetResultTreeId());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTheirs()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.Theirs.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"a\"), db.Resolve(\"c\") });\n\t\t\tAssert.IsTrue(merge);\n\t\t\tAssert.AreEqual(db.MapTree(\"c\").Id, ourMerger.GetResultTreeId());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTrivialTwoWay()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"a\"), db.Resolve(\"c\") });\n\t\t\tAssert.IsTrue(merge);\n\t\t\tAssert.AreEqual(\"02ba32d3649e510002c21651936b7077aa75ffa9\", ourMerger.GetResultTreeId().Name);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_disjointhistories()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"a\"), db.Resolve(\"c~4\") });\n\t\t\tAssert.IsTrue(merge);\n\t\t\tAssert.AreEqual(\"86265c33b19b2be71bdd7b8cb95823f2743d03a8\", ourMerger.GetResultTreeId().Name);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_ok()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"a^0^0^0\"), db.Resolve(\"a^0^0^1\") });\n\t\t\tAssert.IsTrue(merge);\n\t\t\tAssert.AreEqual(db.MapTree(\"a^0^0\").Id, ourMerger.GetResultTreeId());\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_conflict()\n\t\t{\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { db.Resolve(\"f\"), db.Resolve(\"g\") });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_validSubtreeSort()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"libelf-po/a\", FileMode.RegularFile));\n\t\t\t\tb.add(MakeEntry(\"libelf/c\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"Makefile\", FileMode.RegularFile));\n\t\t\t\to.add(MakeEntry(\"libelf-po/a\", FileMode.RegularFile));\n\t\t\t\to.add(MakeEntry(\"libelf/c\", FileMode.RegularFile));\n\n\t\t\t\tt.add(MakeEntry(\"libelf-po/a\", FileMode.RegularFile));\n\t\t\t\tt.add(MakeEntry(\"libelf/c\", FileMode.RegularFile, \"blah\"));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsTrue(merge);\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db) { Recursive = true };\n\t\t\ttw.reset(ourMerger.GetResultTreeId());\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"Makefile\", tw.getPathString());\n\t\t\tAssertCorrectId(treeO, tw);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"libelf-po/a\", tw.getPathString());\n\t\t\tAssertCorrectId(treeO, tw);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"libelf/c\", tw.getPathString());\n\t\t\tAssertCorrectId(treeT, tw);\n\n\t\t\tAssert.IsFalse(tw.next());\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_concurrentSubtreeChange()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tb.add(MakeEntry(\"d/t\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d/o\", FileMode.RegularFile, \"o !\"));\n\t\t\t\to.add(MakeEntry(\"d/t\", FileMode.RegularFile));\n\n\t\t\t\tt.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tt.add(MakeEntry(\"d/t\", FileMode.RegularFile, \"t !\"));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsTrue(merge);\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db) { Recursive = true };\n\t\t\ttw.reset(ourMerger.GetResultTreeId());\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"d/o\", tw.getPathString());\n\t\t\tAssertCorrectId(treeO, tw);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"d/t\", tw.getPathString());\n\t\t\tAssertCorrectId(treeT, tw);\n\n\t\t\tAssert.IsFalse(tw.next());\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_conflictSubtreeChange()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tb.add(MakeEntry(\"d/t\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\to.add(MakeEntry(\"d/t\", FileMode.RegularFile, \"o !\"));\n\n\t\t\t\tt.add(MakeEntry(\"d/o\", FileMode.RegularFile, \"t !\"));\n\t\t\t\tt.add(MakeEntry(\"d/t\", FileMode.RegularFile, \"t !\"));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_leftDFconflict1()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tb.add(MakeEntry(\"d/t\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d\", FileMode.RegularFile));\n\n\t\t\t\tt.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tt.add(MakeEntry(\"d/t\", FileMode.RegularFile, \"t !\"));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_rightDFconflict1()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\tb.add(MakeEntry(\"d/t\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\t\t\t\to.add(MakeEntry(\"d/t\", FileMode.RegularFile, \"o !\"));\n\n\t\t\t\tt.add(MakeEntry(\"d\", FileMode.RegularFile));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_leftDFconflict2()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d\", FileMode.RegularFile, \"o !\"));\n\n\t\t\t\tt.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\t[Test]\n        public void testTrivialTwoWay_rightDFconflict2()\n\t\t{\n\t\t\tDirCache treeB = DirCache.read(db);\n\t\t\tDirCache treeO = DirCache.read(db);\n\t\t\tDirCache treeT = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = treeB.builder();\n\t\t\t\tDirCacheBuilder o = treeO.builder();\n\t\t\t\tDirCacheBuilder t = treeT.builder();\n\n\t\t\t\tb.add(MakeEntry(\"d\", FileMode.RegularFile));\n\n\t\t\t\to.add(MakeEntry(\"d/o\", FileMode.RegularFile));\n\n\t\t\t\tt.add(MakeEntry(\"d\", FileMode.RegularFile, \"t !\"));\n\n\t\t\t\tb.finish();\n\t\t\t\to.finish();\n\t\t\t\tt.finish();\n\t\t\t}\n\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId B = Commit(ow, treeB, new ObjectId[] { });\n\t\t\tObjectId O = Commit(ow, treeO, new[] { B });\n\t\t\tObjectId T = Commit(ow, treeT, new[] { B });\n\n\t\t\tMerger ourMerger = MergeStrategy.SimpleTwoWayInCore.NewMerger(db);\n\t\t\tbool merge = ourMerger.Merge(new[] { O, T });\n\t\t\tAssert.IsFalse(merge);\n\t\t}\n\n\t\tprivate static void AssertCorrectId(DirCache treeT, GitSharp.Core.TreeWalk.TreeWalk tw)\n\t\t{\n\t\t\tAssert.AreEqual(treeT.getEntry(tw.getPathString()).getObjectId(), tw.getObjectId(0));\n\t\t}\n\n\t\tprivate ObjectId Commit(ObjectWriter ow, DirCache treeB, ObjectId[] parentIds)\n\t\t{\n            var c = new Core.Commit(db) { TreeId = treeB.writeTree(ow), Author = new PersonIdent(\"A U Thor\", \"a.u.thor\", 1L, 0) };\n\t\t\tc.Committer = c.Author;\n\t\t\tc.ParentIds = parentIds;\n\t\t\tc.Message = \"Tree \" + c.TreeId.Name;\n\t\t\treturn ow.WriteCommit(c);\n\t\t}\n\n\t\tprivate DirCacheEntry MakeEntry(string path, FileMode mode)\n\t\t{\n\t\t\treturn MakeEntry(path, mode, path);\n\t\t}\n\n\t\tprivate DirCacheEntry MakeEntry(string path, FileMode mode, String content)\n\t\t{\n\t\t\tvar ent = new DirCacheEntry(path);\n\t\t\tent.setFileMode(mode);\n\t\t\tbyte[] contentBytes = Constants.encode(content);\n\t\t\tent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(contentBytes.Length, new MemoryStream(contentBytes)));\n\t\t\treturn ent;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ObjectCheckerTests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class ObjectCheckerTests\n\t{\n\t\t#region Setup/Teardown\n\n\t\t[SetUp]\n\t\tpublic void setUp()\n\t\t{\n\t\t\t_checker = new ObjectChecker();\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate ObjectChecker _checker;\n\n\t\tprivate static void entry(StringBuilder b, string modeName)\n\t\t{\n\t\t\tb.Append(modeName);\n\t\t\tb.Append('\\0');\n\t\t\tfor (int i = 0; i < Constants.OBJECT_ID_LENGTH; i++)\n\t\t\t{\n\t\t\t\tb.Append((char) i);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testCheckBlob()\n\t\t{\n\t\t\t// Any blob should pass...\n\t\t\t_checker.checkBlob(new byte[0]);\n\t\t\t_checker.checkBlob(new byte[1]);\n\n\t\t\t_checker.check(Constants.OBJ_BLOB, new byte[0]);\n\t\t\t_checker.check(Constants.OBJ_BLOB, new byte[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <foo 1 +0000\\n\");\n\n            byte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor foo> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author a <b> +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor5()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author a <b>\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor6()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author a <b> z\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidAuthor7()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author a <b> 1 z\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidCommitter()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author a <b> 1 +0000\\n\");\n\t\t\tb.Append(\"committer a <\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"invalid committer\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidParent1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid parent\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidParent2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"zzzzfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid parent\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidParent3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent  \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid parent\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidParent4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent  \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\"z\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid parent\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidParent5()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent\\t\");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"no author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidTree1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"zzzzfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tree\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidTree2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\"z\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tree\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidTree3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9b\");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tree\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitInvalidTree4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree  \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tree\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoAuthor()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"no author\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoCommitter1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"no committer\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoCommitter2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\t\t\tb.Append(\"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\t// Yes, really, we complain about author not being\n\t\t\t\t// found as the invalid parent line wasn't consumed.\n\t\t\t\tAssert.AreEqual(\"no committer\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoTree1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tree header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoTree2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"trie \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tree header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoTree3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree\");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tree header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidCommitNoTree4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree\\t\");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkCommit(data);\n\t\t\t\tAssert.Fail(\"Did not catch corrupt object\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tree header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagInvalidTaggerHeader1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tag foo\\n\");\n\t\t\tb.Append(\"tagger \\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tagger\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagInvalidTaggerHeader3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tag foo\\n\");\n\t\t\tb.Append(\"tagger a < 1 +000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid tagger\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no object header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object\\t\");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no object header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"obejct \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no object header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"zz9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid object\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject5()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append(\" \\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid object\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoObject6()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid object\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTagHasNoTaggerHeader()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tag foo\\n\");\n\n            _checker.checkTag(Constants.encodeASCII(b.ToString()));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoTagHeader1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tag header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoTagHeader2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tag\\tfoo\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tag header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoTagHeader3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tga foo\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tag header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoType1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no type header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoType2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type\\tcommit\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no type header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoType3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"tpye commit\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no type header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTagNoType4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTag(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted invalid tag\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"no tag header\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeBadSorting1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 foobar\");\n\t\t\tentry(b, \"100644 fooaaa\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"incorrectly sorted\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeBadSorting2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"40000 a\");\n\t\t\tentry(b, \"100644 a.c\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"incorrectly sorted\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeBadSorting3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a0c\");\n\t\t\tentry(b, \"40000 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"incorrectly sorted\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeDuplicateNames1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"100644 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"duplicate entry names\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeDuplicateNames2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"100755 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"duplicate entry names\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeDuplicateNames3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"40000 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"duplicate entry names\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeDuplicateNames4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"100644 a.c\");\n\t\t\tentry(b, \"100644 a.d\");\n\t\t\tentry(b, \"100644 a.e\");\n\t\t\tentry(b, \"40000 a\");\n\t\t\tentry(b, \"100644 zoo\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"duplicate entry names\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeMissingName()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tb.Append(\"100644\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"truncated in mode\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeNotOctal1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"8 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid mode character\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeNotOctal2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"Z a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid mode character\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeNotSupportedMode1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"1 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid mode 1\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeNotSupportedMode2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"170000 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid mode \" + 0170000, e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeStartsWithZero1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"0 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"mode starts with '0'\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeStartsWithZero2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"0100644 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"mode starts with '0'\", e.Message);\n\t\t\t}\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeModeStartsWithZero3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"040000 a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"mode starts with '0'\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeNameContainsSlash()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a/b\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"name contains '/'\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeNameIsDot()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 .\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid name '.'\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeNameIsDotDot()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 ..\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"invalid name '..'\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeNameIsEmpty()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 \");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"zero length name\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeTruncatedInName()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tb.Append(\"100644 b\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"truncated in name\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidTreeTruncatedInObjectId()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tb.Append(\"100644 b\" + '\\0' + (char)1 + (char)2);\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.checkTree(data);\n\t\t\t\tAssert.Fail(\"incorrectly accepted an invalid tree\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(\"truncated in object id\", e.Message);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInvalidType()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_checker.check(Constants.OBJ_BAD, new byte[0]);\n\t\t\t\tAssert.Fail(\"Did not throw CorruptObjectException\");\n\t\t\t}\n\t\t\tcatch (CorruptObjectException e)\n\t\t\t{\n\t\t\t\tstring m = e.Message;\n\t\t\t\tAssert.AreEqual(\"Invalid object type: \" + Constants.OBJ_BAD, m);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommit128Parent()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tfor (int i = 0; i < 128; i++)\n\t\t\t{\n\t\t\t\tb.Append(\"parent \");\n\t\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\t\tb.Append('\\n');\n\t\t\t}\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommit1Parent()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommit2Parent()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"parent \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommitBlankAuthor()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author <> 0 +0000\\n\");\n\t\t\tb.Append(\"committer <> 0 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommitNoParent()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> 1 +0000\\n\");\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidCommitNormalTime()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tstring when = \"1222757360 -0730\";\n\n\t\t\tb.Append(\"tree \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"author A. U. Thor <author@localhost> \" + when + \"\\n\");\n\t\t\tb.Append(\"committer A. U. Thor <author@localhost> \" + when + \"\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkCommit(data);\n\t\t\t_checker.check(Constants.OBJ_COMMIT, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidEmptyTree()\n\t\t{\n\t\t\t_checker.checkTree(new byte[0]);\n\t\t\t_checker.check(Constants.OBJ_TREE, new byte[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTag()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\n\t\t\tb.Append(\"object \");\n\t\t\tb.Append(\"be9bfa841874ccc9f2ef7c48d0c76226f89b7189\");\n\t\t\tb.Append('\\n');\n\n\t\t\tb.Append(\"type commit\\n\");\n\t\t\tb.Append(\"tag test-tag\\n\");\n\t\t\tb.Append(\"tagger A. U. Thor <author@localhost> 1 +0000\\n\");\n\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTag(data);\n\t\t\t_checker.check(Constants.OBJ_TAG, data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 regular-file\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100755 executable\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"40000 tree\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"120000 symlink\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree5()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"160000 git link\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTree6()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 .a\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting1()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 fooaaa\");\n\t\t\tentry(b, \"100755 foobar\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting2()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100755 fooaaa\");\n\t\t\tentry(b, \"100644 foobar\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting3()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"40000 a\");\n\t\t\tentry(b, \"100644 b\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting4()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"40000 b\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting5()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a.c\");\n\t\t\tentry(b, \"40000 a\");\n\t\t\tentry(b, \"100644 a0c\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting6()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"40000 a\");\n\t\t\tentry(b, \"100644 apple\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting7()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"40000 an orang\");\n\t\t\tentry(b, \"40000 an orange\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTreeSorting8()\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tentry(b, \"100644 a\");\n\t\t\tentry(b, \"100644 a0c\");\n\t\t\tentry(b, \"100644 b\");\n\t\t\tbyte[] data = Constants.encodeASCII(b.ToString());\n\t\t\t_checker.checkTree(data);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ObjectIdRefTest.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class ObjectIdRefTest\n    {\n        private static ObjectId ID_A = ObjectId\n            .FromString(\"41eb0d88f833b558bddeb269b7ab77399cdf98ed\");\n\n        private static ObjectId ID_B = ObjectId\n            .FromString(\"698dd0b8d0c299f080559a1cffc7fe029479a408\");\n\n        private static string name = \"refs/heads/a.test.ref\";\n\n        [Test]\n        public void testConstructor_PeeledStatusNotKnown()\n        {\n            ObjectIdRef r;\n\n            r = new Unpeeled(Storage.Loose, name, ID_A);\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreSame(name, r.getName());\n            Assert.AreSame(ID_A, r.getObjectId());\n            Assert.IsFalse(r.isPeeled(), \"not peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n            Assert.AreSame(r, r.getLeaf(), \"leaf is this\");\n            Assert.AreSame(r, r.getTarget(), \"target is this\");\n            Assert.IsFalse(r.isSymbolic(), \"not symbolic\");\n\n            r = new Unpeeled(Storage.Packed, name, ID_A);\n            Assert.AreSame(Storage.Packed, r.getStorage());\n\n            r = new Unpeeled(Storage.LoosePacked, name, ID_A);\n            Assert.AreSame(Storage.LoosePacked, r.getStorage());\n\n            r = new Unpeeled(Storage.New, name, null);\n            Assert.AreSame(Storage.New, r.getStorage());\n            Assert.AreSame(name, r.getName());\n            Assert.IsNull(r.getObjectId(), \"no id on new ref\");\n            Assert.IsFalse(r.isPeeled(), \"not peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n            Assert.AreSame(r, r.getLeaf(), \"leaf is this\");\n            Assert.AreSame(r, r.getTarget(), \"target is this\");\n            Assert.IsFalse(r.isSymbolic(), \"not symbolic\");\n        }\n\n        [Test]\n        public void testConstructor_Peeled()\n        {\n            ObjectIdRef r;\n\n            r = new Unpeeled(Storage.Loose, name, ID_A);\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreSame(name, r.getName());\n            Assert.AreSame(ID_A, r.getObjectId());\n            Assert.IsFalse(r.isPeeled(), \"not peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n            Assert.AreSame(r, r.getLeaf(), \"leaf is this\");\n            Assert.AreSame(r, r.getTarget(), \"target is this\");\n            Assert.IsFalse(r.isSymbolic(), \"not symbolic\");\n\n            r = new PeeledNonTag(Storage.Loose, name, ID_A);\n            Assert.IsTrue(r.isPeeled(), \"is peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n\n            r = new PeeledTag(Storage.Loose, name, ID_A, ID_B);\n            Assert.IsTrue(r.isPeeled(), \"is peeled\");\n            Assert.AreSame(ID_B, r.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testToString()\n        {\n            ObjectIdRef r;\n\n            r = new Unpeeled(Storage.Loose, name, ID_A);\n            Assert.AreEqual(\"Ref[\" + name + \"=\" + ID_A.Name + \"]\", r.ToString());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackIndexTestCase.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    public abstract class PackIndexTestCase : RepositoryTestCase\n    {\n        protected PackIndex smallIdx;\n        private PackIndex _denseIdx;\n\n        [SetUp]\n        public override void setUp()\n        {\n            base.setUp();\n            smallIdx = PackIndex.Open(GetFileForPack34Be9032());\n            _denseIdx = PackIndex.Open(GetFileForPackdf2982F28());\n        }\n\n        /// <summary>\n        /// Return File with appropriate index version for prepared pack.\n        /// </summary>\n        /// <returns></returns>\n        protected abstract FileInfo GetFileForPack34Be9032();\n\n        /// <summary>\n        /// Return File with appropriate index version for prepared pack.\n        /// </summary>\n        /// <returns></returns>\n        protected abstract FileInfo GetFileForPackdf2982F28();\n\n        /// <summary>\n        /// Verify CRC32 support.\n        /// </summary>\n        public abstract void testCRC32();\n\n        /// <summary>\n        /// Test contracts of Iterator methods and this implementation remove()\n        /// limitations.\n        /// </summary>\n        [Test]\n        public void testIteratorMethodsContract()\n        {\n            IEnumerator<PackIndex.MutableEntry> iter = smallIdx.GetEnumerator();\n            while (iter.MoveNext())\n            {\n                var entry = iter.Current;\n            }\n            Assert.IsFalse(iter.MoveNext());\n        }\n\n        /// <summary>\n        /// Test results of iterator comparing to content of well-known (prepared)\n        /// small index.\n        /// </summary>\n        [Test]\n        public void testIteratorReturnedValues1()\n        {\n            IEnumerator<PackIndex.MutableEntry> iter = smallIdx.GetEnumerator();\n            iter.MoveNext();\n            Assert.AreEqual(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"82c6b885ff600be425b4ea96dee75dca255b69e7\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"902d5476fa249b7abc9d84c611577a81381f0327\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"aabf2ffaec9b497f0950352b3e582d73035c2035\", iter.Current.Name);\n            iter.MoveNext();\n            Assert.AreEqual(\"c59759f143fb1fe21c197981df75a7ee00290799\", iter.Current.Name);\n            Assert.IsFalse(iter.MoveNext());\n        }\n\n        /// <summary>\n        /// Compare offset from iterator entries with output of findOffset() method.\n        /// </summary>\n        [Test]\n        public void testCompareEntriesOffsetsWithFindOffsets()\n        {\n            foreach (var me in smallIdx)\n            {\n                Assert.AreEqual(smallIdx.FindOffset(me.ToObjectId()), me.Offset);\n            }\n\n            foreach (var me in _denseIdx)\n            {\n                Assert.AreEqual(_denseIdx.FindOffset(me.ToObjectId()), me.Offset);\n            }\n        }\n\n        /// <summary>\n        /// Test partial results of iterator comparing to content of well-known\n        /// (prepared) dense index, that may need multi-level indexing.\n        /// </summary>\n        [Test]\n        public void testIteratorReturnedValues2()\n        {\n            IEnumerator<PackIndex.MutableEntry> iter = _denseIdx.GetEnumerator();\n            iter.MoveNext();\n\n            while (!iter.Current.Name.Equals(\"0a3d7772488b6b106fb62813c4d6d627918d9181\"))\n            {\n                // just iterating\n                iter.MoveNext();\n            }\n\n            iter.MoveNext();\n            Assert.AreEqual(\"1004d0d7ac26fbf63050a234c9b88a46075719d3\", iter.Current.Name); // same level-1\n            iter.MoveNext();\n            Assert.AreEqual(\"10da5895682013006950e7da534b705252b03be6\", iter.Current.Name); // same level-1\n            iter.MoveNext();\n            Assert.AreEqual(\"1203b03dc816ccbb67773f28b3c19318654b0bc8\", iter.Current.Name);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackIndexTests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class PackIndexTests\n\t{\n\t\t[Test]\n\t\tpublic void ObjectList()\n\t\t{\n\t\t\tvar knownOffsets = new long[] { 370, 349, 304, 12, 175, 414 };\n\t\t\tvar knownCrcs = new long[] { 1376555649, 3015185563, 2667925865, 914969567, 2706901546, 39477847 };\n\t\t\tvar knownObjectIds = new[] { \"1AFC38724D2B89264C7B3826D40B0655A95CFAB4\", \"557DB03DE997C86A4A028E1EBD3A1CEB225BE238\", \"67DC4302383B2715F4E0B8C41840EB05B1873697\", \"A48B402F61EB8ED445DACAA3AF80A2E9796DCB3B\", \"E41517D564000311F3D7A54F1390EE82F5F1A55B\", \"E965047AD7C57865823C7D992B1D046EA66EDF78\" };\n\n            var indexFile = new FileInfo(\"Resources\" + Path.DirectorySeparatorChar + \"sample.git\" + Path.DirectorySeparatorChar + \"objects\"\n\t\t\t\t\t\t\t\t\t\t + Path.DirectorySeparatorChar + \"pack\"\n\t\t\t\t\t\t\t\t\t\t + Path.DirectorySeparatorChar + \"pack-845b2ba3349cc201321e752b01c5ada8102a9a08.idx\");\n\n\t\t\tvar index = PackIndex.Open(indexFile);\n\t\n\t\t\tAssert.AreEqual(6, index.ObjectCount);\n\t\t\tAssert.IsTrue(index.HasCRC32Support);\n\t\t\t\n\t\t\tvar i = 0;\n\t\t\tforeach (var item in index)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(knownObjectIds[i], item.Name.ToUpper(), \"ObjectListId#\" + i);\n\t\t\t\tAssert.AreEqual(knownOffsets[i], item.Offset, \"ObjectListOffset#\" + i);\n\t\t\t\tAssert.AreEqual(knownCrcs[i], index.FindCRC32(item.idBuffer), \"ObjectListCRC#\" + i);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackIndexV1Tests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class PackIndexV1Test : PackIndexTestCase\n    {\n    \tprotected override FileInfo GetFileForPack34Be9032()\n        {\n            return new FileInfo(\"Resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\");\n        }\n\n    \tprotected override FileInfo GetFileForPackdf2982F28()\n        {\n            return new FileInfo(\"Resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\");\n        }\n\n        /// <summary>\n\t\t/// Verify CRC32 - V1 should not index anything.\n        /// </summary>\n        [Test]\n        public override void testCRC32()\n        {\n        \tAssertHelper.Throws<NotSupportedException>(() => \n\t\t\t\tsmallIdx.FindCRC32(ObjectId.FromString(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\")));\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackIndexV2Tests.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Tests.GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class PackIndexV2Tests : PackIndexTestCase\n    {\n    \tprotected override FileInfo GetFileForPack34Be9032()\n        {\n            return new FileInfo(\"Resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\");\n        }\n\n    \tprotected override FileInfo GetFileForPackdf2982F28()\n        {\n            return new FileInfo(\"Resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\");\n        }\n\n        /// <summary>\n\t\t/// Verify CRC32 indexing.\n        /// </summary>\n        [Test]\n        public override void testCRC32()\n        {\n            Assert.IsTrue(smallIdx.HasCRC32Support);\n            Assert.AreEqual(0x00000000C2B64258L, smallIdx.FindCRC32(ObjectId.FromString(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\")));\n            Assert.AreEqual(0x0000000072AD57C2L, smallIdx.FindCRC32(ObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\")));\n            Assert.AreEqual(0x00000000FF10A479L, smallIdx.FindCRC32(ObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\")));\n            Assert.AreEqual(0x0000000034B27DDCL, smallIdx.FindCRC32(ObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\")));\n            Assert.AreEqual(0x000000004743F1E4L, smallIdx.FindCRC32(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\")));\n            Assert.AreEqual(0x00000000640B358BL, smallIdx.FindCRC32(ObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\")));\n            Assert.AreEqual(0x000000002A17CB5EL, smallIdx.FindCRC32(ObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\")));\n            Assert.AreEqual(0x000000000B3B5BA6L, smallIdx.FindCRC32(ObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\")));\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackReverseIndexTest.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class PackReverseIndexTest : RepositoryTestCase\n\t{\n\t\tprivate PackIndex _idx;\n\t\tprivate PackReverseIndex _reverseIdx;\n\n\t\t///\t<summary>\n\t\t/// Set up tested class instance, test constructor by the way.\n\t\t/// </summary>\n\t\tpublic override void setUp()\n\t\t{\n\t\t\tbase.setUp();\n\n\t\t\t// index with both small (< 2^31) and big offsets\n\t\t\tvar fi = new FileInfo(\"Resources/pack-huge.idx\");\n\t\t\tAssert.IsTrue(fi.Exists, \"Does the index exist\");\n\t\t\t_idx = PackIndex.Open(fi);\n\t\t\t_reverseIdx = new PackReverseIndex(_idx);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test findObject() for all index entries.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testFindObject()\n\t\t{\n\t\t\tforeach (PackIndex.MutableEntry me in _idx)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(me.ToObjectId(), _reverseIdx.FindObject(me.Offset));\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test findObject() with illegal argument.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testFindObjectWrongOffset()\n\t\t{\n\t\t\tAssert.IsNull(_reverseIdx.FindObject(0));\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test findNextOffset() for all index entries.\n\t\t///\t</summary>\n\t\t[Test]\n\t\tpublic void testFindNextOffset()\n\t\t{\n\t\t\tlong offset = FindFirstOffset();\n\t\t\tAssert.IsTrue(offset > 0);\n\n\t\t\tfor (int i = 0; i < _idx.ObjectCount; i++)\n\t\t\t{\n\t\t\t\tlong newOffset = _reverseIdx.FindNextOffset(offset, long.MaxValue);\n\t\t\t\tAssert.IsTrue(newOffset > offset);\n\n\t\t\t\tif (i == _idx.ObjectCount - 1)\n\t\t\t\t{\n\t\t\t\t\tAssert.AreEqual(newOffset, long.MaxValue);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tAssert.AreEqual(newOffset, _idx.FindOffset(_reverseIdx.FindObject(newOffset)));\n\t\t\t\t}\n\n\t\t\t\toffset = newOffset;\n\t\t\t}\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test findNextOffset() with wrong illegal argument as offset.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testFindNextOffsetWrongOffset()\n\t\t{\n\t\t\tAssertHelper.Throws<CorruptObjectException>(() => _reverseIdx.FindNextOffset(0, long.MaxValue));\n\t\t}\n\n\t\tprivate long FindFirstOffset()\n\t\t{\n\t\t\tlong min = long.MaxValue;\n\t\t\tforeach (PackIndex.MutableEntry me in _idx)\n\t\t\t{\n\t\t\t\tmin = Math.Min(min, me.Offset);\n\t\t\t}\n\t\t\treturn min;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/PackWriterTest.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n    public class PackWriterTest : SampleDataRepositoryTestCase\n\t{\n\t\tprivate static readonly IList<ObjectId> EMPTY_LIST_OBJECT = new List<ObjectId>();\n\t\tprivate static readonly IList<RevObject> EMPTY_LIST_REVS = new List<RevObject>();\n\n\t\tprivate PackWriter _writer;\n\t\tprivate MemoryStream _os;\n\t\tprivate PackOutputStream _cos;\n\t\tprivate FileInfo _packBase;\n\t\tprivate FileInfo _packFile;\n\t\tprivate FileInfo _indexFile;\n\t\tprivate PackFile _pack;\n\n\t\t#region Setup/Teardown\n\n\t\t[SetUp]\n\t\tpublic override void setUp()\n\t\t{\n\t\t\tbase.setUp();\n\n\t\t\t_os = new MemoryStream();\n\t\t\t_cos = new PackOutputStream(_os);\n\t\t\t_packBase = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack\"));\n\t\t\t_packFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack._pack\"));\n\t\t\t_indexFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack.idx\"));\n\t\t\t_writer = new PackWriter(db, new TextProgressMonitor());\n\t\t}\n     \n        [TearDown]\n        public override void tearDown()\n        {\n            if (_pack != null)\n                _pack.Dispose();\n\n            base.tearDown();\n        }\n\t\t#endregion\n\n\t\t///\t<summary>\n\t\t/// Try to pass non-existing object as uninteresting, with ignoring setting.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testIgnoreNonExistingObjects()\n\t\t{\n\t\t\tObjectId nonExisting = ObjectId.FromString(\"0000000000000000000000000000000000000001\");\n\t\t\tCreateVerifyOpenPack(EMPTY_LIST_OBJECT, Enumerable.Repeat(nonExisting, 1), false, true);\n\t\t\t// shouldn't throw anything\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create pack basing on only interesting objects, then precisely verify\n\t\t///\tcontent. No delta reuse here.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack1()\n\t\t{\n\t\t\t_writer.ReuseDeltas = false;\n\t\t\tWriteVerifyPack1();\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Compare sizes of packs created using\n\t\t///\t<seealso cref=\"testWritePack2DeltasReuseRefs()\"/> and\n\t\t///\t<seealso cref=\"testWritePack2DeltasReuseOffsets()\"/>. \n\t\t/// The pack with delta bases written as offsets should be smaller.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"Exception\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2SizeOffsetsVsRefs()\n\t\t{\n\t\t\ttestWritePack2DeltasReuseRefs();\n\t\t\tlong sizePack2DeltasRefs = _cos.Length;\n\t\t\ttearDown();\n\t\t\tsetUp();\n\t\t\ttestWritePack2DeltasReuseOffsets();\n\t\t\tlong sizePack2DeltasOffsets = _cos.Length;\n\n\t\t\tAssert.IsTrue(sizePack2DeltasRefs > sizePack2DeltasOffsets);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Compare sizes of packs created using <seealso cref=\"testWritePack4()\"/> and\n\t\t///\t<seealso cref=\"testWritePack4ThinPack()\"/>. \n\t\t/// Obviously, the thin pack should be smaller.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"Exception\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack4SizeThinVsNoThin()\n\t\t{\n\t\t\ttestWritePack4();\n\t\t\tlong sizePack4 = _cos.Length;\n\t\t\ttearDown();\n\t\t\tsetUp();\n\t\t\ttestWritePack4ThinPack();\n\t\t\tlong sizePack4Thin = _cos.Length;\n\n\t\t\tAssert.IsTrue(sizePack4 > sizePack4Thin);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWriteIndex()\n\t\t{\n\t\t\t_writer.setIndexVersion(2);\n\t\t\tWriteVerifyPack4(false);\n\n\t\t\t// Validate that IndexPack came up with the right CRC32 value.\n\t\t\tPackIndex idx1 = PackIndex.Open(_indexFile);\n\t\t\tAssert.IsTrue(idx1 is PackIndexV2);\n\t\t\tAssert.AreEqual(0x4743F1E4L, idx1.FindCRC32(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\")));\n\n\t\t\t// Validate that an index written by PackWriter is the same.\n\t\t\tFileInfo idx2File = new FileInfo(_indexFile.FullName+ \".2\");\n\t\t\tusing (var @is = new FileStream(idx2File.FullName, System.IO.FileMode.CreateNew))\n\t\t\t{\n\t\t\t\t_writer.writeIndex(@is);\n\t\t\t}\n\t\n            PackIndex idx2 = PackIndex.Open(idx2File);\n#pragma warning disable 0612\n            Assert.IsInstanceOfType(typeof(PackIndexV2), idx2); // [henon] IsInstanceOfType is obsolete\n#pragma warning restore 0612\n            Assert.AreEqual(idx1.ObjectCount, idx2.ObjectCount);\n\t\t\tAssert.AreEqual(idx1.Offset64Count, idx2.Offset64Count);\n\n\t\t\tfor (int i = 0; i < idx1.ObjectCount; i++)\n\t\t\t{\n\t\t\t\tObjectId id = idx1.GetObjectId(i);\n\t\t\t\tAssert.AreEqual(id, idx2.GetObjectId(i));\n\t\t\t\tAssert.AreEqual(idx1.FindOffset(id), idx2.FindOffset(id));\n\t\t\t\tAssert.AreEqual(idx1.FindCRC32(id), idx2.FindCRC32(id));\n\t\t\t}\n\t\t}\n\n\t\t// TODO: testWritePackDeltasCycle()\n\t\t// TODO: testWritePackDeltasDepth()\n\n\t\tprivate void WriteVerifyPack1()\n\t\t{\n\t\t\tvar interestings = new LinkedList<ObjectId>();\n\t\t\tinterestings.AddLast(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"));\n\t\t\tCreateVerifyOpenPack(interestings, EMPTY_LIST_OBJECT, false, false);\n\n\t\t\tvar expectedOrder = new[]\n\t\t\t                    \t{\n\t\t\t                    \t\tObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"),\n\t\t\t                    \t\tObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\"),\n\t\t\t                    \t\tObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\"),\n\t\t\t                    \t\tObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"),\n\t\t\t                    \t\tObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\"),\n\t\t\t                    \t\tObjectId.FromString(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"),\n\t\t\t                    \t\tObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\"),\n\t\t\t                    \t\tObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\")\n\t\t\t                    \t};\n\n\t\t\tAssert.AreEqual(expectedOrder.Length, _writer.getObjectsNumber());\n\t\t\tVerifyObjectsOrder(expectedOrder);\n\t\t\tAssert.AreEqual(\"34be9032ac282b11fa9babdc2b2a93ca996c9c2f\", _writer.computeName().Name);\n\t\t}\n\n\t\tprivate void WriteVerifyPack2(bool deltaReuse)\n\t\t{\n\t\t\t_writer.ReuseDeltas = deltaReuse;\n\t\t\tvar interestings = new LinkedList<ObjectId>();\n\t\t\tinterestings.AddLast(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"));\n\t\t\tvar uninterestings = new LinkedList<ObjectId>();\n\t\t\tuninterestings.AddLast(ObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\"));\n\t\t\tCreateVerifyOpenPack(interestings, uninterestings, false, false);\n\n\t\t\tvar expectedOrder = new[]\n\t\t\t                    \t{\n\t\t\t                    \t\tObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"),\n\t\t\t                    \t\tObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\"),\n\t\t\t                    \t\tObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"),\n\t\t\t                    \t\tObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\"),\n\t\t\t                    \t\tObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\"),\n\t\t\t                    \t\tObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\")\n\t\t\t                    \t};\n\t\t\tif (deltaReuse)\n\t\t\t{\n\t\t\t\t// objects order influenced (swapped) by delta-base first rule\n\t\t\t\tObjectId temp = expectedOrder[4];\n\t\t\t\texpectedOrder[4] = expectedOrder[5];\n\t\t\t\texpectedOrder[5] = temp;\n\t\t\t}\n\n\t\t\tAssert.AreEqual(expectedOrder.Length, _writer.getObjectsNumber());\n\t\t\tVerifyObjectsOrder(expectedOrder);\n\t\t\tAssert.AreEqual(\"ed3f96b8327c7c66b0f8f70056129f0769323d86\", _writer.computeName().Name);\n\t\t}\n\n\t\tprivate void WriteVerifyPack4(bool thin)\n\t\t{\n\t\t\tvar interestings = new LinkedList<ObjectId>();\n\t\t\tinterestings.AddLast(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"));\n\t\t\tvar uninterestings = new LinkedList<ObjectId>();\n\t\t\tuninterestings.AddLast(ObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\"));\n\t\t\tCreateVerifyOpenPack(interestings, uninterestings, thin, false);\n\n\t\t\tvar writtenObjects = new[]\n\t\t\t                     \t{\n\t\t\t                     \t\tObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"),\n\t\t\t                     \t\tObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"),\n\t\t\t                     \t\tObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\")\n\t\t\t                     \t};\n\n\t\t\tAssert.AreEqual(writtenObjects.Length, _writer.getObjectsNumber());\n\t\t\tObjectId[] expectedObjects;\n\t\t\tif (thin)\n\t\t\t{\n\t\t\t\texpectedObjects = new ObjectId[4];\n\t\t\t\tArray.Copy(writtenObjects, 0, expectedObjects, 0, writtenObjects.Length);\n\t\t\t\texpectedObjects[3] = ObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texpectedObjects = writtenObjects;\n\t\t\t}\n\n\t\t\tVerifyObjectsOrder(expectedObjects);\n\t\t\tAssert.AreEqual(\"cded4b74176b4456afa456768b2b5aafb41c44fc\", _writer.computeName().Name);\n\t\t}\n\n\t\tprivate void CreateVerifyOpenPack(IEnumerable<ObjectId> interestings, \n\t\t\tIEnumerable<ObjectId> uninterestings, bool thin, bool ignoreMissingUninteresting)\n\t\t{\n\t\t\t_writer.Thin = thin;\n\t\t\t_writer.IgnoreMissingUninteresting = ignoreMissingUninteresting;\n\t\t\t_writer.preparePack(interestings, uninterestings);\n\t\t\t_writer.writePack(_cos);\n\t\t\tVerifyOpenPack(thin);\n\t\t}\n\n\t\tprivate void CreateVerifyOpenPack(IEnumerable<RevObject> objectSource)\n\t\t{\n\t\t\t_writer.preparePack(objectSource);\n\t\t\t_writer.writePack(_cos);\n\t\t\tVerifyOpenPack(false);\n\t\t}\n\n\t\tprivate void VerifyOpenPack(bool thin)\n\t\t{\n\t\t\tIndexPack indexer;\n\t\t\tStream @is;\n\n\t\t\tif (thin)\n\t\t\t{\n\t\t\t\t@is = new MemoryStream(_os.ToArray());\n\t\t\t\tindexer = new IndexPack(db, @is, _packBase);\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tindexer.index(new TextProgressMonitor());\n\t\t\t\t\tAssert.Fail(\"indexer should grumble about missing object\");\n\t\t\t\t}\n\t\t\t\tcatch (IOException)\n\t\t\t\t{\n\t\t\t\t\t// expected\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@is = new MemoryStream(_os.ToArray());\n\t\t\tindexer = new IndexPack(db, @is, _packBase);\n\t\t\tindexer.setKeepEmpty(true);\n\t\t\tindexer.setFixThin(thin);\n\t\t\tindexer.setIndexVersion(2);\n\t\t\tindexer.index(new TextProgressMonitor());\n\t\t\t_pack = new PackFile(_indexFile, _packFile);\n\t\t}\n\n\t\tprivate void VerifyObjectsOrder(ObjectId[] objectsOrder)\n\t\t{\n\t\t\tvar entries = new SortedList<long, PackIndex.MutableEntry>();\n\n\t\t\tforeach (PackIndex.MutableEntry me in _pack)\n\t\t\t{\n\t\t\t\tentries.Add(me.Offset, me.CloneEntry());\n\t\t\t}\n\n\t\t\tint i = 0;\n\t\t\tforeach (PackIndex.MutableEntry me in entries.Values)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(objectsOrder[i++].ToObjectId(), me.ToObjectId());\n\t\t\t}\n\t\t}\n\n\t\t///\t <summary>\n\t\t/// Test constructor for exceptions, default settings, initialization.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testContructor()\n\t\t{\n\t\t\tAssert.AreEqual(false, _writer.DeltaBaseAsOffset);\n\t\t\tAssert.AreEqual(true, _writer.ReuseDeltas);\n\t\t\tAssert.AreEqual(true, _writer.ReuseObjects);\n\t\t\tAssert.AreEqual(0, _writer.getObjectsNumber());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Change default settings and verify them.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testModifySettings()\n\t\t{\n\t\t\t_writer.DeltaBaseAsOffset = true;\n\t\t\t_writer.ReuseDeltas = false;\n\t\t\t_writer.ReuseObjects = false;\n\n\t\t\tAssert.AreEqual(true, _writer.DeltaBaseAsOffset);\n\t\t\tAssert.AreEqual(false, _writer.ReuseDeltas);\n\t\t\tAssert.AreEqual(false, _writer.ReuseObjects);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Try to pass non-existing object as uninteresting, with non-ignoring\n\t\t///\tsetting.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testNotIgnoreNonExistingObjects()\n\t\t{\n\t\t\tAssertHelper.Throws<MissingObjectException>(() =>\n\t\t\t                                            \t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tObjectId nonExisting = ObjectId.FromString(\"0000000000000000000000000000000000000001\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCreateVerifyOpenPack(EMPTY_LIST_OBJECT, Enumerable.Repeat(nonExisting, 1), false, false);\n\t\t\t                                            \t});\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Write empty pack by providing empty sets of interesting/uninteresting\n\t\t///\tobjects and check for correct format.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWriteEmptyPack1()\n\t\t{\n\t\t\tCreateVerifyOpenPack(EMPTY_LIST_OBJECT, EMPTY_LIST_OBJECT, false, false);\n\n\t\t\tAssert.AreEqual(0, _writer.getObjectsNumber());\n\t\t\tAssert.AreEqual(0, _pack.ObjectCount);\n\t\t\tAssert.AreEqual(\"da39a3ee5e6b4b0d3255bfef95601890afd80709\", _writer.computeName().Name);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Write empty pack by providing empty iterator of objects to write and\n\t\t/// check for correct format.\n\t\t/// </summary>\n\t\t/// <exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWriteEmptyPack2()\n\t\t{\n\t\t\tCreateVerifyOpenPack(EMPTY_LIST_REVS);\n\n\t\t\tAssert.AreEqual(0, _writer.getObjectsNumber());\n\t\t\tAssert.AreEqual(0, _pack.ObjectCount);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test writing pack without object reuse. Pack content/preparation as in\n\t\t///\t<seealso cref=\"testWritePack1()\"/>.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic virtual void testWritePack1NoObjectReuse()\n\t\t{\n\t\t\t_writer.ReuseDeltas = false;\n\t\t\t_writer.ReuseObjects = false;\n\t\t\tWriteVerifyPack1();\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create pack basing on both interesting and uninteresting objects, then\n\t\t///\tprecisely verify content. No delta reuse here.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2()\n\t\t{\n\t\t\tWriteVerifyPack2(false);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test pack writing with delta reuse. Raw-data copy (reuse) is made on a\n\t\t///\tpack with CRC32 index. Pack configuration as in\n\t\t///\t<seealso cref=\"testWritePack2DeltasReuseRefs()\"/>.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2DeltasCRC32Copy()\n\t\t{\n\t\t\tvar packDir = new FileInfo(Path.Combine(db.ObjectsDirectory.FullName, \"pack\"));\n\t\t\tvar crc32Pack = new FileInfo(Path.Combine(packDir.DirectoryName, \"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\"));\n\t\t\tvar crc32Idx = new FileInfo(Path.Combine(packDir.DirectoryName, \"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\"));\n\t\t\tFileInfo packFile = new FileInfo(\"Resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\");\n\t\t\tpackFile.CopyTo(crc32Idx.FullName);\n\t\t\tdb.OpenPack(crc32Pack, crc32Idx);\n\n\t\t\tWriteVerifyPack2(true);\n\t\t}\n\n\t\t///\t<summary> \n\t\t/// Test pack writing with delta reuse. Delta bases referred as offsets. Pack\n\t\t///\tconfiguration as in <seealso cref=\"testWritePack2DeltasReuseRefs()\"/>.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2DeltasReuseOffsets()\n\t\t{\n\t\t\t_writer.DeltaBaseAsOffset = true;\n\t\t\tWriteVerifyPack2(true);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test pack writing with deltas reuse, delta-base first rule. Pack\n\t\t///\tcontent/preparation as in <seealso cref=\"testWritePack2()\"/>.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2DeltasReuseRefs()\n\t\t{\n\t\t\tWriteVerifyPack2(true);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Compare sizes of packs created using <seealso cref=\"testWritePack2()\"/> and\n\t\t///\t<seealso cref=\"testWritePack2DeltasReuseRefs()\"/>. The pack using deltas should\n\t\t///\tbe smaller.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"Exception\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack2SizeDeltasVsNoDeltas()\n\t\t{\n\t\t\ttestWritePack2();\n\t\t\tlong sizePack2NoDeltas = _cos.Length;\n\t\t\ttearDown();\n\t\t\tsetUp();\n\t\t\ttestWritePack2DeltasReuseRefs();\n\t\t\tlong sizePack2DeltasRefs = _cos.Length;\n\n\t\t\tAssert.IsTrue(sizePack2NoDeltas > sizePack2DeltasRefs);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Create pack basing on fixed objects list, then precisely verify content.\n\t\t///\tNo delta reuse here.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t///\t<exception cref=\"MissingObjectException\">\n\t\t///\t</exception>\n\t\t[Test]\n\t\tpublic void testWritePack3()\n\t\t{\n\t\t\t_writer.ReuseDeltas = false;\n\t\t\tvar forcedOrder = new[]\n\t\t\t                  \t{\n\t\t\t                  \t\tObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\"),\n\t\t\t                  \t\tObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\"),\n\t\t\t                  \t\tObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"),\n\t\t\t                  \t\tObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\"),\n\t\t\t                  \t\tObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\"),\n\t\t\t                  \t\tObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\")\n\t\t\t                  \t};\n\t\t\tvar parser = new GitSharp.Core.RevWalk.RevWalk(db);\n\t\t\tvar forcedOrderRevs = new RevObject[forcedOrder.Length];\n\n\t\t\tfor (int i = 0; i < forcedOrder.Length; i++)\n\t\t\t{\n\t\t\t\tforcedOrderRevs[i] = parser.parseAny(forcedOrder[i]);\n\t\t\t}\n\n\t\t\tCreateVerifyOpenPack(forcedOrderRevs.AsEnumerable());\n\n\t\t\tAssert.AreEqual(forcedOrder.Length, _writer.getObjectsNumber());\n\t\t\tVerifyObjectsOrder(forcedOrder);\n\t\t\tAssert.AreEqual(\"ed3f96b8327c7c66b0f8f70056129f0769323d86\", _writer.computeName().Name);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Another pack creation: basing on both interesting and uninteresting\n\t\t///\tobjects. No delta reuse possible here, as this is a specific case when we\n\t\t///\twrite only 1 commit, associated with 1 tree, 1 blob.\n\t\t///\t</summary>\n\t\t///\t <exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack4()\n\t\t{\n\t\t\tWriteVerifyPack4(false);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Test thin pack writing: 1 blob delta base is on objects edge. Pack\n\t\t///\tconfiguration as in <seealso cref=\"testWritePack4()\"/>.\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testWritePack4ThinPack()\n\t\t{\n\t\t\tWriteVerifyPack4(true);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/BasePatchTest.cs",
    "content": "﻿using System.IO;\nusing System.Text;\nusing GitSharp.Core.Patch;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n\tpublic class BasePatchTest\n\t{\n\t\tprotected const string DiffsDir = \"Resources/Diff/\";\n\t\tprotected const string PatchsDir = \"Resources/Patch/\";\n\n\t\tprotected static GitSharp.Core.Patch.Patch ParseTestPatchFile(string patchFile)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var inStream = new FileStream(patchFile, System.IO.FileMode.Open))\n\t\t\t\t{\n\t\t\t\t\tvar p = new GitSharp.Core.Patch.Patch();\n\t\t\t\t\tp.parse(inStream);\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(IOException)\n\t\t\t{\n\t\t\t\tAssert.Fail(\"No \" + patchFile + \" test vector\");\n\t\t\t\treturn null; // Never happens\n\t\t\t}\n\t\t}\n\n\t\tprotected static string GetAllErrorsFromPatch(GitSharp.Core.Patch.Patch patch)\n\t\t{\n\t\t\tif (patch == null || patch.getErrors().Count == 0)\n\t\t\t{\n\t\t\t\treturn string.Empty;\n\t\t\t}\n\n\t\t\tvar sb = new StringBuilder();\n\n\t\t\tforeach (FormatError formatError in patch.getErrors())\n\t\t\t{\n\t\t\t\tsb.AppendLine(formatError.getMessage());\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/EditListTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Diff;\nusing GitSharp.Core.Patch;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n    [TestFixture]\n    public class EditListTest : BasePatchTest\n    {\n        [Test]\n\t    public void testHunkHeader()\n        {\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_BothISO88591.patch\");\n\t\t    FileHeader fh = p.getFiles()[0];\n\n\t\t    EditList list0 = fh.Hunks[0].ToEditList();\n\t\t    Assert.AreEqual(1, list0.size());\n\t\t    Assert.AreEqual(new Edit(4 - 1, 5 - 1, 4 - 1, 5 - 1), list0.get(0));\n\n\t\t    EditList list1 = fh.Hunks[1].ToEditList();\n\t\t    Assert.AreEqual(1, list1.size());\n\t\t    Assert.AreEqual(new Edit(16 - 1, 17 - 1, 16 - 1, 17 - 1), list1.get(0));\n\t    }\n\n        [Test]\n\t    public void testFileHeader()\n        {\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_BothISO88591.patch\");\n\t\t    FileHeader fh = p.getFiles()[0];\n\t\t    EditList e = fh.ToEditList();\n\t\t    Assert.AreEqual(2, e.size());\n\t\t    Assert.AreEqual(new Edit(4 - 1, 5 - 1, 4 - 1, 5 - 1), e.get(0));\n\t\t    Assert.AreEqual(new Edit(16 - 1, 17 - 1, 16 - 1, 17 - 1), e.get(1));\n\t    }\n\n        [Test]\n\t    public void testTypes()\n        {\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testEditList_Types.patch\");\n\t\t    FileHeader fh = p.getFiles()[0];\n\t\t    EditList e = fh.ToEditList();\n            Assert.AreEqual(3, e.size());\n            Assert.AreEqual(new Edit(3 - 1, 3 - 1, 3 - 1, 4 - 1), e.get(0));\n            Assert.AreEqual(new Edit(17 - 1, 19 - 1, 18 - 1, 18 - 1), e.get(1));\n            Assert.AreEqual(new Edit(23 - 1, 25 - 1, 22 - 1, 28 - 1), e.get(2));\n\t    }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/FileHeaderTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Patch;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n    [TestFixture]\n    public class FileHeaderTest : BasePatchTest\n    {\n        [Test]\n\t    public void testParseGitFileName_Empty()\n        {\n\t\t    FileHeader fh = Data(string.Empty);\n\t\t\tAssert.AreEqual(-1, fh.parseGitFileName(0, fh.Buffer.Length));\n\t\t    Assert.IsNotNull(fh.Hunks);\n\t\t    Assert.IsTrue(fh.Hunks.Count == 0);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_NoLF()\n        {\n\t\t    FileHeader fh = Data(\"a/ b/\");\n\t\t\tAssert.AreEqual(-1, fh.parseGitFileName(0, fh.Buffer.Length));\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_NoSecondLine()\n        {\n\t\t    FileHeader fh = Data(\"\\n\");\n\t\t\tAssert.AreEqual(-1, fh.parseGitFileName(0, fh.Buffer.Length));\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_EmptyHeader()\n        {\n\t\t    FileHeader fh = Data(\"\\n\\n\");\n\t\t\tAssert.AreEqual(1, fh.parseGitFileName(0, fh.Buffer.Length));\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_Foo()\n        {\n\t\t    const string name = \"foo\";\n\t\t    FileHeader fh = Header(name);\n\t\t\tAssert.AreEqual(GitLine(name).Length, fh.parseGitFileName(0, fh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_FailFooBar()\n        {\n\t\t    FileHeader fh = Data(\"a/foo b/bar\\n-\");\n\t\t\tAssert.IsTrue(fh.parseGitFileName(0, fh.Buffer.Length) > 0);\n\t\t    Assert.IsNull(fh.OldName);\n\t\t    Assert.IsNull(fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_FooSpBar()\n        {\n\t\t    const string name = \"foo bar\";\n\t\t    FileHeader fh = Header(name);\n\t\t    Assert.AreEqual(GitLine(name).Length, fh.parseGitFileName(0,\n\t\t\t\t\tfh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_DqFooTabBar()\n        {\n\t\t    const string name = \"foo\\tbar\";\n\t\t    const string dqName = \"foo\\\\tbar\";\n\t\t    FileHeader fh = DqHeader(dqName);\n\t\t    Assert.AreEqual(DqGitLine(dqName).Length, fh.parseGitFileName(0,\n\t\t\t\t\tfh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_DqFooSpLfNulBar()\n        {\n\t\t    const string name = \"foo \\n\\0bar\";\n\t\t    const string dqName = \"foo \\\\n\\\\0bar\";\n\t\t    FileHeader fh = DqHeader(dqName);\n\t\t    Assert.AreEqual(DqGitLine(dqName).Length, fh.parseGitFileName(0,\n\t\t\t\t\tfh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_SrcFooC()\n        {\n\t\t    const string name = \"src/foo/bar/argh/code.c\";\n\t\t    FileHeader fh = Header(name);\n\t\t    Assert.AreEqual(GitLine(name).Length, fh.parseGitFileName(0,\n\t\t\t\t\tfh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseGitFileName_SrcFooCNonStandardPrefix()\n        {\n\t\t    const string name = \"src/foo/bar/argh/code.c\";\n\t\t    const string header = \"project-v-1.0/\" + name + \" mydev/\" + name + \"\\n\";\n\t\t    FileHeader fh = Data(header + \"-\");\n\t\t\tAssert.AreEqual(header.Length, fh.parseGitFileName(0, fh.Buffer.Length));\n\t\t    Assert.AreEqual(name, fh.OldName);\n\t\t    Assert.AreSame(fh.OldName, fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\t    }\n\n        [Test]\n\t    public void testParseUnicodeName_NewFile()\n        {\n\t\t    FileHeader fh = Data(\"diff --git \\\"a/\\\\303\\\\205ngstr\\\\303\\\\266m\\\" \\\"b/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\"\n\t\t\t\t    + \"new file mode 100644\\n\"\n\t\t\t\t    + \"index 0000000..7898192\\n\"\n\t\t\t\t    + \"--- /dev/null\\n\"\n\t\t\t\t    + \"+++ \\\"b/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\"\n\t\t\t\t    + \"@@ -0,0 +1 @@\\n\" + \"+a\\n\");\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"/dev/null\", fh.OldName);\n\t\t    Assert.AreSame(FileHeader.DEV_NULL, fh.OldName);\n\t\t    Assert.AreEqual(\"\\u00c5ngstr\\u00f6m\", fh.NewName);\n\n            Assert.AreEqual(FileHeader.ChangeTypeEnum.ADD, fh.getChangeType());\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.AreSame(FileMode.Missing, fh.GetOldMode());\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.NewMode);\n\n\t\t    Assert.AreEqual(\"0000000\", fh.getOldId().name());\n\t\t    Assert.AreEqual(\"7898192\", fh.getNewId().name());\n\t\t    Assert.AreEqual(0, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseUnicodeName_DeleteFile()\n        {\n\t\t    FileHeader fh = Data(\"diff --git \\\"a/\\\\303\\\\205ngstr\\\\303\\\\266m\\\" \\\"b/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\"\n\t\t\t\t    + \"deleted file mode 100644\\n\"\n\t\t\t\t    + \"index 7898192..0000000\\n\"\n\t\t\t\t    + \"--- \\\"a/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\"\n\t\t\t\t    + \"+++ /dev/null\\n\"\n\t\t\t\t    + \"@@ -1 +0,0 @@\\n\" + \"-a\\n\");\n\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"\\u00c5ngstr\\u00f6m\", fh.OldName);\n\t\t    Assert.AreEqual(\"/dev/null\", fh.NewName);\n\t\t    Assert.AreSame(FileHeader.DEV_NULL, fh.NewName);\n\n            Assert.AreEqual(FileHeader.ChangeTypeEnum.DELETE, fh.getChangeType());\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.GetOldMode());\n\t\t    Assert.AreSame(FileMode.Missing, fh.NewMode);\n\n\t\t    Assert.AreEqual(\"7898192\", fh.getOldId().name());\n\t\t    Assert.AreEqual(\"0000000\", fh.getNewId().name());\n\t\t    Assert.AreEqual(0, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseModeChange()\n        {\n\t\t    FileHeader fh = Data(\"diff --git a/a b b/a b\\n\"\n\t\t\t\t    + \"old mode 100644\\n\" + \"new mode 100755\\n\");\n\n\t\t    AssertParse(fh);\n\t\t    Assert.AreEqual(\"a b\", fh.OldName);\n\t\t    Assert.AreEqual(\"a b\", fh.NewName);\n\n\t\t    Assert.AreEqual(FileHeader.ChangeTypeEnum.MODIFY, fh.getChangeType());\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNull(fh.getOldId());\n\t\t    Assert.IsNull(fh.getNewId());\n\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.GetOldMode());\n\t\t    Assert.AreSame(FileMode.ExecutableFile, fh.NewMode);\n\t\t    Assert.AreEqual(0, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseRename100_NewStyle()\n        {\n\t\t    FileHeader fh = Data(\"diff --git a/a b/ c/\\\\303\\\\205ngstr\\\\303\\\\266m\\n\"\n\t\t\t\t    + \"similarity index 100%\\n\"\n\t\t\t\t    + \"rename from a\\n\"\n\t\t\t\t    + \"rename to \\\" c/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\");\n\n\t\t\tint ptr = fh.parseGitFileName(0, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\t\t    Assert.IsNull(fh.OldName); // can't parse names on a rename\n\t\t    Assert.IsNull(fh.NewName);\n\n\t\t\tptr = fh.parseGitHeaders(ptr, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\" c/\\u00c5ngstr\\u00f6m\", fh.NewName);\n\n\t\t    Assert.AreEqual(FileHeader.ChangeTypeEnum.RENAME, fh.getChangeType());\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNull(fh.getOldId());\n\t\t    Assert.IsNull(fh.getNewId());\n\n\t\t    Assert.IsNull(fh.GetOldMode());\n\t\t    Assert.IsNull(fh.NewMode);\n\n\t\t    Assert.AreEqual(100, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseRename100_OldStyle()\n        {\n\t\t    FileHeader fh = Data(\"diff --git a/a b/ c/\\\\303\\\\205ngstr\\\\303\\\\266m\\n\"\n\t\t\t\t    + \"similarity index 100%\\n\"\n\t\t\t\t    + \"rename old a\\n\"\n\t\t\t\t    + \"rename new \\\" c/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\");\n\n\t\t\tint ptr = fh.parseGitFileName(0, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\t\t    Assert.IsNull(fh.OldName); // can't parse names on a rename\n\t\t    Assert.IsNull(fh.NewName);\n\n\t\t\tptr = fh.parseGitHeaders(ptr, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\" c/\\u00c5ngstr\\u00f6m\", fh.NewName);\n\n            Assert.AreEqual(FileHeader.ChangeTypeEnum.RENAME, fh.getChangeType());\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNull(fh.getOldId());\n\t\t    Assert.IsNull(fh.getNewId());\n\n\t\t    Assert.IsNull(fh.GetOldMode());\n\t\t    Assert.IsNull(fh.NewMode);\n\n\t\t    Assert.AreEqual(100, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseCopy100()\n        {\n\t\t    FileHeader fh = Data(\"diff --git a/a b/ c/\\\\303\\\\205ngstr\\\\303\\\\266m\\n\"\n\t\t\t\t    + \"similarity index 100%\\n\"\n\t\t\t\t    + \"copy from a\\n\"\n\t\t\t\t    + \"copy to \\\" c/\\\\303\\\\205ngstr\\\\303\\\\266m\\\"\\n\");\n\n\t\t\tint ptr = fh.parseGitFileName(0, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\t\t    Assert.IsNull(fh.OldName); // can't parse names on a copy\n\t\t    Assert.IsNull(fh.NewName);\n\n\t\t\tptr = fh.parseGitHeaders(ptr, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\" c/\\u00c5ngstr\\u00f6m\", fh.NewName);\n\n\t\t    Assert.AreEqual(FileHeader.ChangeTypeEnum.COPY, fh.getChangeType());\n\t\t    Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t    Assert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNull(fh.getOldId());\n\t\t    Assert.IsNull(fh.getNewId());\n\n\t\t    Assert.IsNull(fh.GetOldMode());\n\t\t    Assert.IsNull(fh.NewMode);\n\n\t\t    Assert.AreEqual(100, fh.getScore());\n\t    }\n\n        [Test]\n\t    public void testParseFullIndexLine_WithMode()\n        {\n\t\t    const string oid = \"78981922613b2afb6025042ff6bd878ac1994e85\";\n\t\t    const string nid = \"61780798228d17af2d34fce4cfbdf35556832472\";\n\t\t    FileHeader fh = Data(\"diff --git a/a b/a\\n\" + \"index \" + oid\n\t\t\t\t    + \"..\" + nid + \" 100644\\n\" + \"--- a/a\\n\" + \"+++ b/a\\n\");\n\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\"a\", fh.NewName);\n\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.GetOldMode());\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.NewMode);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNotNull(fh.getOldId());\n\t\t    Assert.IsNotNull(fh.getNewId());\n\n\t\t    Assert.IsTrue(fh.getOldId().isComplete());\n\t\t    Assert.IsTrue(fh.getNewId().isComplete());\n\n\t\t    Assert.AreEqual(ObjectId.FromString(oid), fh.getOldId().ToObjectId());\n\t\t    Assert.AreEqual(ObjectId.FromString(nid), fh.getNewId().ToObjectId());\n\t    }\n\n        [Test]\n\t    public void testParseFullIndexLine_NoMode()\n        {\n\t\t    const string oid = \"78981922613b2afb6025042ff6bd878ac1994e85\";\n\t\t    const string nid = \"61780798228d17af2d34fce4cfbdf35556832472\";\n\t\t    FileHeader fh = Data(\"diff --git a/a b/a\\n\" + \"index \" + oid\n\t\t\t\t    + \"..\" + nid + \"\\n\" + \"--- a/a\\n\" + \"+++ b/a\\n\");\n\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\"a\", fh.NewName);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNull(fh.GetOldMode());\n\t\t    Assert.IsNull(fh.NewMode);\n\n\t\t    Assert.IsNotNull(fh.getOldId());\n\t\t    Assert.IsNotNull(fh.getNewId());\n\n\t\t    Assert.IsTrue(fh.getOldId().isComplete());\n\t\t    Assert.IsTrue(fh.getNewId().isComplete());\n\n\t\t    Assert.AreEqual(ObjectId.FromString(oid), fh.getOldId().ToObjectId());\n\t\t    Assert.AreEqual(ObjectId.FromString(nid), fh.getNewId().ToObjectId());\n\t    }\n\n        [Test]\n\t    public void testParseAbbrIndexLine_WithMode()\n        {\n\t\t    const int a = 7;\n\t\t    const string oid = \"78981922613b2afb6025042ff6bd878ac1994e85\";\n\t\t    const string nid = \"61780798228d17af2d34fce4cfbdf35556832472\";\n\t\t    FileHeader fh = Data(\"diff --git a/a b/a\\n\" + \"index \"\n\t\t\t\t    + oid.Substring(0, a - 1) + \"..\" + nid.Substring(0, a - 1)\n\t\t\t\t    + \" 100644\\n\" + \"--- a/a\\n\" + \"+++ b/a\\n\");\n\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\"a\", fh.NewName);\n\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.GetOldMode());\n\t\t    Assert.AreSame(FileMode.RegularFile, fh.NewMode);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNotNull(fh.getOldId());\n\t\t    Assert.IsNotNull(fh.getNewId());\n\n\t\t    Assert.IsFalse(fh.getOldId().isComplete());\n\t\t    Assert.IsFalse(fh.getNewId().isComplete());\n\n\t\t    Assert.AreEqual(oid.Substring(0, a - 1), fh.getOldId().name());\n\t\t    Assert.AreEqual(nid.Substring(0, a - 1), fh.getNewId().name());\n\n\t\t    Assert.IsTrue(ObjectId.FromString(oid).startsWith(fh.getOldId()));\n\t\t    Assert.IsTrue(ObjectId.FromString(nid).startsWith(fh.getNewId()));\n\t    }\n\n        [Test]\n\t    public void testParseAbbrIndexLine_NoMode()\n        {\n\t\t    const int a = 7;\n\t\t    const string oid = \"78981922613b2afb6025042ff6bd878ac1994e85\";\n\t\t    const string nid = \"61780798228d17af2d34fce4cfbdf35556832472\";\n\t\t    FileHeader fh = Data(\"diff --git a/a b/a\\n\" + \"index \"\n\t\t\t\t    + oid.Substring(0, a - 1) + \"..\" + nid.Substring(0, a - 1)\n\t\t\t\t    + \"\\n\" + \"--- a/a\\n\" + \"+++ b/a\\n\");\n\n\t\t    AssertParse(fh);\n\n\t\t    Assert.AreEqual(\"a\", fh.OldName);\n\t\t    Assert.AreEqual(\"a\", fh.NewName);\n\n\t\t    Assert.IsNull(fh.GetOldMode());\n\t\t    Assert.IsNull(fh.NewMode);\n\t\t    Assert.IsFalse(fh.hasMetaDataChanges());\n\n\t\t    Assert.IsNotNull(fh.getOldId());\n\t\t    Assert.IsNotNull(fh.getNewId());\n\n\t\t    Assert.IsFalse(fh.getOldId().isComplete());\n\t\t    Assert.IsFalse(fh.getNewId().isComplete());\n\n\t\t    Assert.AreEqual(oid.Substring(0, a - 1), fh.getOldId().name());\n\t\t    Assert.AreEqual(nid.Substring(0, a - 1), fh.getNewId().name());\n\n\t\t    Assert.IsTrue(ObjectId.FromString(oid).startsWith(fh.getOldId()));\n\t\t    Assert.IsTrue(ObjectId.FromString(nid).startsWith(fh.getNewId()));\n\t    }\n\n\t    private static void AssertParse(FileHeader fh)\n        {\n\t\t\tint ptr = fh.parseGitFileName(0, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\t\t\tptr = fh.parseGitHeaders(ptr, fh.Buffer.Length);\n\t\t    Assert.IsTrue(ptr > 0);\n\t    }\n\n\t    private static FileHeader Data(string inStr)\n        {\n\t\t    return new FileHeader(Constants.encodeASCII(inStr), 0);\n\t    }\n\n\t    private static FileHeader Header(string path)\n        {\n\t\t    return Data(GitLine(path) + \"--- \" + path + \"\\n\");\n\t    }\n\n\t    private static string GitLine(string path)\n        {\n\t\t    return \"a/\" + path + \" b/\" + path + \"\\n\";\n\t    }\n\n\t    private static FileHeader DqHeader(string path)\n        {\n\t\t    return Data(DqGitLine(path) + \"--- \" + path + \"\\n\");\n\t    }\n\n\t    private static string DqGitLine(string path)\n        {\n\t\t    return \"\\\"a/\" + path + \"\\\" \\\"b/\" + path + \"\\\"\\n\";\n\t    }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/GetTextTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Patch;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing NUnit.Framework;\nusing System.IO;\nusing System.Text;\nusing System.Diagnostics;\nusing FileMode=System.IO.FileMode;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n    [TestFixture]\n    public class GetTextTest : BasePatchTest\n    {\n        [Test]\n        public void testGetText_BothISO88591()\n        {\n            Encoding cs = Charset.forName(\"ISO-8859-1\");\n            Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_BothISO88591.patch\");\n            Assert.IsTrue(p.getErrors().Count == 0);\n            Assert.AreEqual(1, p.getFiles().Count);\n            FileHeader fh = p.getFiles()[0];\n            Assert.AreEqual(2, fh.Hunks.Count);\n            Assert.AreEqual(ReadTestPatchFile(cs), fh.getScriptText(cs, cs));\n        }\n\n        [Test]\n        public void testGetText_NoBinary()\n        {\n            Encoding cs = Charset.forName(\"ISO-8859-1\");\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_NoBinary.patch\");\n            Assert.IsTrue(p.getErrors().Count == 0);\n            Assert.AreEqual(1, p.getFiles().Count);\n            FileHeader fh = p.getFiles()[0];\n            Assert.AreEqual(0, fh.Hunks.Count);\n            Assert.AreEqual(ReadTestPatchFile(cs), fh.getScriptText(cs, cs));\n        }\n\n        [Test]\n        public void testGetText_Convert()\n        {\n            Encoding csOld = Charset.forName(\"ISO-8859-1\");\n            Encoding csNew = Charset.forName(\"UTF-8\");\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_Convert.patch\");\n            Assert.IsTrue(p.getErrors().Count == 0);\n            Assert.AreEqual(1, p.getFiles().Count);\n            FileHeader fh = p.getFiles()[0];\n            Assert.AreEqual(2, fh.Hunks.Count);\n\n            // Read the original File as ISO-8859-1 and fix up the one place\n            // where we changed the character encoding. That makes the exp\n            // string match what we really expect to get back.\n            //\n            string exp = ReadTestPatchFile(csOld);\n            exp = exp.Replace(\"\\u00C3\\u0085ngstr\\u00C3\\u00B6m\", \"\\u00c5ngstr\\u00f6m\");  // henon: octal character representation is not legal in c# literals: \"\\303\\205ngstr\\303\\266m\"\n\n            Assert.AreEqual(exp, fh.getScriptText(csOld, csNew));\n        }\n\n        [Test]\n        public void testGetText_DiffCc()\n        {\n            Assert.Ignore(\"We are going to deal with encoding problems later. For now, they are only disturbing the build.\");\n\n            Encoding csOld = Charset.forName(\"ISO-8859-1\");\n            Encoding csNew = Charset.forName(\"UTF-8\");\n            GitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testGetText_DiffCc.patch\");\n            Assert.IsTrue(p.getErrors().Count == 0);\n            Assert.AreEqual(1, p.getFiles().Count);\n            var fh = (CombinedFileHeader)p.getFiles()[0];\n            Assert.AreEqual(1, fh.Hunks.Count);\n\n            // Read the original File as ISO-8859-1 and fix up the one place\n            // where we changed the character encoding. That makes the exp\n            // string match what we really expect to get back.\n            //\n            string exp = ReadTestPatchFile(csOld);\n            exp = exp.Replace(\"\\u00C3\\u0085ngstr\\u00C3\\u00B6m\", \"\\u00c5ngstr\\u00f6m\");\n            Assert.AreEqual(exp, fh.getScriptText(new[] { csNew, csOld, csNew }));\n        }\n\n        private static string ReadTestPatchFile(Encoding cs)\n        {\n            string patchFile = (new StackFrame(1, true)).GetMethod().Name + \".patch\";\n\n            using (Stream inStream = new FileStream(PatchsDir + patchFile, System.IO.FileMode.Open))\n            using (var r = new StreamReader(inStream, cs))\n            {\n                var tmp = new char[2048];\n                var s = new StringBuilder();\n                int n;\n                while ((n = r.Read(tmp, 0, 2048)) > 0)\n                {\n                    s.Append(tmp, 0, n);\n                }\n                return s.ToString();\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/PatchCcErrorTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Patch;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n    [TestFixture]\n    public class PatchCcErrorTest : BasePatchTest\n    {\n        [Test]\n\t    public void testError_CcTruncatedOld()\n        {\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_CcTruncatedOld.patch\");\n\t\t    Assert.AreEqual(1, p.getFiles().Count);\n\t\t    Assert.AreEqual(3, p.getErrors().Count);\n\t\t    {\n\t\t\t    FormatError e = p.getErrors()[0];\n\t\t\t    Assert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\t    Assert.AreEqual(\n\t\t\t\t\t    \"Truncated hunk, at least 1 lines is missing for ancestor 1\",\n\t\t\t\t\t    e.getMessage());\n\t\t\t    Assert.AreEqual(346, e.getOffset());\n\t\t\t    Assert.IsTrue(e.getLineText().StartsWith(\n\t\t\t\t\t    \"@@@ -55,12 -163,13 +163,15 @@@ public \"));\n\t\t    }\n\t\t    {\n\t\t\t    FormatError e = p.getErrors()[1];\n\t\t\t    Assert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\t    Assert.AreEqual(\n\t\t\t\t\t    \"Truncated hunk, at least 2 lines is missing for ancestor 2\",\n\t\t\t\t\t    e.getMessage());\n\t\t\t    Assert.AreEqual(346, e.getOffset());\n\t\t\t    Assert.IsTrue(e.getLineText().StartsWith(\n\t\t\t\t\t    \"@@@ -55,12 -163,13 +163,15 @@@ public \"));\n\t\t    }\n\t\t    {\n\t\t\t    FormatError e = p.getErrors()[2];\n                Assert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\t    Assert.AreEqual(\"Truncated hunk, at least 3 new lines is missing\", e\n\t\t\t\t\t    .getMessage());\n\t\t\t    Assert.AreEqual(346, e.getOffset());\n\t\t\t    Assert.IsTrue(e.getLineText().StartsWith(\n\t\t\t\t\t    \"@@@ -55,12 -163,13 +163,15 @@@ public \"));\n\t\t    }\n\t    }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/PatchCcTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Patch;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n\t[TestFixture]\n\tpublic class PatchCcTest : BasePatchTest\n\t{\n\t\t[Test]\n\t\tpublic void testParse_OneFileCc()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_OneFileCc.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().isEmpty());\n\n\t\t\tvar cfh = (CombinedFileHeader)p.getFiles()[0];\n\n\t\t\tAssert.AreEqual(\"org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\", cfh.NewName);\n\t\t\tAssert.AreEqual(cfh.NewName, cfh.OldName);\n\n\t\t\tAssert.AreEqual(98, cfh.StartOffset);\n\n\t\t\tAssert.AreEqual(2, cfh.ParentCount);\n\t\t\tAssert.AreSame(cfh.getOldId(0), cfh.getOldId());\n\t\t\tAssert.AreEqual(\"169356b\", cfh.getOldId(0).name());\n\t\t\tAssert.AreEqual(\"dd8c317\", cfh.getOldId(1).name());\n\t\t\tAssert.AreEqual(\"fd85931\", cfh.getNewId().name());\n\n\t\t\tAssert.AreEqual(cfh.getOldMode(0), cfh.GetOldMode());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, cfh.getOldMode(0));\n\t\t\tAssert.AreEqual(FileMode.RegularFile, cfh.getOldMode(1));\n\t\t\tAssert.AreEqual(FileMode.ExecutableFile, cfh.NewMode);\n\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.MODIFY, cfh.getChangeType());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, cfh.getPatchType());\n\n\t\t\tAssert.AreEqual(1, cfh.Hunks.Count);\n\t\t\t{\n\t\t\t\tvar h = (CombinedHunkHeader)cfh.Hunks[0];\n\n\t\t\t\tAssert.AreSame(cfh, h.File);\n\t\t\t\tAssert.AreEqual(346, h.StartOffset);\n\t\t\t\tAssert.AreEqual(764, h.EndOffset);\n\n\t\t\t\tAssert.AreSame(h.GetOldImage(0), h.OldImage);\n\t\t\t\tAssert.AreSame(cfh.getOldId(0), h.GetOldImage(0).Id);\n\t\t\t\tAssert.AreSame(cfh.getOldId(1), h.GetOldImage(1).Id);\n\n\t\t\t\tAssert.AreEqual(55, h.GetOldImage(0).StartLine);\n\t\t\t\tAssert.AreEqual(12, h.GetOldImage(0).LineCount);\n\t\t\t\tAssert.AreEqual(3, h.GetOldImage(0).LinesAdded);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(0).LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(163, h.GetOldImage(1).StartLine);\n\t\t\t\tAssert.AreEqual(13, h.GetOldImage(1).LineCount);\n\t\t\t\tAssert.AreEqual(2, h.GetOldImage(1).LinesAdded);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(1).LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(163, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(15, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(10, h.LinesContext);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_CcNewFile()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_CcNewFile.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().isEmpty());\n\n\t\t\tvar cfh = (CombinedFileHeader)p.getFiles()[0];\n\n\t\t\tAssert.AreSame(FileHeader.DEV_NULL, cfh.OldName);\n\t\t\tAssert.AreEqual(\"d\", cfh.NewName);\n\n\t\t\tAssert.AreEqual(187, cfh.StartOffset);\n\n\t\t\tAssert.AreEqual(2, cfh.ParentCount);\n\t\t\tAssert.AreSame(cfh.getOldId(0), cfh.getOldId());\n\t\t\tAssert.AreEqual(\"0000000\", cfh.getOldId(0).name());\n\t\t\tAssert.AreEqual(\"0000000\", cfh.getOldId(1).name());\n\t\t\tAssert.AreEqual(\"4bcfe98\", cfh.getNewId().name());\n\n\t\t\tAssert.AreSame(cfh.getOldMode(0), cfh.GetOldMode());\n\t\t\tAssert.AreSame(FileMode.Missing, cfh.getOldMode(0));\n\t\t\tAssert.AreSame(FileMode.Missing, cfh.getOldMode(1));\n\t\t\tAssert.AreSame(FileMode.RegularFile, cfh.NewMode);\n\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.ADD, cfh.getChangeType());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, cfh.getPatchType());\n\n\t\t\tAssert.AreEqual(1, cfh.Hunks.Count);\n\t\t\t{\n\t\t\t\tvar h = (CombinedHunkHeader)cfh.Hunks[0];\n\n\t\t\t\tAssert.AreSame(cfh, h.File);\n\t\t\t\tAssert.AreEqual(273, h.StartOffset);\n\t\t\t\tAssert.AreEqual(300, h.EndOffset);\n\n\t\t\t\tAssert.AreSame(h.GetOldImage(0), h.OldImage);\n\t\t\t\tAssert.AreSame(cfh.getOldId(0), h.GetOldImage(0).Id);\n\t\t\t\tAssert.AreSame(cfh.getOldId(1), h.GetOldImage(1).Id);\n\n\t\t\t\tAssert.AreEqual(1, h.GetOldImage(0).StartLine);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(0).LineCount);\n\t\t\t\tAssert.AreEqual(1, h.GetOldImage(0).LinesAdded);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(0).LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(1, h.GetOldImage(1).StartLine);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(1).LineCount);\n\t\t\t\tAssert.AreEqual(1, h.GetOldImage(1).LinesAdded);\n\t\t\t\tAssert.AreEqual(0, h.GetOldImage(1).LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(1, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(1, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(0, h.LinesContext);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_CcDeleteFile()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_CcDeleteFile.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().isEmpty());\n\n\t\t\tvar cfh = (CombinedFileHeader)p.getFiles()[0];\n\n\t\t\tAssert.AreEqual(\"a\", cfh.OldName);\n\t\t\tAssert.AreSame(FileHeader.DEV_NULL, cfh.NewName);\n\n\t\t\tAssert.AreEqual(187, cfh.StartOffset);\n\n\t\t\tAssert.AreEqual(2, cfh.ParentCount);\n\t\t\tAssert.AreSame(cfh.getOldId(0), cfh.getOldId());\n\t\t\tAssert.AreEqual(\"7898192\", cfh.getOldId(0).name());\n\t\t\tAssert.AreEqual(\"2e65efe\", cfh.getOldId(1).name());\n\t\t\tAssert.AreEqual(\"0000000\", cfh.getNewId().name());\n\n\t\t\tAssert.AreSame(cfh.getOldMode(0), cfh.GetOldMode());\n\t\t\tAssert.AreSame(FileMode.RegularFile, cfh.getOldMode(0));\n\t\t\tAssert.AreSame(FileMode.RegularFile, cfh.getOldMode(1));\n\t\t\tAssert.AreSame(FileMode.Missing, cfh.NewMode);\n\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.DELETE, cfh.getChangeType());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, cfh.getPatchType());\n\n\t\t\tAssert.IsTrue(cfh.Hunks.isEmpty());\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/PatchErrorTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Patch;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n\t[TestFixture]\n\tpublic class PatchErrorTest : BasePatchTest\n\t{\n\t\t[Test]\n\t\tpublic void testError_DisconnectedHunk()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_DisconnectedHunk.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\n\t\t\tFileHeader fh = p.getFiles()[0];\n\t\t\tAssert.AreEqual(\"org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\", fh.NewName);\n\t\t\tAssert.AreEqual(1, fh.Hunks.Count);\n\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\t\t\tFormatError e = p.getErrors()[0];\n\t\t\tAssert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Hunk disconnected from file\", e.getMessage());\n\t\t\tAssert.AreEqual(18, e.getOffset());\n\t\t\tAssert.IsTrue(e.getLineText().StartsWith(\"@@ -109,4 +109,11 @@ assert\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testError_TruncatedOld()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_TruncatedOld.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\n\t\t\tFormatError e = p.getErrors()[0];\n\t\t\tAssert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Truncated hunk, at least 1 old lines is missing\", e.getMessage());\n\t\t\tAssert.AreEqual(313, e.getOffset());\n\t\t\tAssert.IsTrue(e.getLineText().StartsWith(\"@@ -236,9 +236,9 @@ protected \"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testError_TruncatedNew()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_TruncatedNew.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\n\t\t\tFormatError e = p.getErrors()[0];\n\t\t\tAssert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Truncated hunk, at least 1 new lines is missing\", e.getMessage());\n\t\t\tAssert.AreEqual(313, e.getOffset());\n\t\t\tAssert.IsTrue(e.getLineText().StartsWith(\"@@ -236,9 +236,9 @@ protected \"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testError_BodyTooLong()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_BodyTooLong.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\n\t\t\tFormatError e = p.getErrors()[0];\n\t\t\tAssert.AreEqual(FormatError.Severity.WARNING, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Hunk header 4:11 does not match body line count of 4:12\", e.getMessage());\n\t\t\tAssert.AreEqual(349, e.getOffset());\n\t\t\tAssert.IsTrue(e.getLineText().StartsWith(\"@@ -109,4 +109,11 @@ assert\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testError_GarbageBetweenFiles()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_GarbageBetweenFiles.patch\");\n\t\t\tAssert.AreEqual(2, p.getFiles().Count);\n\n\t\t\tFileHeader fh0 = p.getFiles()[0];\n\t\t\tAssert.AreEqual(\"org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\", fh0.NewName);\n\t\t\tAssert.AreEqual(1, fh0.Hunks.Count);\n\n\t\t\tFileHeader fh1 = p.getFiles()[1];\n\t\t\tAssert.AreEqual(\"org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\", fh1.NewName);\n\t\t\tAssert.AreEqual(1, fh1.Hunks.Count);\n\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\t\t\tFormatError e = p.getErrors()[0];\n\t\t\tAssert.AreEqual(FormatError.Severity.WARNING, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Unexpected hunk trailer\", e.getMessage());\n\t\t\tAssert.AreEqual(926, e.getOffset());\n\t\t\tAssert.AreEqual(\"I AM NOT HERE\\n\", e.getLineText());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testError_GitBinaryNoForwardHunk()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testError_GitBinaryNoForwardHunk.patch\");\n\t\t\tAssert.AreEqual(2, p.getFiles().Count);\n\n\t\t\tFileHeader fh0 = p.getFiles()[0];\n\t\t\tAssert.AreEqual(\"org.spearce.egit.ui/icons/toolbar/fetchd.png\", fh0.NewName);\n            Assert.AreEqual(FileHeader.PatchTypeEnum.GIT_BINARY, fh0.getPatchType());\n\t\t\tAssert.IsTrue(fh0.Hunks.isEmpty());\n\t\t\tAssert.IsNull(fh0.getForwardBinaryHunk());\n\n\t\t\tFileHeader fh1 = p.getFiles()[1];\n\t\t\tAssert.AreEqual(\"org.spearce.egit.ui/icons/toolbar/fetche.png\", fh1.NewName);\n            Assert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh1.getPatchType());\n\t\t\tAssert.IsTrue(fh1.Hunks.isEmpty());\n\t\t\tAssert.IsNull(fh1.getForwardBinaryHunk());\n\n\t\t\tAssert.AreEqual(1, p.getErrors().Count);\n\t\t\tFormatError e = p.getErrors()[0];\n            Assert.AreEqual(FormatError.Severity.ERROR, e.getSeverity());\n\t\t\tAssert.AreEqual(\"Missing forward-image in GIT binary patch\", e.getMessage());\n\t\t\tAssert.AreEqual(297, e.getOffset());\n\t\t\tAssert.AreEqual(\"\\n\", e.getLineText());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Patch/PatchTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Patch;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Patch\n{\n\t[TestFixture]\n\tpublic class PatchTest : BasePatchTest\n\t{\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n\t\t\tvar patch = new GitSharp.Core.Patch.Patch();\n\t\t\tAssert.IsTrue(patch.getFiles().Count == 0);\n\t\t\tAssert.IsTrue(patch.getErrors().Count == 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_ConfigCaseInsensitive()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_ConfigCaseInsensitive.patch\");\n\t\t\tAssert.AreEqual(2, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0);\n\n\t\t\tFileHeader fRepositoryConfigTest = p.getFiles()[0];\n\t\t\tFileHeader fRepositoryConfig = p.getFiles()[1];\n\n\t\t\tAssert.AreEqual(\n\t\t\t\t\t\"org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\",\n\t\t\t\t\tfRepositoryConfigTest.NewName);\n\n\t\t\tAssert.AreEqual(\n\t\t\t\t\t\"org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\",\n\t\t\t\t\tfRepositoryConfig.NewName);\n\n\t\t\tAssert.AreEqual(572, fRepositoryConfigTest.StartOffset);\n\t\t\tAssert.AreEqual(1490, fRepositoryConfig.StartOffset);\n\n\t\t\tAssert.AreEqual(\"da7e704\", fRepositoryConfigTest.getOldId().name());\n\t\t\tAssert.AreEqual(\"34ce04a\", fRepositoryConfigTest.getNewId().name());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fRepositoryConfigTest.getPatchType());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, fRepositoryConfigTest.GetOldMode());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, fRepositoryConfigTest.NewMode);\n\t\t\tAssert.AreEqual(1, fRepositoryConfigTest.Hunks.Count);\n\t\t\t{\n\t\t\t\tHunkHeader h = fRepositoryConfigTest.Hunks[0];\n\t\t\t\tAssert.AreEqual(fRepositoryConfigTest, h.File);\n\t\t\t\tAssert.AreEqual(921, h.StartOffset);\n\t\t\t\tAssert.AreEqual(109, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(4, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(109, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(11, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(4, h.LinesContext);\n\t\t\t\tAssert.AreEqual(7, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(0, h.OldImage.LinesDeleted);\n\t\t\t\tAssert.AreEqual(fRepositoryConfigTest.getOldId(), h.OldImage.Id);\n\n\t\t\t\tAssert.AreEqual(1490, h.EndOffset);\n\t\t\t}\n\n\t\t\tAssert.AreEqual(\"45c2f8a\", fRepositoryConfig.getOldId().name());\n\t\t\tAssert.AreEqual(\"3291bba\", fRepositoryConfig.getNewId().name());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fRepositoryConfig\n\t\t\t\t\t.getPatchType());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, fRepositoryConfig.GetOldMode());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, fRepositoryConfig.NewMode);\n\t\t\tAssert.AreEqual(3, fRepositoryConfig.Hunks.Count);\n\t\t\t{\n\t\t\t\tHunkHeader h = fRepositoryConfig.Hunks[0];\n\t\t\t\tAssert.AreEqual(fRepositoryConfig, h.File);\n\t\t\t\tAssert.AreEqual(1803, h.StartOffset);\n\t\t\t\tAssert.AreEqual(236, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(9, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(236, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(9, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(7, h.LinesContext);\n\t\t\t\tAssert.AreEqual(2, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(2, h.OldImage.LinesDeleted);\n\t\t\t\tAssert.AreEqual(fRepositoryConfig.getOldId(), h.OldImage.Id);\n\n\t\t\t\tAssert.AreEqual(2434, h.EndOffset);\n\t\t\t}\n\t\t\t{\n\t\t\t\tHunkHeader h = fRepositoryConfig.Hunks[1];\n\t\t\t\tAssert.AreEqual(2434, h.StartOffset);\n\t\t\t\tAssert.AreEqual(300, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(7, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(300, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(7, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(6, h.LinesContext);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(2816, h.EndOffset);\n\t\t\t}\n\t\t\t{\n\t\t\t\tHunkHeader h = fRepositoryConfig.Hunks[2];\n\t\t\t\tAssert.AreEqual(2816, h.StartOffset);\n\t\t\t\tAssert.AreEqual(954, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(7, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(954, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(7, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(6, h.LinesContext);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesDeleted);\n\n\t\t\t\tAssert.AreEqual(3035, h.EndOffset);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_NoBinary()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_NoBinary.patch\");\n\t\t\tAssert.AreEqual(5, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0);\n\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tFileHeader fh = p.getFiles()[i];\n\t\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.ADD, fh.getChangeType());\n\t\t\t\tAssert.IsNotNull(fh.getOldId());\n\t\t\t\tAssert.IsNotNull(fh.getNewId());\n\t\t\t\tAssert.AreEqual(\"0000000\", fh.getOldId().name());\n\t\t\t\tAssert.AreEqual(FileMode.Missing, fh.GetOldMode());\n\t\t\t\tAssert.AreEqual(FileMode.RegularFile, fh.NewMode);\n\t\t\t\tAssert.IsTrue(fh.NewName.StartsWith(\n\t\t\t\t\t\t\"org.spearce.egit.ui/icons/toolbar/\"));\n\t\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.BINARY, fh.getPatchType());\n\t\t\t\tAssert.IsTrue(fh.Hunks.Count == 0);\n\t\t\t\tAssert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t\t\tAssert.IsNull(fh.getForwardBinaryHunk());\n\t\t\t\tAssert.IsNull(fh.getReverseBinaryHunk());\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tFileHeader fh = p.getFiles()[4];\n\t\t\t\tAssert.AreEqual(\"org.spearce.egit.ui/plugin.xml\", fh.NewName);\n\t\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.MODIFY, fh.getChangeType());\n\t\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t\t\tAssert.IsFalse(fh.hasMetaDataChanges());\n\t\t\t\tAssert.AreEqual(\"ee8a5a0\", fh.getNewId().name());\n\t\t\t\tAssert.IsNull(fh.getForwardBinaryHunk());\n\t\t\t\tAssert.IsNull(fh.getReverseBinaryHunk());\n\t\t\t\tAssert.AreEqual(1, fh.Hunks.Count);\n\t\t\t\tAssert.AreEqual(272, fh.Hunks[0].OldImage.StartLine);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_GitBinaryLiteral()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_GitBinaryLiteral.patch\");\n\t\t\tint[] binsizes = { 359, 393, 372, 404 };\n\t\t\tAssert.AreEqual(5, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0);\n\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tFileHeader fh = p.getFiles()[i];\n\t\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.ADD, fh.getChangeType());\n\t\t\t\tAssert.IsNotNull(fh.getOldId());\n\t\t\t\tAssert.IsNotNull(fh.getNewId());\n\t\t\t\tAssert.AreEqual(ObjectId.ZeroId.Name, fh.getOldId().name());\n\t\t\t\tAssert.AreEqual(FileMode.RegularFile, fh.NewMode);\n\t\t\t\tAssert.IsTrue(fh.NewName.StartsWith(\n\t\t\t\t\t\t\"org.spearce.egit.ui/icons/toolbar/\"));\n\t\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.GIT_BINARY, fh.getPatchType());\n\t\t\t\tAssert.IsTrue(fh.Hunks.Count == 0);\n\t\t\t\tAssert.IsTrue(fh.hasMetaDataChanges());\n\n\t\t\t\tBinaryHunk fwd = fh.getForwardBinaryHunk();\n\t\t\t\tBinaryHunk rev = fh.getReverseBinaryHunk();\n\t\t\t\tAssert.IsNotNull(fwd);\n\t\t\t\tAssert.IsNotNull(rev);\n\t\t\t\tAssert.AreEqual(binsizes[i], fwd.getSize());\n\t\t\t\tAssert.AreEqual(0, rev.getSize());\n\n\t\t\t\tAssert.AreEqual(fh, fwd.getFileHeader());\n\t\t\t\tAssert.AreEqual(fh, rev.getFileHeader());\n\n\t\t\t\tAssert.AreEqual(BinaryHunk.Type.LITERAL_DEFLATED, fwd.getType());\n\t\t\t\tAssert.AreEqual(BinaryHunk.Type.LITERAL_DEFLATED, rev.getType());\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tFileHeader fh = p.getFiles()[4];\n\t\t\t\tAssert.AreEqual(\"org.spearce.egit.ui/plugin.xml\", fh.NewName);\n\t\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.MODIFY, fh.getChangeType());\n\t\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, fh.getPatchType());\n\t\t\t\tAssert.IsFalse(fh.hasMetaDataChanges());\n\t\t\t\tAssert.AreEqual(\"ee8a5a0\", fh.getNewId().name());\n\t\t\t\tAssert.IsNull(fh.getForwardBinaryHunk());\n\t\t\t\tAssert.IsNull(fh.getReverseBinaryHunk());\n\t\t\t\tAssert.AreEqual(1, fh.Hunks.Count);\n\t\t\t\tAssert.AreEqual(272, fh.Hunks[0].OldImage.StartLine);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_GitBinaryDelta()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_GitBinaryDelta.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0);\n\n\t\t\tFileHeader fh = p.getFiles()[0];\n\t\t\tAssert.IsTrue(fh.NewName.StartsWith(\"zero.bin\"));\n\t\t\tAssert.AreEqual(FileHeader.ChangeTypeEnum.MODIFY, fh.getChangeType());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.GIT_BINARY, fh.getPatchType());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, fh.NewMode);\n\n\t\t\tAssert.IsNotNull(fh.getOldId());\n\t\t\tAssert.IsNotNull(fh.getNewId());\n\t\t\tAssert.AreEqual(\"08e7df176454f3ee5eeda13efa0adaa54828dfd8\", fh.getOldId()\n\t\t\t\t\t.name());\n\t\t\tAssert.AreEqual(\"d70d8710b6d32ff844af0ee7c247e4b4b051867f\", fh.getNewId()\n\t\t\t\t\t.name());\n\n\t\t\tAssert.IsTrue(fh.Hunks.Count == 0);\n\t\t\tAssert.IsFalse(fh.hasMetaDataChanges());\n\n\t\t\tBinaryHunk fwd = fh.getForwardBinaryHunk();\n\t\t\tBinaryHunk rev = fh.getReverseBinaryHunk();\n\t\t\tAssert.IsNotNull(fwd);\n\t\t\tAssert.IsNotNull(rev);\n\t\t\tAssert.AreEqual(12, fwd.getSize());\n\t\t\tAssert.AreEqual(11, rev.getSize());\n\n\t\t\tAssert.AreEqual(fh, fwd.getFileHeader());\n\t\t\tAssert.AreEqual(fh, rev.getFileHeader());\n\n\t\t\tAssert.AreEqual(BinaryHunk.Type.DELTA_DEFLATED, fwd.getType());\n\t\t\tAssert.AreEqual(BinaryHunk.Type.DELTA_DEFLATED, rev.getType());\n\n\t\t\tAssert.AreEqual(496, fh.EndOffset);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_FixNoNewline()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_FixNoNewline.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0);\n\n\t\t\tFileHeader f = p.getFiles()[0];\n\n\t\t\tAssert.AreEqual(\"a\", f.NewName);\n\t\t\tAssert.AreEqual(252, f.StartOffset);\n\n\t\t\tAssert.AreEqual(\"2e65efe\", f.getOldId().name());\n\t\t\tAssert.AreEqual(\"f2ad6c7\", f.getNewId().name());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, f.getPatchType());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, f.GetOldMode());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, f.NewMode);\n\t\t\tAssert.AreEqual(1, f.Hunks.Count);\n\t\t\t{\n\t\t\t\tHunkHeader h = f.Hunks[0];\n\t\t\t\tAssert.AreEqual(f, h.File);\n\t\t\t\tAssert.AreEqual(317, h.StartOffset);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(1, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(1, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(0, h.LinesContext);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesDeleted);\n\t\t\t\tAssert.AreEqual(f.getOldId(), h.OldImage.Id);\n\n\t\t\t\tAssert.AreEqual(363, h.EndOffset);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testParse_AddNoNewline()\n\t\t{\n\t\t\tGitSharp.Core.Patch.Patch p = ParseTestPatchFile(PatchsDir + \"testParse_AddNoNewline.patch\");\n\t\t\tAssert.AreEqual(1, p.getFiles().Count);\n\t\t\tAssert.IsTrue(p.getErrors().Count == 0, GetAllErrorsFromPatch(p));\n\n\t\t\tFileHeader f = p.getFiles()[0];\n\n\t\t\tAssert.AreEqual(\"a\", f.NewName);\n\t\t\tAssert.AreEqual(256, f.StartOffset);\n\n\t\t\tAssert.AreEqual(\"f2ad6c7\", f.getOldId().name());\n\t\t\tAssert.AreEqual(\"c59d9b6\", f.getNewId().name());\n\t\t\tAssert.AreEqual(FileHeader.PatchTypeEnum.UNIFIED, f.getPatchType());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, f.GetOldMode());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, f.NewMode);\n\t\t\tAssert.AreEqual(1, f.Hunks.Count);\n\t\t\t{\n\t\t\t\tHunkHeader h = f.Hunks[0];\n\t\t\t\tAssert.AreEqual(f, h.File);\n\t\t\t\tAssert.AreEqual(321, h.StartOffset);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.StartLine);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LineCount);\n\t\t\t\tAssert.AreEqual(1, h.NewStartLine);\n\t\t\t\tAssert.AreEqual(1, h.NewLineCount);\n\n\t\t\t\tAssert.AreEqual(0, h.LinesContext);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesAdded);\n\t\t\t\tAssert.AreEqual(1, h.OldImage.LinesDeleted);\n\t\t\t\tAssert.AreEqual(f.getOldId(), h.OldImage.Id);\n\n\t\t\t\tAssert.AreEqual(367, h.EndOffset);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ReadTreeTest.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class ReadTreeTest : RepositoryTestCase\n    {\n        /*\n             * Directory/File Conflict cases:\n             * It's entirely possible that in practice a number of these may be equivalent\n             * to the cases described in git-Read-tree.txt. As long as it does the right thing,\n             * that's all I care about. These are basically reverse-engineered from\n             * what git currently does. If there are tests for these in git, it's kind of\n             * hard to track them all down...\n             * \n             *     H        I       M     Clean     H==M     H==I    I==M         Result\n             *     ------------------------------------------------------------------\n             *1    D        D       F       Y         N       Y       N           Update\n             *2    D        D       F       N         N       Y       N           Conflict\n             *3    D        F       D                 Y       N       N           Update\n             *4    D        F       D                 N       N       N           Update\n             *5    D        F       F       Y         N       N       Y           Keep\n             *6    D        F       F       N         N       N       Y           Keep\n             *7    F        D       F       Y         Y       N       N           Update\n             *8    F        D       F       N         Y       N       N           Conflict\n             *9    F        D       F       Y         N       N       N           Update\n             *10   F        D       D                 N       N       Y           Keep\n             *11   F\t\tD\t\tD\t\t\t\t  N\t\t  N\t\t  N\t\t\t  Conflict\n             *12   F\t\tF\t\tD\t\tY\t\t  N\t\t  Y\t\t  N\t\t\t  Update\n             *13   F\t\tF\t\tD\t\tN\t\t  N\t\t  Y\t\t  N\t\t\t  Conflict\n             *14   F\t\tF\t\tD\t\t\t\t  N\t\t  N\t\t  N\t\t\t  Conflict\n             *15   0\t\tF\t\tD\t\t\t\t  N\t\t  N\t\t  N\t\t\t  Conflict\n             *16   0\t\tD\t\tF\t\tY\t\t  N\t\t  N\t\t  N\t\t\t  Update\n             *17   0\t\tD\t\tF\t\t \t\t  N\t\t  N\t\t  N\t\t\t  Conflict\n             *18   F        0       D    \t\t\t\t\t\t\t\t\t\t  Update\n             *19   D\t    0       F\t\t\t\t\t\t\t\t\t\t\t  Update\n        */\n\n        // Fields\n        private Core.Tree _theHead;\n        private GitIndex _theIndex;\n        private Core.Tree _theMerge;\n        private WorkDirCheckout _theReadTree;\n\n        // Methods\n        private void assertAllEmpty()\n        {\n            Assert.IsTrue(_theReadTree.Removed.isEmpty());\n            Assert.IsTrue(_theReadTree.Updated.isEmpty());\n            Assert.IsTrue(_theReadTree.Conflicts.isEmpty());\n        }\n\n        private void AssertConflict(string s)\n        {\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(s));\n        }\n\n        private void AssertNoConflicts()\n        {\n            Assert.IsTrue(_theReadTree.Conflicts.isEmpty());\n        }\n\n        private void AssertRemoved(string s)\n        {\n            Assert.IsTrue(_theReadTree.Removed.Contains(s));\n        }\n\n        private void AssertUpdated(string s)\n        {\n            Assert.IsTrue(_theReadTree.Updated.ContainsKey(s));\n        }\n\n        private GitIndex BuildIndex(Dictionary<string, string> indexEntries)\n        {\n            var index = new GitIndex(db);\n            if (indexEntries != null)\n            {\n                foreach (var pair in indexEntries)\n                {\n                    index.add(trash, writeTrashFile(pair.Key, pair.Value)).forceRecheck();\n                }\n            }\n            return index;\n        }\n\n        private Core.Tree BuildTree(Dictionary<string, string> headEntries)\n        {\n            var tree = new Core.Tree(db);\n            if (headEntries != null)\n            {\n                foreach (var pair in headEntries)\n                {\n                    tree.AddFile(pair.Key).Id = GenSha1(pair.Value);\n                }\n            }\n            return tree;\n        }\n\n        private void Checkout()\n        {\n            _theReadTree = new WorkDirCheckout(db, trash, _theHead, _theIndex, _theMerge);\n            _theReadTree.checkout();\n        }\n\n        private void cleanUpDF()\n        {\n            tearDown();\n            setUp();\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"DF\")));\n        }\n\n        private void DoIt(Dictionary<string, string> h, Dictionary<string, string> m, Dictionary<string, string> i)\n        {\n            SetupCase(h, m, i);\n            Go();\n        }\n\n        private ObjectId GenSha1(string data)\n        {\n            var input = new MemoryStream(data.getBytes());\n            var writer = new ObjectWriter(db);\n            try\n            {\n                return writer.WriteObject(ObjectType.Blob, data.getBytes().Length, input, true);\n            }\n            catch (IOException exception)\n            {\n                Assert.Fail(exception.ToString());\n            }\n            return null;\n        }\n\n        private WorkDirCheckout Go()\n        {\n            _theReadTree = new WorkDirCheckout(db, trash, _theHead, _theIndex, _theMerge);\n            _theReadTree.PrescanTwoTrees();\n            return _theReadTree;\n        }\n\n        private static Dictionary<string, string> MakeMap(string a)\n        {\n            return MakeMap(new[] { a, a });\n        }\n\n        private static Dictionary<string, string> MakeMap(params string[] args)\n        {\n            if ((args.Length % 2) > 0)\n            {\n                throw new ArgumentException(\"needs to be pairs\");\n            }\n            var dictionary = new Dictionary<string, string>();\n            for (int i = 0; i < args.Length; i += 2)\n            {\n                dictionary.Add(args[i], args[i + 1]);\n            }\n            return dictionary;\n        }\n\n        private void SetupCase(Dictionary<string, string> headEntries, Dictionary<string, string> mergeEntries,\n                               Dictionary<string, string> indexEntries)\n        {\n            _theHead = BuildTree(headEntries);\n            _theMerge = BuildTree(mergeEntries);\n            _theIndex = BuildIndex(indexEntries);\n        }\n\n        [Test]\n        public void testCheckoutOutChanges()\n        {\n            SetupCase(MakeMap(\"foo\"), MakeMap(\"foo/bar\"), MakeMap(\"foo\"));\n            Checkout();\n            Assert.IsFalse(new FileInfo(Path.Combine(trash.FullName, \"foo\")).IsFile());\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"foo/bar\")).IsFile());\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n\n            SetupCase(MakeMap(\"foo/bar\"), MakeMap(\"foo\"), MakeMap(\"foo/bar\"));\n            Checkout();\n            Assert.IsFalse(new FileInfo(Path.Combine(trash.FullName, \"foo/bar\")).IsFile());\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"foo\")).IsFile());\n            SetupCase(MakeMap(\"foo\"), MakeMap(new[] { \"foo\", \"qux\" }), MakeMap(new[] { \"foo\", \"bar\" }));\n            try\n            {\n                Checkout();\n                Assert.Fail(\"did not throw exception\");\n            }\n            catch (CheckoutConflictException)\n            {\n            }\n        }\n\n        [Test]\n        public void testCloseNameConflicts1()\n        {\n            SetupCase(MakeMap(new[] { \"a/a\", \"a/a-c\" }), MakeMap(new[] { \"a/a\", \"a/a\", \"a.a/a.a\", \"a.a/a.a\" }),\n                      MakeMap(new[] { \"a/a\", \"a/a-c\" }));\n            Checkout();\n            Go();\n            AssertNoConflicts();\n        }\n\n        [Test]\n        public void testCloseNameConflictsX0()\n        {\n            SetupCase(MakeMap(new[] { \"a/a\", \"a/a-c\" }),\n                      MakeMap(new[] { \"a/a\", \"a/a\", \"b.b/b.b\", \"b.b/b.bs\" }),\n                      MakeMap(new[] { \"a/a\", \"a/a-c\" }));\n            Checkout();\n            Go();\n            AssertNoConflicts();\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_1()\n        {\n            DoIt(MakeMap(\"DF/DF\"), MakeMap(\"DF\"), MakeMap(\"DF/DF\"));\n            AssertNoConflicts();\n            AssertUpdated(\"DF\");\n            AssertRemoved(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_10()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(\"DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF/DF\"));\n            AssertNoConflicts();\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_11()\n        {\n            DoIt(MakeMap(\"DF\"), MakeMap(\"DF/DF\"), MakeMap(new[] { \"DF/DF\", \"asdf\" }));\n            AssertConflict(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_12()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(\"DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF\"));\n            AssertRemoved(\"DF\");\n            AssertUpdated(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_13()\n        {\n            cleanUpDF();\n            SetupCase(MakeMap(\"DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF\"));\n            writeTrashFile(\"DF\", \"asdfsdf\");\n            Go();\n            AssertConflict(\"DF\");\n            AssertUpdated(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_14()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(\"DF\"), MakeMap(\"DF/DF\"), MakeMap(new[] { \"DF\", \"Foo\" }));\n            AssertConflict(\"DF\");\n            AssertUpdated(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_15()\n        {\n            DoIt(MakeMap(new string[0]), MakeMap(\"DF/DF\"), MakeMap(\"DF\"));\n            AssertRemoved(\"DF\");\n            AssertUpdated(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_15b()\n        {\n            DoIt(MakeMap(new string[0]), MakeMap(\"DF/DF/DF/DF\"), MakeMap(\"DF\"));\n            AssertRemoved(\"DF\");\n            AssertUpdated(\"DF/DF/DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_16()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(new string[0]), MakeMap(\"DF\"), MakeMap(\"DF/DF/DF\"));\n            AssertRemoved(\"DF/DF/DF\");\n            AssertUpdated(\"DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_17()\n        {\n            cleanUpDF();\n            SetupCase(MakeMap(new string[0]), MakeMap(\"DF\"), MakeMap(\"DF/DF/DF\"));\n            writeTrashFile(\"DF/DF/DF\", \"asdf\");\n            Go();\n            AssertConflict(\"DF/DF/DF\");\n            AssertUpdated(\"DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_18()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(\"DF/DF\"), MakeMap(\"DF/DF/DF/DF\"), null);\n            AssertRemoved(\"DF/DF\");\n            AssertUpdated(\"DF/DF/DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_19()\n        {\n            cleanUpDF();\n            DoIt(MakeMap(\"DF/DF/DF/DF\"), MakeMap(\"DF/DF/DF\"), null);\n            AssertRemoved(\"DF/DF/DF/DF\");\n            AssertUpdated(\"DF/DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_2()\n        {\n            SetupCase(MakeMap(\"DF/DF\"), MakeMap(\"DF\"), MakeMap(\"DF/DF\"));\n            writeTrashFile(\"DF/DF\", \"different\");\n            Go();\n            AssertConflict(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_3()\n        {\n            DoIt(MakeMap(\"DF/DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF\"));\n            AssertUpdated(\"DF/DF\");\n            AssertRemoved(\"DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_4()\n        {\n            DoIt(MakeMap(\"DF/DF\"), MakeMap(new[] { \"DF/DF\", \"foo\" }), MakeMap(\"DF\"));\n            AssertUpdated(\"DF/DF\");\n            AssertRemoved(\"DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_5()\n        {\n            DoIt(MakeMap(\"DF/DF\"), MakeMap(\"DF\"), MakeMap(\"DF\"));\n            AssertRemoved(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_6()\n        {\n            SetupCase(MakeMap(\"DF/DF\"), MakeMap(\"DF\"), MakeMap(\"DF\"));\n            writeTrashFile(\"DF\", \"different\");\n            Go();\n            AssertRemoved(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_7()\n        {\n            DoIt(MakeMap(\"DF\"), MakeMap(\"DF\"), MakeMap(\"DF/DF\"));\n            AssertUpdated(\"DF\");\n            AssertRemoved(\"DF/DF\");\n            cleanUpDF();\n\n            SetupCase(MakeMap(\"DF/DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF/DF/DF/DF/DF\"));\n            Go();\n            AssertRemoved(\"DF/DF/DF/DF/DF\");\n            AssertUpdated(\"DF/DF\");\n            cleanUpDF();\n\n            SetupCase(MakeMap(\"DF/DF\"), MakeMap(\"DF/DF\"), MakeMap(\"DF/DF/DF/DF/DF\"));\n            writeTrashFile(\"DF/DF/DF/DF/DF\", \"diff\");\n            Go();\n            AssertConflict(\"DF/DF/DF/DF/DF\");\n            AssertUpdated(\"DF/DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileConflicts_9()\n        {\n            DoIt(MakeMap(\"DF\"), MakeMap(new[] { \"DF\", \"QP\" }), MakeMap(\"DF/DF\"));\n            AssertRemoved(\"DF/DF\");\n            AssertUpdated(\"DF\");\n        }\n\n        [Test]\n        public void testDirectoryFileSimple()\n        {\n            _theIndex = new GitIndex(db);\n            _theIndex.add(trash, writeTrashFile(\"DF\", \"DF\"));\n            Core.Tree head = db.MapTree(_theIndex.writeTree());\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"DF\")));\n\n            _theIndex = new GitIndex(db);\n            _theIndex.add(trash, writeTrashFile(\"DF/DF\", \"DF/DF\"));\n            Core.Tree merge = db.MapTree(_theIndex.writeTree());\n            _theIndex = new GitIndex(db);\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"DF\")));\n\n            _theIndex.add(trash, writeTrashFile(\"DF\", \"DF\"));\n            _theReadTree = new WorkDirCheckout(db, trash, head, _theIndex, merge);\n            _theReadTree.PrescanTwoTrees();\n            Assert.IsTrue(_theReadTree.Removed.Contains(\"DF\"));\n            Assert.IsTrue(_theReadTree.Updated.ContainsKey(\"DF/DF\"));\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"DF\")));\n\n            _theIndex = new GitIndex(db);\n            _theIndex.add(trash, writeTrashFile(\"DF/DF\", \"DF/DF\"));\n            _theReadTree = new WorkDirCheckout(db, trash, merge, _theIndex, head);\n            _theReadTree.PrescanTwoTrees();\n            Assert.IsTrue(_theReadTree.Removed.Contains(\"DF/DF\"));\n            Assert.IsTrue(_theReadTree.Updated.ContainsKey(\"DF\"));\n        }\n\n        [Test]\n        public void testRules1thru3_NoIndexEntry()\n        {\n            var index = new GitIndex(db);\n            var head = new Core.Tree(db);\n            FileTreeEntry entry = head.AddFile(\"foo\");\n            ObjectId expected = ObjectId.FromString(\"ba78e065e2c261d4f7b8f42107588051e87e18e9\");\n            entry.Id = expected;\n            var merge = new Core.Tree(db);\n            var checkout = new WorkDirCheckout(db, trash, head, index, merge);\n            checkout.PrescanTwoTrees();\n            Assert.IsTrue(checkout.Removed.Contains(\"foo\"));\n            checkout = new WorkDirCheckout(db, trash, merge, index, head);\n            checkout.PrescanTwoTrees();\n            Assert.AreEqual(expected, checkout.Updated[\"foo\"]);\n            ObjectId id2 = ObjectId.FromString(\"ba78e065e2c261d4f7b8f42107588051e87e18ee\");\n            merge.AddFile(\"foo\").Id = id2;\n            checkout = new WorkDirCheckout(db, trash, head, index, merge);\n            checkout.PrescanTwoTrees();\n            Assert.AreEqual(id2, checkout.Updated[\"foo\"]);\n        }\n\n        [Test]\n        public void testRules4thru13_IndexEntryNotInHead()\n        {\n            // rule 4 and 5\n            var indexEntries = new Dictionary<string, string> {{\"foo\", \"foo\"}};\n            SetupCase(null, null, indexEntries);\n            _theReadTree = Go();\n            assertAllEmpty();\n\n            // rule 6 and 7\n            indexEntries = new Dictionary<string, string> { { \"foo\", \"foo\" } };\n            SetupCase(null, indexEntries, indexEntries);\n            _theReadTree = Go();\n            assertAllEmpty();\n\n            // rule 8 and 9\n            var mergeEntries = new Dictionary<string, string> { { \"foo\", \"merge\" } };\n            SetupCase(null, mergeEntries, indexEntries);\n            Go();\n            Assert.IsTrue(_theReadTree.Updated.isEmpty());\n            Assert.IsTrue(_theReadTree.Removed.isEmpty());\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(\"foo\"));\n\n            // rule 10\n            var headEntries = new Dictionary<string, string> { { \"foo\", \"foo\" } };\n            SetupCase(headEntries, null, indexEntries);\n            Go();\n            Assert.IsTrue(_theReadTree.Removed.Contains(\"foo\"));\n            Assert.IsTrue(_theReadTree.Updated.isEmpty());\n            Assert.IsTrue(_theReadTree.Conflicts.isEmpty());\n\n            // rule 11\n            SetupCase(headEntries, null, indexEntries);\n            new FileInfo(Path.Combine(trash.FullName, \"foo\")).Delete();\n            writeTrashFile(\"foo\", \"bar\");\n            _theIndex.Members[0].forceRecheck();\n            Go();\n            Assert.IsTrue(_theReadTree.Removed.isEmpty());\n            Assert.IsTrue(_theReadTree.Updated.isEmpty());\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(\"foo\"));\n\n            // rule 12 and 13\n            headEntries[\"foo\"] = \"head\";\n            SetupCase(headEntries, null, indexEntries);\n            Go();\n            Assert.IsTrue(_theReadTree.Removed.isEmpty());\n            Assert.IsTrue(_theReadTree.Updated.isEmpty());\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(\"foo\"));\n\n            // rule 14 and 15\n            SetupCase(headEntries, headEntries, indexEntries);\n            Go();\n            assertAllEmpty();\n\n            // rule 16 and 17\n            SetupCase(headEntries, mergeEntries, indexEntries);\n            Go();\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(\"foo\"));\n\n            // rule 18 and 19\n            SetupCase(headEntries, indexEntries, indexEntries);\n            Go();\n            assertAllEmpty();\n\n            // rule 20\n            SetupCase(indexEntries, mergeEntries, indexEntries);\n            Go();\n            Assert.IsTrue(_theReadTree.Updated.ContainsKey(\"foo\"));\n\n            // rule 21\n            SetupCase(indexEntries, mergeEntries, indexEntries);\n            new FileInfo(Path.Combine(trash.FullName, \"foo\")).Delete();\n            writeTrashFile(\"foo\", \"bar\");\n            _theIndex.Members[0].forceRecheck();\n            Go();\n            Assert.IsTrue(_theReadTree.Conflicts.Contains(\"foo\"));\n        }\n\n        [Test]\n        public void testUntrackedConflicts()\n        {\n            SetupCase(null, MakeMap(\"foo\"), null);\n            writeTrashFile(\"foo\", \"foo\");\n            Go();\n            AssertConflict(\"foo\");\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n            SetupCase(null, MakeMap(\"foo\"), null);\n            writeTrashFile(\"foo/bar/baz\", \"\");\n            writeTrashFile(\"foo/blahblah\", \"\");\n            Go();\n            AssertConflict(\"foo/bar/baz\");\n            AssertConflict(\"foo/blahblah\");\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n            SetupCase(MakeMap(new[] { \"foo/bar\", \"\", \"foo/baz\", \"\" }), MakeMap(\"foo\"),\n                      MakeMap(new[] { \"foo/bar\", \"\", \"foo/baz\", \"\" }));\n            Assert.IsTrue(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")).Exists);\n            Go();\n            AssertNoConflicts();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RefDirectoryTest.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class RefDirectoryTest : LocalDiskRepositoryTestCase\n    {\n        private global::GitSharp.Core.Repository diskRepo;\n\n        private TestRepository repo;\n\n        private RefDirectory refdir;\n\n        private RevCommit A;\n\n        private RevCommit B;\n\n        private RevTag v1_0;\n\n        [SetUp]\n        public override void setUp()\n        {\n            base.setUp();\n\n            diskRepo = createBareRepository();\n            refdir = (RefDirectory)diskRepo.RefDatabase;\n\n            repo = new TestRepository(diskRepo);\n            A = repo.commit().create();\n            B = repo.commit(repo.getRevWalk().parseCommit(A));\n            v1_0 = repo.tag(\"v1_0\", B);\n            repo.getRevWalk().parseBody(v1_0);\n        }\n\n        [Test]\n        public void testCreate()\n        {\n            // setUp above created the directory. We just have to test it.\n            DirectoryInfo d = diskRepo.Directory;\n            Assert.AreSame(diskRepo, refdir.getRepository());\n\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"refs\").IsDirectory());\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"logs\").IsDirectory());\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"logs/refs\").IsDirectory());\n            Assert.IsFalse(PathUtil.CombineFilePath(d, \"packed-refs\").Exists);\n\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"refs/heads\").IsDirectory());\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"refs/tags\").IsDirectory());\n            Assert.AreEqual(2, PathUtil.CombineDirectoryPath(d, \"refs\").GetFileSystemInfos().Length);\n            Assert.AreEqual(0, PathUtil.CombineDirectoryPath(d, \"refs/heads\").GetFileSystemInfos().Length);\n            Assert.AreEqual(0, PathUtil.CombineDirectoryPath(d, \"refs/tags\").GetFileSystemInfos().Length);\n\n            Assert.IsTrue(PathUtil.CombineDirectoryPath(d, \"logs/refs/heads\").IsDirectory());\n            Assert.IsFalse(PathUtil.CombineFilePath(d, \"logs/HEAD\").Exists);\n            Assert.AreEqual(0, PathUtil.CombineDirectoryPath(d, \"logs/refs/heads\").GetFileSystemInfos().Length);\n\n            Assert.AreEqual(\"ref: refs/heads/master\\n\", read(PathUtil.CombineFilePath(d, Constants.HEAD)));\n        }\n\n        [Test]\n        public void testGetRefs_EmptyDatabase()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.IsTrue(all.isEmpty(), \"no references\");\n\n            all = refdir.getRefs(Constants.R_HEADS);\n            Assert.IsTrue(all.isEmpty(), \"no references\");\n\n            all = refdir.getRefs(Constants.R_TAGS);\n            Assert.IsTrue(all.isEmpty(), \"no references\");\n        }\n\n        [Test]\n        public void testGetRefs_HeadOnOneBranch()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref head, master;\n\n            writeLooseRef(\"refs/heads/master\", A);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(2, all.size());\n            Assert.IsTrue(all.ContainsKey(Constants.HEAD), \"has HEAD\");\n            Assert.IsTrue(all.ContainsKey(\"refs/heads/master\"), \"has master\");\n\n            head = all.get(Constants.HEAD);\n            master = all.get(\"refs/heads/master\");\n\n            Assert.AreEqual(Constants.HEAD, head.Name);\n            Assert.IsTrue(head.isSymbolic());\n            Assert.AreSame(Storage.Loose, head.StorageFormat);\n            Assert.AreSame(master, head.getTarget(), \"uses same ref as target\");\n\n            Assert.AreEqual(\"refs/heads/master\", master.Name);\n            Assert.IsFalse(master.isSymbolic());\n            Assert.AreSame(Storage.Loose, master.StorageFormat);\n            Assert.AreEqual(A, master.ObjectId);\n        }\n\n        [Test]\n        public void testGetRefs_DeatchedHead1()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref head;\n\n            writeLooseRef(Constants.HEAD, A);\n            BUG_WorkAroundRacyGitIssues(Constants.HEAD);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(1, all.size());\n            Assert.IsTrue(all.ContainsKey(Constants.HEAD), \"has HEAD\");\n\n            head = all.get(Constants.HEAD);\n\n            Assert.AreEqual(Constants.HEAD, head.Name);\n            Assert.IsFalse(head.isSymbolic());\n            Assert.AreSame(global::GitSharp.Core.Storage.Loose, head.StorageFormat);\n            Assert.AreEqual(A, head.ObjectId);\n        }\n\n        [Test]\n        public void testGetRefs_DeatchedHead2()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref head, master;\n\n            writeLooseRef(Constants.HEAD, A);\n            writeLooseRef(\"refs/heads/master\", B);\n            BUG_WorkAroundRacyGitIssues(Constants.HEAD);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(2, all.size());\n\n            head = all.get(Constants.HEAD);\n            master = all.get(\"refs/heads/master\");\n\n            Assert.AreEqual(Constants.HEAD, head.getName());\n            Assert.IsFalse(head.isSymbolic());\n            Assert.AreSame(Storage.Loose, head.getStorage());\n            Assert.AreEqual(A, head.getObjectId());\n\n            Assert.AreEqual(\"refs/heads/master\", master.getName());\n            Assert.IsFalse(master.isSymbolic());\n            Assert.AreSame(Storage.Loose, master.getStorage());\n            Assert.AreEqual(B, master.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_DeeplyNestedBranch()\n        {\n            string name = \"refs/heads/a/b/c/d/e/f/g/h/i/j/k\";\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref r;\n\n            writeLooseRef(name, A);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(1, all.size());\n\n            r = all.get(name);\n            Assert.AreEqual(name, r.getName());\n            Assert.IsFalse(r.isSymbolic());\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreEqual(A, r.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_HeadBranchNotBorn()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref a, b;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            writeLooseRef(\"refs/heads/B\", B);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(2, all.size());\n            Assert.IsFalse(all.ContainsKey(Constants.HEAD), \"no HEAD\");\n\n            a = all.get(\"refs/heads/A\");\n            b = all.get(\"refs/heads/B\");\n\n            Assert.AreEqual(A, a.getObjectId());\n            Assert.AreEqual(B, b.getObjectId());\n\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(\"refs/heads/B\", b.getName());\n        }\n\n        [Test]\n        public void testGetRefs_LooseOverridesPacked()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a;\n\n            writeLooseRef(\"refs/heads/master\", B);\n            writePackedRef(\"refs/heads/master\", A);\n\n            heads = refdir.getRefs(Constants.R_HEADS);\n            Assert.AreEqual(1, heads.size());\n\n            a = heads.get(\"master\");\n            Assert.AreEqual(\"refs/heads/master\", a.getName());\n            Assert.AreEqual(B, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_IgnoresGarbageRef1()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            write(PathUtil.CombineFilePath(diskRepo.Directory, \"refs/heads/bad\"), \"FAIL\\n\");\n\n            heads = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(1, heads.size());\n\n            a = heads.get(\"refs/heads/A\");\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(A, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_IgnoresGarbageRef2()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            write(PathUtil.CombineFilePath(diskRepo.Directory, \"refs/heads/bad\"), \"\");\n\n            heads = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(1, heads.size());\n\n            a = heads.get(\"refs/heads/A\");\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(A, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_IgnoresGarbageRef3()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            write(PathUtil.CombineFilePath(diskRepo.Directory, \"refs/heads/bad\"), \"\\n\");\n\n            heads = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(1, heads.size());\n\n            a = heads.get(\"refs/heads/A\");\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(A, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_IgnoresGarbageRef4()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a, b, c;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            writeLooseRef(\"refs/heads/B\", B);\n            writeLooseRef(\"refs/heads/C\", A);\n            heads = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(3, heads.size());\n            Assert.IsTrue(heads.ContainsKey(\"refs/heads/A\"));\n            Assert.IsTrue(heads.ContainsKey(\"refs/heads/B\"));\n            Assert.IsTrue(heads.ContainsKey(\"refs/heads/C\"));\n\n            writeLooseRef(\"refs/heads/B\", \"FAIL\\n\");\n            BUG_WorkAroundRacyGitIssues(\"refs/heads/B\");\n\n            heads = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(2, heads.size());\n\n            a = heads.get(\"refs/heads/A\");\n            b = heads.get(\"refs/heads/B\");\n            c = heads.get(\"refs/heads/C\");\n\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(A, a.getObjectId());\n\n            Assert.IsNull(b, \"no refs/heads/B\");\n\n            Assert.AreEqual(\"refs/heads/C\", c.getName());\n            Assert.AreEqual(A, c.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_InvalidName()\n        {\n            writeLooseRef(\"refs/heads/A\", A);\n\n            Assert.IsTrue(refdir.getRefs(\"refs/heads\").isEmpty(), \"empty refs/heads\");\n            Assert.IsTrue(refdir.getRefs(\"objects\").isEmpty(), \"empty objects\");\n            Assert.IsTrue(refdir.getRefs(\"objects/\").isEmpty(), \"empty objects/\");\n        }\n\n        [Test]\n        public void testGetRefs_HeadsOnly_AllLoose()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a, b;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            writeLooseRef(\"refs/heads/B\", B);\n            writeLooseRef(\"refs/tags/v1.0\", v1_0);\n\n            heads = refdir.getRefs(Constants.R_HEADS);\n            Assert.AreEqual(2, heads.size());\n\n            a = heads.get(\"A\");\n            b = heads.get(\"B\");\n\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(\"refs/heads/B\", b.getName());\n\n            Assert.AreEqual(A, a.getObjectId());\n            Assert.AreEqual(B, b.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_HeadsOnly_AllPacked1()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a;\n\n            deleteLooseRef(Constants.HEAD);\n            writePackedRef(\"refs/heads/A\", A);\n\n            heads = refdir.getRefs(Constants.R_HEADS);\n            Assert.AreEqual(1, heads.size());\n\n            a = heads.get(\"A\");\n\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(A, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_HeadsOnly_SymrefToPacked()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref master, other;\n\n            writeLooseRef(\"refs/heads/other\", \"ref: refs/heads/master\\n\");\n            writePackedRef(\"refs/heads/master\", A);\n\n            heads = refdir.getRefs(Constants.R_HEADS);\n            Assert.AreEqual(2, heads.size());\n\n            master = heads.get(\"master\");\n            other = heads.get(\"other\");\n\n            Assert.AreEqual(\"refs/heads/master\", master.getName());\n            Assert.AreEqual(A, master.getObjectId());\n\n            Assert.AreEqual(\"refs/heads/other\", other.getName());\n            Assert.AreEqual(A, other.getObjectId());\n            Assert.AreSame(master, other.getTarget());\n        }\n\n        [Test]\n        public void testGetRefs_HeadsOnly_Mixed()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> heads;\n            global::GitSharp.Core.Ref a, b;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            writeLooseRef(\"refs/heads/B\", B);\n            writePackedRef(\"refs/tags/v1.0\", v1_0);\n\n            heads = refdir.getRefs(Constants.R_HEADS);\n            Assert.AreEqual(2, heads.size());\n\n            a = heads.get(\"A\");\n            b = heads.get(\"B\");\n\n            Assert.AreEqual(\"refs/heads/A\", a.getName());\n            Assert.AreEqual(\"refs/heads/B\", b.getName());\n\n            Assert.AreEqual(A, a.getObjectId());\n            Assert.AreEqual(B, b.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_TagsOnly_AllLoose()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> tags;\n            global::GitSharp.Core.Ref a;\n\n            writeLooseRef(\"refs/heads/A\", A);\n            writeLooseRef(\"refs/tags/v1.0\", v1_0);\n\n            tags = refdir.getRefs(Constants.R_TAGS);\n            Assert.AreEqual(1, tags.size());\n\n            a = tags.get(\"v1.0\");\n\n            Assert.AreEqual(\"refs/tags/v1.0\", a.getName());\n            Assert.AreEqual(v1_0, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_TagsOnly_AllPacked()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> tags;\n            global::GitSharp.Core.Ref a;\n\n            deleteLooseRef(Constants.HEAD);\n            writePackedRef(\"refs/tags/v1.0\", v1_0);\n\n            tags = refdir.getRefs(Constants.R_TAGS);\n            Assert.AreEqual(1, tags.size());\n\n            a = tags.get(\"v1.0\");\n\n            Assert.AreEqual(\"refs/tags/v1.0\", a.getName());\n            Assert.AreEqual(v1_0, a.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversNewLoose1()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n            global::GitSharp.Core.Ref orig_r, next_r;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            writeLooseRef(\"refs/heads/next\", B);\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(2, orig.size());\n            Assert.AreEqual(3, next.size());\n\n            Assert.IsFalse(orig.ContainsKey(\"refs/heads/next\"));\n            Assert.IsTrue(next.ContainsKey(\"refs/heads/next\"));\n\n            orig_r = orig.get(\"refs/heads/master\");\n            next_r = next.get(\"refs/heads/master\");\n            Assert.AreEqual(A, orig_r.getObjectId());\n            Assert.AreSame(orig_r, next_r, \"uses cached instance\");\n            Assert.AreSame(orig_r, orig.get(Constants.HEAD).getTarget(), \"same HEAD\");\n            Assert.AreSame(orig_r, next.get(Constants.HEAD).getTarget(), \"same HEAD\");\n\n            next_r = next.get(\"refs/heads/next\");\n            Assert.AreSame(Storage.Loose, next_r.getStorage());\n            Assert.AreEqual(B, next_r.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversNewLoose2()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next, news;\n\n            writeLooseRef(\"refs/heads/pu\", A);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            writeLooseRef(\"refs/heads/new/B\", B);\n            news = refdir.getRefs(\"refs/heads/new/\");\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(1, orig.size());\n            Assert.AreEqual(2, next.size());\n            Assert.AreEqual(1, news.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsTrue(next.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsFalse(news.ContainsKey(\"refs/heads/pu\"));\n\n            Assert.IsFalse(orig.ContainsKey(\"refs/heads/new/B\"));\n            Assert.IsTrue(next.ContainsKey(\"refs/heads/new/B\"));\n            Assert.IsTrue(news.ContainsKey(\"B\"));\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversModifiedLoose()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(A, all.get(Constants.HEAD).getObjectId());\n\n            writeLooseRef(\"refs/heads/master\", B);\n            BUG_WorkAroundRacyGitIssues(\"refs/heads/master\");\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(B, all.get(Constants.HEAD).getObjectId());\n        }\n\n        [Test]\n        public void testGetRef_DiscoversModifiedLoose()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(A, all.get(Constants.HEAD).getObjectId());\n\n            writeLooseRef(\"refs/heads/master\", B);\n            BUG_WorkAroundRacyGitIssues(\"refs/heads/master\");\n\n            global::GitSharp.Core.Ref master = refdir.getRef(\"refs/heads/master\");\n            Assert.AreEqual(B, master.getObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversDeletedLoose1()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n            global::GitSharp.Core.Ref orig_r, next_r;\n\n            writeLooseRef(\"refs/heads/B\", B);\n            writeLooseRef(\"refs/heads/master\", A);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            deleteLooseRef(\"refs/heads/B\");\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(3, orig.size());\n            Assert.AreEqual(2, next.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/B\"));\n            Assert.IsFalse(next.ContainsKey(\"refs/heads/B\"));\n\n            orig_r = orig.get(\"refs/heads/master\");\n            next_r = next.get(\"refs/heads/master\");\n            Assert.AreEqual(A, orig_r.getObjectId());\n            Assert.AreSame(orig_r, next_r, \"uses cached instance\");\n            Assert.AreSame(orig_r, orig.get(Constants.HEAD).getTarget(), \"same HEAD\");\n            Assert.AreSame(orig_r, next.get(Constants.HEAD).getTarget(), \"same HEAD\");\n\n            orig_r = orig.get(\"refs/heads/B\");\n            Assert.AreSame(Storage.Loose, orig_r.getStorage());\n            Assert.AreEqual(B, orig_r.getObjectId());\n        }\n\n        [Test]\n        public void testGetRef_DiscoversDeletedLoose()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            all = refdir.getRefs(RefDatabase.ALL);\n            Assert.AreEqual(A, all.get(Constants.HEAD).getObjectId());\n\n            deleteLooseRef(\"refs/heads/master\");\n            Assert.IsNull(refdir.getRef(\"refs/heads/master\"));\n            Assert.IsTrue(refdir.getRefs(RefDatabase.ALL).isEmpty());\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversDeletedLoose2()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            writeLooseRef(\"refs/heads/pu\", B);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            deleteLooseRef(\"refs/heads/pu\");\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(3, orig.size());\n            Assert.AreEqual(2, next.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsFalse(next.ContainsKey(\"refs/heads/pu\"));\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversDeletedLoose3()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            writeLooseRef(\"refs/heads/next\", B);\n            writeLooseRef(\"refs/heads/pu\", B);\n            writeLooseRef(\"refs/tags/v1.0\", v1_0);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            deleteLooseRef(\"refs/heads/pu\");\n            deleteLooseRef(\"refs/heads/next\");\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(5, orig.size());\n            Assert.AreEqual(3, next.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/next\"));\n            Assert.IsFalse(next.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsFalse(next.ContainsKey(\"refs/heads/next\"));\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversDeletedLoose4()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n            global::GitSharp.Core.Ref orig_r, next_r;\n\n            writeLooseRef(\"refs/heads/B\", B);\n            writeLooseRef(\"refs/heads/master\", A);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            deleteLooseRef(\"refs/heads/master\");\n            next = refdir.getRefs(\"refs/heads/\");\n\n            Assert.AreEqual(3, orig.size());\n            Assert.AreEqual(1, next.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/B\"));\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/master\"));\n            Assert.IsTrue(next.ContainsKey(\"B\"));\n            Assert.IsFalse(next.ContainsKey(\"master\"));\n\n            orig_r = orig.get(\"refs/heads/B\");\n            next_r = next.get(\"B\");\n            Assert.AreEqual(B, orig_r.getObjectId());\n            Assert.AreSame(orig_r, next_r, \"uses cached instance\");\n        }\n\n        [Test]\n        public void testGetRefs_DiscoversDeletedLoose5()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> orig, next;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            writeLooseRef(\"refs/heads/pu\", B);\n            orig = refdir.getRefs(RefDatabase.ALL);\n\n            deleteLooseRef(\"refs/heads/pu\");\n            writeLooseRef(\"refs/tags/v1.0\", v1_0);\n            next = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(3, orig.size());\n            Assert.AreEqual(3, next.size());\n\n            Assert.IsTrue(orig.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsFalse(orig.ContainsKey(\"refs/tags/v1.0\"));\n            Assert.IsFalse(next.ContainsKey(\"refs/heads/pu\"));\n            Assert.IsTrue(next.ContainsKey(\"refs/tags/v1.0\"));\n        }\n\n        [Test]\n        public void testGetRefs_SkipsLockFiles()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writeLooseRef(\"refs/heads/master\", A);\n            writeLooseRef(\"refs/heads/pu.lock\", B);\n            all = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(2, all.size());\n\n            Assert.IsTrue(all.ContainsKey(Constants.HEAD));\n            Assert.IsTrue(all.ContainsKey(\"refs/heads/master\"));\n            Assert.IsFalse(all.ContainsKey(\"refs/heads/pu.lock\"));\n        }\n\n        [Test]\n        public void testGetRefs_CycleInSymbolicRef()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n            global::GitSharp.Core.Ref r;\n\n            writeLooseRef(\"refs/1\", \"ref: refs/2\\n\");\n            writeLooseRef(\"refs/2\", \"ref: refs/3\\n\");\n            writeLooseRef(\"refs/3\", \"ref: refs/4\\n\");\n            writeLooseRef(\"refs/4\", \"ref: refs/5\\n\");\n            writeLooseRef(\"refs/5\", \"ref: refs/end\\n\");\n            writeLooseRef(\"refs/end\", A);\n\n            all = refdir.getRefs(RefDatabase.ALL);\n            r = all.get(\"refs/1\");\n            Assert.IsNotNull(r, \"has 1\");\n\n            Assert.AreEqual(\"refs/1\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsTrue(r.isSymbolic());\n\n            r = r.getTarget();\n            Assert.AreEqual(\"refs/2\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsTrue(r.isSymbolic());\n\n            r = r.getTarget();\n            Assert.AreEqual(\"refs/3\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsTrue(r.isSymbolic());\n\n            r = r.getTarget();\n            Assert.AreEqual(\"refs/4\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsTrue(r.isSymbolic());\n\n            r = r.getTarget();\n            Assert.AreEqual(\"refs/5\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsTrue(r.isSymbolic());\n\n            r = r.getTarget();\n            Assert.AreEqual(\"refs/end\", r.getName());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.IsFalse(r.isSymbolic());\n\n            writeLooseRef(\"refs/5\", \"ref: refs/6\\n\");\n            writeLooseRef(\"refs/6\", \"ref: refs/end\\n\");\n            BUG_WorkAroundRacyGitIssues(\"refs/5\");\n            all = refdir.getRefs(RefDatabase.ALL);\n            r = all.get(\"refs/1\");\n            Assert.IsNull(r, \"mising 1 due to cycle\");\n        }\n\n        [Test]\n        public void testGetRefs_PackedNotPeeled_Sorted()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writePackedRefs(\"\" + //\n                            A.Name + \" refs/heads/master\\n\" + //\n                            B.Name + \" refs/heads/other\\n\" + //\n                            v1_0.Name + \" refs/tags/v1.0\\n\");\n            all = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(4, all.size());\n            global::GitSharp.Core.Ref head = all.get(Constants.HEAD);\n            global::GitSharp.Core.Ref master = all.get(\"refs/heads/master\");\n            global::GitSharp.Core.Ref other = all.get(\"refs/heads/other\");\n            global::GitSharp.Core.Ref tag = all.get(\"refs/tags/v1.0\");\n\n            Assert.AreEqual(A, master.getObjectId());\n            Assert.IsFalse(master.isPeeled());\n            Assert.IsNull(master.getPeeledObjectId());\n\n            Assert.AreEqual(B, other.getObjectId());\n            Assert.IsFalse(other.isPeeled());\n            Assert.IsNull(other.getPeeledObjectId());\n\n            Assert.AreSame(master, head.getTarget());\n            Assert.AreEqual(A, head.getObjectId());\n            Assert.IsFalse(head.isPeeled());\n            Assert.IsNull(head.getPeeledObjectId());\n\n            Assert.AreEqual(v1_0, tag.getObjectId());\n            Assert.IsFalse(tag.isPeeled());\n            Assert.IsNull(tag.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testGetRef_PackedNotPeeled_WrongSort()\n        {\n            writePackedRefs(\"\" + //\n                            v1_0.Name + \" refs/tags/v1.0\\n\" + //\n                            B.Name + \" refs/heads/other\\n\" + //\n                            A.Name + \" refs/heads/master\\n\");\n\n            global::GitSharp.Core.Ref head = refdir.getRef(Constants.HEAD);\n            global::GitSharp.Core.Ref master = refdir.getRef(\"refs/heads/master\");\n            global::GitSharp.Core.Ref other = refdir.getRef(\"refs/heads/other\");\n            global::GitSharp.Core.Ref tag = refdir.getRef(\"refs/tags/v1.0\");\n\n            Assert.AreEqual(A, master.getObjectId());\n            Assert.IsFalse(master.isPeeled());\n            Assert.IsNull(master.getPeeledObjectId());\n\n            Assert.AreEqual(B, other.getObjectId());\n            Assert.IsFalse(other.isPeeled());\n            Assert.IsNull(other.getPeeledObjectId());\n\n            Assert.AreSame(master, head.getTarget());\n            Assert.AreEqual(A, head.getObjectId());\n            Assert.IsFalse(head.isPeeled());\n            Assert.IsNull(head.getPeeledObjectId());\n\n            Assert.AreEqual(v1_0, tag.getObjectId());\n            Assert.IsFalse(tag.isPeeled());\n            Assert.IsNull(tag.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_PackedWithPeeled()\n        {\n            IDictionary<string, global::GitSharp.Core.Ref> all;\n\n            writePackedRefs(\"# pack-refs with: peeled \\n\" + //\n                            A.Name + \" refs/heads/master\\n\" + //\n                            B.Name + \" refs/heads/other\\n\" + //\n                            v1_0.Name + \" refs/tags/v1.0\\n\" + //\n                            \"^\" + v1_0.getObject().Name + \"\\n\");\n            all = refdir.getRefs(RefDatabase.ALL);\n\n            Assert.AreEqual(4, all.size());\n            global::GitSharp.Core.Ref head = all.get(Constants.HEAD);\n            global::GitSharp.Core.Ref master = all.get(\"refs/heads/master\");\n            global::GitSharp.Core.Ref other = all.get(\"refs/heads/other\");\n            global::GitSharp.Core.Ref tag = all.get(\"refs/tags/v1.0\");\n\n            Assert.AreEqual(A, master.getObjectId());\n            Assert.IsTrue(master.isPeeled());\n            Assert.IsNull(master.getPeeledObjectId());\n\n            Assert.AreEqual(B, other.getObjectId());\n            Assert.IsTrue(other.isPeeled());\n            Assert.IsNull(other.getPeeledObjectId());\n\n            Assert.AreSame(master, head.getTarget());\n            Assert.AreEqual(A, head.getObjectId());\n            Assert.IsTrue(head.isPeeled());\n            Assert.IsNull(head.getPeeledObjectId());\n\n            Assert.AreEqual(v1_0, tag.getObjectId());\n            Assert.IsTrue(tag.isPeeled());\n            Assert.AreEqual(v1_0.getObject(), tag.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testGetRef_EmptyDatabase()\n        {\n            global::GitSharp.Core.Ref r;\n\n            r = refdir.getRef(Constants.HEAD);\n            Assert.IsTrue(r.isSymbolic());\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreEqual(\"refs/heads/master\", r.getTarget().getName());\n            Assert.AreSame(Storage.New, r.getTarget().getStorage());\n            Assert.IsNull(r.getTarget().getObjectId());\n\n            Assert.IsNull(refdir.getRef(\"refs/heads/master\"));\n            Assert.IsNull(refdir.getRef(\"refs/tags/v1.0\"));\n            Assert.IsNull(refdir.getRef(\"FETCH_HEAD\"));\n            Assert.IsNull(refdir.getRef(\"NOT.A.REF.NAME\"));\n            Assert.IsNull(refdir.getRef(\"master\"));\n            Assert.IsNull(refdir.getRef(\"v1.0\"));\n        }\n\n        [Test]\n        public void testGetRef_FetchHead()\n        {\n            // This is an odd special case where we need to make sure we read\n            // exactly the first 40 bytes of the file and nothing further on\n            // that line, or the remainder of the file.\n            write(PathUtil.CombineFilePath(diskRepo.Directory, \"FETCH_HEAD\"), A.Name\n                                                                              + \"\\tnot-for-merge\"\n                                                                              + \"\\tbranch 'master' of git://egit.eclipse.org/jgit\\n\");\n\n            global::GitSharp.Core.Ref r = refdir.getRef(\"FETCH_HEAD\");\n            Assert.IsFalse(r.isSymbolic());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.AreEqual(\"FETCH_HEAD\", r.getName());\n            Assert.IsFalse(r.isPeeled());\n            Assert.IsNull(r.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testGetRef_AnyHeadWithGarbage()\n        {\n            write(PathUtil.CombineFilePath(diskRepo.Directory, \"refs/heads/A\"), A.Name\n                                                                                + \"012345 . this is not a standard reference\\n\"\n                                                                                + \"#and even more junk\\n\");\n\n            global::GitSharp.Core.Ref r = refdir.getRef(\"refs/heads/A\");\n            Assert.IsFalse(r.isSymbolic());\n            Assert.AreEqual(A, r.getObjectId());\n            Assert.AreEqual(\"refs/heads/A\", r.getName());\n            Assert.IsFalse(r.isPeeled());\n            Assert.IsNull(r.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testGetRefs_CorruptSymbolicReference()\n        {\n            string name = \"refs/heads/A\";\n            writeLooseRef(name, \"ref: \\n\");\n            Assert.IsTrue(refdir.getRefs(RefDatabase.ALL).isEmpty());\n        }\n\n        [Test]\n        public void testGetRef_CorruptSymbolicReference()\n        {\n            string name = \"refs/heads/A\";\n            writeLooseRef(name, \"ref: \\n\");\n            try\n            {\n                refdir.getRef(name);\n                Assert.Fail(\"read an invalid reference\");\n            }\n            catch (IOException err)\n            {\n                string msg = err.Message;\n                Assert.AreEqual(\"Not a ref: \" + name + \": ref:\", msg);\n            }\n        }\n\n        [Test]\n        public void testGetRefs_CorruptObjectIdReference()\n        {\n            string name = \"refs/heads/A\";\n            string content = \"zoo\" + A.Name;\n            writeLooseRef(name, content + \"\\n\");\n            Assert.IsTrue(refdir.getRefs(RefDatabase.ALL).isEmpty());\n        }\n\n        [Test]\n        public void testGetRef_CorruptObjectIdReference()\n        {\n            string name = \"refs/heads/A\";\n            string content = \"zoo\" + A.Name;\n            writeLooseRef(name, content + \"\\n\");\n            try\n            {\n                refdir.getRef(name);\n                Assert.Fail(\"read an invalid reference\");\n            }\n            catch (IOException err)\n            {\n                string msg = err.Message;\n                Assert.AreEqual(\"Not a ref: \" + name + \": \" + content, msg);\n            }\n        }\n\n        [Test]\n        public void testIsNameConflicting()\n        {\n            writeLooseRef(\"refs/heads/a/b\", A);\n            writePackedRef(\"refs/heads/q\", B);\n\n            // new references cannot replace an existing container\n            Assert.IsTrue(refdir.isNameConflicting(\"refs\"));\n            Assert.IsTrue(refdir.isNameConflicting(\"refs/heads\"));\n            Assert.IsTrue(refdir.isNameConflicting(\"refs/heads/a\"));\n\n            // existing reference is not conflicting\n            Assert.IsFalse(refdir.isNameConflicting(\"refs/heads/a/b\"));\n\n            // new references are not conflicting\n            Assert.IsFalse(refdir.isNameConflicting(\"refs/heads/a/d\"));\n            Assert.IsFalse(refdir.isNameConflicting(\"refs/heads/master\"));\n\n            // existing reference must not be used as a container\n            Assert.IsTrue(refdir.isNameConflicting(\"refs/heads/a/b/c\"));\n            Assert.IsTrue(refdir.isNameConflicting(\"refs/heads/q/master\"));\n        }\n\n        [Test]\n        public void testPeelLooseTag()\n        {\n            writeLooseRef(\"refs/tags/v1_0\", v1_0);\n            writeLooseRef(\"refs/tags/current\", \"ref: refs/tags/v1_0\\n\");\n\n            global::GitSharp.Core.Ref tag = refdir.getRef(\"refs/tags/v1_0\");\n            global::GitSharp.Core.Ref cur = refdir.getRef(\"refs/tags/current\");\n\n            Assert.AreEqual(v1_0, tag.getObjectId());\n            Assert.IsFalse(tag.isSymbolic());\n            Assert.IsFalse(tag.isPeeled());\n            Assert.IsNull(tag.getPeeledObjectId());\n\n            Assert.AreEqual(v1_0, cur.getObjectId());\n            Assert.IsTrue(cur.isSymbolic());\n            Assert.IsFalse(cur.isPeeled());\n            Assert.IsNull(cur.getPeeledObjectId());\n\n            global::GitSharp.Core.Ref tag_p = refdir.peel(tag);\n            global::GitSharp.Core.Ref cur_p = refdir.peel(cur);\n\n            Assert.AreNotSame(tag, tag_p);\n            Assert.IsFalse(tag_p.isSymbolic());\n            Assert.IsTrue(tag_p.isPeeled());\n            Assert.AreEqual(v1_0, tag_p.getObjectId());\n            Assert.AreEqual(v1_0.getObject(), tag_p.getPeeledObjectId());\n            Assert.AreSame(tag_p, refdir.peel(tag_p));\n\n            Assert.AreNotSame(cur, cur_p);\n            Assert.AreEqual(\"refs/tags/current\", cur_p.getName());\n            Assert.IsTrue(cur_p.isSymbolic());\n            Assert.AreEqual(\"refs/tags/v1_0\", cur_p.getTarget().getName());\n            Assert.IsTrue(cur_p.isPeeled());\n            Assert.AreEqual(v1_0, cur_p.getObjectId());\n            Assert.AreEqual(v1_0.getObject(), cur_p.getPeeledObjectId());\n\n            // reuses cached peeling later, but not immediately due to\n            // the implementation so we have to fetch it once.\n            global::GitSharp.Core.Ref tag_p2 = refdir.getRef(\"refs/tags/v1_0\");\n            Assert.IsFalse(tag_p2.isSymbolic());\n            Assert.IsTrue(tag_p2.isPeeled());\n            Assert.AreEqual(v1_0, tag_p2.getObjectId());\n            Assert.AreEqual(v1_0.getObject(), tag_p2.getPeeledObjectId());\n\n            Assert.AreSame(tag_p2, refdir.getRef(\"refs/tags/v1_0\"));\n            Assert.AreSame(tag_p2, refdir.getRef(\"refs/tags/current\").getTarget());\n            Assert.AreSame(tag_p2, refdir.peel(tag_p2));\n        }\n\n        [Test]\n        public void testPeelCommit()\n        {\n            writeLooseRef(\"refs/heads/master\", A);\n\n            global::GitSharp.Core.Ref master = refdir.getRef(\"refs/heads/master\");\n            Assert.AreEqual(A, master.getObjectId());\n            Assert.IsFalse(master.isPeeled());\n            Assert.IsNull(master.getPeeledObjectId());\n\n            global::GitSharp.Core.Ref master_p = refdir.peel(master);\n            Assert.AreNotSame(master, master_p);\n            Assert.AreEqual(A, master_p.getObjectId());\n            Assert.IsTrue(master_p.isPeeled());\n            Assert.IsNull(master_p.getPeeledObjectId());\n\n            // reuses cached peeling later, but not immediately due to\n            // the implementation so we have to fetch it once.\n            global::GitSharp.Core.Ref master_p2 = refdir.getRef(\"refs/heads/master\");\n            Assert.AreNotSame(master, master_p2);\n            Assert.AreEqual(A, master_p2.getObjectId());\n            Assert.IsTrue(master_p2.isPeeled());\n            Assert.IsNull(master_p2.getPeeledObjectId());\n            Assert.AreSame(master_p2, refdir.peel(master_p2));\n        }\n\n        private void writeLooseRef(string name, AnyObjectId id)\n        {\n            writeLooseRef(name, id.Name + \"\\n\");\n        }\n\n        private void writeLooseRef(string name, string content)\n        {\n            write(PathUtil.CombineFilePath(diskRepo.Directory, name), content);\n        }\n\n        private void writePackedRef(string name, AnyObjectId id)\n        {\n            writePackedRefs(id.Name + \" \" + name + \"\\n\");\n        }\n\n        private void writePackedRefs(string content)\n        {\n            FileInfo pr = PathUtil.CombineFilePath(diskRepo.Directory, \"packed-refs\");\n            write(pr, content);\n        }\n\n        private void deleteLooseRef(string name)\n        {\n            FileInfo path = PathUtil.CombineFilePath(diskRepo.Directory, name);\n            Assert.IsTrue(path.DeleteFile(), \"deleted \" + name);\n        }\n\n        /*\n     * Kick the timestamp of a local file.\n     * <p>\n     * We shouldn't have to make these method calls. The cache is using file\n     * system timestamps, and on many systems unit tests run faster than the\n     * modification clock. Dumping the cache after we make an edit behind\n     * RefDirectory's back allows the tests to pass.\n     *\n     * @param name\n     *            the file in the repository to force a time change on.\n     */\n        private void BUG_WorkAroundRacyGitIssues(string name)\n        {\n            FileInfo path = PathUtil.CombineFilePath(diskRepo.Directory, name);\n            long old = path.lastModified();\n            long set = 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009\n            path.LastWriteTime = (set.MillisToUtcDateTime());\n            Assert.IsTrue(old != path.lastModified(), \"time changed\");\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RefTest.cs",
    "content": "/*\n * Copyright (C) 2009, Robin Rosenberg\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    /**\n     * Misc tests for refs. A lot of things are tested elsewhere so not having a\n     * test for a ref related method, does not mean it is untested.\n     */\n    [TestFixture]\n    public class RefTest : SampleDataRepositoryTestCase\n    {\n        private void writeSymref(String src, String dst)\n        {\n            RefUpdate u = db.UpdateRef(src);\n            switch (u.link(dst))\n            {\n                case RefUpdate.RefUpdateResult.NEW:\n                case RefUpdate.RefUpdateResult.FORCED:\n                case RefUpdate.RefUpdateResult.NO_CHANGE:\n                    break;\n                default:\n                    Assert.Fail(\"link \" + src + \" to \" + dst);\n                    break;\n            }\n        }\n\n        [Test]\n        public virtual void testReadAllIncludingSymrefs()\n        {\n            ObjectId masterId = db.Resolve(\"refs/heads/master\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/remotes/origin/master\");\n            updateRef.setNewObjectId(masterId);\n            updateRef.setForceUpdate(true);\n            updateRef.update();\n            writeSymref(\"refs/remotes/origin/HEAD\", \"refs/remotes/origin/master\");\n\n            ObjectId r = db.Resolve(\"refs/remotes/origin/HEAD\");\n            Assert.AreEqual(masterId, r);\n\n            IDictionary<string, global::GitSharp.Core.Ref> allRefs = db.getAllRefs();\n            global::GitSharp.Core.Ref refHEAD = allRefs[\"refs/remotes/origin/HEAD\"];\n            Assert.IsNotNull(refHEAD);\n            Assert.AreEqual(masterId, refHEAD.ObjectId);\n            Assert.IsFalse(refHEAD.IsPeeled);\n            Assert.IsNull(refHEAD.PeeledObjectId);\n\n            global::GitSharp.Core.Ref refmaster = allRefs[\"refs/remotes/origin/master\"];\n            Assert.AreEqual(masterId, refmaster.ObjectId);\n            Assert.IsFalse(refmaster.IsPeeled);\n            Assert.IsNull(refmaster.PeeledObjectId);\n        }\n\n        [Test]\n        public virtual void testReadSymRefToPacked()\n        {\n            writeSymref(\"HEAD\", \"refs/heads/b\");\n            global::GitSharp.Core.Ref @ref = db.getRef(\"HEAD\");\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n            Assert.IsTrue(@ref.isSymbolic(), \"is symref\");\n            @ref = @ref.getTarget();\n            Assert.AreEqual(\"refs/heads/b\", @ref.Name);\n            Assert.AreEqual(Storage.Packed, @ref.StorageFormat);\n        }\n\n        [Test]\n        public void testReadSymRefToLoosePacked()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/master^\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.setNewObjectId(pid);\n            updateRef.setForceUpdate(true);\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update); // internal\n\n            writeSymref(\"HEAD\", \"refs/heads/master\");\n            global::GitSharp.Core.Ref @ref = db.getRef(\"HEAD\");\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n            @ref = @ref.getTarget();\n            Assert.AreEqual(\"refs/heads/master\", @ref.Name);\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n        }\n\n        [Test]\n        public void testReadLooseRef()\n        {\n            RefUpdate updateRef = db.UpdateRef(\"ref/heads/new\");\n            updateRef.setNewObjectId(db.Resolve(\"refs/heads/master\"));\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n            global::GitSharp.Core.Ref @ref = db.getRef(\"ref/heads/new\");\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n        }\n\n        /// <summary>\n        /// Let an \"outsider\" Create a loose ref with the same name as a packed one\n        /// </summary>\n        [Test]\n        public void testReadLoosePackedRef()\n        {\n            global::GitSharp.Core.Ref @ref = db.getRef(\"refs/heads/master\");\n            Assert.AreEqual(Storage.Packed, @ref.StorageFormat);\n            string path = Path.Combine(db.Directory.FullName, \"refs/heads/master\");\n            using (FileStream os = new FileStream(path, System.IO.FileMode.OpenOrCreate))\n            {\n                byte[] buffer = @ref.ObjectId.Name.getBytes();\n                os.Write(buffer, 0, buffer.Length);\n                os.WriteByte(Convert.ToByte('\\n'));\n            }\n\n            @ref = db.getRef(\"refs/heads/master\");\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n        }\n\n        ///\t<summary>\n        /// Modify a packed ref using the API. This creates a loose ref too, ie. LOOSE_PACKED\n        ///\t</summary>\n        [Test]\n        public void testReadSimplePackedRefSameRepo()\n        {\n            global::GitSharp.Core.Ref @ref = db.getRef(\"refs/heads/master\");\n            ObjectId pid = db.Resolve(\"refs/heads/master^\");\n            Assert.AreEqual(Storage.Packed, @ref.StorageFormat);\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.setNewObjectId(pid);\n            updateRef.setForceUpdate(true);\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n\n            @ref = db.getRef(\"refs/heads/master\");\n            Assert.AreEqual(Storage.Loose, @ref.StorageFormat);\n        }\n\n        [Test]\n        public void testResolvedNamesBranch()\n        {\n            global::GitSharp.Core.Ref @ref = db.getRef(\"a\");\n            Assert.AreEqual(\"refs/heads/a\", @ref.Name);\n        }\n\n        [Test]\n        public void testResolvedNamesSymRef()\n        {\n            global::GitSharp.Core.Ref @ref = db.getRef(Constants.HEAD);\n            Assert.AreEqual(Constants.HEAD, @ref.Name);\n            Assert.IsTrue(@ref.isSymbolic(), \"is symbolic ref\");\n            Assert.AreSame(Storage.Loose, @ref.StorageFormat);\n\n            global::GitSharp.Core.Ref dst = @ref.getTarget();\n            Assert.IsNotNull(dst, \"has target\");\n            Assert.AreEqual(\"refs/heads/master\", dst.Name);\n\n            Assert.AreSame(dst.ObjectId, @ref.ObjectId);\n            Assert.AreSame(dst.PeeledObjectId, @ref.PeeledObjectId);\n            Assert.AreEqual(dst.IsPeeled, @ref.IsPeeled);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RefUpdateTest.cs",
    "content": "/*\n * Copyright (C) 2008, Charles O'Farrell <charleso@charleso.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class RefUpdateTest : SampleDataRepositoryTestCase\n    {\n        private void writeSymref(string src, string dst)\n        {\n            RefUpdate u = db.UpdateRef(src);\n            switch (u.link(dst))\n            {\n                case RefUpdate.RefUpdateResult.NEW:\n                case RefUpdate.RefUpdateResult.FORCED:\n                case RefUpdate.RefUpdateResult.NO_CHANGE:\n                    break;\n                default:\n                    Assert.Fail(\"link \" + src + \" to \" + dst);\n                    break;\n            }\n        }\n\n        private RefUpdate updateRef(string name)\n        {\n            RefUpdate @ref = db.UpdateRef(name);\n            @ref.setNewObjectId(db.Resolve(Constants.HEAD));\n            return @ref;\n        }\n\n        private void delete(RefUpdate @ref, RefUpdate.RefUpdateResult expected)\n        {\n            delete(@ref, expected, true, true);\n        }\n\n        private void delete(RefUpdate @ref, RefUpdate.RefUpdateResult expected,\n        bool exists, bool removed)\n        {\n            Assert.AreEqual(exists, db.getAllRefs().ContainsKey(@ref.getName()));\n            Assert.AreEqual(expected, @ref.delete());\n            Assert.AreEqual(!removed, db.getAllRefs().ContainsKey(@ref.getName()));\n        }\n\n        [Test]\n        public void testNoCacheObjectIdSubclass()\n        {\n            string newRef = \"refs/heads/abc\";\n            RefUpdate ru = updateRef(newRef);\n            RevCommit newid = new RevCommit(ru.getNewObjectId())\n            {\n                // empty\n            };\n\n            ru.setNewObjectId(newid);\n            RefUpdate.RefUpdateResult update = ru.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n            Core.Ref r = db.getAllRefs()[newRef];\n            Assert.IsNotNull(r);\n            Assert.AreEqual(newRef, r.Name);\n            Assert.IsNotNull(r.ObjectId);\n            Assert.AreNotSame(newid, r.ObjectId);\n            Assert.AreSame(typeof(ObjectId), r.ObjectId.GetType());\n            Assert.AreEqual(newid.Copy(), r.ObjectId);\n            IList<ReflogReader.Entry> reverseEntries1 = db.ReflogReader(\"refs/heads/abc\").getReverseEntries();\n            ReflogReader.Entry entry1 = reverseEntries1[0];\n            Assert.AreEqual(1, reverseEntries1.Count);\n            Assert.AreEqual(ObjectId.ZeroId, entry1.getOldId());\n            Assert.AreEqual(r.ObjectId, entry1.getNewId());\n            Assert.AreEqual(new PersonIdent(db).ToString(), entry1.getWho().ToString());\n            Assert.AreEqual(\"\", entry1.getComment());\n            IList<ReflogReader.Entry> reverseEntries2 = db.ReflogReader(\"HEAD\").getReverseEntries();\n            Assert.AreEqual(0, reverseEntries2.Count);\n        }\n\n        [Test]\n        public void testNewNamespaceConflictWithLoosePrefixNameExists()\n        {\n            string newRef = \"refs/heads/z\";\n            RefUpdate ru = updateRef(newRef);\n            RevCommit newid = new RevCommit(ru.getNewObjectId())\n            {\n                // empty\n            };\n            ru.setNewObjectId(newid);\n            RefUpdate.RefUpdateResult update = ru.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n            // end setup\n            string newRef2 = \"refs/heads/z/a\";\n            RefUpdate ru2 = updateRef(newRef2);\n            RevCommit newid2 = new RevCommit(ru2.getNewObjectId())\n            {\n                // empty\n            };\n            ru.setNewObjectId(newid2);\n            RefUpdate.RefUpdateResult update2 = ru2.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update2);\n            Assert.AreEqual(1, db.ReflogReader(\"refs/heads/z\").getReverseEntries().Count);\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        [Test]\n        public void testNewNamespaceConflictWithPackedPrefixNameExists()\n        {\n            string newRef = \"refs/heads/master/x\";\n            RefUpdate ru = updateRef(newRef);\n            RevCommit newid = new RevCommit(ru.getNewObjectId())\n            {\n                // empty\n            };\n            ru.NewObjectId = newid;\n            RefUpdate.RefUpdateResult update = ru.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update);\n            Assert.IsNull(db.ReflogReader(\"refs/heads/master/x\"));\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        [Test]\n        public void testNewNamespaceConflictWithLoosePrefixOfExisting()\n        {\n            string newRef = \"refs/heads/z/a\";\n            RefUpdate ru = updateRef(newRef);\n            RevCommit newid = new RevCommit(ru.NewObjectId)\n            {\n                // empty\n            };\n            ru.NewObjectId = newid;\n            RefUpdate.RefUpdateResult update = ru.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n            // end setup\n            string newRef2 = \"refs/heads/z\";\n            RefUpdate ru2 = updateRef(newRef2);\n            RevCommit newid2 = new RevCommit(ru2.NewObjectId)\n            {\n                // empty\n            };\n            ru.NewObjectId = newid2;\n            RefUpdate.RefUpdateResult update2 = ru2.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update2);\n            Assert.AreEqual(1, db.ReflogReader(\"refs/heads/z/a\").getReverseEntries().Count);\n            Assert.IsNull(db.ReflogReader(\"refs/heads/z\"));\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        [Test]\n        public void testNewNamespaceConflictWithPackedPrefixOfExisting()\n        {\n            string newRef = \"refs/heads/prefix\";\n            RefUpdate ru = updateRef(newRef);\n            RevCommit newid = new RevCommit(ru.NewObjectId)\n            {\n                // empty\n            };\n            ru.NewObjectId = newid;\n            RefUpdate.RefUpdateResult update = ru.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update);\n            Assert.IsNull(db.ReflogReader(\"refs/heads/prefix\"));\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        /**\n         * Delete a ref that is pointed to by HEAD\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testDeleteHEADreferencedRef()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/master^\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = pid;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update); // internal\n\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/master\");\n            RefUpdate.RefUpdateResult delete = updateRef2.delete();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.REJECTED_CURRENT_BRANCH, delete);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n            Assert.AreEqual(1, db.ReflogReader(\"refs/heads/master\").getReverseEntries().Count);\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        [Test]\n        public void testLooseDelete()\n        {\n            string newRef = \"refs/heads/abc\";\n            RefUpdate @ref = updateRef(newRef);\n            @ref.update(); // create loose ref\n            @ref = updateRef(newRef); // refresh\n            delete(@ref, RefUpdate.RefUpdateResult.NO_CHANGE);\n            Assert.IsNull(db.ReflogReader(\"refs/heads/abc\"));\n        }\n\n        [Test]\n        public void testDeleteHead()\n        {\n            RefUpdate @ref = updateRef(Constants.HEAD);\n            delete(@ref, RefUpdate.RefUpdateResult.REJECTED_CURRENT_BRANCH, true, false);\n            Assert.AreEqual(0, db.ReflogReader(\"refs/heads/master\").getReverseEntries().Count);\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n        }\n\n        /**\n         * Delete a loose ref and make sure the directory in refs is deleted too,\n         * and the reflog dir too\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testDeleteLooseAndItsDirectory()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/c^\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/z/c\");\n            updateRef.NewObjectId = pid;\n            updateRef.IsForceUpdate = true;\n            updateRef.setRefLogMessage(\"new test ref\", false);\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update); // internal\n            Assert.IsTrue(new DirectoryInfo(Path.Combine(db.Directory.FullName, Constants.R_HEADS + \"z\")).Exists);\n            Assert.IsTrue(new DirectoryInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/z\")).Exists);\n\n            // The real test here\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/z/c\");\n            updateRef2.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult delete = updateRef2.delete();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, delete);\n            Assert.IsNull(db.Resolve(\"refs/heads/z/c\"));\n            Assert.IsFalse(new DirectoryInfo(Path.Combine(db.Directory.FullName, Constants.R_HEADS + \"z\")).Exists);\n            Assert.IsFalse(new DirectoryInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/z\")).Exists);\n        }\n\n        [Test]\n        public void testDeleteNotFound()\n        {\n            RefUpdate @ref = updateRef(\"refs/heads/xyz\");\n            delete(@ref, RefUpdate.RefUpdateResult.NEW, false, true);\n        }\n\n        [Test]\n        public void testDeleteFastForward()\n        {\n            RefUpdate @ref = updateRef(\"refs/heads/a\");\n            delete(@ref, RefUpdate.RefUpdateResult.FAST_FORWARD);\n        }\n\n        [Test]\n        public void testDeleteForce()\n        {\n            RefUpdate @ref = db.UpdateRef(\"refs/heads/b\");\n            @ref.NewObjectId = db.Resolve(\"refs/heads/a\");\n            delete(@ref, RefUpdate.RefUpdateResult.REJECTED, true, false);\n            @ref.IsForceUpdate = true;\n            delete(@ref, RefUpdate.RefUpdateResult.FORCED);\n        }\n\n        [Test]\n        public void testRefKeySameAsName()\n        {\n            foreach (var e in db.getAllRefs())\n            {\n                Assert.AreEqual(e.Key, e.Value.Name);\n\n            }\n        }\n\n        /**\n         * Try modify a ref forward, fast forward\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testUpdateRefForward()\n        {\n            ObjectId ppid = db.Resolve(\"refs/heads/master^\");\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = ppid;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n            Assert.AreEqual(ppid, db.Resolve(\"refs/heads/master\"));\n\n            // real test\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/master\");\n            updateRef2.NewObjectId = pid;\n            RefUpdate.RefUpdateResult update2 = updateRef2.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FAST_FORWARD, update2);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n        }\n\n        /*\n        * Update the HEAD ref. Only it should be changed, not what it points to.\n        *\n        * @throws Exception\n        */\n        [Test]\n        public void testUpdateRefDetached()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n            ObjectId ppid = db.Resolve(\"refs/heads/master^\");\n            RefUpdate updateRef = db.UpdateRef(\"HEAD\", true);\n            updateRef.IsForceUpdate = true;\n            updateRef.NewObjectId = ppid;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n            Assert.AreEqual(ppid, db.Resolve(\"HEAD\"));\n            Ref @ref = db.getRef(\"HEAD\");\n            Assert.AreEqual(\"HEAD\", @ref.Name);\n            Assert.IsTrue(!@ref.isSymbolic(), \"is detached\");\n\n            // the branch HEAD referred to is left untouched\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n            ReflogReader reflogReader = new ReflogReader(db, \"HEAD\");\n            ReflogReader.Entry e = reflogReader.getReverseEntries()[0];\n            Assert.AreEqual(pid, e.getOldId());\n            Assert.AreEqual(ppid, e.getNewId());\n            Assert.AreEqual(\"GIT_COMMITTER_EMAIL\", e.getWho().EmailAddress);\n            Assert.AreEqual(\"GIT_COMMITTER_NAME\", e.getWho().Name);\n            Assert.AreEqual(1250379778000L, e.getWho().When);\n        }\n\n        /*\n         * Update the HEAD ref when the referenced branch is unborn\n         *\n         * @throws Exception\n         */\n        [Test]\n        public void testUpdateRefDetachedUnbornHead()\n        {\n            ObjectId ppid = db.Resolve(\"refs/heads/master^\");\n            writeSymref(\"HEAD\", \"refs/heads/unborn\");\n            RefUpdate updateRef = db.UpdateRef(\"HEAD\", true);\n            updateRef.IsForceUpdate = true;\n            updateRef.NewObjectId = ppid;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n            Assert.AreEqual(ppid, db.Resolve(\"HEAD\"));\n            Ref @ref = db.getRef(\"HEAD\");\n            Assert.AreEqual(\"HEAD\", @ref.Name);\n            Assert.IsTrue(!@ref.isSymbolic(), \"is detached\");\n\n            // the branch HEAD referred to is left untouched\n            Assert.IsNull(db.Resolve(\"refs/heads/unborn\"));\n            ReflogReader reflogReader = new ReflogReader(db, \"HEAD\");\n            ReflogReader.Entry e = reflogReader.getReverseEntries()[0];\n            Assert.AreEqual(ObjectId.ZeroId, e.getOldId());\n            Assert.AreEqual(ppid, e.getNewId());\n            Assert.AreEqual(\"GIT_COMMITTER_EMAIL\", e.getWho().EmailAddress);\n            Assert.AreEqual(\"GIT_COMMITTER_NAME\", e.getWho().Name);\n            Assert.AreEqual(1250379778000L, e.getWho().When);\n        }\n\n        /**\n         * Delete a ref that exists both as packed and loose. Make sure the ref\n         * cannot be resolved after delete.\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testDeleteLoosePacked()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/c^\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/c\");\n            updateRef.NewObjectId = pid;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update); // internal\n\n            // The real test here\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/c\");\n            updateRef2.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult delete = updateRef2.delete();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, delete);\n            Assert.IsNull(db.Resolve(\"refs/heads/c\"));\n        }\n\n        /**\n         * Try modify a ref to same\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testUpdateRefNoChange()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = pid;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NO_CHANGE, update);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n        }\n\n        /**\n        * Test case originating from\n        * <a href=\"http://bugs.eclipse.org/285991\">bug 285991</a>\n        *\n        * Make sure the in memory cache is updated properly after\n        * update of symref. This one did not fail because the\n        * ref was packed due to implementation issues.\n        *\n        * @throws Exception\n        */\n        [Test]\n        public void testRefsCacheAfterUpdate()\n        {\n            // Do not use the defalt repo for this case.\n            IDictionary<string, Core.Ref> allRefs = db.getAllRefs();\n            ObjectId oldValue = db.Resolve(\"HEAD\");\n            ObjectId newValue = db.Resolve(\"HEAD^\");\n            // first make HEAD refer to loose ref\n            RefUpdate updateRef = db.UpdateRef(Constants.HEAD);\n            updateRef.IsForceUpdate = true;\n            updateRef.NewObjectId = newValue;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n\n            // now update that ref\n            updateRef = db.UpdateRef(Constants.HEAD);\n            updateRef.IsForceUpdate = true;\n            updateRef.NewObjectId = oldValue;\n            update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FAST_FORWARD, update);\n\n            allRefs = db.getAllRefs();\n            Ref master = allRefs.GetValue(\"refs/heads/master\");\n            Ref head = allRefs.GetValue(\"HEAD\");\n            Assert.AreEqual(\"refs/heads/master\", master.Name);\n            Assert.AreEqual(\"HEAD\", head.Name);\n            Assert.IsTrue(head.isSymbolic(), \"is symbolic reference\");\n            Assert.AreSame(master, head.getTarget());\n        }\n\n        /**\n        * Test case originating from\n        * <a href=\"http://bugs.eclipse.org/285991\">bug 285991</a>\n        *\n        * Make sure the in memory cache is updated properly after\n        * update of symref.\n        *\n        * @throws Exception\n        */\n\n        [Test]\n        public void testRefsCacheAfterUpdateLooseOnly()\n        {\n            // Do not use the defalt repo for this case.\n            IDictionary<string, Core.Ref> allRefs = db.getAllRefs();\n            ObjectId oldValue = db.Resolve(\"HEAD\");\n            writeSymref(Constants.HEAD, \"refs/heads/newref\");\n            RefUpdate updateRef = db.UpdateRef(Constants.HEAD);\n            updateRef.IsForceUpdate = true;\n            updateRef.NewObjectId = oldValue;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, update);\n\n            allRefs = db.getAllRefs();\n            Ref head = allRefs.GetValue(\"HEAD\");\n            Ref newref = allRefs.GetValue(\"refs/heads/newref\");\n            Assert.AreEqual(\"refs/heads/newref\", newref.Name);\n            Assert.AreEqual(\"HEAD\", head.Name);\n            Assert.IsTrue(head.isSymbolic(), \"is symbolic reference\");\n            Assert.AreSame(newref, head.getTarget());\n        }\n\n        /**\n         * Try modify a ref, but get wrong expected old value\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testUpdateRefLockFailureWrongOldValue()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = pid;\n            updateRef.ExpectedOldObjectId = db.Resolve(\"refs/heads/master^\");\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n        }\n\n        /**\n          * Try modify a ref forward, fast forward, checking old value first\n          *\n          * @throws IOException\n          */\n        [Test]\n        public void testUpdateRefForwardWithCheck1()\n        {\n            ObjectId ppid = db.Resolve(\"refs/heads/master^\");\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = ppid;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n            Assert.AreEqual(ppid, db.Resolve(\"refs/heads/master\"));\n\n            // real test\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/master\");\n            updateRef2.ExpectedOldObjectId = ppid;\n            updateRef2.NewObjectId = pid;\n            RefUpdate.RefUpdateResult update2 = updateRef2.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FAST_FORWARD, update2);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n        }\n\n        /**\n          * Try modify a ref forward, fast forward, checking old commit first\n          *\n          * @throws IOException\n          */\n        [Test]\n        public void testUpdateRefForwardWithCheck2()\n        {\n            ObjectId ppid = db.Resolve(\"refs/heads/master^\");\n            ObjectId pid = db.Resolve(\"refs/heads/master\");\n\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = ppid;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update);\n            Assert.AreEqual(ppid, db.Resolve(\"refs/heads/master\"));\n\n            // real test\n            RevCommit old = new Core.RevWalk.RevWalk(db).parseCommit(ppid);\n            RefUpdate updateRef2 = db.UpdateRef(\"refs/heads/master\");\n            updateRef2.ExpectedOldObjectId = old;\n            updateRef2.NewObjectId = pid;\n            RefUpdate.RefUpdateResult update2 = updateRef2.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FAST_FORWARD, update2);\n            Assert.AreEqual(pid, db.Resolve(\"refs/heads/master\"));\n        }\n\n        /**\n         * Try modify a ref that is locked\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testUpdateRefLockFailureLocked()\n        {\n            ObjectId opid = db.Resolve(\"refs/heads/master\");\n            ObjectId pid = db.Resolve(\"refs/heads/master^\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/master\");\n            updateRef.NewObjectId = pid;\n            var lockFile1 = new LockFile(new FileInfo(Path.Combine(db.Directory.FullName, \"refs/heads/master\")));\n            try\n            {\n                Assert.IsTrue(lockFile1.Lock()); // precondition to test\n                RefUpdate.RefUpdateResult update = updateRef.update();\n                Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, update);\n                Assert.AreEqual(opid, db.Resolve(\"refs/heads/master\"));\n                var lockFile2 = new LockFile(new FileInfo(Path.Combine(db.Directory.FullName, \"refs/heads/master\")));\n                Assert.IsFalse(lockFile2.Lock()); // was locked, still is\n            }\n            finally\n            {\n                lockFile1.Unlock();\n            }\n        }\n\n        /**\n         * Try to delete a ref. Delete requires force.\n         *\n         * @throws IOException\n         */\n        [Test]\n        public void testDeleteLoosePackedRejected()\n        {\n            ObjectId pid = db.Resolve(\"refs/heads/c^\");\n            ObjectId oldpid = db.Resolve(\"refs/heads/c\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/c\");\n            updateRef.NewObjectId = pid;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.REJECTED, update);\n            Assert.AreEqual(oldpid, db.Resolve(\"refs/heads/c\"));\n        }\n\n        [Test]\n        public void testRenameBranchNoPreviousLog()\n        {\n            Assert.IsFalse(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists, \"precondition, no log on old branchg\");\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            ObjectId oldHead = db.Resolve(Constants.HEAD);\n            Assert.IsFalse(rb.Equals(oldHead)); // assumption for this test\n            RefRename renameRef = db.RenameRef(\"refs/heads/b\",\n                    \"refs/heads/new/name\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n            Assert.AreEqual(rb, db.Resolve(\"refs/heads/new/name\"));\n            Assert.IsNull(db.Resolve(\"refs/heads/b\"));\n            Assert.AreEqual(1, db.ReflogReader(\"new/name\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\"new/name\")\n                    .getLastEntry().getComment());\n            Assert.IsFalse(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists);\n            Assert.AreEqual(oldHead, db.Resolve(Constants.HEAD)); // unchanged\n        }\n\n        [Test]\n        public void testRenameBranchHasPreviousLog()\n        {\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            ObjectId oldHead = db.Resolve(Constants.HEAD);\n            Assert.IsFalse(rb\n                    .Equals(oldHead), \"precondition for this test, branch b != HEAD\");\n            writeReflog(db, rb, rb, \"Just a message\", \"refs/heads/b\");\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists, \"log on old branch\");\n            RefRename renameRef = db.RenameRef(\"refs/heads/b\",\n                    \"refs/heads/new/name\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n            Assert.AreEqual(rb, db.Resolve(\"refs/heads/new/name\"));\n            Assert.IsNull(db.Resolve(\"refs/heads/b\"));\n            Assert.AreEqual(2, db.ReflogReader(\"new/name\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\"new/name\")\n                    .getLastEntry().getComment());\n            Assert.AreEqual(\"Just a message\", db.ReflogReader(\"new/name\")\n                    .getReverseEntries()[1].getComment());\n            Assert.IsFalse(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists);\n            Assert.AreEqual(oldHead, db.Resolve(Constants.HEAD)); // unchanged\n        }\n\n        [Test]\n        public void testRenameCurrentBranch()\n        {\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            writeSymref(Constants.HEAD, \"refs/heads/b\");\n            ObjectId oldHead = db.Resolve(Constants.HEAD);\n            Assert.IsTrue(rb.Equals(oldHead), \"internal test condition, b == HEAD\");\n            writeReflog(db, rb, rb, \"Just a message\", \"refs/heads/b\");\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists, \"log on old branch\");\n            RefRename renameRef = db.RenameRef(\"refs/heads/b\",\n                    \"refs/heads/new/name\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n            Assert.AreEqual(rb, db.Resolve(\"refs/heads/new/name\"));\n            Assert.IsNull(db.Resolve(\"refs/heads/b\"));\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\n                    \"new/name\").getLastEntry().getComment());\n            Assert.IsFalse(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists);\n            Assert.AreEqual(rb, db.Resolve(Constants.HEAD));\n            Assert.AreEqual(2, db.ReflogReader(\"new/name\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\"new/name\").getReverseEntries()[0].getComment());\n            Assert.AreEqual(\"Just a message\", db.ReflogReader(\"new/name\").getReverseEntries()[1].getComment());\n        }\n\n        [Test]\n        public void testRenameBranchAlsoInPack()\n        {\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            ObjectId rb2 = db.Resolve(\"refs/heads/b~1\");\n            Assert.AreEqual(Storage.Packed, db.getRef(\"refs/heads/b\").StorageFormat);\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/b\");\n            updateRef.NewObjectId = rb2;\n            updateRef.IsForceUpdate = true;\n            RefUpdate.RefUpdateResult update = updateRef.update();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, update, \"internal check new ref is loose\");\n            Assert.AreEqual(Storage.Loose, db.getRef(\"refs/heads/b\").StorageFormat);\n            writeReflog(db, rb, rb, \"Just a message\", \"refs/heads/b\");\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists, \"log on old branch\");\n            RefRename renameRef = db.RenameRef(\"refs/heads/b\",\n                    \"refs/heads/new/name\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n            Assert.AreEqual(rb2, db.Resolve(\"refs/heads/new/name\"));\n            Assert.IsNull(db.Resolve(\"refs/heads/b\"));\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\n                    \"new/name\").getLastEntry().getComment());\n            Assert.AreEqual(3, db.ReflogReader(\"refs/heads/new/name\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed b to new/name\", db.ReflogReader(\"refs/heads/new/name\").getReverseEntries()[0].getComment());\n            Assert.AreEqual(0, db.ReflogReader(\"HEAD\").getReverseEntries().Count);\n            // make sure b's log file is gone too.\n            Assert.IsFalse(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/b\")).Exists);\n\n            // Create new Repository instance, to reread caches and make sure our\n            // assumptions are persistent.\n            using (Core.Repository ndb = new Core.Repository(db.Directory))\n            {\n                Assert.AreEqual(rb2, ndb.Resolve(\"refs/heads/new/name\"));\n                Assert.IsNull(ndb.Resolve(\"refs/heads/b\"));\n            }\n        }\n\n        public void tryRenameWhenLocked(string toLock, string fromName,\n                string toName, string headPointsTo)\n        {\n            // setup\n            writeSymref(Constants.HEAD, headPointsTo);\n            ObjectId oldfromId = db.Resolve(fromName);\n            ObjectId oldHeadId = db.Resolve(Constants.HEAD);\n            writeReflog(db, oldfromId, oldfromId, \"Just a message\",\n                    fromName);\n            IList<ReflogReader.Entry> oldFromLog = db\n                    .ReflogReader(fromName).getReverseEntries();\n            IList<ReflogReader.Entry> oldHeadLog = oldHeadId != null ? db\n                    .ReflogReader(Constants.HEAD).getReverseEntries() : null;\n\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/\" + fromName)).Exists, \"internal check, we have a log\");\n\n            // \"someone\" has branch X locked\n            var lockFile = new LockFile(new FileInfo(Path.Combine(db.Directory.FullName, toLock)));\n            try\n            {\n                Assert.IsTrue(lockFile.Lock());\n\n                // Now this is our test\n                RefRename renameRef = db.RenameRef(fromName, toName);\n                RefUpdate.RefUpdateResult result = renameRef.rename();\n                Assert.AreEqual(RefUpdate.RefUpdateResult.LOCK_FAILURE, result);\n\n                // Check that the involved refs are the same despite the failure\n                assertExists(false, toName);\n                if (!toLock.Equals(toName))\n                    assertExists(false, toName + \".lock\");\n                assertExists(true, toLock + \".lock\");\n                if (!toLock.Equals(fromName))\n                    assertExists(false, \"logs/\" + fromName + \".lock\");\n                assertExists(false, \"logs/\" + toName + \".lock\");\n                Assert.AreEqual(oldHeadId, db.Resolve(Constants.HEAD));\n                Assert.AreEqual(oldfromId, db.Resolve(fromName));\n                Assert.IsNull(db.Resolve(toName));\n                Assert.AreEqual(oldFromLog.ToString(), db.ReflogReader(fromName)\n                        .getReverseEntries().ToString());\n                if (oldHeadId != null)\n                    Assert.AreEqual(oldHeadLog.ToString(), db.ReflogReader(Constants.HEAD)\n                            .getReverseEntries().ToString());\n            }\n            finally\n            {\n                lockFile.Unlock();\n            }\n        }\n\n        private void assertExists(bool positive, string toName)\n        {\n            Assert.AreEqual(\n                    positive, new FileInfo(Path.Combine(db.Directory.FullName, toName)).Exists, toName + (positive ? \" \" : \" does not \") + \"exist\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisFromLockHEAD()\n        {\n            tryRenameWhenLocked(\"HEAD\", \"refs/heads/b\", \"refs/heads/new/name\",\n                    \"refs/heads/b\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisFromLockFrom()\n        {\n            tryRenameWhenLocked(\"refs/heads/b\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/b\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisFromLockTo()\n        {\n            tryRenameWhenLocked(\"refs/heads/new/name\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/b\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisToLockFrom()\n        {\n            tryRenameWhenLocked(\"refs/heads/b\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/new/name\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisToLockTo()\n        {\n            tryRenameWhenLocked(\"refs/heads/new/name\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/new/name\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisOtherLockFrom()\n        {\n            tryRenameWhenLocked(\"refs/heads/b\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/a\");\n        }\n\n        [Test]\n        public void testRenameBranchCannotLockAFileHEADisOtherLockTo()\n        {\n            tryRenameWhenLocked(\"refs/heads/new/name\", \"refs/heads/b\",\n                    \"refs/heads/new/name\", \"refs/heads/a\");\n        }\n\n        [Test]\n        public void testRenameRefNameColission1avoided()\n        {\n            // setup\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            writeSymref(Constants.HEAD, \"refs/heads/a\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/a\");\n            updateRef.NewObjectId = rb;\n            updateRef.setRefLogMessage(\"Setup\", false);\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FAST_FORWARD, updateRef.update());\n            ObjectId oldHead = db.Resolve(Constants.HEAD);\n            Assert.IsTrue(rb.Equals(oldHead)); // assumption for this test\n            writeReflog(db, rb, rb, \"Just a message\", \"refs/heads/a\");\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/a\")).Exists, \"internal check, we have a log\");\n\n            // Now this is our test\n            RefRename renameRef = db.RenameRef(\"refs/heads/a\", \"refs/heads/a/b\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n            Assert.IsNull(db.Resolve(\"refs/heads/a\"));\n            Assert.AreEqual(rb, db.Resolve(\"refs/heads/a/b\"));\n            Assert.AreEqual(3, db.ReflogReader(\"a/b\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed a to a/b\", db.ReflogReader(\"a/b\")\n                    .getReverseEntries()[0].getComment());\n            Assert.AreEqual(\"Just a message\", db.ReflogReader(\"a/b\")\n                    .getReverseEntries()[1].getComment());\n            Assert.AreEqual(\"Setup\", db.ReflogReader(\"a/b\").getReverseEntries()\n                    [2].getComment());\n            // same thing was logged to HEAD\n            Assert.AreEqual(\"Branch: renamed a to a/b\", db.ReflogReader(\"HEAD\")\n                               .getReverseEntries()[0].getComment());\n        }\n\n        [Test]\n        public void testRenameRefNameColission2avoided()\n        {\n            // setup\n            ObjectId rb = db.Resolve(\"refs/heads/b\");\n            writeSymref(Constants.HEAD, \"refs/heads/prefix/a\");\n            RefUpdate updateRef = db.UpdateRef(\"refs/heads/prefix/a\");\n            updateRef.NewObjectId = rb;\n            updateRef.setRefLogMessage(\"Setup\", false);\n            updateRef.IsForceUpdate = true;\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, updateRef.update());\n            ObjectId oldHead = db.Resolve(Constants.HEAD);\n            Assert.IsTrue(rb.Equals(oldHead)); // assumption for this test\n            writeReflog(db, rb, rb, \"Just a message\",\n                    \"refs/heads/prefix/a\");\n            Assert.IsTrue(new FileInfo(Path.Combine(db.Directory.FullName, \"logs/refs/heads/prefix/a\")).Exists, \"internal check, we have a log\");\n\n            // Now this is our test\n            RefRename renameRef = db.RenameRef(\"refs/heads/prefix/a\",\n                    \"refs/heads/prefix\");\n            RefUpdate.RefUpdateResult result = renameRef.rename();\n            Assert.AreEqual(RefUpdate.RefUpdateResult.RENAMED, result);\n\n            Assert.IsNull(db.Resolve(\"refs/heads/prefix/a\"));\n            Assert.AreEqual(rb, db.Resolve(\"refs/heads/prefix\"));\n            Assert.AreEqual(3, db.ReflogReader(\"prefix\").getReverseEntries().Count);\n            Assert.AreEqual(\"Branch: renamed prefix/a to prefix\", db.ReflogReader(\n                    \"prefix\").getReverseEntries()[0].getComment());\n            Assert.AreEqual(\"Just a message\", db.ReflogReader(\"prefix\")\n                    .getReverseEntries()[1].getComment());\n            Assert.AreEqual(\"Setup\", db.ReflogReader(\"prefix\").getReverseEntries()[2].getComment());\n            Assert.AreEqual(\"Branch: renamed prefix/a to prefix\", db.ReflogReader(\n                       \"HEAD\").getReverseEntries()[0].getComment());\n        }\n\n        private void writeReflog(Repository db, ObjectId oldId, ObjectId newId,\n                string msg, string refName)\n        {\n            RefDirectory refs = (RefDirectory)db.RefDatabase;\n            RefUpdate update = refs.newUpdate(refName, true);\n            update.setOldObjectId(oldId);\n            update.setNewObjectId(newId);\n            refs.log(update, msg, true);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ReflogConfigTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Christian Halstrick, Matthias Sohn, SAP AG\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class ReflogConfigTest : SampleDataRepositoryTestCase\n    {\n        [Test]\n        public void testlogAllRefUpdates() {\n            long commitTime = 1154236443000L;\n            int tz = -4 * 60;\n\n            // check that there are no entries in the reflog and turn off writing\n            // reflogs\n            Assert.AreEqual(0, db.ReflogReader(Constants.HEAD).getReverseEntries().Count, \"there should be no entries in reflog\");\n            db.Config.setBoolean(\"core\", null, \"logallrefupdates\", false);\n\n            // do one commit and check that reflog size is 0: no reflogs should be\n            // written\n            Core.Tree t = new Core.Tree(db);\n            addFileToTree(t, \"i-am-a-file\", \"and this is the data in me\\n\");\n            commit(t, \"A Commit\\n\", new PersonIdent(author, commitTime, tz), new PersonIdent(committer, commitTime, tz));\n            commitTime += 100;\n            Assert.IsTrue(\n\t\t\t\t\n                db.ReflogReader(Constants.HEAD).getReverseEntries().Count == 0, \"Reflog for HEAD still contain no entry\");\n\n            // set the logAllRefUpdates parameter to true and check it\n            db.Config.setBoolean(\"core\", null, \"logallrefupdates\", true);\n            Assert.IsTrue(db.Config.getCore().isLogAllRefUpdates());\n\n            // do one commit and check that reflog size is increased to 1\n            addFileToTree(t, \"i-am-another-file\", \"and this is other data in me\\n\");\n            commit(t, \"A Commit\\n\", new PersonIdent(author, commitTime, tz), new PersonIdent(committer, commitTime, tz));\n            commitTime += 100;\n            Assert.IsTrue(db.ReflogReader(Constants.HEAD).getReverseEntries().Count == 1, \"Reflog for HEAD should contain one entry\");\n\n            // set the logAllRefUpdates parameter to false and check it\n            db.Config.setBoolean(\"core\", null, \"logallrefupdates\", false);\n            Assert.IsFalse(db.Config.getCore().isLogAllRefUpdates());\n\n            // do one commit and check that reflog size is 2\n            addFileToTree(t, \"i-am-anotheranother-file\", \"and this is other other data in me\\n\");\n            commit(t, \"A Commit\\n\", new PersonIdent(author, commitTime, tz), new PersonIdent(committer, commitTime, tz));\n            Assert.IsTrue(db.ReflogReader(Constants.HEAD).getReverseEntries().Count == 2, \"Reflog for HEAD should contain two entries\");\n        }\n\n\n        [Test]\n        public void testEnsureLogTimeAndTimeZoneOffsetAreCurrentValues()\n        {\n            long commitTime = 1154236443000L;\n            int tz = -4 * 60;\n\n            Core.Tree t = new Core.Tree(db);\n            addFileToTree(t, \"i-am-a-file\", \"and this is the data in me\\n\");\n            commit(t, \"A Commit\\n\", new PersonIdent(author, commitTime, tz), new PersonIdent(committer, commitTime, tz));\n            IList<ReflogReader.Entry> entries = db.ReflogReader(Constants.HEAD).getReverseEntries();\n            Assert.AreEqual(1, entries.Count);\n\n            var entry = entries[0];\n\n            SystemReader mockSystemReader = SystemReader.getInstance();\n            long fakeCurrentTime = mockSystemReader.getCurrentTime();\n            long  remainder = fakeCurrentTime % 1000;\n            fakeCurrentTime -= remainder; // Second based Unix time format is used to store timetamps in the log. Thus, milliseconds are truncated.\n\n            Assert.AreEqual(fakeCurrentTime, entry.getWho().When);\n            Assert.AreEqual(mockSystemReader.getTimezone(fakeCurrentTime), entry.getWho().TimeZoneOffset);\n        }\n\n        private void addFileToTree(Core.Tree t, string filename, string content)\n        {\n            FileTreeEntry f = t.AddFile(filename);\n            writeTrashFile(f.Name, content);\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n        }\n\n        private void commit(Core.Tree t, string commitMsg, PersonIdent author,\n                            PersonIdent committer) {\n            Core.Commit commit = new Core.Commit(db);\n            commit.Author = (author);\n            commit.Committer = (committer);\n            commit.Message = (commitMsg);\n            commit.TreeEntry = (t);\n            //ObjectWriter writer = new ObjectWriter(db);\n            //commit.CommitId = (writer.WriteCommit(commit));\n            commit.Save();\n\n            int nl = commitMsg.IndexOf('\\n');\n            RefUpdate ru = db.UpdateRef(Constants.HEAD);\n            ru.NewObjectId = (commit.CommitId);\n            ru.setRefLogMessage(\"commit : \"\n                                + ((nl == -1) ? commitMsg : commitMsg.Slice(0, nl)), false);\n            ru.forceUpdate();\n                            }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ReflogReaderTest.cs",
    "content": "/*\n * Copyright (C) 2009, Robin Rosenberg\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class ReflogReaderTest : SampleDataRepositoryTestCase\n    {\n\n        static byte[] oneLine = \"da85355dfc525c9f6f3927b876f379f46ccf826e 3e7549db262d1e836d9bf0af7e22355468f1717c A O Thor Too <authortoo@wri.tr> 1243028200 +0200\\tcommit: Add a toString for debugging to RemoteRefUpdate\\n\"\n                .getBytes();\n\n        static byte[] twoLine = (\"0000000000000000000000000000000000000000 c6734895958052a9dbc396cff4459dc1a25029ab A U Thor <thor@committer.au> 1243028201 -0100\\tbranch: Created from rr/renamebranchv4\\n\"\n                + \"c6734895958052a9dbc396cff4459dc1a25029ab 54794942a18a237c57a80719afed44bb78172b10 Same A U Thor <same.author@example.com> 1243028202 +0100\\trebase finished: refs/heads/rr/renamebranch5 onto c6e3b9fe2da0293f11eae202ec35fb343191a82d\\n\")\n                .getBytes();\n\n        static byte[] twoLineWithAppendInProgress = (\"0000000000000000000000000000000000000000 c6734895958052a9dbc396cff4459dc1a25029ab A U Thor <thor@committer.au> 1243028201 -0100\\tbranch: Created from rr/renamebranchv4\\n\"\n                + \"c6734895958052a9dbc396cff4459dc1a25029ab 54794942a18a237c57a80719afed44bb78172b10 Same A U Thor <same.author@example.com> 1243028202 +0100\\trebase finished: refs/heads/rr/renamebranch5 onto c6e3b9fe2da0293f11eae202ec35fb343191a82d\\n\"\n                + \"54794942a18a237c57a80719afed44bb78172b10 \")\n                .getBytes();\n\n        static byte[] aLine = \"1111111111111111111111111111111111111111 3e7549db262d1e836d9bf0af7e22355468f1717c A U Thor <thor@committer.au> 1243028201 -0100\\tbranch: change to a\\n\"\n                .getBytes();\n\n        static byte[] masterLine = \"2222222222222222222222222222222222222222 3e7549db262d1e836d9bf0af7e22355468f1717c A U Thor <thor@committer.au> 1243028201 -0100\\tbranch: change to master\\n\"\n                .getBytes();\n\n        static byte[] headLine = \"3333333333333333333333333333333333333333 3e7549db262d1e836d9bf0af7e22355468f1717c A U Thor <thor@committer.au> 1243028201 -0100\\tbranch: change to HEAD\\n\"\n                .getBytes();\n\n        [Test]\n        public void testReadOneLine()\n        {\n            setupReflog(\"logs/refs/heads/master\", oneLine);\n\n            ReflogReader reader = new ReflogReader(db, \"refs/heads/master\");\n            ReflogReader.Entry e = reader.getLastEntry();\n            Assert.AreEqual(ObjectId\n                    .FromString(\"da85355dfc525c9f6f3927b876f379f46ccf826e\"), e\n                    .getOldId());\n            Assert.AreEqual(ObjectId\n                    .FromString(\"3e7549db262d1e836d9bf0af7e22355468f1717c\"), e\n                    .getNewId());\n            Assert.AreEqual(\"A O Thor Too\", e.getWho().Name);\n            Assert.AreEqual(\"authortoo@wri.tr\", e.getWho().EmailAddress);\n            Assert.AreEqual(120, e.getWho().TimeZoneOffset);\n            Assert.AreEqual(\"2009-05-22T23:36:40\", iso(e.getWho()));\n            Assert.AreEqual(\"commit: Add a toString for debugging to RemoteRefUpdate\",\n                    e.getComment());\n        }\n\n        private string iso(PersonIdent id)\n        {\n            return id.When.MillisToDateTimeOffset(id.TimeZoneOffset).ToIsoDateFormat();\n        }\n\n        [Test]\n        public void testReadTwoLine()\n        {\n            setupReflog(\"logs/refs/heads/master\", twoLine);\n\n            ReflogReader reader = new ReflogReader(db, \"refs/heads/master\");\n            var reverseEntries = reader.getReverseEntries();\n            Assert.AreEqual(2, reverseEntries.Count);\n            ReflogReader.Entry e = reverseEntries[0];\n\n            Assert.AreEqual(ObjectId\n                    .FromString(\"c6734895958052a9dbc396cff4459dc1a25029ab\"), e\n                    .getOldId());\n\n            Assert.AreEqual(ObjectId\n                    .FromString(\"54794942a18a237c57a80719afed44bb78172b10\"), e\n                    .getNewId());\n\n            Assert.AreEqual(\"Same A U Thor\", e.getWho().Name);\n            Assert.AreEqual(\"same.author@example.com\", e.getWho().EmailAddress);\n            Assert.AreEqual(60, e.getWho().TimeZoneOffset);\n            Assert.AreEqual(\"2009-05-22T22:36:42\", iso(e.getWho()));\n            Assert.AreEqual(\n                    \"rebase finished: refs/heads/rr/renamebranch5 onto c6e3b9fe2da0293f11eae202ec35fb343191a82d\",\n                    e.getComment());\n\n            e = reverseEntries[1];\n            Assert.AreEqual(ObjectId\n                    .FromString(\"0000000000000000000000000000000000000000\"), e\n                    .getOldId());\n\n            Assert.AreEqual(ObjectId\n                    .FromString(\"c6734895958052a9dbc396cff4459dc1a25029ab\"), e\n                    .getNewId());\n\n            Assert.AreEqual(\"A U Thor\", e.getWho().Name);\n            Assert.AreEqual(\"thor@committer.au\", e.getWho().EmailAddress);\n            Assert.AreEqual(-60, e.getWho().TimeZoneOffset);\n            Assert.AreEqual(\"2009-05-22T20:36:41\", iso(e.getWho()));\n            Assert.AreEqual(\"branch: Created from rr/renamebranchv4\", e.getComment());\n        }\n\n        [Test]\n        public void testReadWhileAppendIsInProgress()\n        {\n            setupReflog(\"logs/refs/heads/master\", twoLineWithAppendInProgress);\n            ReflogReader reader = new ReflogReader(db, \"refs/heads/master\");\n            var reverseEntries = reader.getReverseEntries();\n            Assert.AreEqual(2, reverseEntries.Count);\n            ReflogReader.Entry e = reverseEntries[0];\n\n            Assert.AreEqual(ObjectId\n                    .FromString(\"c6734895958052a9dbc396cff4459dc1a25029ab\"), e\n                    .getOldId());\n\n            Assert.AreEqual(ObjectId\n                    .FromString(\"54794942a18a237c57a80719afed44bb78172b10\"), e\n                    .getNewId());\n\n            Assert.AreEqual(\"Same A U Thor\", e.getWho().Name);\n            Assert.AreEqual(\"same.author@example.com\", e.getWho().EmailAddress);\n            Assert.AreEqual(60, e.getWho().TimeZoneOffset);\n            Assert.AreEqual(\"2009-05-22T22:36:42\", iso(e.getWho()));\n            Assert.AreEqual(\n                    \"rebase finished: refs/heads/rr/renamebranch5 onto c6e3b9fe2da0293f11eae202ec35fb343191a82d\",\n                    e.getComment());\n            // while similar to testReadTwoLine, we can assume that if we get the last entry\n            // right, everything else is too\n        }\n\n\n        [Test]\n        public void testReadRightLog()\n        {\n            setupReflog(\"logs/refs/heads/a\", aLine);\n            setupReflog(\"logs/refs/heads/master\", masterLine);\n            setupReflog(\"logs/HEAD\", headLine);\n            Assert.AreEqual(\"branch: change to master\", db.ReflogReader(\"master\")\n                    .getLastEntry().getComment());\n            Assert.AreEqual(\"branch: change to a\", db.ReflogReader(\"a\")\n                    .getLastEntry().getComment());\n            Assert.AreEqual(\"branch: change to HEAD\", db.ReflogReader(\"HEAD\")\n                    .getLastEntry().getComment());\n        }\n\n        [Test]\n        public void testNoLog()\n        {\n            Assert.AreEqual(0, db.ReflogReader(\"master\").getReverseEntries().Count);\n            Assert.IsNull(db.ReflogReader(\"master\").getLastEntry());\n        }\n\n        protected void setupReflog(String logName, byte[] data)\n        {\n            var logfile = new FileInfo(Path.Combine(db.Directory.FullName, logName));\n\n            if (!logfile.Directory.Mkdirs() && !logfile.Directory.IsDirectory())\n            {\n                throw new IOException(\n                    \"oops, cannot create the directory for the test reflog file\"\n                    + logfile);\n            }\n\n            File.WriteAllBytes(logfile.FullName, data);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RepositoryCacheTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class RepositoryCacheTest : RepositoryTestCase\n    {\n        [Test]\n        public void testNonBareFileKey()\n        {\n            DirectoryInfo gitdir = db.Directory;\n            DirectoryInfo parent = gitdir.Parent;\n            Assert.IsNotNull(parent);\n\n            var other = new DirectoryInfo(Path.Combine(parent.FullName, \"notagit\"));\n            Assert.AreEqual(gitdir, RepositoryCache.FileKey.exact(gitdir).getFile());\n            Assert.AreEqual(parent, RepositoryCache.FileKey.exact(parent).getFile());\n            Assert.AreEqual(other, RepositoryCache.FileKey.exact(other).getFile());\n\n            Assert.AreEqual(gitdir, RepositoryCache.FileKey.lenient(gitdir).getFile());\n\n            // Test was \"fixed\" because DirectoryInfo.Equals() compares two different references\n            Assert.AreEqual(gitdir.FullName, RepositoryCache.FileKey.lenient(parent).getFile().FullName);\n            Assert.AreEqual(other, RepositoryCache.FileKey.lenient(other).getFile());\n        }\n\n        [Test]\n        public void testBareFileKey()\n        {\n            Core.Repository bare = createBareRepository();\n            DirectoryInfo gitdir = bare.Directory;\n            DirectoryInfo parent = gitdir.Parent;\n            Assert.IsNotNull(parent);\n\n            string name = gitdir.Name;\n            Assert.IsTrue(name.EndsWith(Constants.DOT_GIT_EXT));\n            name = name.Slice(0, name.Length - 4);\n\n            Assert.AreEqual(gitdir, RepositoryCache.FileKey.exact(gitdir).getFile());\n\n            Assert.AreEqual(gitdir, RepositoryCache.FileKey.lenient(gitdir).getFile());\n\n            // Test was \"fixed\" because DirectoryInfo.Equals() compares two different references\n            Assert.AreEqual(gitdir.FullName, RepositoryCache.FileKey.lenient(new DirectoryInfo(Path.Combine(parent.FullName, name))).getFile().FullName);\n        }\n\n        [Test]\n        public void testFileKeyOpenExisting()\n        {\n            using (Core.Repository r = new RepositoryCache.FileKey(db.Directory).open(true))\n            {\n                Assert.IsNotNull(r);\n                Assert.AreEqual(db.Directory.FullName, r.Directory.FullName);\n            }\n\n            using (Core.Repository r = new RepositoryCache.FileKey(db.Directory).open(false))\n            {\n                Assert.IsNotNull(r);\n                Assert.AreEqual(db.Directory.FullName, r.Directory.FullName);\n            }\n        }\n\n        [Test]\n        public void testFileKeyOpenNew()\n        {\n            DirectoryInfo gitdir;\n\n            using (Repository n = createBareRepository())\n            {\n                gitdir = n.Directory;\n            }\n\n            recursiveDelete(gitdir);\n            Assert.IsFalse(Directory.Exists(gitdir.FullName)); // changed from gitdir.Exist in order to work around a Mono bug (cf. DirectoryInfoExist() test method below).\n\n            var e =\n                AssertHelper.Throws<RepositoryNotFoundException>(() => new RepositoryCache.FileKey(gitdir).open(true));\n            Assert.AreEqual(\"repository not found: \" + gitdir, e.Message);\n\n            using (Repository o = new RepositoryCache.FileKey(gitdir).open(false))\n            {\n                Assert.IsNotNull(o);\n                Assert.AreEqual(gitdir.FullName, o.Directory.FullName);\n                Assert.IsFalse(Directory.Exists(gitdir.FullName));  // changed from gitdir.Exist in order to work around a Mono bug (cf. DirectoryInfoExist() test method below).\n            }\n        }\n\n        [Test]\n        public void FileInfoExists()\n        {\n            string filePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n            File.WriteAllText(filePath, \"test\");\n\n            var file = new FileInfo(filePath);\n            Assert.IsTrue(file.Exists, \"File does not exist.\");\n\n            File.Delete(filePath);\n\n            file.Refresh();\n            Assert.IsFalse(file.Exists, \"File exists.\");\n        }\n\n        [Test]\n        public void DirectoryInfoExists()\n        {\n            string dirPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n            Directory.CreateDirectory(dirPath);\n\n            var dir = new DirectoryInfo(dirPath);\n            Assert.IsTrue(dir.Exists, \"Directory does not exist.\");\n\n            Directory.Delete(dirPath);\n\n            dir.Refresh();\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => { var doesExist = dir.Exists; }, \"As identified by nestalk (http://bugzilla.novell.com/show_bug.cgi?id=582667), DirectoryInfo.Refresh() doesn't seem to refresh the Exist property.\");\n            Assert.IsFalse(dir.Exists, \"Directory exists.\");\n        }\n\n\n        [Test]\n        public void testCacheRegisterOpen()\n        {\n            DirectoryInfo dir = db.Directory;\n            RepositoryCache.register(db);\n            using (Core.Repository exact = RepositoryCache.open(RepositoryCache.FileKey.exact(dir)))\n            {\n                Assert.AreSame(db, exact);\n            }\n\n            Assert.IsTrue(dir.Name.EndsWith(Constants.DOT_GIT_EXT));\n            Assert.AreEqual(Constants.DOT_GIT, dir.Name);\n            DirectoryInfo parent = dir.Parent;\n            using (Core.Repository lenient = RepositoryCache.open(RepositoryCache.FileKey.lenient(parent)))\n            {\n                Assert.AreSame(db, lenient);\n            }\n\n            RepositoryCache.close(db);\n        }\n\n        [Test]\n        public void testCacheOpen()\n        {\n            RepositoryCache.FileKey loc = RepositoryCache.FileKey.exact(db.Directory);\n            Core.Repository d2 = RepositoryCache.open(loc);\n            Assert.AreNotSame(db, d2);\n            Assert.AreSame(d2, RepositoryCache.open(RepositoryCache.FileKey.exact(loc.getFile())));\n            d2.Close();\n            d2.Close();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RepositoryConfigTest.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing GitSharp.Core;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class RepositoryConfigTest\n    {\n        [Test]\n        public void test001_ReadBareKey()\n        {\n            global::GitSharp.Core.Config c = parse(\"[foo]\\nbar\\n\");\n            Assert.AreEqual(true, c.getBoolean(\"foo\", null, \"bar\", false));\n            Assert.AreEqual(string.Empty, c.getString(\"foo\", null, \"bar\"));\n        }\n\n        [Test]\n        public void test002_ReadWithSubsection()\n        {\n            global::GitSharp.Core.Config c = parse(\"[foo \\\"zip\\\"]\\nbar\\n[foo \\\"zap\\\"]\\nbar=false\\nn=3\\n\");\n            Assert.AreEqual(true, c.getBoolean(\"foo\", \"zip\", \"bar\", false));\n            Assert.AreEqual(string.Empty, c.getString(\"foo\", \"zip\", \"bar\"));\n            Assert.AreEqual(false, c.getBoolean(\"foo\", \"zap\", \"bar\", true));\n            Assert.AreEqual(\"false\", c.getString(\"foo\", \"zap\", \"bar\"));\n            Assert.AreEqual(3, c.getInt(\"foo\", \"zap\", \"n\", 4));\n            Assert.AreEqual(4, c.getInt(\"foo\", \"zap\", \"m\", 4));\n        }\n\n        [Test]\n        public void test003_PutRemote()\n        {\n            global::GitSharp.Core.Config c = new global::GitSharp.Core.Config();\n            c.setString(\"sec\", \"ext\", \"name\", \"value\");\n            c.setString(\"sec\", \"ext\", \"name2\", \"value2\");\n            string expText = \"[sec \\\"ext\\\"]\\n\\tname = value\\n\\tname2 = value2\\n\";\n            Assert.AreEqual(expText, c.toText());\n        }\n\n        [Test]\n        public void test004_PutGetSimple()\n        {\n            global::GitSharp.Core.Config c = new global::GitSharp.Core.Config();\n            c.setString(\"my\", null, \"somename\", \"false\");\n            Assert.AreEqual(\"false\", c.getString(\"my\", null, \"somename\"));\n            Assert.AreEqual(\"[my]\\n\\tsomename = false\\n\", c.toText());\n        }\n\n        [Test]\n        public void test005_PutGetStringList()\n        {\n            global::GitSharp.Core.Config c = new global::GitSharp.Core.Config();\n            List<string> values = new List<string>();\n            values.Add(\"value1\");\n            values.Add(\"value2\");\n            c.setStringList(\"my\", null, \"somename\", values);\n\n            object[] expArr = values.ToArray();\n            string[] actArr = c.getStringList(\"my\", null, \"somename\");\n            Assert.IsTrue(expArr.SequenceEqual(actArr));\n\n            string expText = \"[my]\\n\\tsomename = value1\\n\\tsomename = value2\\n\";\n            Assert.AreEqual(expText, c.toText());\n        }\n\n        [Test]\n        public void test006_readCaseInsensitive()\n        {\n            global::GitSharp.Core.Config c = parse(\"[Foo]\\nBar\\n\");\n            Assert.AreEqual(true, c.getBoolean(\"foo\", null, \"bar\", false));\n            Assert.AreEqual(string.Empty, c.getString(\"foo\", null, \"bar\"));\n        }\n\n        [Test]\n        public void test007_readUserConfig()\n        {\n            MockSystemReader mockSystemReader = new MockSystemReader();\n            SystemReader.setInstance(mockSystemReader);\n            string hostname = mockSystemReader.getHostname();\n            global::GitSharp.Core.Config userGitConfig = mockSystemReader.openUserConfig();\n            global::GitSharp.Core.Config localConfig = new global::GitSharp.Core.Config(userGitConfig);\n            mockSystemReader.clearProperties();\n\n            string authorName;\n            string authorEmail;\n\n            // no values defined nowhere\n            authorName = localConfig.get(UserConfig.KEY).getAuthorName();\n            authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();\n            Assert.AreEqual(Constants.UNKNOWN_USER_DEFAULT, authorName);\n            Assert.AreEqual(Constants.UNKNOWN_USER_DEFAULT + \"@\" + hostname, authorEmail);\n\n            // the system user name is defined\n            mockSystemReader.setProperty(Constants.OS_USER_NAME_KEY, \"os user name\");\n            localConfig.uncache(UserConfig.KEY);\n            authorName = localConfig.get(UserConfig.KEY).getAuthorName();\n            Assert.AreEqual(\"os user name\", authorName);\n\n            if (hostname != null && hostname.Length != 0)\n            {\n                authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();\n                Assert.AreEqual(\"os user name@\" + hostname, authorEmail);\n            }\n\n            // the git environment variables are defined\n            mockSystemReader.setProperty(Constants.GIT_AUTHOR_NAME_KEY, \"git author name\");\n            mockSystemReader.setProperty(Constants.GIT_AUTHOR_EMAIL_KEY, \"author@email\");\n            localConfig.uncache(UserConfig.KEY);\n            authorName = localConfig.get(UserConfig.KEY).getAuthorName();\n            authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();\n            Assert.AreEqual(\"git author name\", authorName);\n            Assert.AreEqual(\"author@email\", authorEmail);\n\n            // the values are defined in the global configuration\n            userGitConfig.setString(\"user\", null, \"name\", \"global username\");\n            userGitConfig.setString(\"user\", null, \"email\", \"author@globalemail\");\n            authorName = localConfig.get(UserConfig.KEY).getAuthorName();\n            authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();\n            Assert.AreEqual(\"global username\", authorName);\n            Assert.AreEqual(\"author@globalemail\", authorEmail);\n\n            // the values are defined in the local configuration\n            localConfig.setString(\"user\", null, \"name\", \"local username\");\n            localConfig.setString(\"user\", null, \"email\", \"author@localemail\");\n            authorName = localConfig.get(UserConfig.KEY).getAuthorName();\n            authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();\n            Assert.AreEqual(\"local username\", authorName);\n            Assert.AreEqual(\"author@localemail\", authorEmail);\n\n            authorName = localConfig.get(UserConfig.KEY).getCommitterName();\n            authorEmail = localConfig.get(UserConfig.KEY).getCommitterEmail();\n            Assert.AreEqual(\"local username\", authorName);\n            Assert.AreEqual(\"author@localemail\", authorEmail);\n        }\n\n        [Test]\n        public void testReadBoolean_TrueFalse1()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = true\\nb = false\\n\");\n            Assert.AreEqual(\"true\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"false\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadBoolean_TrueFalse2()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = TrUe\\nb = fAlSe\\n\");\n            Assert.AreEqual(\"TrUe\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"fAlSe\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadBoolean_YesNo1()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = yes\\nb = no\\n\");\n            Assert.AreEqual(\"yes\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"no\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadBoolean_YesNo2()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = yEs\\nb = NO\\n\");\n            Assert.AreEqual(\"yEs\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"NO\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadBoolean_OnOff1()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = on\\nb = off\\n\");\n            Assert.AreEqual(\"on\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"off\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadBoolean_OnOff2()\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = ON\\nb = OFF\\n\");\n            Assert.AreEqual(\"ON\", c.getString(\"s\", null, \"a\"));\n            Assert.AreEqual(\"OFF\", c.getString(\"s\", null, \"b\"));\n\n            Assert.IsTrue(c.getBoolean(\"s\", \"a\", false));\n            Assert.IsFalse(c.getBoolean(\"s\", \"b\", true));\n        }\n\n        [Test]\n        public void testReadLong()\n        {\n            assertReadLong(1L);\n            assertReadLong(-1L);\n            assertReadLong(long.MinValue);\n            assertReadLong(long.MaxValue);\n            assertReadLong(4L * 1024 * 1024 * 1024, \"4g\");\n            assertReadLong(3L * 1024 * 1024, \"3 m\");\n            assertReadLong(8L * 1024, \"8 k\");\n\n            try\n            {\n                assertReadLong(-1, \"1.5g\");\n                Assert.Fail(\"incorrectly accepted 1.5g\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Invalid long value: s.a=1.5g\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testBooleanWithNoValue()\n        {\n            global::GitSharp.Core.Config c = parse(\"[my]\\n\\tempty\\n\");\n            Assert.AreEqual(\"\", c.getString(\"my\", null, \"empty\"));\n            Assert.AreEqual(1, c.getStringList(\"my\", null, \"empty\").Length);\n            Assert.AreEqual(\"\", c.getStringList(\"my\", null, \"empty\")[0]);\n            Assert.IsTrue(c.getBoolean(\"my\", \"empty\", false));\n            Assert.AreEqual(\"[my]\\n\\tempty\\n\", c.toText());\n        }\n\n        [Test]\n        public void testEmptyString()\n        {\n            global::GitSharp.Core.Config c = parse(\"[my]\\n\\tempty =\\n\");\n            Assert.IsNull(c.getString(\"my\", null, \"empty\"));\n\n            String[] values = c.getStringList(\"my\", null, \"empty\");\n            Assert.IsNotNull(values);\n            Assert.AreEqual(1, values.Length);\n            Assert.IsNull(values[0]);\n\n            // always matches the default, because its non-boolean\n            Assert.IsTrue(c.getBoolean(\"my\", \"empty\", true));\n            Assert.IsFalse(c.getBoolean(\"my\", \"empty\", false));\n\n            Assert.AreEqual(\"[my]\\n\\tempty =\\n\", c.toText());\n\n            c = new global::GitSharp.Core.Config();\n            c.setStringList(\"my\", null, \"empty\", values.ToList());\n            Assert.AreEqual(\"[my]\\n\\tempty =\\n\", c.toText());\n        }\n\n        [Test]\n        public void testUnsetBranchSection()\n        {\n            global::GitSharp.Core.Config c = parse(\"\"\n            + \"[branch \\\"keep\\\"]\\n\"\n            + \"  merge = master.branch.to.keep.in.the.file\\n\"\n            + \"\\n\"\n            + \"[branch \\\"remove\\\"]\\n\"\n            + \"  merge = this.will.get.deleted\\n\"\n            + \"  remote = origin-for-some-long-gone-place\\n\"\n            + \"\\n\"\n            + \"[core-section-not-to-remove-in-test]\\n\"\n            + \"  packedGitLimit = 14\\n\");\n            c.unsetSection(\"branch\", \"does.not.exist\");\n            c.unsetSection(\"branch\", \"remove\");\n            Assert.AreEqual(\"\" //\n                    + \"[branch \\\"keep\\\"]\\n\"\n                    + \"  merge = master.branch.to.keep.in.the.file\\n\"\n                    + \"\\n\"\n                    + \"[core-section-not-to-remove-in-test]\\n\"\n                    + \"  packedGitLimit = 14\\n\", c.toText());\n        }\n\n        [Test]\n        public void testUnsetSingleSection()\n        {\n            global::GitSharp.Core.Config c = parse(\"\" //\n                    + \"[branch \\\"keep\\\"]\\n\"\n                    + \"  merge = master.branch.to.keep.in.the.file\\n\"\n                    + \"\\n\"\n                    + \"[single]\\n\"\n                    + \"  merge = this.will.get.deleted\\n\"\n                    + \"  remote = origin-for-some-long-gone-place\\n\"\n                    + \"\\n\"\n                    + \"[core-section-not-to-remove-in-test]\\n\"\n                    + \"  packedGitLimit = 14\\n\");\n            c.unsetSection(\"single\", null);\n            Assert.AreEqual(\"\" //\n                    + \"[branch \\\"keep\\\"]\\n\"\n                    + \"  merge = master.branch.to.keep.in.the.file\\n\"\n                    + \"\\n\"\n                    + \"[core-section-not-to-remove-in-test]\\n\"\n                    + \"  packedGitLimit = 14\\n\", c.toText());\n        }\n        private void assertReadLong(long exp)\n        {\n            assertReadLong(exp, exp.ToString());\n        }\n\n        private void assertReadLong(long exp, string act)\n        {\n            global::GitSharp.Core.Config c = parse(\"[s]\\na = \" + act + \"\\n\");\n            Assert.AreEqual(exp, c.getLong(\"s\", null, \"a\", 0L));\n        }\n\n        private global::GitSharp.Core.Config parse(string content)\n        {\n            var c = new global::GitSharp.Core.Config(null);\n            c.fromText(content);\n            return c;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RepositoryTestCase.cs",
    "content": "/*\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing NUnit.Framework;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Tests\n{\n\n    /**\n     * Base class for most unit tests.\n     *\n     * Sets up a predefined test repository and has support for creating additional\n     * repositories and destroying them when the tests are finished.\n     */\n    public abstract class RepositoryTestCase : LocalDiskRepositoryTestCase\n    {\n        /** Test repository, initialized for this test case. */\n        protected Core.Repository db;\n\n\n        /// <summary>\n        /// mock user's global configuration used instead ~/.gitconfig.\n        /// This configuration can be modified by the tests without any\n        /// effect for ~/.gitconfig.\n        /// </summary>\n        protected RepositoryConfig userGitConfig;\n\n        protected FileInfo writeTrashFile(string name, string data)\n        {\n            var path = new FileInfo(Path.Combine(db.WorkingDirectory.FullName, name));\n    \t\twrite(path, data);\n\t    \treturn path;\n        }\n\n        protected static void checkFile(FileInfo f, string checkData)\n        {\n            var readData = File.ReadAllText(f.FullName, Charset.forName(\"ISO-8859-1\"));\n\n            if (checkData.Length != readData.Length)\n            {\n                throw new IOException(\"Internal error reading file data from \" + f);\n            }\n\n            Assert.AreEqual(checkData, readData);\n        }\n\n       \t/** Working directory of {@link #db}. */\n    \tprotected DirectoryInfo trash;\n\n        public override void setUp()\n        {\n            base.setUp();\n\n            db = createWorkRepository();\n            trash = db.WorkingDirectory;\n        }\n\n        protected static void CopyDirectory(string sourceDirectoryPath, string targetDirectoryPath)\n        {\n            if (!targetDirectoryPath.EndsWith(Path.DirectorySeparatorChar.ToString()))\n            {\n                targetDirectoryPath += Path.DirectorySeparatorChar;\n            }\n\n            if (!Directory.Exists(targetDirectoryPath))\n            {\n                Directory.CreateDirectory(targetDirectoryPath);\n            }\n\n            string[] files = Directory.GetFileSystemEntries(sourceDirectoryPath);\n\n            foreach (string fileSystemElement in files)\n            {\n                if (Directory.Exists(fileSystemElement))\n                {\n                    CopyDirectory(fileSystemElement, targetDirectoryPath + Path.GetFileName(fileSystemElement));\n                    continue;\n                }\n\n                File.Copy(fileSystemElement, targetDirectoryPath + Path.GetFileName(fileSystemElement), true);\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/AlwaysEmptyRevQueueTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n\t[TestFixture]\n\tpublic class AlwaysEmptyRevQueueTest : RevWalkTestCase\n\t{\n\t\tprivate readonly AbstractRevQueue _q = AbstractRevQueue.EmptyQueue;\n\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n\t\t\tAssert.IsNull(_q.next());\n\t\t\tAssert.IsTrue(_q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n\t\t\tAssert.IsFalse(_q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n\t\t\tAssert.AreEqual(Generator.GeneratorOutputType.None, _q.OutputType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testClear()\n\t\t{\n\t\t\t_q.clear();\n\t\t\ttestEmpty();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAddFails()\n\t\t{\n\t\t\tAssertHelper.Throws<InvalidOperationException>(() => _q.add(Commit()));\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/DateRevQueueTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class DateRevQueueTest : RevQueueTestCase<DateRevQueue>\n    {\n        protected override DateRevQueue create()\n        {\n            return new DateRevQueue();\n        }\n\n        [Test]\n        public override void testEmpty()\n        {\n            base.testEmpty();\n            Assert.IsNull(q.peek());\n            Assert.AreEqual(Generator.GeneratorOutputType.SortCommitTimeDesc, q.OutputType);\n        }\n\n        [Test]\n        public void testCloneEmpty()\n        {\n            q = new DateRevQueue(AbstractRevQueue.EmptyQueue);\n            Assert.IsNull(q.next());\n        }\n\n        [Test]\n        public void testInsertOutOfOrder()\n        {\n            RevCommit a = parseBody(Commit());\n            RevCommit b = parseBody(Commit(10, a));\n            RevCommit c1 = parseBody(Commit(5, b));\n            RevCommit c2 = parseBody(Commit(-50, b));\n\n            q.add(c2);\n            q.add(a);\n            q.add(b);\n            q.add(c1);\n\n            AssertCommit(c1, q.next());\n            AssertCommit(b, q.next());\n            AssertCommit(a, q.next());\n            AssertCommit(c2, q.next());\n            Assert.IsNull(q.next());\n        }\n\n        [Test]\n        public void testInsertTie()\n        {\n            RevCommit a = parseBody(Commit());\n            RevCommit b = parseBody(Commit(0, a));\n            {\n                q = create();\n                q.add(a);\n                q.add(b);\n\n                AssertCommit(a, q.next());\n                AssertCommit(b, q.next());\n                Assert.IsNull(q.next());\n            }\n            {\n                q = create();\n                q.add(b);\n                q.add(a);\n\n                AssertCommit(b, q.next());\n                AssertCommit(a, q.next());\n                Assert.IsNull(q.next());\n            }\n        }\n\n        [Test]\n        public void testCloneFIFO()\n        {\n            RevCommit a = parseBody(Commit());\n            RevCommit b = parseBody(Commit(200, a));\n            RevCommit c = parseBody(Commit(200, b));\n\n            var src = new FIFORevQueue();\n            src.add(a);\n            src.add(b);\n            src.add(c);\n\n            q = new DateRevQueue(src);\n            Assert.IsFalse(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            Assert.IsFalse(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            AssertCommit(c, q.peek());\n            AssertCommit(c, q.peek());\n\n            AssertCommit(c, q.next());\n            AssertCommit(b, q.next());\n            AssertCommit(a, q.next());\n            Assert.IsNull(q.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/FIFORevQueueTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class FIFORevQueueTest : RevQueueTestCase<FIFORevQueue>\n    {\n        protected override FIFORevQueue create()\n        {\n            return new FIFORevQueue();\n        }\n\n        [Test]\n        public override void testEmpty()\n        {\n            base.testEmpty();\n\t\t\tAssert.AreEqual(Generator.GeneratorOutputType.None, q.OutputType);\n        }\n\n        [Test]\n        public void testCloneEmpty()\n        {\n            q = new FIFORevQueue(AbstractRevQueue.EmptyQueue);\n            Assert.IsNull(q.next());\n        }\n\n        [Test]\n        public void testAddLargeBlocks()\n        {\n            var lst = new List<RevCommit>();\n            for (int i = 0; i < 3*BlockRevQueue.Block.BLOCK_SIZE; i++)\n            {\n                RevCommit c = Commit();\n                lst.Add(c);\n                q.add(c);\n            }\n            for (int i = 0; i < lst.Count; i++)\n                Assert.AreSame(lst[i], q.next());\n        }\n\n        [Test]\n        public void testUnpopAtFront()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit();\n            RevCommit c = Commit();\n\n            q.add(a);\n            q.unpop(b);\n            q.unpop(c);\n\n            Assert.AreSame(c, q.next());\n            Assert.AreSame(b, q.next());\n            Assert.AreSame(a, q.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/FooterLineTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n\t[TestFixture]\n\tpublic class FooterLineTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void testNoFooters_EmptyBody()\n\t\t{\n\t\t\tRevCommit commit = Parse(string.Empty);\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoFooters_NewlineOnlyBody1()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoFooters_NewlineOnlyBody5()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"\\n\\n\\n\\n\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoFooters_OneLineBodyNoLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"this is a commit\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoFooters_OneLineBodyWithLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"this is a commit\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoFooters_ShortBodyNoLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testNoFooters_ShortBodyWithLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(0, footers.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSignedOffBy_OneUserNoLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Signed-off-by: A. U. Thor <a@example.com>\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"a@example.com\", f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSignedOffBy_OneUserWithLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Signed-off-by: A. U. Thor <a@example.com>\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"a@example.com\", f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSignedOffBy_IgnoreWhitespace()\n\t\t{\n\t\t\t// We only ignore leading whitespace on the value, trailing\n\t\t\t// is assumed part of the value.\n\t\t\t//\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Signed-off-by:   A. U. Thor <a@example.com>  \\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>  \", f.Value);\n\t\t\tAssert.AreEqual(\"a@example.com\", f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEmptyValueNoLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Signed-off-by:\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(string.Empty, f.Value);\n\t\t\tAssert.IsNull(f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEmptyValueWithLF()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Signed-off-by:\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(string.Empty, f.Value);\n\t\t\tAssert.IsNull(f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testShortKey()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"K:V\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"K\", f.Key);\n\t\t\tAssert.AreEqual(\"V\", f.Value);\n\t\t\tAssert.IsNull(f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNonDelimtedEmail()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Acked-by: re@example.com\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Acked-by\", f.Key);\n\t\t\tAssert.AreEqual(\"re@example.com\", f.Value);\n\t\t\tAssert.AreEqual(\"re@example.com\", f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNotEmail()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"\\n\" + \"Acked-by: Main Tain Er\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(1, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Acked-by\", f.Key);\n\t\t\tAssert.AreEqual(\"Main Tain Er\", f.Value);\n\t\t\tAssert.IsNull(f.getEmailAddress());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void testSignedOffBy_ManyUsers()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"Not-A-Footer-Line: this line must not be read as a footer\\n\" + \"\\n\" + \"Signed-off-by: A. U. Thor <a@example.com>\\n\" + \"CC:            <some.mailing.list@example.com>\\n\" + \"Acked-by: Some Reviewer <sr@example.com>\\n\" + \"Signed-off-by: Main Tain Er <mte@example.com>\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(4, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"a@example.com\", f.getEmailAddress());\n\n\t\t\tf = footers[1];\n\t\t\tAssert.AreEqual(\"CC\", f.Key);\n\t\t\tAssert.AreEqual(\"<some.mailing.list@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"some.mailing.list@example.com\", f.getEmailAddress());\n\n\t\t\tf = footers[2];\n\t\t\tAssert.AreEqual(\"Acked-by\", f.Key);\n\t\t\tAssert.AreEqual(\"Some Reviewer <sr@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"sr@example.com\", f.getEmailAddress());\n\n\t\t\tf = footers[3];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"Main Tain Er <mte@example.com>\", f.Value);\n\t\t\tAssert.AreEqual(\"mte@example.com\", f.getEmailAddress());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSignedOffBy_SkipNonFooter()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"Not-A-Footer-Line: this line must not be read as a footer\\n\" + \"\\n\" + \"Signed-off-by: A. U. Thor <a@example.com>\\n\" + \"CC:            <some.mailing.list@example.com>\\n\" + \"not really a footer line but we'll skip it anyway\\n\" + \"Acked-by: Some Reviewer <sr@example.com>\\n\" + \"Signed-off-by: Main Tain Er <mte@example.com>\\n\");\n\t\t\tIList<FooterLine> footers = commit.GetFooterLines();\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(4, footers.Count);\n\n\t\t\tFooterLine f = footers[0];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>\", f.Value);\n\n\t\t\tf = footers[1];\n\t\t\tAssert.AreEqual(\"CC\", f.Key);\n\t\t\tAssert.AreEqual(\"<some.mailing.list@example.com>\", f.Value);\n\n\t\t\tf = footers[2];\n\t\t\tAssert.AreEqual(\"Acked-by\", f.Key);\n\t\t\tAssert.AreEqual(\"Some Reviewer <sr@example.com>\", f.Value);\n\n\t\t\tf = footers[3];\n\t\t\tAssert.AreEqual(\"Signed-off-by\", f.Key);\n\t\t\tAssert.AreEqual(\"Main Tain Er <mte@example.com>\", f.Value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testFilterFootersIgnoreCase()\n\t\t{\n\t\t\tRevCommit commit = Parse(\"subject\\n\\nbody of commit\\n\" + \"Not-A-Footer-Line: this line must not be read as a footer\\n\" + \"\\n\" + \"Signed-Off-By: A. U. Thor <a@example.com>\\n\" + \"CC:            <some.mailing.list@example.com>\\n\" + \"Acked-by: Some Reviewer <sr@example.com>\\n\" + \"signed-off-by: Main Tain Er <mte@example.com>\\n\");\n\t\t\tIList<string> footers = commit.GetFooterLines(\"signed-off-by\");\n\n\t\t\tAssert.IsNotNull(footers);\n\t\t\tAssert.AreEqual(2, footers.Count);\n\n\t\t\tAssert.AreEqual(\"A. U. Thor <a@example.com>\", footers[0]);\n\t\t\tAssert.AreEqual(\"Main Tain Er <mte@example.com>\", footers[1]);\n\t\t}\n\n\t\tprivate RevCommit Parse(string msg)\n\t\t{\n\t\t\tvar buf = new StringBuilder();\n\t\t\tbuf.Append(\"tree \" + ObjectId.ZeroId.Name + \"\\n\");\n\t\t\tbuf.Append(\"author A. U. Thor <a@example.com> 1 +0000\\n\");\n\t\t\tbuf.Append(\"committer A. U. Thor <a@example.com> 1 +0000\\n\");\n\t\t\tbuf.Append(\"\\n\");\n\t\t\tbuf.Append(msg);\n\n\t\t\tvar walk = new GitSharp.Core.RevWalk.RevWalk(db);\n\t\t\twalk.setRetainBody(true);\n\t\t\tvar c = new RevCommit(ObjectId.ZeroId);\n\t\t\tc.parseCanonical(walk, Constants.encode(buf.ToString()));\n\t\t\treturn c;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/LIFORevQueueTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class LIFORevQueueTest : RevQueueTestCase<LIFORevQueue>\n    {\n        protected override LIFORevQueue create()\n        {\n            return new LIFORevQueue();\n        }\n\n        [Test]\n        public override void testEmpty()\n        {\n            base.testEmpty();\n\t\t\tAssert.AreEqual(Generator.GeneratorOutputType.None, q.OutputType);\n        }\n\n        [Test]\n        public void testCloneEmpty()\n        {\n            q = new LIFORevQueue(AbstractRevQueue.EmptyQueue);\n            Assert.IsNull(q.next());\n        }\n\n        [Test]\n        public void testAddLargeBlocks()\n        {\n            var lst = new List<RevCommit>();\n            for (int i = 0; i < 3*BlockRevQueue.Block.BLOCK_SIZE; i++)\n            {\n                RevCommit c = Commit();\n                lst.Add(c);\n                q.add(c);\n            }\n\n            lst.Reverse();\n            for (int i = 0; i < lst.Count; i++)\n            {\n            \tAssert.AreSame(lst[i], q.next());\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/ObjectWalkTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Tests.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.RevWalk\n{\n    [TestFixture]\n    public class ObjectWalkTest : RevWalkTestCase\n    {\n        protected ObjectWalk objw;\n\n        protected override global::GitSharp.Core.RevWalk.RevWalk createRevWalk()\n        {\n            return objw = new ObjectWalk(db);\n        }\n\n        [Test]\n        public void testNoCommits()\n        {\n            Assert.IsNull(objw.next());\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testTwoCommitsEmptyTree()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            MarkStart(b);\n\n            AssertCommit(b, objw.next());\n            AssertCommit(a, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(tree(), objw.nextObject());\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testOneCommitOneTreeTwoBlob()\n        {\n            RevBlob f0 = blob(\"0\");\n            RevBlob f1 = blob(\"1\");\n            RevTree t = tree(File(\"0\", f0), File(\"1\", f1), File(\"2\", f1));\n            RevCommit a = Commit(t);\n            MarkStart(a);\n\n            AssertCommit(a, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(t, objw.nextObject());\n            Assert.AreSame(f0, objw.nextObject());\n            Assert.AreSame(f1, objw.nextObject());\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testTwoCommitTwoTreeTwoBlob()\n        {\n            RevBlob f0 = blob(\"0\");\n            RevBlob f1 = blob(\"1\");\n            RevBlob f2 = blob(\"0v2\");\n            RevTree ta = tree(File(\"0\", f0), File(\"1\", f1), File(\"2\", f1));\n            RevTree tb = tree(File(\"0\", f2), File(\"1\", f1), File(\"2\", f1));\n            RevCommit a = Commit(ta);\n            RevCommit b = Commit(tb, a);\n            MarkStart(b);\n\n            AssertCommit(b, objw.next());\n            AssertCommit(a, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(tb, objw.nextObject());\n            Assert.AreSame(f2, objw.nextObject());\n            Assert.AreSame(f1, objw.nextObject());\n\n            Assert.AreSame(ta, objw.nextObject());\n            Assert.AreSame(f0, objw.nextObject());\n\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testTwoCommitDeepTree1()\n        {\n            RevBlob f0 = blob(\"0\");\n            RevBlob f1 = blob(\"0v2\");\n            RevTree ta = tree(File(\"a/b/0\", f0));\n            RevTree tb = tree(File(\"a/b/1\", f1));\n            RevCommit a = Commit(ta);\n            RevCommit b = Commit(tb, a);\n            MarkStart(b);\n\n            AssertCommit(b, objw.next());\n            AssertCommit(a, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(tb, objw.nextObject());\n            Assert.AreSame(get(tb, \"a\"), objw.nextObject());\n            Assert.AreSame(get(tb, \"a/b\"), objw.nextObject());\n            Assert.AreSame(f1, objw.nextObject());\n\n            Assert.AreSame(ta, objw.nextObject());\n            Assert.AreSame(get(ta, \"a\"), objw.nextObject());\n            Assert.AreSame(get(ta, \"a/b\"), objw.nextObject());\n            Assert.AreSame(f0, objw.nextObject());\n\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testTwoCommitDeepTree2()\n        {\n            RevBlob f1 = blob(\"1\");\n            RevTree ta = tree(File(\"a/b/0\", f1), File(\"a/c/q\", f1));\n            RevTree tb = tree(File(\"a/b/1\", f1), File(\"a/c/q\", f1));\n            RevCommit a = Commit(ta);\n            RevCommit b = Commit(tb, a);\n            MarkStart(b);\n\n            AssertCommit(b, objw.next());\n            AssertCommit(a, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(tb, objw.nextObject());\n            Assert.AreSame(get(tb, \"a\"), objw.nextObject());\n            Assert.AreSame(get(tb, \"a/b\"), objw.nextObject());\n            Assert.AreSame(f1, objw.nextObject());\n            Assert.AreSame(get(tb, \"a/c\"), objw.nextObject());\n\n            Assert.AreSame(ta, objw.nextObject());\n            Assert.AreSame(get(ta, \"a\"), objw.nextObject());\n            Assert.AreSame(get(ta, \"a/b\"), objw.nextObject());\n\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testCull()\n        {\n            RevBlob f1 = blob(\"1\");\n            RevBlob f2 = blob(\"2\");\n            RevBlob f3 = blob(\"3\");\n            RevBlob f4 = blob(\"4\");\n\n            RevTree ta = tree(File(\"a/1\", f1), File(\"c/3\", f3));\n            RevCommit a = Commit(ta);\n\n            RevTree tb = tree(File(\"a/1\", f2), File(\"c/3\", f3));\n            RevCommit b1 = Commit(tb, a);\n            RevCommit b2 = Commit(tb, b1);\n\n            RevTree tc = tree(File(\"a/1\", f4));\n            RevCommit c1 = Commit(tc, a);\n            RevCommit c2 = Commit(tc, c1);\n\n            MarkStart(b2);\n            MarkUninteresting(c2);\n\n            AssertCommit(b2, objw.next());\n            AssertCommit(b1, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.IsTrue(a.has(RevFlag.UNINTERESTING));\n            Assert.IsTrue(ta.has(RevFlag.UNINTERESTING));\n            Assert.IsTrue(f1.has(RevFlag.UNINTERESTING));\n            Assert.IsTrue(f3.has(RevFlag.UNINTERESTING));\n\n            Assert.AreSame(tb, objw.nextObject());\n            Assert.AreSame(get(tb, \"a\"), objw.nextObject());\n            Assert.AreSame(f2, objw.nextObject());\n            Assert.IsNull(objw.nextObject());\n        }\n\n        [Test]\n        public void testEmptyTreeCorruption()\n        {\n            ObjectId bId = ObjectId.FromString(\"abbbfafe3129f85747aba7bfac992af77134c607\");\n            RevTree tree_root, tree_A, tree_AB;\n            RevCommit b;\n            {\n                global::GitSharp.Core.Tree root = new global::GitSharp.Core.Tree(db);\n                global::GitSharp.Core.Tree A = root.AddTree(\"A\");\n                FileTreeEntry B = root.AddFile(\"B\");\n                B.Id = (bId);\n\n                global::GitSharp.Core.Tree A_A = A.AddTree(\"A\");\n                global::GitSharp.Core.Tree A_B = A.AddTree(\"B\");\n\n                var ow = new ObjectWriter(db);\n                A_A.Id = (ow.WriteTree(A_A));\n                A_B.Id = (ow.WriteTree(A_B));\n                A.Id = (ow.WriteTree(A));\n                root.Id = (ow.WriteTree(root));\n\n                tree_root = rw.parseTree(root.Id);\n                tree_A = rw.parseTree(A.Id);\n                tree_AB = rw.parseTree(A_A.Id);\n                Assert.AreSame(tree_AB, rw.parseTree(A_B.Id));\n                b = Commit(rw.parseTree(root.Id));\n            }\n\n            MarkStart(b);\n\n            AssertCommit(b, objw.next());\n            Assert.IsNull(objw.next());\n\n            Assert.AreSame(tree_root, objw.nextObject());\n            Assert.AreSame(tree_A, objw.nextObject());\n            Assert.AreSame(tree_AB, objw.nextObject());\n            Assert.AreSame(rw.lookupBlob(bId), objw.nextObject());\n            Assert.IsNull(objw.nextObject());\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevCommitParseTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevCommitParseTest : RepositoryTestCase\n    {\n        [Test]\n        public void testParse_NoParents()\n        {\n            ObjectId treeId = id(\"9788669ad918b6fcce64af8882fc9a81cb6aba67\");\n            const string authorName = \"A U. Thor\";\n            const string authorEmail = \"a_u_thor@example.com\";\n            const int authorTime = 1218123387;\n\n            const string committerName = \"C O. Miter\";\n            const string committerEmail = \"comiter@example.com\";\n            const int committerTime = 1218123390;\n            var body = new StringBuilder();\n\n            body.Append(\"tree \");\n            body.Append(treeId.Name);\n            body.Append(\"\\n\");\n\n            body.Append(\"author \");\n            body.Append(authorName);\n            body.Append(\" <\");\n            body.Append(authorEmail);\n            body.Append(\"> \");\n            body.Append(authorTime);\n            body.Append(\" +0700\\n\");\n\n            body.Append(\"committer \");\n            body.Append(committerName);\n            body.Append(\" <\");\n            body.Append(committerEmail);\n            body.Append(\"> \");\n            body.Append(committerTime);\n            body.Append(\" -0500\\n\");\n\n            body.Append(\"\\n\");\n\n            var rw = new GitSharp.Core.RevWalk.RevWalk(db);\n\n        \tvar c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n            Assert.IsNull(c.Tree);\n            Assert.IsNull(c.Parents);\n\n            c.parseCanonical(rw, body.ToString().getBytes(\"UTF-8\"));\n            Assert.IsNotNull(c.Tree);\n            Assert.AreEqual(treeId, c.Tree.getId());\n            Assert.AreSame(rw.lookupTree(treeId), c.Tree);\n\n            Assert.IsNotNull(c.Parents);\n            Assert.AreEqual(0, c.Parents.Length);\n            Assert.AreEqual(string.Empty, c.getFullMessage());\n\n            PersonIdent cAuthor = c.getAuthorIdent();\n            Assert.IsNotNull(cAuthor);\n            Assert.AreEqual(authorName, cAuthor.Name);\n            Assert.AreEqual(authorEmail, cAuthor.EmailAddress);\n\n            PersonIdent cCommitter = c.getCommitterIdent();\n            Assert.IsNotNull(cCommitter);\n            Assert.AreEqual(committerName, cCommitter.Name);\n            Assert.AreEqual(committerEmail, cCommitter.EmailAddress);\n        }\n\n        private RevCommit create(string msg)\n        {\n            var b = new StringBuilder();\n            b.Append(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\");\n            b.Append(\"author A U. Thor <a_u_thor@example.com> 1218123387 +0700\\n\");\n            b.Append(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\");\n            b.Append(\"\\n\");\n            b.Append(msg);\n\n        \tvar c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n\n            c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), b.ToString().getBytes(\"UTF-8\"));\n            return c;\n        }\n\n        [Test]\n        public void testParse_WeirdHeaderOnlyCommit()\n        {\n            var b = new StringBuilder();\n            b.Append(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\");\n            b.Append(\"author A U. Thor <a_u_thor@example.com> 1218123387 +0700\\n\");\n            b.Append(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\");\n\n        \tvar c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n\n            c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), b.ToString().getBytes(\"UTF-8\"));\n\n            Assert.AreEqual(string.Empty, c.getFullMessage());\n            Assert.AreEqual(string.Empty, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_implicit_UTF8_encoded()\n        {\n            RevCommit c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"author F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Sm\\u00f6rg\\u00e5sbord\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n                c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\")); // bogus id\n                c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), ((MemoryStream) b.BaseStream).ToArray());\n            }\n\n            Assert.AreSame(Constants.CHARSET, c.Encoding);\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getAuthorIdent().Name);\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\", c.getShortMessage());\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\\n\\n\\u304d\\u308c\\u3044\\n\", c.getFullMessage());\n        }\n\n        [Test]\n        public void testParse_implicit_mixed_encoded()\n        {\n            RevCommit c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"author F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"ISO-8859-1\"));\n                b.Write(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Sm\\u00f6rg\\u00e5sbord\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\")); // bogus id\n                c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), ((MemoryStream) b.BaseStream).ToArray());\n            }\n\n            Assert.AreSame(Constants.CHARSET, c.Encoding);\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => Assert.AreEqual(\"F\\u00f6r fattare\", c.getAuthorIdent().Name), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=549914\");\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\", c.getShortMessage());\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\\n\\n\\u304d\\u308c\\u3044\\n\", c.getFullMessage());\n        }\n\n        /// <summary>\n\t\t/// Test parsing of a commit whose encoding is given and works.\n        /// </summary>\n        [Test]\n        public void testParse_explicit_encoded()\n        {\n            Assert.Ignore(\"We are going to deal with encoding problems later. For now, they are only disturbing the build.\");\n            RevCommit c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"author F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"encoding euc_JP\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"Hi\\n\".getBytes(\"EUC-JP\"));\n\n                c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\")); // bogus id\n                c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), ((MemoryStream) b.BaseStream).ToArray());\n            }\n            Assert.AreEqual(\"EUC-JP\", c.Encoding.WebName.ToUpperInvariant()); //Hacked as Windows uses a lowercased naming convention\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getAuthorIdent().Name);\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n\t\t/// <summary>\n\t\t/// This is a twisted case, but show what we expect here. We can revise the\n\t\t/// expectations provided this case is updated.\n\t\t/// \n\t\t/// What happens here is that an encoding us given, but data is not encoded\n\t\t/// that way (and we can detect it), so we try other encodings.\n\t\t/// </summary>\n        [Test]\n        public void testParse_explicit_bad_encoded()\n        {\n            RevCommit c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"author F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"ISO-8859-1\"));\n                b.Write(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"encoding EUC-JP\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Hi\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\")); // bogus id\n                c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), ((MemoryStream) b.BaseStream).ToArray());\n            }\n\n            Assert.AreEqual(\"EUC-JP\", c.Encoding.WebName.ToUpperInvariant()); //Hacked as Windows uses a lowercased naming convention\n\t\t    AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => Assert.AreEqual(\"F\\u00f6r fattare\", c.getAuthorIdent().Name), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=547902\");\n\t\t    Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n        /// <summary>\n        /// This is a twisted case too, but show what we expect here. We can revise the\n\t\t/// expectations provided this case is updated.\n\t\t/// \n\t\t/// What happens here is that an encoding us given, but data is not encoded\n\t\t/// that way (and we can detect it), so we try other encodings. Here data could\n\t\t/// actually be decoded in the stated encoding, but we override using UTF-8.\n        /// </summary>\n        [Test]\n        public void testParse_explicit_bad_encoded2()\n        {\n            RevCommit c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"author F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"committer C O. Miter <c@example.com> 1218123390 -0500\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"encoding ISO-8859-1\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Hi\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevCommit(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\")); // bogus id\n                c.parseCanonical(new GitSharp.Core.RevWalk.RevWalk(db), ((MemoryStream) b.BaseStream).ToArray());\n            }\n\n            Assert.AreEqual(\"ISO-8859-1\", c.Encoding.WebName.ToUpperInvariant()); //Hacked as Windows uses a lowercased naming convention\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getAuthorIdent().Name);\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n        [Test]\n        public void testParse_NoMessage()\n        {\n            string msg = string.Empty;\n            RevCommit c = create(msg);\n            Assert.AreEqual(msg, c.getFullMessage());\n            Assert.AreEqual(msg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_OnlyLFMessage()\n        {\n            RevCommit c = create(\"\\n\");\n            Assert.AreEqual(\"\\n\", c.getFullMessage());\n            Assert.AreEqual(string.Empty, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyNoLF()\n        {\n            const string shortMsg = \"This is a short message.\";\n            RevCommit c = create(shortMsg);\n            Assert.AreEqual(shortMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEndLF()\n        {\n            const string shortMsg = \"This is a short message.\";\n            const string fullMsg = shortMsg + \"\\n\";\n            RevCommit c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEmbeddedLF()\n        {\n            const string fullMsg = \"This is a\\nshort message.\";\n            string shortMsg = fullMsg.Replace('\\n', ' ');\n            RevCommit c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEmbeddedAndEndingLF()\n        {\n            const string fullMsg = \"This is a\\nshort message.\\n\";\n            const string shortMsg = \"This is a short message.\";\n            RevCommit c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_GitStyleMessage()\n        {\n            const string shortMsg = \"This fixes a bug.\";\n            const string body = \"We do it with magic and pixie dust and stuff.\\n\"\n                                + \"\\n\" + \"Signed-off-by: A U. Thor <author@example.com>\\n\";\n            const string fullMsg = shortMsg + \"\\n\" + \"\\n\" + body;\n            RevCommit c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        private static ObjectId id(string str)\n        {\n            return ObjectId.FromString(str);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevFlagSetTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n\t[TestFixture]\n\tpublic class RevFlagSetTest : RevWalkTestCase\n\t{\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n\t\t\tvar flagSet = new RevFlagSet();\n\t\t\tAssert.AreEqual(0, flagSet.Mask);\n\t\t\tAssert.AreEqual(0, flagSet.Count);\n\t\t\tAssert.IsNotNull(flagSet.GetEnumerator());\n\t\t\tAssert.IsFalse(flagSet.GetEnumerator().MoveNext());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAddOne()\n\t\t{\n\t\t\tconst string flagName = \"flag\";\n\t\t\tRevFlag flag = rw.newFlag(flagName);\n\t\t\tAssert.IsTrue(0 != flag.Mask);\n\t\t\tAssert.AreSame(flagName, flag.Name);\n\n\t\t\tvar flagSet = new RevFlagSet();\n\t\t\tAssert.IsTrue(flagSet.Add(flag));\n\t\t\tAssert.IsFalse(flagSet.Add(flag));\n\t\t\tAssert.AreEqual(flag.Mask, flagSet.Mask);\n\t\t\tAssert.AreEqual(1, flagSet.Count);\n\t\t\tvar i = flagSet.GetEnumerator();\n\t\t\tAssert.IsTrue(i.MoveNext());\n\t\t\tAssert.AreSame(flag, i.Current);\n\t\t\tAssert.IsFalse(i.MoveNext());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAddTwo()\n\t\t{\n\t\t\tRevFlag flag1 = rw.newFlag(\"flag_1\");\n\t\t\tRevFlag flag2 = rw.newFlag(\"flag_2\");\n\t\t\tAssert.IsTrue((flag1.Mask & flag2.Mask) == 0);\n\n\t\t\tvar flagSet = new RevFlagSet();\n\t\t\tAssert.IsTrue(flagSet.Add(flag1));\n\t\t\tAssert.IsTrue(flagSet.Add(flag2));\n\t\t\tAssert.AreEqual(flag1.Mask | flag2.Mask, flagSet.Mask);\n\t\t\tAssert.AreEqual(2, flagSet.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContainsAll()\n\t\t{\n\t\t\tRevFlag flag1 = rw.newFlag(\"flag_1\");\n\t\t\tRevFlag flag2 = rw.newFlag(\"flag_2\");\n\t\t\tvar set1 = new RevFlagSet();\n\t\t\tAssert.IsTrue(set1.Add(flag1));\n\t\t\tAssert.IsTrue(set1.Add(flag2));\n\n\t\t\tAssert.IsTrue(set1.ContainsAll(set1));\n\t\t\tAssert.IsTrue(set1.ContainsAll(new[] { flag1, flag2 }));\n\n\t\t\tvar set2 = new RevFlagSet { rw.newFlag(\"flag_3\") };\n\t\t\tAssert.IsFalse(set1.ContainsAll(set2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEquals()\n\t\t{\n\t\t\tRevFlag flag1 = rw.newFlag(\"flag_1\");\n\t\t\tRevFlag flag2 = rw.newFlag(\"flag_2\");\n\t\t\tvar flagSet = new RevFlagSet();\n\t\t\tAssert.IsTrue(flagSet.Add(flag1));\n\t\t\tAssert.IsTrue(flagSet.Add(flag2));\n\n\t\t\tAssert.IsTrue(new RevFlagSet(flagSet).Equals(flagSet));\n\t\t\tAssert.IsTrue(new RevFlagSet(new[] { flag1, flag2 }).Equals(flagSet));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testRemove()\n\t\t{\n\t\t\tRevFlag flag1 = rw.newFlag(\"flag_1\");\n\t\t\tRevFlag flag2 = rw.newFlag(\"flag_2\");\n\t\t\tvar flagSet = new RevFlagSet();\n\t\t\tAssert.IsTrue(flagSet.Add(flag1));\n\t\t\tAssert.IsTrue(flagSet.Add(flag2));\n\n\t\t\tAssert.IsTrue(flagSet.Remove(flag1));\n\t\t\tAssert.IsFalse(flagSet.Remove(flag1));\n\t\t\tAssert.AreEqual(flag2.Mask, flagSet.Mask);\n\t\t\tAssert.IsFalse(flagSet.Contains(flag1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testContains()\n\t\t{\n\t\t\tRevFlag flag1 = rw.newFlag(\"flag_1\");\n\t\t\tRevFlag flag2 = rw.newFlag(\"flag_2\");\n\t\t\tvar flagSet = new RevFlagSet {flag1};\n\t\t\tAssert.IsTrue(flagSet.Contains(flag1));\n\t\t\tAssert.IsFalse(flagSet.Contains(flag2));\n\t\t\t//Assert.IsFalse(flagSet.Contains(\"bob\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevObjectTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevObjectTest : RevWalkTestCase\n    {\n        [Test]\n        public void testId()\n        {\n            RevCommit a = Commit();\n            Assert.AreSame(a, a.getId());\n        }\n\n        [Test]\n        public void testEqualsIsIdentity()\n        {\n            RevCommit a1 = Commit();\n            RevCommit b1 = Commit();\n\n            Assert.IsTrue(a1.Equals(a1));\n            Assert.IsTrue(a1.Equals((object)a1));\n            Assert.IsFalse(a1.Equals(b1));\n\n            Assert.IsFalse(a1.Equals(a1.Copy()));\n            Assert.IsFalse(a1.Equals((object)a1.Copy()));\n            Assert.IsFalse(a1.Equals(string.Empty));\n\n            var rw2 = new Core.RevWalk.RevWalk(db);\n            RevCommit a2 = rw2.parseCommit(a1);\n            RevCommit b2 = rw2.parseCommit(b1);\n            Assert.AreNotSame(a1, a2);\n            Assert.AreNotSame(b1, b2);\n\n            Assert.IsFalse(a1.Equals(a2));\n            Assert.IsFalse(b1.Equals(b2));\n\n            Assert.AreEqual(a1.GetHashCode(), a2.GetHashCode());\n            Assert.AreEqual(b1.GetHashCode(), b2.GetHashCode());\n\n            Assert.IsTrue(AnyObjectId.equals(a1, a2));\n            Assert.IsTrue(AnyObjectId.equals(b1, b2));\n        }\n\n        [Test]\n        public void testRevObjectTypes()\n        {\n            Assert.AreEqual(Constants.OBJ_TREE, tree().Type);\n            Assert.AreEqual(Constants.OBJ_COMMIT, Commit().Type);\n            Assert.AreEqual(Constants.OBJ_BLOB, blob(string.Empty).Type);\n            Assert.AreEqual(Constants.OBJ_TAG, Tag(\"emptyTree\", tree()).Type);\n        }\n\n        [Test]\n        public void testHasRevFlag()\n        {\n            RevCommit a = Commit();\n            Assert.IsFalse(a.has(RevFlag.UNINTERESTING));\n            a.Flags |= GitSharp.Core.RevWalk.RevWalk.UNINTERESTING;\n            Assert.IsTrue(a.has(RevFlag.UNINTERESTING));\n        }\n\n        [Test]\n        public void testHasAnyFlag()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            var s = new RevFlagSet { flag1, flag2 };\n\n            Assert.IsFalse(a.hasAny(s));\n            a.Flags |= flag1.Mask;\n            Assert.IsTrue(a.hasAny(s));\n        }\n\n        [Test]\n        public void testHasAllFlag()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            var s = new RevFlagSet { flag1, flag2 };\n\n            Assert.IsFalse(a.hasAll(s));\n            a.Flags |= flag1.Mask;\n            Assert.IsFalse(a.hasAll(s));\n            a.Flags |= flag2.Mask;\n            Assert.IsTrue(a.hasAll(s));\n        }\n\n        [Test]\n        public void testAddRevFlag()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            Assert.AreEqual(0, a.Flags);\n\n            a.add(flag1);\n            Assert.AreEqual(flag1.Mask, a.Flags);\n\n            a.add(flag2);\n            Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);\n        }\n\n        [Test]\n        public void testAddRevFlagSet()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            var s = new RevFlagSet { flag1, flag2 };\n\n            Assert.AreEqual(0, a.Flags);\n\n            a.add(s);\n            Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);\n        }\n\n        [Test]\n        public void testRemoveRevFlag()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            a.add(flag1);\n            a.add(flag2);\n            Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);\n            a.remove(flag2);\n            Assert.AreEqual(flag1.Mask, a.Flags);\n        }\n\n        [Test]\n        public void testRemoveRevFlagSet()\n        {\n            RevCommit a = Commit();\n            RevFlag flag1 = rw.newFlag(\"flag1\");\n            RevFlag flag2 = rw.newFlag(\"flag2\");\n            RevFlag flag3 = rw.newFlag(\"flag3\");\n            var s = new RevFlagSet { flag1, flag2 };\n            a.add(flag3);\n            a.add(s);\n            Assert.AreEqual(flag1.Mask | flag2.Mask | flag3.Mask, a.Flags);\n            a.remove(s);\n            Assert.AreEqual(flag3.Mask, a.Flags);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevQueueTestCase.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    public abstract class RevQueueTestCase<T> : RevWalkTestCase\n        where T : AbstractRevQueue\n    {\n        protected T q;\n\n        [SetUp]\n        public override void setUp()\n        {\n            base.setUp();\n            q = create();\n        }\n\n        protected abstract T create();\n\n        [Test]\n        public virtual void testEmpty()\n        {\n            Assert.IsNull(q.next());\n            Assert.IsTrue(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            Assert.IsFalse(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n        }\n\n        [Test]\n        public void testClear()\n        {\n            RevCommit a = parseBody(Commit());\n            RevCommit b = parseBody(Commit(a));\n\n            q.add(a);\n            q.add(b);\n            q.clear();\n            Assert.IsNull(q.next());\n        }\n\n        [Test]\n        public void testHasFlags()\n        {\n            RevCommit a = parseBody(Commit());\n            RevCommit b = parseBody(Commit(a));\n\n            q.add(a);\n            q.add(b);\n\n            Assert.IsFalse(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            Assert.IsFalse(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n\n            a.Flags |= GitSharp.Core.RevWalk.RevWalk.UNINTERESTING;\n            Assert.IsFalse(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            Assert.IsTrue(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n\n            b.Flags |= GitSharp.Core.RevWalk.RevWalk.UNINTERESTING;\n            Assert.IsTrue(q.everbodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n            Assert.IsTrue(q.anybodyHasFlag(GitSharp.Core.RevWalk.RevWalk.UNINTERESTING));\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevTagParseTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevTagParseTest : RepositoryTestCase\n    {\n        [Test]\n        public void testTagBlob()\n        {\n            testOneType(Constants.OBJ_BLOB);\n        }\n\n        [Test]\n        public void testTagTree()\n        {\n            testOneType(Constants.OBJ_TREE);\n        }\n\n        [Test]\n        public void testTagCommit()\n        {\n            testOneType(Constants.OBJ_COMMIT);\n        }\n\n        [Test]\n        public void testTagTag()\n        {\n            testOneType(Constants.OBJ_TAG);\n        }\n\n        private void testOneType(int typeCode)\n        {\n            ObjectId locId = Id(\"9788669ad918b6fcce64af8882fc9a81cb6aba67\");\n            var b = new StringBuilder();\n            b.Append(\"object \" + locId.Name + \"\\n\");\n            b.Append(\"type \" + Constants.typeString(typeCode) + \"\\n\");\n            b.Append(\"tag v1.2.3.4.5\\n\");\n            b.Append(\"tagger A U. Thor <a_u_thor@example.com> 1218123387 +0700\\n\");\n            b.Append(\"\\n\");\n\n            var rw = new Core.RevWalk.RevWalk(db);\n\n            var c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n            Assert.IsNull(c.getObject());\n            Assert.IsNull(c.getTagName());\n\n            c.parseCanonical(rw, b.ToString().getBytes(\"UTF-8\"));\n            Assert.IsNotNull(c.getObject());\n            Assert.AreEqual(locId, c.getObject().getId());\n            Assert.AreSame(rw.lookupAny(locId, typeCode), c.getObject());\n        }\n\n        [Test]\n        public void testParseAllFields()\n        {\n            ObjectId treeId = Id(\"9788669ad918b6fcce64af8882fc9a81cb6aba67\");\n            const string name = \"v1.2.3.4.5\";\n            const string taggerName = \"A U. Thor\";\n            const string taggerEmail = \"a_u_thor@example.com\";\n            const int taggerTime = 1218123387;\n\n            var body = new StringBuilder();\n\n            body.Append(\"object \");\n            body.Append(treeId.Name);\n            body.Append(\"\\n\");\n\n            body.Append(\"type tree\\n\");\n\n            body.Append(\"tag \");\n            body.Append(name);\n            body.Append(\"\\n\");\n\n            body.Append(\"tagger \");\n            body.Append(taggerName);\n            body.Append(\" <\");\n            body.Append(taggerEmail);\n            body.Append(\"> \");\n            body.Append(taggerTime);\n            body.Append(\" +0700\\n\");\n\n            body.Append(\"\\n\");\n\n            var rw = new Core.RevWalk.RevWalk(db);\n\n            var c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n            Assert.IsNull(c.getObject());\n            Assert.IsNull(c.getTagName());\n\n            c.parseCanonical(rw, body.ToString().getBytes(\"UTF-8\"));\n            Assert.IsNotNull(c.getObject());\n            Assert.AreEqual(treeId, c.getObject().getId());\n            Assert.AreSame(rw.lookupTree(treeId), c.getObject());\n\n            Assert.IsNotNull(c.getTagName());\n            Assert.AreEqual(name, c.getTagName());\n            Assert.AreEqual(string.Empty, c.getFullMessage());\n\n            PersonIdent cTagger = c.getTaggerIdent();\n            Assert.IsNotNull(cTagger);\n            Assert.AreEqual(taggerName, cTagger.Name);\n            Assert.AreEqual(taggerEmail, cTagger.EmailAddress);\n        }\n\n        [Test]\n        public void testParseOldStyleNoTagger()\n        {\n            ObjectId treeId = Id(\"9788669ad918b6fcce64af8882fc9a81cb6aba67\");\n            string name = \"v1.2.3.4.5\";\n            string message = \"test\\n\" //\n                    + \"\\n\" //\n                    + \"-----BEGIN PGP SIGNATURE-----\\n\" //\n                    + \"Version: GnuPG v1.4.1 (GNU/Linux)\\n\" //\n                    + \"\\n\" //\n                    + \"iD8DBQBC0b9oF3Y\\n\" //\n                    + \"-----END PGP SIGNATURE------n\";\n\n            var body = new StringBuilder();\n\n            body.Append(\"object \");\n            body.Append(treeId.Name);\n            body.Append(\"\\n\");\n\n            body.Append(\"type tree\\n\");\n\n            body.Append(\"tag \");\n            body.Append(name);\n            body.Append(\"\\n\");\n            body.Append(\"\\n\");\n            body.Append(message);\n\n            var rw = new Core.RevWalk.RevWalk(db);\n            RevTag c;\n\n            c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n            Assert.IsNull(c.getObject());\n            Assert.IsNull(c.getTagName());\n\n            c.parseCanonical(rw, body.ToString().getBytes(\"UTF-8\"));\n            Assert.IsNotNull(c.getObject());\n            Assert.AreEqual(treeId, c.getObject().getId());\n            Assert.AreSame(rw.lookupTree(treeId), c.getObject());\n\n            Assert.IsNotNull(c.getTagName());\n            Assert.AreEqual(name, c.getTagName());\n            Assert.AreEqual(\"test\", c.getShortMessage());\n            Assert.AreEqual(message, c.getFullMessage());\n\n            Assert.IsNull(c.getTaggerIdent());\n        }\n\n        private RevTag create(string msg)\n        {\n            var b = new StringBuilder();\n            b.Append(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\");\n            b.Append(\"type tree\\n\");\n            b.Append(\"tag v1.2.3.4.5\\n\");\n            b.Append(\"tagger A U. Thor <a_u_thor@example.com> 1218123387 +0700\\n\");\n            b.Append(\"\\n\");\n            b.Append(msg);\n\n            var c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n\n            c.parseCanonical(new Core.RevWalk.RevWalk(db), b.ToString().getBytes(\"UTF-8\"));\n            return c;\n        }\n\n        [Test]\n        public void testParse_implicit_UTF8_encoded()\n        {\n            RevTag c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"type tree\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tag v1.2.3.4.5\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tagger F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Sm\\u00f6rg\\u00e5sbord\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n                c.parseCanonical(new Core.RevWalk.RevWalk(db), ((MemoryStream)b.BaseStream).ToArray());\n            }\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getTaggerIdent().Name);\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\", c.getShortMessage());\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\\n\\n\\u304d\\u308c\\u3044\\n\", c.getFullMessage());\n        }\n\n        [Test]\n        public void testParse_implicit_mixed_encoded()\n        {\n            RevTag c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"type tree\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tag v1.2.3.4.5\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tagger F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"ISO-8859-1\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Sm\\u00f6rg\\u00e5sbord\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n                c.parseCanonical(new Core.RevWalk.RevWalk(db), ((MemoryStream)b.BaseStream).ToArray());\n            }\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => Assert.AreEqual(\"F\\u00f6r fattare\", c.getTaggerIdent().Name), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=549914\");\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\", c.getShortMessage());\n            Assert.AreEqual(\"Sm\\u00f6rg\\u00e5sbord\\n\\n\\u304d\\u308c\\u3044\\n\", c.getFullMessage());\n        }\n\n        /**\n         * Test parsing of a commit whose encoding is given and works.\n         *\n         * @throws Exception\n         */\n\n        [Test]\n        public void testParse_explicit_encoded()\n        {\n            Assert.Ignore(\"We are going to deal with encoding problems later. For now, they are only disturbing the build.\");\n            RevTag c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"type tree\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"tag v1.2.3.4.5\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"tagger F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"encoding euc_JP\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"\\n\".getBytes(\"EUC-JP\"));\n                b.Write(\"Hi\\n\".getBytes(\"EUC-JP\"));\n\n                c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n                c.parseCanonical(new Core.RevWalk.RevWalk(db), ((MemoryStream)b.BaseStream).ToArray());\n            }\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getTaggerIdent().Name);\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n        /**\n         * This is a twisted case, but show what we expect here. We can revise the\n         * expectations provided this case is updated.\n         *\n         * What happens here is that an encoding us given, but data is not encoded\n         * that way (and we can detect it), so we try other encodings.\n         *\n         * @throws Exception\n         */\n\n        [Test]\n        public void testParse_explicit_bad_encoded()\n        {\n            RevTag c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"type tree\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tag v1.2.3.4.5\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tagger F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"ISO-8859-1\"));\n                b.Write(\"encoding EUC-JP\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Hi\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n                c.parseCanonical(new Core.RevWalk.RevWalk(db), ((MemoryStream)b.BaseStream).ToArray());\n            }\n\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => Assert.AreEqual(\"F\\u00f6r fattare\", c.getTaggerIdent().Name), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=547902\");\n\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n        /**\n         * This is a twisted case too, but show what we expect here. We can revise\n         * the expectations provided this case is updated.\n         *\n         * What happens here is that an encoding us given, but data is not encoded\n         * that way (and we can detect it), so we try other encodings. Here data\n         * could actually be decoded in the stated encoding, but we override using\n         * UTF-8.\n         *\n         * @throws Exception\n         */\n\n        [Test]\n        public void testParse_explicit_bad_encoded2()\n        {\n            RevTag c;\n            using (var b = new BinaryWriter(new MemoryStream()))\n            {\n                b.Write(\"object 9788669ad918b6fcce64af8882fc9a81cb6aba67\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"type tree\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tag v1.2.3.4.5\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"tagger F\\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"encoding ISO-8859-1\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\u304d\\u308c\\u3044\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"\\n\".getBytes(\"UTF-8\"));\n                b.Write(\"Hi\\n\".getBytes(\"UTF-8\"));\n\n                c = new RevTag(Id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n                c.parseCanonical(new Core.RevWalk.RevWalk(db), ((MemoryStream)b.BaseStream).ToArray());\n            }\n            Assert.AreEqual(\"F\\u00f6r fattare\", c.getTaggerIdent().Name);\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\", c.getShortMessage());\n            Assert.AreEqual(\"\\u304d\\u308c\\u3044\\n\\nHi\\n\", c.getFullMessage());\n        }\n\n        [Test]\n        public void testParse_NoMessage()\n        {\n            const string msg = \"\";\n            RevTag c = create(msg);\n            Assert.AreEqual(msg, c.getFullMessage());\n            Assert.AreEqual(msg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_OnlyLFMessage()\n        {\n            RevTag c = create(\"\\n\");\n            Assert.AreEqual(\"\\n\", c.getFullMessage());\n            Assert.AreEqual(string.Empty, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyNoLF()\n        {\n            const string shortMsg = \"This is a short message.\";\n            RevTag c = create(shortMsg);\n            Assert.AreEqual(shortMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEndLF()\n        {\n            const string shortMsg = \"This is a short message.\";\n            const string fullMsg = shortMsg + \"\\n\";\n            RevTag c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEmbeddedLF()\n        {\n            const string fullMsg = \"This is a\\nshort message.\";\n            string shortMsg = fullMsg.Replace('\\n', ' ');\n            RevTag c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_ShortLineOnlyEmbeddedAndEndingLF()\n        {\n            const string fullMsg = \"This is a\\nshort message.\\n\";\n            const string shortMsg = \"This is a short message.\";\n            RevTag c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        [Test]\n        public void testParse_GitStyleMessage()\n        {\n            const string shortMsg = \"This fixes a bug.\";\n            const string body = \"We do it with magic and pixie dust and stuff.\\n\"\n                                + \"\\n\" + \"Signed-off-by: A U. Thor <author@example.com>\\n\";\n            const string fullMsg = shortMsg + \"\\n\" + \"\\n\" + body;\n            RevTag c = create(fullMsg);\n            Assert.AreEqual(fullMsg, c.getFullMessage());\n            Assert.AreEqual(shortMsg, c.getShortMessage());\n        }\n\n        private static ObjectId Id(string str)\n        {\n            return ObjectId.FromString(str);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkCullTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevWalkCullTest : RevWalkTestCase\n    {\n        [Test]\n        public void testProperlyCullAllAncestors1()\n        {\n            // Credit goes to Junio C Hamano <gitster@pobox.com> for this\n            // test case in git-core (t/t6009-rev-list-parent.sh)\n            //\n            // We induce a clock skew so two is dated before one.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(-2400, a);\n            RevCommit c = Commit(b);\n            RevCommit d = Commit(c);\n\n            MarkStart(a);\n            MarkUninteresting(d);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testProperlyCullAllAncestors2()\n        {\n            // Despite clock skew on c1 being very old it should not\n            // produce, neither should a or b, or any part of that chain.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(-5, b);\n            RevCommit c2 = Commit(10, b);\n            RevCommit d = Commit(c1, c2);\n\n            MarkStart(d);\n            MarkUninteresting(c1);\n            AssertCommit(d, rw.next());\n            AssertCommit(c2, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testProperlyCullAllAncestors_LongHistory()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            for (int i = 0; i < 24; i++)\n            {\n                b = Commit(b);\n                if ((i & 2) == 0)\n                    MarkUninteresting(b);\n            }\n            RevCommit c = Commit(b);\n\n            MarkStart(c);\n            MarkUninteresting(b);\n            AssertCommit(c, rw.next());\n            Assert.IsNull(rw.next());\n\n            // We should have aborted before we got back so far that \"a\"\n            // would be parsed. Thus, its parents shouldn't be allocated.\n            //\n            Assert.IsNull(a.Parents);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkFilterTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevWalkFilterTest : RevWalkTestCase\n    {\n        private static readonly MyAll MY_ALL = new MyAll();\n\n        [Test]\n        public void testFilter_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(RevFilter.ALL);\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_Negate_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(RevFilter.ALL.negate());\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NOT_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(NotRevFilter.create(RevFilter.ALL));\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(RevFilter.NONE);\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NOT_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(NotRevFilter.create(RevFilter.NONE));\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_ALL_And_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(AndRevFilter.create(RevFilter.ALL, RevFilter.NONE));\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NONE_And_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(AndRevFilter.create(RevFilter.NONE, RevFilter.ALL));\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_ALL_Or_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(OrRevFilter.create(RevFilter.ALL, RevFilter.NONE));\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NONE_Or_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(OrRevFilter.create(RevFilter.NONE, RevFilter.ALL));\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_MY_ALL_And_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(AndRevFilter.create(MY_ALL, RevFilter.NONE));\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NONE_And_MY_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(AndRevFilter.create(RevFilter.NONE, MY_ALL));\n            MarkStart(c);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_MY_ALL_Or_NONE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(OrRevFilter.create(MY_ALL, RevFilter.NONE));\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NONE_Or_MY_ALL()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n\n            rw.setRevFilter(OrRevFilter.create(RevFilter.NONE, MY_ALL));\n            MarkStart(c);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testFilter_NO_MERGES()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(b);\n            RevCommit c2 = Commit(b);\n            RevCommit d = Commit(c1, c2);\n            RevCommit e = Commit(d);\n\n            rw.setRevFilter(RevFilter.NO_MERGES);\n            MarkStart(e);\n            AssertCommit(e, rw.next());\n            AssertCommit(c2, rw.next());\n            AssertCommit(c1, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testCommitTimeRevFilter()\n        {\n            RevCommit a = Commit();\n            Tick(100);\n\n            RevCommit b = Commit(a);\n            Tick(100);\n\n            DateTime since = getClock();\n            RevCommit c1 = Commit(b);\n            Tick(100);\n\n            RevCommit c2 = Commit(b);\n            Tick(100);\n\n            DateTime until = getClock();\n            RevCommit d = Commit(c1, c2);\n            Tick(100);\n\n            RevCommit e = Commit(d);\n\n            {\n                RevFilter after = CommitTimeRevFilter.After(since);\n                Assert.IsNotNull(after);\n                rw.setRevFilter(after);\n                MarkStart(e);\n                AssertCommit(e, rw.next());\n                AssertCommit(d, rw.next());\n                AssertCommit(c2, rw.next());\n                AssertCommit(c1, rw.next());\n                Assert.IsNull(rw.next());\n            }\n\n            {\n                RevFilter before = CommitTimeRevFilter.Before(until);\n                Assert.IsNotNull(before);\n                rw.reset();\n                rw.setRevFilter(before);\n                MarkStart(e);\n                AssertCommit(c2, rw.next());\n                AssertCommit(c1, rw.next());\n                AssertCommit(b, rw.next());\n                AssertCommit(a, rw.next());\n                Assert.IsNull(rw.next());\n            }\n\n            {\n                RevFilter between = CommitTimeRevFilter.Between(since, until);\n                Assert.IsNotNull(between);\n                rw.reset();\n                rw.setRevFilter(between);\n                MarkStart(e);\n                AssertCommit(c2, rw.next());\n                AssertCommit(c1, rw.next());\n                Assert.IsNull(rw.next());\n            }\n        }\n\n        private class MyAll : RevFilter\n        {\n            public override RevFilter Clone()\n            {\n                return this;\n            }\n\n            public override bool include(GitSharp.Core.RevWalk.RevWalk walker, RevCommit cmit)\n            {\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkMergeBaseTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.RevWalk.Filter;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevWalkMergeBaseTest : RevWalkTestCase\n    {\n        [Test]\n        public void testNone()\n        {\n            RevCommit c1 = Commit(Commit(Commit()));\n            RevCommit c2 = Commit(Commit(Commit()));\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            MarkStart(c1);\n            MarkStart(c2);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testDisallowTreeFilter()\n        {\n            RevCommit c1 = Commit();\n            RevCommit c2 = Commit();\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            rw.setTreeFilter(TreeFilter.ANY_DIFF);\n            MarkStart(c1);\n            MarkStart(c2);\n\n\t\t\tAssertHelper.Throws<InvalidOperationException>(() => Assert.IsNull(rw.next()));\n        }\n\n        [Test]\n        public void testSimple()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(Commit(Commit(Commit(Commit(b)))));\n            RevCommit c2 = Commit(Commit(Commit(Commit(Commit(b)))));\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            MarkStart(c1);\n            MarkStart(c2);\n            AssertCommit(b, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testMultipleHeads_SameBase1()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(Commit(Commit(Commit(Commit(b)))));\n            RevCommit c2 = Commit(Commit(Commit(Commit(Commit(b)))));\n            RevCommit c3 = Commit(Commit(Commit(b)));\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            MarkStart(c1);\n            MarkStart(c2);\n            MarkStart(c3);\n            AssertCommit(b, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testMultipleHeads_SameBase2()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n            RevCommit d1 = Commit(Commit(Commit(Commit(Commit(b)))));\n            RevCommit d2 = Commit(Commit(Commit(Commit(Commit(c)))));\n            RevCommit d3 = Commit(Commit(Commit(c)));\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            MarkStart(d1);\n            MarkStart(d2);\n            MarkStart(d3);\n            AssertCommit(b, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testCrissCross()\n        {\n            // See http://marc.info/?l=git&m=111463358500362&w=2 for a nice\n            // description of what this test is creating. We don't have a\n            // clean merge base for d,e as they each merged the parents b,c\n            // in different orders.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(a);\n            RevCommit d = Commit(b, c);\n            RevCommit e = Commit(c, b);\n\n            rw.setRevFilter(RevFilter.MERGE_BASE);\n            MarkStart(d);\n            MarkStart(e);\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            Assert.IsNull(rw.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkPathFilter1Test.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevWalkPathFilter1Test : RevWalkTestCase\n    {\n        protected void filter(string path)\n        {\n            rw.setTreeFilter(AndTreeFilter.create(\n                                 PathFilterGroup.createFromStrings(new[] {path}), TreeFilter.ANY_DIFF));\n        }\n\n        [Test]\n        public void testEmpty_EmptyTree()\n        {\n            RevCommit a = Commit();\n            filter(\"a\");\n            MarkStart(a);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testEmpty_NoMatch()\n        {\n            RevCommit a = Commit(tree(File(\"0\", blob(\"0\"))));\n            filter(\"a\");\n            MarkStart(a);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSimple1()\n        {\n            RevCommit a = Commit(tree(File(\"0\", blob(\"0\"))));\n            filter(\"0\");\n            MarkStart(a);\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testEdits_MatchNone()\n        {\n            RevCommit a = Commit(tree(File(\"0\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"0\", blob(\"b\"))), a);\n            RevCommit c = Commit(tree(File(\"0\", blob(\"c\"))), b);\n            RevCommit d = Commit(tree(File(\"0\", blob(\"d\"))), c);\n            filter(\"a\");\n            MarkStart(d);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testEdits_MatchAll()\n        {\n            RevCommit a = Commit(tree(File(\"0\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"0\", blob(\"b\"))), a);\n            RevCommit c = Commit(tree(File(\"0\", blob(\"c\"))), b);\n            RevCommit d = Commit(tree(File(\"0\", blob(\"d\"))), c);\n            filter(\"0\");\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testStringOfPearls_FilePath1()\n        {\n            RevCommit a = Commit(tree(File(\"d/f\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"d/f\", blob(\"a\"))), a);\n            RevCommit c = Commit(tree(File(\"d/f\", blob(\"b\"))), b);\n            filter(\"d/f\");\n            MarkStart(c);\n\n            AssertCommit(c, rw.next());\n            Assert.AreEqual(1, c.ParentCount);\n            AssertCommit(a, c.GetParent(0)); // b was skipped\n\n            AssertCommit(a, rw.next());\n            Assert.AreEqual(0, a.ParentCount);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testStringOfPearls_FilePath2()\n        {\n            RevCommit a = Commit(tree(File(\"d/f\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"d/f\", blob(\"a\"))), a);\n            RevCommit c = Commit(tree(File(\"d/f\", blob(\"b\"))), b);\n            RevCommit d = Commit(tree(File(\"d/f\", blob(\"b\"))), c);\n            filter(\"d/f\");\n            MarkStart(d);\n\n            // d was skipped\n            AssertCommit(c, rw.next());\n            Assert.AreEqual(1, c.ParentCount);\n            AssertCommit(a, c.GetParent(0)); // b was skipped\n\n            AssertCommit(a, rw.next());\n            Assert.AreEqual(0, a.ParentCount);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testStringOfPearls_DirPath2()\n        {\n            RevCommit a = Commit(tree(File(\"d/f\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"d/f\", blob(\"a\"))), a);\n            RevCommit c = Commit(tree(File(\"d/f\", blob(\"b\"))), b);\n            RevCommit d = Commit(tree(File(\"d/f\", blob(\"b\"))), c);\n            filter(\"d\");\n            MarkStart(d);\n\n            // d was skipped\n            AssertCommit(c, rw.next());\n            Assert.AreEqual(1, c.ParentCount);\n            AssertCommit(a, c.GetParent(0)); // b was skipped\n\n            AssertCommit(a, rw.next());\n            Assert.AreEqual(0, a.ParentCount);\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testStringOfPearls_FilePath3()\n        {\n            RevCommit a = Commit(tree(File(\"d/f\", blob(\"a\"))));\n            RevCommit b = Commit(tree(File(\"d/f\", blob(\"a\"))), a);\n            RevCommit c = Commit(tree(File(\"d/f\", blob(\"b\"))), b);\n            RevCommit d = Commit(tree(File(\"d/f\", blob(\"b\"))), c);\n            RevCommit e = Commit(tree(File(\"d/f\", blob(\"b\"))), d);\n            RevCommit f = Commit(tree(File(\"d/f\", blob(\"b\"))), e);\n            RevCommit g = Commit(tree(File(\"d/f\", blob(\"b\"))), f);\n            RevCommit h = Commit(tree(File(\"d/f\", blob(\"b\"))), g);\n            RevCommit i = Commit(tree(File(\"d/f\", blob(\"c\"))), h);\n            filter(\"d/f\");\n            MarkStart(i);\n\n            AssertCommit(i, rw.next());\n            Assert.AreEqual(1, i.ParentCount);\n            AssertCommit(c, i.GetParent(0)); // h..d was skipped\n\n            AssertCommit(c, rw.next());\n            Assert.AreEqual(1, c.ParentCount);\n            AssertCommit(a, c.GetParent(0)); // b was skipped\n\n            AssertCommit(a, rw.next());\n            Assert.AreEqual(0, a.ParentCount);\n            Assert.IsNull(rw.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkPathFilter6012Test.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    // Note: Much of this test case is broken as it depends upon\n    // the graph applying topological sorting *before* doing merge\n    // simplification.  It also depends upon a difference between\n    // full history and non-full history for a path, something we\n    // don't quite yet have a distiction for in JGit.\n    //\n    [TestFixture]\n    public class RevWalkPathFilter6012Test : RevWalkTestCase\n    {\n        private const string pA = \"pA\", pE = \"pE\", pF = \"pF\";\n        private RevCommit a, b, c, d, e, f, g, h, i;\n        private Dictionary<RevCommit, string> byName;\n\n        public override void setUp()\n        {\n            base.setUp();\n\n            // Test graph was stolen from git-core t6012-rev-list-simplify\n            // (by Junio C Hamano in 65347030590bcc251a9ff2ed96487a0f1b9e9fa8)\n            //\n            RevBlob zF = blob(\"zF\");\n            RevBlob zH = blob(\"zH\");\n            RevBlob zI = blob(\"zI\");\n            RevBlob zS = blob(\"zS\");\n            RevBlob zY = blob(\"zY\");\n\n            a = Commit(tree(File(pF, zH)));\n            b = Commit(tree(File(pF, zI)), a);\n            c = Commit(tree(File(pF, zI)), a);\n            d = Commit(tree(File(pA, zS), File(pF, zI)), c);\n            parseBody(d);\n\n            e = Commit(d.Tree, d, b);\n            f = Commit(tree(File(pA, zS), File(pE, zY), File(pF, zI)), e);\n            parseBody(f);\n\n            g = Commit(tree(File(pE, zY), File(pF, zI)), b);\n            h = Commit(f.Tree, g, f);\n            i = Commit(tree(File(pA, zS), File(pE, zY), File(pF, zF)), h);\n\n            byName = new Dictionary<RevCommit, string>();\n            var fields = typeof(RevWalkPathFilter6012Test).GetFields(BindingFlags.NonPublic | BindingFlags.Instance)\n                .Where(x => x.FieldType == typeof(RevCommit));\n\n            foreach (FieldInfo z in fields)\n            {\n                byName.Add((RevCommit)z.GetValue(this), z.Name);\n            }\n        }\n\n        private void Check(params RevCommit[] order)\n        {\n            MarkStart(i);\n\n            var act = new StringBuilder();\n            foreach (RevCommit z in rw)\n            {\n                string name = byName[z];\n                Assert.IsNotNull(name);\n                act.Append(name);\n                act.Append(' ');\n            }\n\n            var exp = new StringBuilder();\n            foreach (RevCommit z in order)\n            {\n                string name = byName[z];\n                Assert.IsNotNull(name);\n                exp.Append(name);\n                exp.Append(' ');\n            }\n\n            Assert.AreEqual(exp.ToString(), act.ToString());\n        }\n\n        private void Filter(string path)\n        {\n            rw.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(new[] { path }), TreeFilter.ANY_DIFF));\n        }\n\n        [Test]\n        public void test1()\n        {\n            // TODO --full-history\n            Check(i, h, g, f, e, d, c, b, a);\n        }\n\n        [Test]\n        public void test2()\n        {\n            // TODO --full-history\n            Filter(pF);\n            // TODO fix broken test\n            //Check(i, h, e, c, b, a);\n        }\n\n        [Test]\n        public void test3()\n        {\n            // TODO --full-history\n            rw.sort(RevSort.TOPO);\n            Filter(pF);\n            // TODO fix broken test\n            //Check(i, h, e, c, b, a);\n        }\n\n        [Test]\n        public void test4()\n        {\n            // TODO --full-history\n            rw.sort(RevSort.COMMIT_TIME_DESC);\n            Filter(pF);\n            // TODO fix broken test\n            //Check(i, h, e, c, b, a);\n        }\n\n        [Test]\n        public void test5()\n        {\n            // TODO --simplify-merges\n            Filter(pF);\n            // TODO fix broken test\n            //Check(i, e, c, b, a);\n        }\n\n        [Test]\n        public void test6()\n        {\n            Filter(pF);\n            Check(i, b, a);\n        }\n\n        [Test]\n        public void test7()\n        {\n            rw.sort(RevSort.TOPO);\n            Filter(pF);\n            Check(i, b, a);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkSortTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.RevWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n    [TestFixture]\n    public class RevWalkSortTest : RevWalkTestCase\n    {\n        [Test]\n        public void testSort_Default()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(1, a);\n            RevCommit c = Commit(1, b);\n            RevCommit d = Commit(1, c);\n\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_COMMIT_TIME_DESC()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n            RevCommit d = Commit(c);\n\n            rw.sort(RevSort.COMMIT_TIME_DESC);\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_REVERSE()\n        {\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(b);\n            RevCommit d = Commit(c);\n\n            rw.sort(RevSort.REVERSE);\n            MarkStart(d);\n            AssertCommit(a, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(c, rw.next());\n            AssertCommit(d, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_COMMIT_TIME_DESC_OutOfOrder1()\n        {\n            // Despite being out of order time-wise, a strand-of-pearls must\n            // still maintain topological order.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c = Commit(-5, b);\n            RevCommit d = Commit(10, c);\n            Assert.IsTrue(parseBody(a).CommitTime < parseBody(d).CommitTime);\n            Assert.IsTrue(parseBody(c).CommitTime < parseBody(b).CommitTime);\n\n            rw.sort(RevSort.COMMIT_TIME_DESC);\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_COMMIT_TIME_DESC_OutOfOrder2()\n        {\n            // c1 is back dated before its parent.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(-5, b);\n            RevCommit c2 = Commit(10, b);\n            RevCommit d = Commit(c1, c2);\n\n            rw.sort(RevSort.COMMIT_TIME_DESC);\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c2, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            AssertCommit(c1, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_TOPO()\n        {\n            // c1 is back dated before its parent.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(-5, b);\n            RevCommit c2 = Commit(10, b);\n            RevCommit d = Commit(c1, c2);\n\n            rw.sort(RevSort.TOPO);\n            MarkStart(d);\n            AssertCommit(d, rw.next());\n            AssertCommit(c2, rw.next());\n            AssertCommit(c1, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(a, rw.next());\n            Assert.IsNull(rw.next());\n        }\n\n        [Test]\n        public void testSort_TOPO_REVERSE()\n        {\n            // c1 is back dated before its parent.\n            //\n            RevCommit a = Commit();\n            RevCommit b = Commit(a);\n            RevCommit c1 = Commit(-5, b);\n            RevCommit c2 = Commit(10, b);\n            RevCommit d = Commit(c1, c2);\n\n            rw.sort(RevSort.TOPO);\n            rw.sort(RevSort.REVERSE, true);\n            MarkStart(d);\n            AssertCommit(a, rw.next());\n            AssertCommit(b, rw.next());\n            AssertCommit(c1, rw.next());\n            AssertCommit(c2, rw.next());\n            AssertCommit(d, rw.next());\n            Assert.IsNull(rw.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/RevWalk/RevWalkTestCase.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Tests.RevWalk\n{\n\n    public abstract class RevWalkTestCase : RepositoryTestCase\n    {\n        private TestRepository util;\n        protected GitSharp.Core.RevWalk.RevWalk rw;\n\n        [SetUp]\n        public override void setUp()\n        {\n            base.setUp();\n            util = new TestRepository(db, createRevWalk());\n            rw = util.getRevWalk();\n        }\n\n        protected virtual GitSharp.Core.RevWalk.RevWalk createRevWalk()\n        {\n            return new GitSharp.Core.RevWalk.RevWalk(db);\n        }\n\n        protected DateTime getClock()\n        {\n            return util.getClock();\n        }\n\n        protected void Tick(int secDelta)\n        {\n            util.tick(secDelta);\n        }\n\n        protected RevBlob blob(string content)\n        {\n            return util.blob(content);\n        }\n\n        protected DirCacheEntry File(string path, RevBlob blob)\n        {\n            return util.file(path, blob);\n        }\n\n        protected RevTree tree(params DirCacheEntry[] entries)\n        {\n            return util.tree(entries);\n        }\n\n        protected RevObject get(RevTree tree, string path)\n        {\n            return util.get(tree, path);\n        }\n\n        protected RevCommit Commit(params RevCommit[] parents)\n        {\n            return util.commit(parents);\n        }\n\n        protected RevCommit Commit(RevTree tree, params RevCommit[] parents)\n        {\n            return util.commit(tree, parents);\n        }\n\n        protected RevCommit Commit(int secDelta, params RevCommit[] parents)\n        {\n            return util.commit(secDelta, parents);\n        }\n\n        protected RevCommit Commit(int secDelta, RevTree tree, params RevCommit[] parents)\n        {\n            return util.commit(secDelta, tree, parents);\n        }\n\n        protected RevTag Tag(string name, RevObject dst)\n        {\n            return util.tag(name, dst);\n        }\n\n        protected T parseBody<T>(T t) where T : RevObject\n        {\n            return util.parseBody(t);\n        }\n\n        protected void MarkStart(RevCommit commit)\n        {\n            rw.markStart(commit);\n        }\n\n        protected void MarkUninteresting(RevCommit commit)\n        {\n            rw.markUninteresting(commit);\n        }\n\n        protected static void AssertCommit(RevCommit exp, RevCommit act)\n        {\n            Assert.AreSame(exp, act);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/SampleDataRepositoryTestCase.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\n\nnamespace GitSharp.Core.Tests\n{\n    public class SampleDataRepositoryTestCase : RepositoryTestCase\n    {\n        public override void setUp()\n        {\n            base.setUp();\n\n            string[] packs = {\n\t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f\",\n\t\t\t\t\"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371\",\n\t\t\t\t\"pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745\",\n\t\t\t\t\"pack-546ff360fe3488adb20860ce3436a2d6373d2796\",\n\t\t\t\t\"pack-cbdeda40019ae0e6e789088ea0f51f164f489d14\",\n\t\t\t\t\"pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa\",\n\t\t\t\t\"pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12\"\n\t\t    };\n\n            var packDir = new DirectoryInfo(db.ObjectsDirectory + \"/pack\");\n\n            foreach (var packname in packs)\n            {\n                new FileInfo(\"Resources/\" + Core.Transport.IndexPack.GetPackFileName(packname)).CopyTo(packDir + \"/\" + Core.Transport.IndexPack.GetPackFileName(packname), true);\n                new FileInfo(\"Resources/\" + Core.Transport.IndexPack.GetIndexFileName(packname)).CopyTo(packDir + \"/\" + Core.Transport.IndexPack.GetIndexFileName(packname), true);\n            }\n\n            new FileInfo(\"Resources/packed-refs\").CopyTo(db.Directory.FullName + \"/packed-refs\", true);\n\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/SubmoduleTest.cs",
    "content": "/*\n * Copyright (C) 2009, Stefan Schake <caytchen@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    \n    [TestFixture]\n    public class SubmoduleTest : RepositoryTestCase\n    {\n        private static GitSharp.Repository SetupRepository()\n        {\n            return new GitSharp.Repository(Path.Combine(\"Resources\", \"SubmoduleRepository.git\"));\n        }\n\n        [Test]\n        public void TestSimple()\n        {\n            using (var repo = SetupRepository())\n            {\n                var tree = repo.Head.CurrentCommit.Tree;\n\n                // this should always be secure for a repository with git submodules in it\n                foreach (var leaf in tree.Leaves)\n                {\n                }\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/SymbolicRefTest.cs",
    "content": "﻿/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class SymbolicRefTest\n    {\n        private static ObjectId ID_A = ObjectId\n            .FromString(\"41eb0d88f833b558bddeb269b7ab77399cdf98ed\");\n\n        private static ObjectId ID_B = ObjectId\n            .FromString(\"698dd0b8d0c299f080559a1cffc7fe029479a408\");\n\n        private static string targetName = \"refs/heads/a.test.ref\";\n\n        private static string name = \"refs/remotes/origin/HEAD\";\n\n        [Test]\n        public void testConstructor()\n        {\n            global::GitSharp.Core.Ref t;\n            SymbolicRef r;\n\n            t = new Unpeeled(Storage.New, targetName, null);\n            r = new SymbolicRef(name, t);\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreSame(name, r.getName());\n            Assert.IsNull(r.getObjectId(), \"no id on new ref\");\n            Assert.IsFalse(r.isPeeled(), \"not peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n            Assert.AreSame(t, r.getLeaf(), \"leaf is t\");\n            Assert.AreSame(t, r.getTarget(), \"target is t\");\n            Assert.IsTrue(r.isSymbolic(), \"is symbolic\");\n\n            t = new Unpeeled(Storage.Packed, targetName, ID_A);\n            r = new SymbolicRef(name, t);\n            Assert.AreSame(Storage.Loose, r.getStorage());\n            Assert.AreSame(name, r.getName());\n            Assert.AreSame(ID_A, r.getObjectId());\n            Assert.IsFalse(r.isPeeled(), \"not peeled\");\n            Assert.IsNull(r.getPeeledObjectId(), \"no peel id\");\n            Assert.AreSame(t, r.getLeaf(), \"leaf is t\");\n            Assert.AreSame(t, r.getTarget(), \"target is t\");\n            Assert.IsTrue(r.isSymbolic(), \"is symbolic\");\n        }\n\n        [Test]\n        public void testLeaf()\n        {\n            global::GitSharp.Core.Ref a;\n            SymbolicRef b, c, d;\n\n            a = new PeeledTag(Storage.Packed, targetName, ID_A, ID_B);\n            b = new SymbolicRef(\"B\", a);\n            c = new SymbolicRef(\"C\", b);\n            d = new SymbolicRef(\"D\", c);\n\n            Assert.AreSame(c, d.getTarget());\n            Assert.AreSame(b, c.getTarget());\n            Assert.AreSame(a, b.getTarget());\n\n            Assert.AreSame(a, d.getLeaf());\n            Assert.AreSame(a, c.getLeaf());\n            Assert.AreSame(a, b.getLeaf());\n            Assert.AreSame(a, a.getLeaf());\n\n            Assert.AreSame(ID_A, d.getObjectId());\n            Assert.AreSame(ID_A, c.getObjectId());\n            Assert.AreSame(ID_A, b.getObjectId());\n\n            Assert.IsTrue(d.isPeeled());\n            Assert.IsTrue(c.isPeeled());\n            Assert.IsTrue(b.isPeeled());\n\n            Assert.AreSame(ID_B, d.getPeeledObjectId());\n            Assert.AreSame(ID_B, c.getPeeledObjectId());\n            Assert.AreSame(ID_B, b.getPeeledObjectId());\n        }\n\n        [Test]\n        public void testToString()\n        {\n            global::GitSharp.Core.Ref a;\n            SymbolicRef b, c, d;\n\n            a = new PeeledTag(Storage.Packed, targetName, ID_A, ID_B);\n            b = new SymbolicRef(\"B\", a);\n            c = new SymbolicRef(\"C\", b);\n            d = new SymbolicRef(\"D\", c);\n\n            Assert.AreEqual(\"SymbolicRef[D -> C -> B -> \" + targetName + \"=\"\n                            + ID_A.Name + \"]\", d.ToString());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0001_ObjectId.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2008, Kevin Thompson <kevin.thompson@theautomaters.com>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class T0001_ObjectId\n    {\n        [Test]\n        public void ObjectIdToStringTest()\n        {\n            var id = ObjectId.FromString(\"003ae55c8f6f23aaee66acd2e1c35523fa6ddc33\");\n            Assert.AreEqual(\"003ae55c8f6f23aaee66acd2e1c35523fa6ddc33\", id.Name);\n            Assert.AreEqual(0, id.GetFirstByte());\n        }\n\n        [Test]\n        public void GetFirstByteTest()\n        {\n            for(var i = 0; i < 255;i++)\n            {\n                var iInHex = i.ToString(\"x\").PadLeft(2, '0');\n                foreach(var j in new[] {0x0,0x1,0xffffff})\n                {\n                    var firstFourBytes = iInHex + j.ToString(\"x\").PadLeft(6, '0');\n                    var id = ObjectId.FromString(firstFourBytes + \"00000000000000000000000000000000\");\n                    Assert.AreEqual(i, id.GetFirstByte(),\"GetFirstByteTest#\" + firstFourBytes);    \n                }\n                \n            }\n        }\n\n        [Test]\n        public void test001_toString()\n        {\n            string x = \"def4c620bc3713bb1bb26b808ec9312548e73946\";\n            ObjectId oid = ObjectId.FromString(x);\n            Assert.AreEqual(x, oid.Name);\n        }\n\n        [Test]\n        public void test002_toString()\n        {\n            string x = \"ff00eedd003713bb1bb26b808ec9312548e73946\";\n            ObjectId oid = ObjectId.FromString(x);\n            Assert.AreEqual(x, oid.Name);\n        }\n\n        [Test]\n        public void test003_equals()\n        {\n            string x = \"def4c620bc3713bb1bb26b808ec9312548e73946\";\n            ObjectId a = ObjectId.FromString(x);\n            ObjectId b = ObjectId.FromString(x);\n            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());\n            Assert.IsTrue(a.Equals(b), \"a and b are same\");\n        }\n\n        [Test]\n        public void test004_isId()\n        {\n            Assert.IsTrue(ObjectId.IsId(\"def4c620bc3713bb1bb26b808ec9312548e73946\"), \"valid id\");\n        }\n\n        [Test]\n        public void test005_notIsId()\n        {\n            Assert.IsFalse(ObjectId.IsId(\"bob\"), \"bob is not an id\");\n        }\n\n        [Test]\n        public void test006_notIsId()\n        {\n            Assert.IsFalse(ObjectId.IsId(\"def4c620bc3713bb1bb26b808ec9312548e7394\"), \"39 digits is not an id\");\n        }\n\n        [Test]\n        public void test007_isId()\n        {\n            Assert.IsTrue(ObjectId.IsId(\"Def4c620bc3713bb1bb26b808ec9312548e73946\"), \"uppercase is accepted\");\n        }\n\n        [Test]\n        public void test008_notIsId()\n        {\n            Assert.IsFalse(ObjectId.IsId(\"gef4c620bc3713bb1bb26b808ec9312548e73946\"), \"g is not a valid hex digit\");\n        }\n\n        [Test]\n        public void test009_toString()\n        {\n            string x = \"ff00eedd003713bb1bb26b808ec9312548e73946\";\n            ObjectId oid = ObjectId.FromString(x);\n            Assert.AreEqual(x, ObjectId.ToString(oid));\n        }\n\n        [Test]\n        public void test010_toString()\n        {\n            string x = \"0000000000000000000000000000000000000000\";\n            Assert.AreEqual(x, ObjectId.ToString(null));\n        }\n\n        [Test]\n        public void test011_toString()\n        {\n            string x = \"0123456789ABCDEFabcdef1234567890abcdefAB\";\n            ObjectId oid = ObjectId.FromString(x);\n            Assert.AreEqual(x.ToLower(), oid.Name);\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0001_PersonIdent.cs",
    "content": "/*\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Globalization;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class T0001_PersonIdent\n    {\n        [Test]\n        public void GitTimeToDateTimeOffset()\n        {\n            Assert.AreEqual(\"06/21/2009 15:04:53 +02:00\", 1245589493000L.MillisToDateTimeOffset(2 * 60).ToString(CultureInfo.InvariantCulture));\n            Assert.AreEqual(\"04/29/2009 18:41:17 -07:00\", 1241055677000L.MillisToDateTimeOffset(-7 * 60).ToString(CultureInfo.InvariantCulture));\n            Assert.AreEqual(1245589493000L, new DateTimeOffset(2009, 06, 21, 15, 04, 53, new TimeSpan(2, 0, 0)).ToMillisecondsSinceEpoch());\n            Assert.AreEqual(1241055677000L, new DateTimeOffset(2009, 04, 29, 18, 41, 17, new TimeSpan(-7, 0, 0)).ToMillisecondsSinceEpoch());\n        }\n\n        [Test]\n        public void test001_NewIdent()\n        {\n            PersonIdent p;\n            p = new PersonIdent(\"A U Thor\", \"author@example.com\", 1142878501000L.MillisToUtcDateTime(),\n                                    (int)new TimeSpan(-5, 0, 0).TotalMinutes);\n\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n            Assert.AreEqual(\"A U Thor <author@example.com> 1142878501 -0500\", p.ToExternalString());\n        }\n\n        [Test]\n        public void test002_ParseIdent()\n        {\n            string i = \"A U Thor <author@example.com> 1142878501 -0500\";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(i, p.ToExternalString());\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n\n        [Test]\n        public void test003_ParseIdent()\n        {\n            string i = \"A U Thor <author@example.com> 1142878501 +0230\";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(i, p.ToExternalString());\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n\n        [Test]\n        public void test004_ParseIdent()\n        {\n            string i = \"A U Thor<author@example.com> 1142878501 +0230\";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n\n        [Test]\n        public void test005_ParseIdent()\n        {\n            string i = \"A U Thor<author@example.com>1142878501 +0230\";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n\n        [Test]\n        public void test006_ParseIdent()\n        {\n            string i = \"A U Thor   <author@example.com>1142878501 +0230\";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n\n        [Test]\n        public void test007_ParseIdent()\n        {\n            string i = \"A U Thor<author@example.com>1142878501 +0230 \";\n            var p = new PersonIdent(i);\n            Assert.AreEqual(\"A U Thor\", p.Name);\n            Assert.AreEqual(\"author@example.com\", p.EmailAddress);\n            Assert.AreEqual(1142878501000L, p.When);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0002_Tree.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n    public class T0002_Tree : SampleDataRepositoryTestCase\n\t{\n\t\tprivate static readonly ObjectId SomeFakeId = ObjectId.FromString(\"0123456789abcdef0123456789abcdef01234567\");\n\n\t\tprivate static int CompareNamesUsingSpecialCompare(String a, String b)\n\t\t{\n\t\t\tchar lasta = '\\0';\n\t\t\tif (a.Length > 0 && a[a.Length - 1] == '/')\n\t\t\t{\n\t\t\t\tlasta = '/';\n\t\t\t\ta = a.Slice(0, a.Length - 1);\n\t\t\t}\n\t\t\tbyte[] abytes = a.getBytes(\"ISO-8859-1\");\n\t\t\tchar lastb = '\\0';\n\t\t\tif (b.Length > 0 && b[b.Length - 1] == '/')\n\t\t\t{\n\t\t\t\tlastb = '/';\n\t\t\t\tb = b.Slice(0, b.Length - 1);\n\t\t\t}\n\t\t\tbyte[] bbytes = b.getBytes(\"ISO-8859-1\");\n            return Core.Tree.CompareNames(abytes, bbytes, lasta, lastb);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test000_sort_01()\n\t\t{\n\t\t\tAssert.AreEqual(0, CompareNamesUsingSpecialCompare(\"a\", \"a\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test000_sort_02()\n\t\t{\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a\", \"b\"));\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"b\", \"a\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test000_sort_03()\n\t\t{\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"a:\", \"a\"));\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"a/\", \"a\"));\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a\", \"a/\"));\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a\", \"a:\"));\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"a:\", \"a/\"));\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a/\", \"a:\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test000_sort_04()\n\t\t{\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a.a\", \"a/a\"));\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"a/a\", \"a.a\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test000_sort_05()\n\t\t{\n\t\t\tAssert.AreEqual(-1, CompareNamesUsingSpecialCompare(\"a.\", \"a/\"));\n\t\t\tAssert.AreEqual(1, CompareNamesUsingSpecialCompare(\"a/\", \"a.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test001_createEmpty()\n\t\t{\n            var t = new Core.Tree(db);\n\t\t\tAssert.IsTrue(t.IsLoaded);\n\t\t\tAssert.IsTrue(t.IsModified);\n\t\t\tAssert.IsTrue(t.Parent == null);\n\t\t\tAssert.IsTrue(t.IsRoot);\n\t\t\tAssert.IsTrue(t.Name == null);\n\t\t\tAssert.IsTrue(t.NameUTF8 == null);\n\t\t\tAssert.IsTrue(t.Members != null);\n\t\t\tAssert.IsTrue(t.Members.Length == 0);\n\t\t\tAssert.AreEqual(string.Empty, t.FullName);\n\t\t\tAssert.IsTrue(t.Id == null);\n\t\t\tAssert.IsTrue(t.TreeEntry == t);\n\t\t\tAssert.IsTrue(t.Repository == db);\n\t\t\tAssert.IsTrue(t.findTreeMember(\"foo\") == null);\n\t\t\tAssert.IsTrue(t.FindBlobMember(\"foo\") == null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test002_addFile()\n\t\t{\n            var t = new Core.Tree(db) { Id = SomeFakeId };\n\t\t\tAssert.IsTrue(t.Id != null);\n\t\t\tAssert.IsFalse(t.IsModified);\n\n\t\t\tconst string n = \"bob\";\n\t\t\tFileTreeEntry f = t.AddFile(n);\n\t\t\tAssert.IsNotNull(f);\n\t\t\tAssert.AreEqual(n, f.Name);\n            Assert.AreEqual(f.Name, Constants.CHARSET.GetString(f.NameUTF8));\n\t\t\tAssert.AreEqual(n, f.FullName);\n\t\t\tAssert.IsTrue(f.Id == null);\n\t\t\tAssert.IsTrue(t.IsModified);\n\t\t\tAssert.IsTrue(t.Id == null);\n\t\t\tAssert.IsTrue(t.FindBlobMember(f.Name) == f);\n\n\t\t\tTreeEntry[] i = t.Members;\n\t\t\tAssert.IsNotNull(i);\n\t\t\tAssert.IsTrue(i != null && i.Length > 0);\n\t\t\tAssert.IsTrue(i != null && i[0] == f);\n\t\t\tAssert.IsTrue(i != null && i.Length == 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test004_addTree()\n\t\t{\n            var t = new Core.Tree(db) { Id = SomeFakeId };\n\t\t\tAssert.IsTrue(t.Id != null);\n\t\t\tAssert.IsFalse(t.IsModified);\n\n\t\t\tconst string n = \"bob\";\n            Core.Tree f = t.AddTree(n);\n\t\t\tAssert.IsNotNull(f);\n\t\t\tAssert.AreEqual(n, f.Name);\n            Assert.AreEqual(f.Name, Constants.CHARSET.GetString(f.NameUTF8));\n\t\t\tAssert.AreEqual(n, f.FullName);\n\t\t\tAssert.IsTrue(f.Id == null);\n\t\t\tAssert.IsTrue(f.Parent == t);\n\t\t\tAssert.IsTrue(f.Repository == db);\n\t\t\tAssert.IsTrue(f.IsLoaded);\n\t\t\tAssert.IsFalse(f.Members.Length > 0);\n\t\t\tAssert.IsFalse(f.IsRoot);\n\t\t\tAssert.IsTrue(f.TreeEntry == f);\n\t\t\tAssert.IsTrue(t.IsModified);\n\t\t\tAssert.IsTrue(t.Id == null);\n\t\t\tAssert.IsTrue(t.findTreeMember(f.Name) == f);\n\n\t\t\tTreeEntry[] i = t.Members;\n\t\t\tAssert.IsTrue(i.Length > 0);\n\t\t\tAssert.IsTrue(i[0] == f);\n\t\t\tAssert.IsTrue(i.Length == 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test005_addRecursiveFile()\n\t\t{\n            var t = new Core.Tree(db);\n\t\t\tFileTreeEntry f = t.AddFile(\"a/b/c\");\n\t\t\tAssert.IsNotNull(f);\n\t\t\tAssert.AreEqual(f.Name, \"c\");\n\t\t\tAssert.AreEqual(f.Parent.Name, \"b\");\n\t\t\tAssert.AreEqual(f.Parent.Parent.Name, \"a\");\n\t\t\tAssert.IsTrue(t == f.Parent.Parent.Parent, \"t is great-grandparent\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test005_addRecursiveTree()\n\t\t{\n            var t = new Core.Tree(db);\n            Core.Tree f = t.AddTree(\"a/b/c\");\n\t\t\tAssert.IsNotNull(f);\n\t\t\tAssert.AreEqual(f.Name, \"c\");\n\t\t\tAssert.AreEqual(f.Parent.Name, \"b\");\n\t\t\tAssert.AreEqual(f.Parent.Parent.Name, \"a\");\n\t\t\tAssert.IsTrue(t == f.Parent.Parent.Parent, \"t is great-grandparent\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test006_addDeepTree()\n\t\t{\n            var t = new Core.Tree(db);\n\n            Core.Tree e = t.AddTree(\"e\");\n\t\t\tAssert.IsNotNull(e);\n\t\t\tAssert.IsTrue(e.Parent == t);\n            Core.Tree f = t.AddTree(\"f\");\n\t\t\tAssert.IsNotNull(f);\n\t\t\tAssert.IsTrue(f.Parent == t);\n            Core.Tree g = f.AddTree(\"g\");\n\t\t\tAssert.IsNotNull(g);\n\t\t\tAssert.IsTrue(g.Parent == f);\n            Core.Tree h = g.AddTree(\"h\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.IsTrue(h.Parent == g);\n\n\t\t\th.Id = SomeFakeId;\n\t\t\tAssert.IsTrue(!h.IsModified);\n\t\t\tg.Id = SomeFakeId;\n\t\t\tAssert.IsTrue(!g.IsModified);\n\t\t\tf.Id = SomeFakeId;\n\t\t\tAssert.IsTrue(!f.IsModified);\n\t\t\te.Id = SomeFakeId;\n\t\t\tAssert.IsTrue(!e.IsModified);\n\t\t\tt.Id = SomeFakeId;\n\t\t\tAssert.IsTrue(!t.IsModified);\n\n\t\t\tAssert.AreEqual(\"f/g/h\", h.FullName);\n\t\t\tAssert.IsTrue(t.findTreeMember(h.FullName) == h);\n\t\t\tAssert.IsTrue(t.FindBlobMember(\"f/z\") == null);\n\t\t\tAssert.IsTrue(t.FindBlobMember(\"y/z\") == null);\n\n\t\t\tFileTreeEntry i = h.AddFile(\"i\");\n\t\t\tAssert.IsNotNull(i);\n\t\t\tAssert.AreEqual(\"f/g/h/i\", i.FullName);\n\t\t\tAssert.IsTrue(t.FindBlobMember(i.FullName) == i);\n\t\t\tAssert.IsTrue(h.IsModified);\n\t\t\tAssert.IsTrue(g.IsModified);\n\t\t\tAssert.IsTrue(f.IsModified);\n\t\t\tAssert.IsTrue(!e.IsModified);\n\t\t\tAssert.IsTrue(t.IsModified);\n\n\t\t\tAssert.IsTrue(h.Id == null);\n\t\t\tAssert.IsTrue(g.Id == null);\n\t\t\tAssert.IsTrue(f.Id == null);\n\t\t\tAssert.IsTrue(e.Id != null);\n\t\t\tAssert.IsTrue(t.Id == null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test007_manyFileLookup()\n\t\t{\n            var t = new Core.Tree(db);\n\t\t\tvar files = new List<FileTreeEntry>(26 * 26);\n\t\t\tfor (char level1 = 'a'; level1 <= 'z'; level1++)\n\t\t\t{\n\t\t\t\tfor (char level2 = 'a'; level2 <= 'z'; level2++)\n\t\t\t\t{\n\t\t\t\t\tString n = \".\" + level1 + level2 + \"9\";\n\t\t\t\t\tFileTreeEntry f = t.AddFile(n);\n\t\t\t\t\tAssert.IsNotNull(f, \"File \" + n + \" added.\");\n\t\t\t\t\tAssert.AreEqual(n, f.Name);\n\t\t\t\t\tfiles.Add(f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAssert.AreEqual(files.Count, t.MemberCount);\n\t\t\tTreeEntry[] ents = t.Members;\n\t\t\tAssert.IsNotNull(ents);\n\t\t\tAssert.AreEqual(files.Count, ents.Length);\n\t\t\tfor (int k = 0; k < ents.Length; k++)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(files[k] == ents[k], \"File \" + files[k].Name + \" is at \" + k + \".\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test008_SubtreeInternalSorting()\n\t\t{\n            var t = new Core.Tree(db);\n\t\t\tFileTreeEntry e0 = t.AddFile(\"a-b\");\n\t\t\tFileTreeEntry e1 = t.AddFile(\"a-\");\n\t\t\tFileTreeEntry e2 = t.AddFile(\"a=b\");\n            Core.Tree e3 = t.AddTree(\"a\");\n\t\t\tFileTreeEntry e4 = t.AddFile(\"a=\");\n\n\t\t\tTreeEntry[] ents = t.Members;\n\t\t\tAssert.AreSame(e1, ents[0]);\n\t\t\tAssert.AreSame(e0, ents[1]);\n\t\t\tAssert.AreSame(e3, ents[2]);\n\t\t\tAssert.AreSame(e4, ents[3]);\n\t\t\tAssert.AreSame(e2, ents[4]);\n\t\t}\n\n        [Test]\n\t    public void test009_SymlinkAndGitlink()\n\t    {\n            Core.Tree symlinkTree = db.MapTree(\"symlink\");\n\t        Assert.IsTrue(symlinkTree.ExistsBlob(\"symlink.txt\"), \"Symlink entry exists\");\n            Core.Tree gitlinkTree = db.MapTree(\"gitlink\");\n\t        Assert.IsTrue(gitlinkTree.ExistsBlob(\"submodule\"), \"Gitlink entry exists\");\n\t    }\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0003_Basic_Config.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class T0003_Basic_Config : RepositoryTestCase\n    {\n        [Test]\n        public void test005_ReadSimpleConfig()\n        {\n            RepositoryConfig c = db.Config;\n            Assert.IsNotNull(c);\n            Assert.AreEqual(\"0\", c.getString(\"core\", null, \"repositoryformatversion\"));\n            Assert.AreEqual(\"0\", c.getString(\"CoRe\", null, \"REPOSITORYFoRmAtVeRsIoN\"));\n            Assert.AreEqual(\"true\", c.getString(\"core\", null, \"filemode\"));\n            Assert.AreEqual(\"true\", c.getString(\"cOrE\", null, \"fIlEModE\"));\n            Assert.IsNull(c.getString(\"notavalue\", null, \"reallyNotAValue\"));\n        }\n\n        [Test]\n        public void test006_ReadUglyConfig()\n        {\n            RepositoryConfig c = db.Config;\n            string cfg = Path.Combine(db.Directory.FullName, \"config\");\n            \n            string configStr = \"  [core];comment\\n\\tfilemode = yes\\n\"\n                   + \"[user]\\n\"\n                   + \"  email = A U Thor <thor@example.com> # Just an example...\\n\"\n                   + \" name = \\\"A  Thor \\\\\\\\ \\\\\\\"\\\\t \\\"\\n\"\n                   + \"    defaultCheckInComment = a many line\\\\n\\\\\\ncomment\\\\n\\\\\\n\"\n                   + \" to test\\n\";\n            File.WriteAllText(cfg, configStr);\n            c.load();\n            Assert.AreEqual(\"yes\", c.getString(\"core\", null, \"filemode\"));\n            Assert.AreEqual(\"A U Thor <thor@example.com>\", c\n                    .getString(\"user\", null, \"email\"));\n            Assert.AreEqual(\"A  Thor \\\\ \\\"\\t \", c.getString(\"user\", null, \"name\"));\n            Assert.AreEqual(\"a many line\\ncomment\\n to test\", c.getString(\"user\", null, \"defaultCheckInComment\"));\n            c.save();\n            var configStr1 = File.ReadAllText(cfg);\n            Assert.AreEqual(configStr, configStr1);\n        }\n\n        [Test]\n        public void test007_Open()\n        {\n            using (Core.Repository db2 = new Core.Repository(db.Directory))\n            {\n                Assert.AreEqual(db.Directory, db2.Directory);\n                Assert.AreEqual(db.ObjectsDirectory.FullName, db2.ObjectsDirectory.FullName);\n                Assert.AreNotSame(db.Config, db2.Config);\n            }\n        }\n\n        [Test]\n        public void test008_FailOnWrongVersion()\n        {\n            string cfg = db.Directory.FullName + \"/config\";\n\n            string badvers = \"ihopethisisneveraversion\";\n            string configStr = \"[core]\\n\" + \"\\trepositoryFormatVersion=\"\n                               + badvers + \"\\n\";\n            File.WriteAllText(cfg, configStr);\n\n            var ioe = AssertHelper.Throws<IOException>(() =>\n                                                           {\n                                                               new Core.Repository(db.Directory);\n                                                               Assert.Fail(\"incorrectly opened a bad repository\");\n                                                           }\n                );\n\n            Assert.IsTrue(ioe.Message.IndexOf(\"format\") > 0);\n            Assert.IsTrue(ioe.Message.IndexOf(badvers) > 0);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0003_Basic_Write.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Text;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Tests.GitSharp.Core\n{\n    [TestFixture]\n    public class T0003_Basic_Write : SampleDataRepositoryTestCase\n    {\n        [Test]\n        public void test001_Initalize()\n        {\n            var gitdir = PathUtil.CombineDirectoryPath(trash, Constants.DOT_GIT);\n            var objects = PathUtil.CombineDirectoryPath(gitdir, \"objects\");\n            var objects_pack = PathUtil.CombineDirectoryPath(objects, \"pack\");\n            var objects_info = PathUtil.CombineDirectoryPath(objects, \"info\");\n            var refs = PathUtil.CombineDirectoryPath(gitdir, \"refs\");\n            var refs_heads = PathUtil.CombineDirectoryPath(refs, \"heads\");\n            var refs_tags = PathUtil.CombineDirectoryPath(refs, \"tags\");\n            var HEAD = PathUtil.CombineFilePath(gitdir, \"HEAD\");\n\n            Assert.IsTrue(trash.IsDirectory(), \"Exists \" + trash);\n            Assert.IsTrue(objects.IsDirectory(), \"Exists \" + objects);\n            Assert.IsTrue(objects_pack.IsDirectory(), \"Exists \" + objects_pack);\n            Assert.IsTrue(objects_info.IsDirectory(), \"Exists \" + objects_info);\n            Assert.AreEqual(2, objects.ListFiles().Length);\n            Assert.IsTrue(refs.IsDirectory(), \"Exists \" + refs);\n            Assert.IsTrue(refs_heads.IsDirectory(), \"Exists \" + refs_heads);\n            Assert.IsTrue(refs_tags.IsDirectory(), \"Exists \" + refs_tags);\n            Assert.IsTrue(HEAD.IsFile(), \"Exists \" + HEAD);\n            Assert.AreEqual(23, HEAD.Length);\n        }\n\n        [Test]\n        public void test000_openRepoBadArgs()\n        {\n            var e = AssertHelper.Throws<ArgumentException>(() => { using (var r = new global::GitSharp.Core.Repository(null, null)) { } });\n            Assert.AreEqual(\"Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor\", e.Message);\n        }\n\n        /*\n         * Check the default rules for looking up directories and files within a\n         * repo when the gitDir is given.\n         */\n        [Test]\n        public void test000_openrepo_default_gitDirSet()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(theDir, null))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(repo1Parent, r.WorkingDirectory);\n                assertEqualsPath(PathUtil.CombineFilePath(theDir, \"index\"), r.getIndexFile());\n                assertEqualsPath(PathUtil.CombineDirectoryPath(theDir, \"objects\"), r.ObjectsDirectory);\n            }\n        }\n\n        /*\n         * Check that we can pass both a git directory and a work tree\n         * repo when the gitDir is given.\n         */\n        [Test]\n        public void test000_openrepo_default_gitDirAndWorkTreeSet()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(theDir, repo1Parent.Parent))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(repo1Parent.Parent, r.WorkingDirectory);\n                assertEqualsPath(PathUtil.CombineFilePath(theDir, \"index\"), r.getIndexFile());\n                assertEqualsPath(PathUtil.CombineDirectoryPath(theDir, \"objects\"), r.ObjectsDirectory);\n            }\n        }\n\n        /*\n         * Check the default rules for looking up directories and files within a\n         * repo when the workTree is given.\n         */\n        [Test]\n        public void test000_openrepo_default_workDirSet()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(null, repo1Parent))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(repo1Parent, r.WorkingDirectory);\n                assertEqualsPath(PathUtil.CombineFilePath(theDir, \"index\"), r.getIndexFile());\n                assertEqualsPath(PathUtil.CombineDirectoryPath(theDir, \"objects\"), r.ObjectsDirectory);\n            }\n        }\n\n        /*\n         * Check that worktree config has an effect, given absolute path.\n         */\n        [Test]\n        public void test000_openrepo_default_absolute_workdirconfig()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            DirectoryInfo workdir = PathUtil.CombineDirectoryPath(trash.Parent, \"rw\");\n            workdir.Mkdirs();\n\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n                repo1initial.Config.setString(\"core\", null, \"worktree\", workdir.FullName);\n                repo1initial.Config.save();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(theDir, null))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(workdir, r.WorkingDirectory);\n                assertEqualsPath(PathUtil.CombineFilePath(theDir, \"index\"), r.getIndexFile());\n                assertEqualsPath(PathUtil.CombineDirectoryPath(theDir, \"objects\"), r.ObjectsDirectory);\n            }\n        }\n\n        /*\n         * Check that worktree config has an effect, given a relative path.\n         */\n        [Test]\n        public void test000_openrepo_default_relative_workdirconfig()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            DirectoryInfo workdir = PathUtil.CombineDirectoryPath(trash.Parent, \"rw\");\n            workdir.Mkdirs();\n\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n                repo1initial.Config.setString(\"core\", null, \"worktree\", \"../../rw\");\n                repo1initial.Config.save();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(theDir, null))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(workdir, r.WorkingDirectory);\n                assertEqualsPath(PathUtil.CombineFilePath(theDir, \"index\"), r.getIndexFile());\n                assertEqualsPath(PathUtil.CombineDirectoryPath(theDir, \"objects\"), r.ObjectsDirectory);\n            }\n        }\n\n        /*\n         * Check that the given index file is honored and the alternate object\n         * directories too\n         */\n        [Test]\n        [Ignore(\"Repository is not properly released. Once this bug is fixed, remove final GC.Collect() call.\" )]\n        public void test000_openrepo_alternate_index_file_and_objdirs()\n        {\n            DirectoryInfo repo1Parent = PathUtil.CombineDirectoryPath(trash.Parent, \"r1\");\n            FileInfo indexFile = PathUtil.CombineFilePath(trash, \"idx\");\n            DirectoryInfo objDir = PathUtil.CombineDirectoryPath(trash, \"../obj\");\n            DirectoryInfo[] altObjDirs = new[] { db.ObjectsDirectory };\n\n            using (global::GitSharp.Core.Repository repo1initial = new global::GitSharp.Core.Repository(PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT)))\n            {\n                repo1initial.Create();\n            }\n\n            DirectoryInfo theDir = PathUtil.CombineDirectoryPath(repo1Parent, Constants.DOT_GIT);\n            using (global::GitSharp.Core.Repository r = new global::GitSharp.Core.Repository(theDir, null, objDir, altObjDirs, indexFile))\n            {\n                assertEqualsPath(theDir, r.Directory);\n                assertEqualsPath(theDir.Parent, r.WorkingDirectory);\n                assertEqualsPath(indexFile, r.getIndexFile());\n                assertEqualsPath(objDir, r.ObjectsDirectory);\n                Assert.IsNotNull(r.MapCommit(\"6db9c2ebf75590eef973081736730a9ea169a0c4\"));\n                // Must close or the default repo pack files created by this test gets\n                // locked via the alternate object directories on Windows.\n                r.Close();\n            }\n\n            GC.Collect(); // To be removed once the repository resource releasing is fixed.\n        }\n\n        protected void assertEqualsPath(FileSystemInfo expected, FileSystemInfo actual)\n        {\n            Assert.AreEqual(expected.FullName, actual.FullName);\n        }\n\n        [Test]\n        public void Write_Blob()\n        {\n            ObjectId id = new ObjectWriter(db).WriteBlob(new FileInfo(\"Resources/single_file_commit/i-am-a-file\"));\n            Assert.AreEqual(\"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\", id.Name);\n            Assert.AreEqual(Inspector.Inspect(\"Resources/single_file_commit\", \"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\"), new Inspector(db).Inspect(id));\n\n            writeTrashFile(\"i-am-a-file\", \"and this is the data in me\\r\\n\\r\\n\");\n            id = new ObjectWriter(db).WriteBlob(new FileInfo(db.WorkingDirectory.FullName + \"/i-am-a-file\"));\n            Assert.AreEqual(\"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\", id.Name);\n        }\n\n        [Test]\n        public void Write_Tree()\n        {\n            var t = new global::GitSharp.Core.Tree(db);\n            FileTreeEntry f = t.AddFile(\"i-am-a-file\");\n            writeTrashFile(f.Name, \"and this is the data in me\\r\\n\\r\\n\");\n            Assert.AreEqual(File.ReadAllText(\"Resources/single_file_commit/i-am-a-file\"), File.ReadAllText(db.WorkingDirectory.FullName + \"/i-am-a-file\"));\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            var id = t.Id;\n\n            int git_w1;\n            int git_w2;\n            int w1;\n            int w2;\n\n            using (var b1 = new BinaryReader(new Inspector(db).ContentStream(id)))\n            using (var b2 = new BinaryReader(Inspector.ContentStream(\"Resources/single_file_commit\", \"917c130bd4fa5bf2df0c399dc1b03401860aa448\")))\n            {\n                b1.BaseStream.Position = b1.BaseStream.Length - 21;\n                b2.BaseStream.Position = b2.BaseStream.Length - 21;\n                Assert.AreEqual(b2.ReadByte(), b1.ReadByte());\n\n                git_w1 = b2.ReadInt32();\n                git_w2 = b2.ReadInt32();\n                var git_w3 = b2.ReadInt32();\n                var git_w4 = b2.ReadInt32();\n                var git_w5 = b2.ReadInt32();\n                b2.BaseStream.Position = b2.BaseStream.Length - 20;\n                var git_id = ObjectId.FromRaw(b2.ReadBytes(20));\n                w1 = b1.ReadInt32();\n                w2 = b1.ReadInt32();\n            }\n\n            Assert.AreEqual(git_w1,w1);\n            Assert.AreEqual(git_w2, w2);\n\n            Assert.AreEqual(\"917c130bd4fa5bf2df0c399dc1b03401860aa448\", id.Name);\n            var s_git = Inspector.Inspect(\"Resources/single_file_commit\", \"917c130bd4fa5bf2df0c399dc1b03401860aa448\");\n            var s = new Inspector(db).Inspect(id);\n            Assert.AreEqual(s_git, s);\n        }\n\n        [Test]\n        public void test002_WriteEmptyTree()\n        {\n            // One of our test packs contains the empty tree object. If the pack is\n            // open when we Create it we won't write the object file out as a loose\n            // object (as it already exists in the pack).\n            //\n            global::GitSharp.Core.Repository newdb = createBareRepository();\n            var t = new global::GitSharp.Core.Tree(newdb);\n            t.Accept(new WriteTree(trash, newdb), TreeEntry.MODIFIED_ONLY);\n            Assert.AreEqual(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\", t.Id.Name);\n            var o = new FileInfo(newdb.Directory + \"/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904\");\n            Assert.IsTrue(o.IsFile(), \"Exists \" + o);\n            Assert.IsTrue(o.IsReadOnly, \"Read-only \" + o);\n        }\n\n        [Test]\n        public void test002_WriteEmptyTree2()\n        {\n            // File shouldn't exist as it is in a test pack.\n            //\n            var t = new global::GitSharp.Core.Tree(db);\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            Assert.AreEqual(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\", t.Id.Name);\n            var o = new FileInfo(db.Directory + \"/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904\");\n            Assert.IsFalse(o.IsFile(), \"Exists \" + o);\n        }\n\n        [Test]\n        public void test003_WriteShouldBeEmptyTree()\n        {\n            global::GitSharp.Core.Tree t = new global::GitSharp.Core.Tree(db);\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            t.AddFile(\"should-be-empty\").Id = emptyId;\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            Assert.AreEqual(\"7bb943559a305bdd6bdee2cef6e5df2413c3d30a\", t.Id.Name);\n\n            var o = new FileInfo(db.Directory + \"/objects/7b/b943559a305bdd6bdee2cef6e5df2413c3d30a\");\n            Assert.IsTrue(o.IsFile(), \"Exists \" + o);\n            Assert.IsTrue(o.IsReadOnly, \"Read-only \" + o);\n\n            o = new FileInfo(db.Directory + \"/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391\");\n            Assert.IsTrue(o.IsFile(), \"Exists \" + o);\n            Assert.IsTrue(o.IsReadOnly, \"Read-only \" + o);\n        }\n\n        [Test]\n        public void Write_Simple_Commit()\n        {\n            var t = new global::GitSharp.Core.Tree(db);\n            FileTreeEntry f = t.AddFile(\"i-am-a-file\");\n            writeTrashFile(f.Name, \"and this is the data in me\\r\\n\\r\\n\");\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            //new ObjectChecker().checkBlob(Constants.CHARSET.GetString(db.OpenObject(t.TreeId).getBytes()).ToCharArray());\n\n            string s = new Inspector(db).Inspect(t.Id);\n            string s1 = Inspector.Inspect(\"Resources/single_file_commit\", \"16c0beaf7523eb3ef5df45bd42dd4fc6343de864\");\n            string s2 = Inspector.Inspect(\"Resources/single_file_commit\", \"917c130bd4fa5bf2df0c399dc1b03401860aa448\");\n            string s3 = Inspector.Inspect(\"Resources/single_file_commit\", \"95ea6a6859af6791464bd8b6de76ad5a6f9fad81\");\n\n            //tree 917c130bd4fa5bf2df0c399dc1b03401860aa448\\nauthor henon <meinrad.recheis@gmail.com> 1245946742 +0200\\ncommitter henon <meinrad.recheis@gmail.com> 1245946742 +0200\\n\\nA Commit\\n\"\n\n            Assert.AreEqual(ObjectId.FromString(\"917c130bd4fa5bf2df0c399dc1b03401860aa448\"), t.Id);\n\n\n            var c = new global::GitSharp.Core.Commit(db)\n                        {\n                            Author = (new PersonIdent(\"henon\", \"meinrad.recheis@gmail.com\", 1245946742000L, 2*60)),\n                            Committer = (new PersonIdent(\"henon\", \"meinrad.recheis@gmail.com\", 1245946742000L, 2*60)),\n                            Message = (\"A Commit\\n\"),\n                            TreeEntry = (t)\n                        };\n            Assert.AreEqual(t.TreeId, c.TreeId);\n            c.Save();\n\n            string s_c = new Inspector(db).Inspect(c.CommitId);\n            ObjectId cmtid = ObjectId.FromString(\"16c0beaf7523eb3ef5df45bd42dd4fc6343de864\");\n            Assert.AreEqual(cmtid, c.CommitId);\n\n            // Verify the commit we just wrote is in the correct format.\n            //using (var xis = new XInputStream(new FileStream(db.ToFile(cmtid).FullName, System.IO.FileMode.Open, FileAccess.Read)))\n            //{\n            //    Assert.AreEqual(0x78, xis.ReadUInt8());\n            //    Assert.AreEqual(0x9c, xis.ReadUInt8());\n            //    Assert.IsTrue(0x789c % 31 == 0);\n            //}\n\n            // Verify we can Read it.\n            global::GitSharp.Core.Commit c2 = db.MapCommit(cmtid.Name);\n            Assert.IsNotNull(c2);\n            Assert.AreEqual(c.Message, c2.Message);\n            Assert.AreEqual(c.TreeId, c2.TreeId);\n            Assert.AreEqual(c.Author, c2.Author);\n            Assert.AreEqual(c.Committer, c2.Committer);\n        }\n\n        [Test]\n        public void test009_CreateCommitOldFormat()\n        {\n            writeTrashFile(\".git/config\", \"[core]\\n\" + \"legacyHeaders=1\\n\");\n            db.Config.load();\n            Assert.AreEqual(true, db.Config.getBoolean(\"core\", \"legacyHeaders\", false));\n\n            var t = new global::GitSharp.Core.Tree(db);\n            FileTreeEntry f = t.AddFile(\"i-am-a-file\");\n            writeTrashFile(f.Name, \"and this is the data in me\\n\");\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n\n            Assert.AreEqual(ObjectId.FromString(\"00b1f73724f493096d1ffa0b0f1f1482dbb8c936\"), t.TreeId);\n\n\n            var c = new global::GitSharp.Core.Commit(db)\n                        {\n                            Author = (new PersonIdent(author, 1154236443000L, -4*60)),\n                            Committer = (new PersonIdent(committer, 1154236443000L, -4*60)),\n                            Message = (\"A Commit\\n\"),\n                            TreeEntry = t\n                        };\n            Assert.AreEqual(t.TreeId, c.TreeId);\n            c.Save();\n\n            ObjectId cmtid = ObjectId.FromString(\"803aec4aba175e8ab1d666873c984c0308179099\");\n            Assert.AreEqual(cmtid, c.CommitId);\n\n            // Verify the commit we just wrote is in the correct format.\n            using (var xis = new XInputStream(new FileStream(db.ToFile(cmtid).FullName, System.IO.FileMode.Open, FileAccess.Read)))\n            {\n                Assert.AreEqual(0x78, xis.ReadUInt8());\n                Assert.AreEqual(0x9c, xis.ReadUInt8());\n                Assert.IsTrue(0x789c % 31 == 0);\n            }\n\n            // Verify we can Read it.\n            global::GitSharp.Core.Commit c2 = db.MapCommit(cmtid);\n            Assert.IsNotNull(c2);\n            Assert.AreEqual(c.Message, c2.Message);\n            Assert.AreEqual(c.TreeId, c2.TreeId);\n            Assert.AreEqual(c.Author, c2.Author);\n            Assert.AreEqual(c.Committer, c2.Committer);\n        }\n\n\n        [Test]\n        public void test012_SubtreeExternalSorting()\n        {\n            ObjectId emptyBlob = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var t = new global::GitSharp.Core.Tree(db);\n            FileTreeEntry e0 = t.AddFile(\"a-\");\n            FileTreeEntry e1 = t.AddFile(\"a-b\");\n            FileTreeEntry e2 = t.AddFile(\"a/b\");\n            FileTreeEntry e3 = t.AddFile(\"a=\");\n            FileTreeEntry e4 = t.AddFile(\"a=b\");\n\n            e0.Id = emptyBlob;\n            e1.Id = emptyBlob;\n            e2.Id = emptyBlob;\n            e3.Id = emptyBlob;\n            e4.Id = emptyBlob;\n\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            Assert.AreEqual(ObjectId.FromString(\"b47a8f0a4190f7572e11212769090523e23eb1ea\"), t.Id);\n        }\n\n        [Test]\n        public void test020_createBlobTag()\n        {\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var t = new global::GitSharp.Core.Tag(db)\n                        {\n                            Id = emptyId,\n                            TagType = \"blob\",\n                            TagName = \"test020\",\n                            Author = new PersonIdent(author, 1154236443000L, -4*60),\n                            Message = \"test020 tagged\\n\"\n                        };\n            t.Save();\n            Assert.AreEqual(\"6759556b09fbb4fd8ae5e315134481cc25d46954\", t.TagId.Name);\n\n            global::GitSharp.Core.Tag MapTag = db.MapTag(\"test020\");\n            Assert.AreEqual(\"blob\", MapTag.TagType);\n            Assert.AreEqual(\"test020 tagged\\n\", MapTag.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), MapTag.Author);\n            Assert.AreEqual(\"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\", MapTag.Id.Name);\n        }\n\n        [Test]\n        public void test020b_createBlobPlainTag()\n        {\n            test020_createBlobTag();\n            var t = new global::GitSharp.Core.Tag(db)\n                        {\n                            TagName = \"test020b\",\n                            Id = ObjectId.FromString(\"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\")\n                        };\n            t.Save();\n\n            global::GitSharp.Core.Tag MapTag = db.MapTag(\"test020b\");\n            Assert.AreEqual(\"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\", MapTag.Id.Name);\n\n            // We do not repeat the plain tag test for other object types\n        }\n\n        [Test]\n        public void test021_createTreeTag()\n        {\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var almostEmptyTree = new global::GitSharp.Core.Tree(db);\n            almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, \"empty\".getBytes(), false));\n            ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree);\n\n            var t = new global::GitSharp.Core.Tag(db)\n                        {\n                            Id = almostEmptyTreeId,\n                            TagType = \"tree\",\n                            TagName = \"test021\",\n                            Author = new PersonIdent(author, 1154236443000L, -4*60),\n                            Message = \"test021 tagged\\n\"\n                        };\n        \t\n            t.Save();\n            Assert.AreEqual(\"b0517bc8dbe2096b419d42424cd7030733f4abe5\", t.TagId.Name);\n\n            global::GitSharp.Core.Tag MapTag = db.MapTag(\"test021\");\n            Assert.AreEqual(\"tree\", MapTag.TagType);\n            Assert.AreEqual(\"test021 tagged\\n\", MapTag.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), MapTag.Author);\n            Assert.AreEqual(\"417c01c8795a35b8e835113a85a5c0c1c77f67fb\", MapTag.Id.Name);\n        }\n\n        [Test]\n        public void test022_createCommitTag()\n        {\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var almostEmptyTree = new global::GitSharp.Core.Tree(db);\n            almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, \"empty\".getBytes(), false));\n            ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree);\n\n            var almostEmptyCommit = new global::GitSharp.Core.Commit(db)\n                                        {\n                                            Author = new PersonIdent(author, 1154236443000L, -2*60),\n                                            Committer = new PersonIdent(author, 1154236443000L, -2*60),\n                                            Message = \"test022\\n\",\n                                            TreeId = almostEmptyTreeId\n                                        };\n\n            ObjectId almostEmptyCommitId = new ObjectWriter(db).WriteCommit(almostEmptyCommit);\n\n            var t = new global::GitSharp.Core.Tag(db)\n                        {\n                            Id = almostEmptyCommitId,\n                            TagType = \"commit\",\n                            TagName = \"test022\",\n                            Author = new PersonIdent(author, 1154236443000L, -4*60),\n                            Message = \"test022 tagged\\n\"\n                        };\n\n            t.Save();\n            Assert.AreEqual(\"0ce2ebdb36076ef0b38adbe077a07d43b43e3807\", t.TagId.Name);\n\n            global::GitSharp.Core.Tag mapTag = db.MapTag(\"test022\");\n            Assert.AreEqual(\"commit\", mapTag.TagType);\n            Assert.AreEqual(\"test022 tagged\\n\", mapTag.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), mapTag.Author);\n            Assert.AreEqual(\"b5d3b45a96b340441f5abb9080411705c51cc86c\", mapTag.Id.Name);\n        }\n\n        [Test]\n        public void test023_createCommitNonAnullii()\n        {\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var almostEmptyTree = new global::GitSharp.Core.Tree(db);\n            almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, \"empty\".getBytes(), false));\n            ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree);\n\n            var commit = new global::GitSharp.Core.Commit(db)\n                             {\n                                 TreeId = almostEmptyTreeId,\n                                 Author = new PersonIdent(\"Joe H\\u00e4cker\", \"joe@example.com\", 4294967295000L, 60),\n                                 Committer = new PersonIdent(\"Joe Hacker\", \"joe2@example.com\", 4294967295000L, 60),\n                                 Encoding = Constants.CHARSET,\n                                 Message = \"\\u00dcbergeeks\"\n                             };\n        \t\n            ObjectId cid = new ObjectWriter(db).WriteCommit(commit);\n            Assert.AreEqual(\"4680908112778718f37e686cbebcc912730b3154\", cid.Name);\n\n            global::GitSharp.Core.Commit loadedCommit = db.MapCommit(cid);\n            Assert.AreNotSame(loadedCommit, commit);\n            Assert.AreEqual(commit.Message, loadedCommit.Message);\n        }\n\n        [Test]\n        public void test024_createCommitNonAscii()\n        {\n            ObjectId emptyId = new ObjectWriter(db).WriteBlob(new byte[0]);\n            var almostEmptyTree = new global::GitSharp.Core.Tree(db);\n            almostEmptyTree.AddEntry(new FileTreeEntry(almostEmptyTree, emptyId, \"empty\".getBytes(), false));\n            ObjectId almostEmptyTreeId = new ObjectWriter(db).WriteTree(almostEmptyTree);\n            var commit = new global::GitSharp.Core.Commit(db)\n                             {\n                                 TreeId = almostEmptyTreeId,\n                                 Author = new PersonIdent(\"Joe H\\u00e4cker\", \"joe@example.com\", 4294967295000L, 60),\n                                 Committer = new PersonIdent(\"Joe Hacker\", \"joe2@example.com\", 4294967295000L, 60),\n                                 Encoding = Encoding.GetEncoding(\"ISO-8859-1\"),\n                                 Message = \"\\u00dcbergeeks\"\n                             };\n            ObjectId cid = new ObjectWriter(db).WriteCommit(commit);\n            var s = new Inspector(db).Inspect(cid);\n            Assert.AreEqual(\"2979b39d385014b33287054b87f77bcb3ecb5ebf\", cid.Name);\n        }\n\n        [Test]\n        public void test025_packedRefs()\n        {\n            test020_createBlobTag();\n            test021_createTreeTag();\n            test022_createCommitTag();\n\n            new FileInfo(db.Directory.FullName + \"/refs/tags/test020\").Delete();\n            if (new FileInfo(db.Directory.FullName + \"/refs/tags/test020\").Exists) throw new IOException(\"Cannot delete unpacked tag\");\n            new FileInfo(db.Directory.FullName + \"/refs/tags/test021\").Delete();\n            if (new FileInfo(db.Directory.FullName + \"/refs/tags/test021\").Exists) throw new IOException(\"Cannot delete unpacked tag\");\n            new FileInfo(db.Directory.FullName + \"/refs/tags/test022\").Delete();\n            if (new FileInfo(db.Directory.FullName + \"/refs/tags/test022\").Exists) throw new IOException(\"Cannot delete unpacked tag\");\n\n            // We cannot Resolve it now, since we have no ref\n            global::GitSharp.Core.Tag mapTag20missing = db.MapTag(\"test020\");\n            Assert.IsNull(mapTag20missing);\n\n            // Construct packed refs file\n            var fs = new FileStream(db.Directory.FullName + \"/packed-refs\", System.IO.FileMode.Create);\n            using (var w = new StreamWriter(fs))\n            {\n                w.WriteLine(\"# packed-refs with: peeled\");\n                w.WriteLine(\"6759556b09fbb4fd8ae5e315134481cc25d46954 refs/tags/test020\");\n                w.WriteLine(\"^e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\");\n                w.WriteLine(\"b0517bc8dbe2096b419d42424cd7030733f4abe5 refs/tags/test021\");\n                w.WriteLine(\"^417c01c8795a35b8e835113a85a5c0c1c77f67fb\");\n                w.WriteLine(\"0ce2ebdb36076ef0b38adbe077a07d43b43e3807 refs/tags/test022\");\n                w.WriteLine(\"^b5d3b45a96b340441f5abb9080411705c51cc86c\");\n            }\n\n            ((RefDirectory)db.RefDatabase).rescan();\n            global::GitSharp.Core.Tag mapTag20 = db.MapTag(\"test020\");\n            Assert.IsNotNull(mapTag20, \"have tag test020\");\n            Assert.AreEqual(\"blob\", mapTag20.TagType);\n            Assert.AreEqual(\"test020 tagged\\n\", mapTag20.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), mapTag20.Author);\n            Assert.AreEqual(\"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\", mapTag20.Id.Name);\n\n            global::GitSharp.Core.Tag mapTag21 = db.MapTag(\"test021\");\n            Assert.AreEqual(\"tree\", mapTag21.TagType);\n            Assert.AreEqual(\"test021 tagged\\n\", mapTag21.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), mapTag21.Author);\n            Assert.AreEqual(\"417c01c8795a35b8e835113a85a5c0c1c77f67fb\", mapTag21.Id.Name);\n\n            global::GitSharp.Core.Tag mapTag22 = db.MapTag(\"test022\");\n            Assert.AreEqual(\"commit\", mapTag22.TagType);\n            Assert.AreEqual(\"test022 tagged\\n\", mapTag22.Message);\n            Assert.AreEqual(new PersonIdent(author, 1154236443000L, -4 * 60), mapTag22.Author);\n            Assert.AreEqual(\"b5d3b45a96b340441f5abb9080411705c51cc86c\", mapTag22.Id.Name);\n        }\n\n        [Test]\n        public void test025_computeSha1NoStore()\n        {\n            byte[] data = \"test025 some data, more than 16 bytes to get good coverage\".getBytes(\"ISO-8859-1\");\n            ObjectId id = new ObjectWriter(db).ComputeBlobSha1(data.Length, new MemoryStream(data));\n            Assert.AreEqual(\"4f561df5ecf0dfbd53a0dc0f37262fef075d9dde\", id.Name);\n        }\n\n        [Test]\n        public void test026_CreateCommitMultipleparents()\n        {\n            db.Config.load();\n\n            var t = new global::GitSharp.Core.Tree(db);\n            FileTreeEntry f = t.AddFile(\"i-am-a-file\");\n            writeTrashFile(f.Name, \"and this is the data in me\\n\");\n            t.Accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);\n            Assert.AreEqual(ObjectId.FromString(\"00b1f73724f493096d1ffa0b0f1f1482dbb8c936\"),\n                            t.TreeId);\n\n            var c1 = new global::GitSharp.Core.Commit(db)\n                         {\n                             Author = new PersonIdent(author, 1154236443000L, -4*60),\n                             Committer = new PersonIdent(committer, 1154236443000L, -4*60),\n                             Message = \"A Commit\\n\",\n                             TreeEntry = t\n                         };\n\n            Assert.AreEqual(t.TreeId, c1.TreeId);\n            c1.Save();\n            ObjectId cmtid1 = ObjectId.FromString(\"803aec4aba175e8ab1d666873c984c0308179099\");\n            Assert.AreEqual(cmtid1, c1.CommitId);\n\n            var c2 = new global::GitSharp.Core.Commit(db)\n                         {\n                             Author = new PersonIdent(author, 1154236443000L, -4*60),\n                             Committer = new PersonIdent(committer, 1154236443000L, -4*60),\n                             Message = \"A Commit 2\\n\",\n                             TreeEntry = t\n                         };\n\n            Assert.AreEqual(t.TreeId, c2.TreeId);\n            c2.ParentIds = new[] { c1.CommitId };\n            c2.Save();\n            ObjectId cmtid2 = ObjectId.FromString(\"95d068687c91c5c044fb8c77c5154d5247901553\");\n            Assert.AreEqual(cmtid2, c2.CommitId);\n\n            global::GitSharp.Core.Commit rm2 = db.MapCommit(cmtid2);\n            Assert.AreNotSame(c2, rm2); // assert the parsed objects is not from the cache\n            Assert.AreEqual(c2.Author, rm2.Author);\n            Assert.AreEqual(c2.CommitId, rm2.CommitId);\n            Assert.AreEqual(c2.Message, rm2.Message);\n            Assert.AreEqual(c2.TreeEntry.TreeId, rm2.TreeEntry.TreeId);\n            Assert.AreEqual(1, rm2.ParentIds.Length);\n            Assert.AreEqual(c1.CommitId, rm2.ParentIds[0]);\n\n            var c3 = new global::GitSharp.Core.Commit(db)\n                         {\n                             Author = new PersonIdent(author, 1154236443000L, -4*60),\n                             Committer = new PersonIdent(committer, 1154236443000L, -4*60),\n                             Message = \"A Commit 3\\n\",\n                             TreeEntry = t\n                         };\n\n            Assert.AreEqual(t.TreeId, c3.TreeId);\n            c3.ParentIds = new[] { c1.CommitId, c2.CommitId };\n            c3.Save();\n            ObjectId cmtid3 = ObjectId.FromString(\"ce6e1ce48fbeeb15a83f628dc8dc2debefa066f4\");\n            Assert.AreEqual(cmtid3, c3.CommitId);\n\n            global::GitSharp.Core.Commit rm3 = db.MapCommit(cmtid3);\n            Assert.AreNotSame(c3, rm3); // assert the parsed objects is not from the cache\n            Assert.AreEqual(c3.Author, rm3.Author);\n            Assert.AreEqual(c3.CommitId, rm3.CommitId);\n            Assert.AreEqual(c3.Message, rm3.Message);\n            Assert.AreEqual(c3.TreeEntry.TreeId, rm3.TreeEntry.TreeId);\n            Assert.AreEqual(2, rm3.ParentIds.Length);\n            Assert.AreEqual(c1.CommitId, rm3.ParentIds[0]);\n            Assert.AreEqual(c2.CommitId, rm3.ParentIds[1]);\n\n            var c4 = new global::GitSharp.Core.Commit(db)\n                         {\n                             Author = new PersonIdent(author, 1154236443000L, -4*60),\n                             Committer = new PersonIdent(committer, 1154236443000L, -4*60),\n                             Message = \"A Commit 4\\n\",\n                             TreeEntry = t\n                         };\n\n            Assert.AreEqual(t.TreeId, c3.TreeId);\n            c4.ParentIds = new[] { c1.CommitId, c2.CommitId, c3.CommitId };\n            c4.Save();\n            ObjectId cmtid4 = ObjectId.FromString(\"d1fca9fe3fef54e5212eb67902c8ed3e79736e27\");\n            Assert.AreEqual(cmtid4, c4.CommitId);\n\n            global::GitSharp.Core.Commit rm4 = db.MapCommit(cmtid4);\n            Assert.AreNotSame(c4, rm3); // assert the parsed objects is not from the cache\n            Assert.AreEqual(c4.Author, rm4.Author);\n            Assert.AreEqual(c4.CommitId, rm4.CommitId);\n            Assert.AreEqual(c4.Message, rm4.Message);\n            Assert.AreEqual(c4.TreeEntry.TreeId, rm4.TreeEntry.TreeId);\n            Assert.AreEqual(3, rm4.ParentIds.Length);\n            Assert.AreEqual(c1.CommitId, rm4.ParentIds[0]);\n            Assert.AreEqual(c2.CommitId, rm4.ParentIds[1]);\n            Assert.AreEqual(c3.CommitId, rm4.ParentIds[2]);\n        }\n\n        [Test]\n        public void test027_UnpackedRefHigherPriorityThanPacked()\n        {\n            const string unpackedId = \"7f822839a2fe9760f386cbbbcb3f92c5fe81def7\";\n            using (var writer = new StreamWriter(new FileStream(db.Directory.FullName + \"/refs/heads/a\", System.IO.FileMode.CreateNew)))\n            {\n                writer.Write(unpackedId);\n                writer.Write('\\n');\n            }\n\n            ObjectId resolved = db.Resolve(\"refs/heads/a\");\n            Assert.AreEqual(unpackedId, resolved.Name);\n        }\n\n        [Test]\n        public void test028_LockPackedRef()\n        {\n            writeTrashFile(\".git/packed-refs\", \"7f822839a2fe9760f386cbbbcb3f92c5fe81def7 refs/heads/foobar\");\n            writeTrashFile(\".git/HEAD\", \"ref: refs/heads/foobar\\n\");\n            BUG_WorkAroundRacyGitIssues(\"packed-refs\");\n            BUG_WorkAroundRacyGitIssues(\"HEAD\");\n\n            ObjectId resolve = db.Resolve(\"HEAD\");\n            Assert.AreEqual(\"7f822839a2fe9760f386cbbbcb3f92c5fe81def7\", resolve.Name);\n\n            RefUpdate lockRef = db.UpdateRef(\"HEAD\");\n            ObjectId newId = ObjectId.FromString(\"07f822839a2fe9760f386cbbbcb3f92c5fe81def\");\n            lockRef.NewObjectId = newId;\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, lockRef.forceUpdate());\n\n            Assert.IsTrue(new FileInfo(db.Directory.FullName + \"/refs/heads/foobar\").Exists);\n            Assert.AreEqual(newId, db.Resolve(\"refs/heads/foobar\"));\n\n            // Again. The ref already exists\n            RefUpdate lockRef2 = db.UpdateRef(\"HEAD\");\n            ObjectId newId2 = ObjectId.FromString(\"7f822839a2fe9760f386cbbbcb3f92c5fe81def7\");\n            lockRef2.NewObjectId = newId2;\n            Assert.AreEqual(RefUpdate.RefUpdateResult.FORCED, lockRef2.forceUpdate());\n\n            Assert.IsTrue(new FileInfo(db.Directory.FullName + \"/refs/heads/foobar\").Exists);\n            Assert.AreEqual(newId2, db.Resolve(\"refs/heads/foobar\"));\n        }\n\n        [Test]\n        public void test029_mapObject()\n        {\n            Assert.AreEqual((new byte[0].GetType()), db.MapObject(ObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Commit), db.MapObject(ObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Tree), db.MapObject(ObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Tag), db.MapObject(ObjectId.FromString(\"17768080a2318cd89bba4c8b87834401e2095703\"), null).GetType());\n        }\n\n        [Test]\n        [Ignore(\"Fails on both Windows and Mono. Mono issue is related to WinterDom.IO.FileMap internals relying on kernel32.dll calls (which is not that Mono compatible :) ). Windows issue has to be investigated.\")]\n        public void test029_mapObject_using_memory_mapped_file()\n        {\n            WindowCacheConfig c = new WindowCacheConfig();\n            c.PackedGitLimit = (128 * WindowCacheConfig.Kb);\n            c.PackedGitWindowSize = (8 * WindowCacheConfig.Kb);\n            c.PackedGitMMAP = (true);\n            c.DeltaBaseCacheLimit = (8 * WindowCacheConfig.Kb);\n            WindowCache.reconfigure(c);\n\n            var repo = createWorkRepository();\n\n            Assert.AreEqual((new byte[0].GetType()), repo.MapObject(ObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Commit), repo.MapObject(ObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Tree), repo.MapObject(ObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\"), null).GetType());\n            Assert.AreEqual(typeof(global::GitSharp.Core.Tag), repo.MapObject(ObjectId.FromString(\"17768080a2318cd89bba4c8b87834401e2095703\"), null).GetType());\n        }\n\n        [Test]\n        public void test30_stripWorkDir()\n        {\n            DirectoryInfo relCwd = new DirectoryInfo(\".\");\n            DirectoryInfo absCwd = new DirectoryInfo(relCwd.FullName);\n            FileInfo absBase = new FileInfo(Path.Combine(new FileInfo(Path.Combine(absCwd.FullName, \"repo\")).FullName, \"workdir\"));\n            FileInfo relBase = new FileInfo(Path.Combine(new FileInfo(Path.Combine(relCwd.FullName, \"repo\")).FullName, \"workdir\"));\n            Assert.AreEqual(absBase.FullName, relBase.FullName);\n\n            FileInfo relBaseFile = new FileInfo(Path.Combine(new FileInfo(Path.Combine(relBase.FullName, \"other\")).FullName, \"module.c\"));\n            FileInfo absBaseFile = new FileInfo(Path.Combine(new FileInfo(Path.Combine(absBase.FullName, \"other\")).FullName, \"module.c\"));\n            Assert.AreEqual(\"other/module.c\", global::GitSharp.Core.Repository.StripWorkDir(relBase, relBaseFile));\n            Assert.AreEqual(\"other/module.c\", global::GitSharp.Core.Repository.StripWorkDir(relBase, absBaseFile));\n            Assert.AreEqual(\"other/module.c\", global::GitSharp.Core.Repository.StripWorkDir(absBase, relBaseFile));\n            Assert.AreEqual(\"other/module.c\", global::GitSharp.Core.Repository.StripWorkDir(absBase, absBaseFile));\n\n            FileInfo relNonFile = new FileInfo(Path.Combine(new FileInfo(Path.Combine(relCwd.FullName, \"not-repo\")).FullName, \".gitignore\"));\n            FileInfo absNonFile = new FileInfo(Path.Combine(new FileInfo(Path.Combine(absCwd.FullName, \"not-repo\")).FullName, \".gitignore\"));\n            Assert.AreEqual(\"\", global::GitSharp.Core.Repository.StripWorkDir(relBase, relNonFile));\n            Assert.AreEqual(\"\", global::GitSharp.Core.Repository.StripWorkDir(absBase, absNonFile));\n\n            Assert.AreEqual(\"\", global::GitSharp.Core.Repository.StripWorkDir(db.WorkingDirectory, db.WorkingDirectory));\n\n            FileInfo file = new FileInfo(Path.Combine(new FileInfo(Path.Combine(db.WorkingDirectory.FullName, \"subdir\")).FullName, \"File.java\"));\n            Assert.AreEqual(\"subdir/File.java\", global::GitSharp.Core.Repository.StripWorkDir(db.WorkingDirectory, file));\n        }\n\n        /*\n\t * Kick the timestamp of a local file.\n\t * <p>\n\t * We shouldn't have to make these method calls. The cache is using file\n\t * system timestamps, and on many systems unit tests run faster than the\n\t * modification clock. Dumping the cache after we make an edit behind\n\t * RefDirectory's back allows the tests to pass.\n\t *\n\t * @param name\n\t *            the file in the repository to force a time change on.\n\t */\n        private void BUG_WorkAroundRacyGitIssues(string name) {\n            FileInfo path = PathUtil.CombineFilePath(db.Directory, name);\n            long old = path.lastModified();\n            long set = 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009\n            path.LastWriteTime = (set.MillisToUtcDateTime());\n            Assert.IsTrue(old != path.lastModified(), \"time changed\");\n        }\n\n        [Test]\n        public void testTwoSuccessiveCommitsLinkedToHead()\n        {\n            var repo = createBareRepository();\n            var workingDirectory = repo.WorkingDirectory;\n            repo.Create();\n\n            var objectWriter = new ObjectWriter(repo);\n\n            FileInfo project1_a_txt = writeTrashFile(Path.Combine(workingDirectory.FullName, \"Project-1/A.txt\"), \"A.txt - first version\\n\");\n            FileInfo project1_b_txt = writeTrashFile(Path.Combine(workingDirectory.FullName, \"Project-1/B.txt\"), \"B.txt - first version\\n\");\n\n            var tree = new global::GitSharp.Core.Tree(repo);\n            global::GitSharp.Core.Tree projectTree = tree.AddTree(\"Project-1\");\n            addFile(projectTree, project1_a_txt, objectWriter);\n            projectTree.Id = (objectWriter.WriteTree(projectTree));\n            addFile(projectTree, project1_b_txt, objectWriter);\n            projectTree.Id = (objectWriter.WriteTree(projectTree));\n            tree.Id = (objectWriter.WriteTree(tree));\n\n            var commit = new global::GitSharp.Core.Commit(repo)\n                             {\n                                 Author = new PersonIdent(author, (0L), 60),\n                                 Committer = new PersonIdent(committer, (0L), 60),\n                                 Message = \"Foo\\n\\nMessage\",\n                                 TreeEntry = tree\n                             };\n            commit.Save();\n            var commitId = commit.CommitId;\n\n            FileInfo project1_b_v2_txt = writeTrashFile(Path.Combine(workingDirectory.FullName, \"Project-1/B.txt\"), \"B.txt - second version\\n\");\n\n            tree = new global::GitSharp.Core.Tree(repo);\n            projectTree = tree.AddTree(\"Project-1\");\n            addFile(projectTree, project1_a_txt, objectWriter);\n            projectTree.Id = (objectWriter.WriteTree(projectTree));\n            addFile(projectTree, project1_b_v2_txt, objectWriter);\n            projectTree.Id = (objectWriter.WriteTree(projectTree));\n            tree.Id = (objectWriter.WriteTree(tree));\n\n            commit = new global::GitSharp.Core.Commit(repo)\n                         {\n                             Author = new PersonIdent(author, (0L), 60),\n                             Committer = new PersonIdent(committer, (0L), 60),\n                             Message = \"Modified\",\n                             ParentIds = new[] { commitId },\n                             TreeEntry = tree\n                         };\n            commit.Save();\n            commitId = commit.CommitId;\n\n            RefUpdate lck = repo.UpdateRef(\"refs/heads/master\");\n            Assert.IsNotNull(lck, \"obtained lock\");\n            lck.NewObjectId = commitId;\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, lck.forceUpdate());\n        }\n\n        private void addFile(global::GitSharp.Core.Tree t, FileInfo f, ObjectWriter objectWriter)\n        {\n            ObjectId id = objectWriter.WriteBlob(f);\n            t.AddEntry(new FileTreeEntry(t, id, f.Name.getBytes(\"UTF-8\"), false));\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0004_PackReader.cs",
    "content": "﻿/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n    public class T0004_PackReader : SampleDataRepositoryTestCase\n\t{\n\t\tprivate const string PackName = \"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f\";\n\t\tprivate static readonly FileInfo TestPack = new FileInfo(Path.Combine(Path.Combine(Directory.GetCurrentDirectory(), \"Resources/\"), GitSharp.Core.Transport.IndexPack.GetPackFileName(PackName)).Replace('/', Path.DirectorySeparatorChar));\n\t\tprivate static readonly FileInfo TestIdx = new FileInfo(Path.Combine(Path.Combine(Directory.GetCurrentDirectory(), \"Resources/\"), GitSharp.Core.Transport.IndexPack.GetIndexFileName(PackName)).Replace('/', Path.DirectorySeparatorChar));\n\n\t\t[Test]\n\t\tpublic void test003_lookupCompressedObject()\n\t\t{\n\t\t\tObjectId id = ObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\");\n\t\t\tusing (var pr = new PackFile(TestIdx, TestPack))\n\t\t\t{\n\t\t\t    PackedObjectLoader or = pr.Get(new WindowCursor(), id);\n\t\t\t    Assert.IsNotNull(or);\n\t\t\t    Assert.AreEqual(Constants.OBJ_TREE, or.Type);\n\t\t\t    Assert.AreEqual(35, or.Size);\n\t\t\t    Assert.AreEqual(7738, or.DataOffset);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test004_lookupDeltifiedObject()\n\t\t{\n\t\t\tObjectId id = ObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\");\n\t\t\tObjectLoader or = db.OpenObject(id);\n\t\t\tAssert.IsNotNull(or);\n\t\t\tAssert.IsTrue(or is PackedObjectLoader);\n\t\t\tAssert.AreEqual(Constants.OBJ_BLOB, or.Type);\n\t\t\tAssert.AreEqual(18009, or.Size);\n\t\t\tAssert.AreEqual(537, ((PackedObjectLoader)or).DataOffset);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0007_Index.cs",
    "content": "/*\n * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class T0007_Index : RepositoryTestCase\n\t{\n\t\tprivate static readonly bool CanRunGitStatus;\n\n\t\tstatic T0007_Index()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCanRunGitStatus = System(new DirectoryInfo(\".\"), \"git --version\") == 0;\n\t\t\t}\n\t\t\tcatch (IOException)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Warning: cannot invoke native git to validate index\");\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tprivate static int System(FileSystemInfo dir, string cmd)\n\t\t{\n\t\t\tint exitCode = -1;\n\n\t\t\tif (dir == null || !dir.Exists || !Directory.Exists(dir.FullName) || string.IsNullOrEmpty(cmd))\n\t\t\t{\n\t\t\t\treturn exitCode;\n\t\t\t}\n\n\t\t\tvar commandAndArgument = cmd.Split(new[] { ' ' });\n\n\t\t\tvar psi = new ProcessStartInfo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCreateNoWindow = true,\n\t\t\t\t\t\t\tFileName = commandAndArgument[0],\n\t\t\t\t\t\t\tArguments = commandAndArgument.Length > 1 ? commandAndArgument[1] : null,\n\t\t\t\t\t\t\tWorkingDirectory = dir.FullName,\n\t\t\t\t\t\t\tRedirectStandardError = true,\n\t\t\t\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\t\t\tWindowStyle = ProcessWindowStyle.Hidden\n\t\t\t\t\t\t};\n\n\t\t\tvar process = Process.Start(psi);\n\t\t\tif (process == null) return exitCode;\n\n\t\t\tprocess.WaitForExit();\n\t\t\texitCode = process.ExitCode;\n\n\t\t\tvar outputText = process.StandardOutput.ReadToEnd();\n\t\t\tvar errorText = process.StandardError.ReadToEnd();\n\n\t\t\tif (!string.IsNullOrEmpty(outputText))\n\t\t\t{\n\t\t\t\tConsole.WriteLine(outputText);\n\t\t\t}\n\n\t\t\tif (!string.IsNullOrEmpty(errorText))\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(errorText);\n\t\t\t}\n\n\t\t\treturn exitCode;\n\t\t}\n\n        [Test]\n        public void testCreateEmptyIndex()\n        {\n            var index = new GitIndex(db);\n            index.write();\n            // native git doesn't like an empty index\n            // Assert.AreEqual(0,System(trash,\"git status\"));\n\n            var indexr = new GitIndex(db);\n            indexr.Read();\n            Assert.AreEqual(0, indexr.Members.Count);\n        }\n\n        [Test]\n        public void testReadWithNoIndex()\n        {\n            var index = new GitIndex(db);\n            index.Read();\n            Assert.AreEqual(0, index.Members.Count);\n        }\n\n        [Test]\n        public void testCreateSimpleSortTestIndex()\n        {\n            var index = new GitIndex(db);\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            writeTrashFile(\"a@b\", \"data:a:b\");\n            writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a.b\")));\n            index.write();\n\n            Assert.AreEqual(\"a/b\", index.GetEntry(\"a/b\").Name);\n            Assert.AreEqual(\"a@b\", index.GetEntry(\"a@b\").Name);\n            Assert.AreEqual(\"a.b\", index.GetEntry(\"a.b\").Name);\n            Assert.IsNull(index.GetEntry(\"a*b\"));\n\n            // Repeat test for re-Read index\n            var indexr = new GitIndex(db);\n            indexr.Read();\n            Assert.AreEqual(\"a/b\", indexr.GetEntry(\"a/b\").Name);\n            Assert.AreEqual(\"a@b\", indexr.GetEntry(\"a@b\").Name);\n            Assert.AreEqual(\"a.b\", indexr.GetEntry(\"a.b\").Name);\n            Assert.IsNull(indexr.GetEntry(\"a*b\"));\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n\n        [Test]\n        public void testUpdateSimpleSortTestIndex()\n        {\n            var index = new GitIndex(db);\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            writeTrashFile(\"a@b\", \"data:a:b\");\n            writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a.b\")));\n            writeTrashFile(\"a/b\", \"data:a/b modified\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.write();\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n        [Test]\n        public void testWriteTree()\n        {\n            var index = new GitIndex(db);\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            writeTrashFile(\"a@b\", \"data:a:b\");\n            writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a.b\")));\n            index.write();\n\n            ObjectId id = index.writeTree();\n            Assert.AreEqual(\"0036d433dc4f10ec47b61abc3ec5033c78d34f84\", id.Name);\n\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n        [Test]\n        public void testReadTree()\n        {\n            // Prepare tree\n            var index = new GitIndex(db);\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            writeTrashFile(\"a@b\", \"data:a:b\");\n            writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a.b\")));\n            index.write();\n\n            ObjectId id = index.writeTree();\n            Console.WriteLine(\"wrote id \" + id);\n            Assert.AreEqual(\"0036d433dc4f10ec47b61abc3ec5033c78d34f84\", id.Name);\n            var index2 = new GitIndex(db);\n\n            index2.ReadTree(db.MapTree(ObjectId.FromString(\"0036d433dc4f10ec47b61abc3ec5033c78d34f84\")));\n            IList<GitIndex.Entry> members = index2.Members;\n            Assert.AreEqual(3, members.Count);\n            Assert.AreEqual(\"a.b\", members[0].Name);\n            Assert.AreEqual(\"a/b\", members[1].Name);\n            Assert.AreEqual(\"a@b\", members[2].Name);\n            Assert.AreEqual(3, members.Count);\n\n            var indexr = new GitIndex(db);\n            indexr.Read();\n            IList<GitIndex.Entry> membersr = indexr.Members;\n            Assert.AreEqual(3, membersr.Count);\n            Assert.AreEqual(\"a.b\", membersr[0].Name);\n            Assert.AreEqual(\"a/b\", membersr[1].Name);\n            Assert.AreEqual(\"a@b\", membersr[2].Name);\n            Assert.AreEqual(3, membersr.Count);\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n        [Test]\n        public void testReadTree2()\n        {\n            // Prepare a larger tree to test some odd cases in tree writing\n            var index = new GitIndex(db);\n            FileInfo f1 = writeTrashFile(\"a/a/a/a\", \"data:a/a/a/a\");\n            FileInfo f2 = writeTrashFile(\"a/c/c\", \"data:a/c/c\");\n            FileInfo f3 = writeTrashFile(\"a/b\", \"data:a/b\");\n            FileInfo f4 = writeTrashFile(\"a@b\", \"data:a:b\");\n            FileInfo f5 = writeTrashFile(\"a/d\", \"data:a/d\");\n            FileInfo f6 = writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, f1);\n            index.add(trash, f2);\n            index.add(trash, f3);\n            index.add(trash, f4);\n            index.add(trash, f5);\n            index.add(trash, f6);\n            index.write();\n            ObjectId id = index.writeTree();\n            Console.WriteLine(\"wrote id \" + id);\n            Assert.AreEqual(\"5e0bf0aad57706894c15fdf0681c9bc7343274fc\", id.Name);\n            var index2 = new GitIndex(db);\n\n            index2.ReadTree(db.MapTree(ObjectId.FromString(\"5e0bf0aad57706894c15fdf0681c9bc7343274fc\")));\n            IList<GitIndex.Entry> members = index2.Members;\n            Assert.AreEqual(6, members.Count);\n            Assert.AreEqual(\"a.b\", members[0].Name);\n            Assert.AreEqual(\"a/a/a/a\", members[1].Name);\n            Assert.AreEqual(\"a/b\", members[2].Name);\n            Assert.AreEqual(\"a/c/c\", members[3].Name);\n            Assert.AreEqual(\"a/d\", members[4].Name);\n            Assert.AreEqual(\"a@b\", members[5].Name);\n\n            // reread and test\n            var indexr = new GitIndex(db);\n            indexr.Read();\n            IList<GitIndex.Entry> membersr = indexr.Members;\n            Assert.AreEqual(6, membersr.Count);\n            Assert.AreEqual(\"a.b\", membersr[0].Name);\n            Assert.AreEqual(\"a/a/a/a\", membersr[1].Name);\n            Assert.AreEqual(\"a/b\", membersr[2].Name);\n            Assert.AreEqual(\"a/c/c\", membersr[3].Name);\n            Assert.AreEqual(\"a/d\", membersr[4].Name);\n            Assert.AreEqual(\"a@b\", membersr[5].Name);\n        }\n\n        [Test]\n        public void testDelete()\n        {\n            var index = new GitIndex(db);\n            writeTrashFile(\"a/b\", \"data:a/b\");\n            writeTrashFile(\"a@b\", \"data:a:b\");\n            writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a/b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.add(trash, new FileInfo(Path.Combine(trash.FullName, \"a.b\")));\n            index.write();\n            index.writeTree();\n            index.remove(trash, new FileInfo(Path.Combine(trash.FullName, \"a@b\")));\n            index.write();\n            Assert.AreEqual(\"a.b\", index.Members[0].Name);\n            Assert.AreEqual(\"a/b\", index.Members[1].Name);\n\n            var indexr = new GitIndex(db);\n            indexr.Read();\n            Assert.AreEqual(\"a.b\", indexr.Members[0].Name);\n            Assert.AreEqual(\"a/b\", indexr.Members[1].Name);\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n        [Test]\n        public void testCheckout()\n        {\n            // Prepare tree, remote it and checkout\n            var index = new GitIndex(db);\n            FileInfo aslashb = writeTrashFile(\"a/b\", \"data:a/b\");\n            FileInfo acolonb = writeTrashFile(\"a@b\", \"data:a:b\");\n            FileInfo adotb = writeTrashFile(\"a.b\", \"data:a.b\");\n            index.add(trash, aslashb);\n            index.add(trash, acolonb);\n            index.add(trash, adotb);\n            index.write();\n            index.writeTree();\n            Delete(aslashb);\n            Delete(acolonb);\n            Delete(adotb);\n            Delete(Directory.GetParent(aslashb.FullName));\n\n            var index2 = new GitIndex(db);\n            Assert.AreEqual(0, index2.Members.Count);\n\n            index2.ReadTree(db.MapTree(ObjectId.FromString(\"0036d433dc4f10ec47b61abc3ec5033c78d34f84\")));\n\n            index2.checkout(trash);\n            Assert.AreEqual(\"data:a/b\", Content(aslashb));\n            Assert.AreEqual(\"data:a:b\", Content(acolonb));\n            Assert.AreEqual(\"data:a.b\", Content(adotb));\n\n            if (CanRunGitStatus)\n            {\n                Assert.AreEqual(0, System(trash, \"git status\"));\n            }\n        }\n\n\t\t[Test]\n\t\tpublic void test030_executeBit_coreModeTrue()\n\t\t{\n\t\t\tif (!FS.supportsExecute())\n\t\t\t{\n\t\t\t\tAssert.Ignore(\"Test ignored since platform FS does not support the execute permission\");\n\t\t\t}\n\n\t\t\tAssert.Fail(\"Not ported yet.\");\n\n\t\t\t/*\n\t\tif (!FS.INSTANCE.supportsExecute())\n\t\t{\n\t\t\tSystem.err.println(\"Test ignored since platform FS does not support the execute permission\");\n\t\t\treturn;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\t// coremode true is the default, typically set to false\n\t\t\t// by git init (but not jgit!)\n\t\t\tvar canExecute = typeof(File).GetMethod(\"canExecute\", (Class[])null);\n\t\t\tMethod setExecute = typeof(File).getMethod(\"setExecutable\", new Class[] { bool.TYPE });\n\t\t\tFile execFile = writeTrashFile(\"exec\",\"exec\");\n\t\t\tif (!((bool)setExecute.invoke(execFile, new object[] { Convert.true })).booleanValue())\n\t\t\t\tthrow new Error(\"could not set execute bit on \"+execFile.getAbsolutePath()+\"for test\");\n\t\t\tFile nonexecFile = writeTrashFile(\"nonexec\",\"nonexec\");\n\t\t\tif (!((bool)setExecute.invoke(nonexecFile, new object[] { Convert.false })).booleanValue())\n\t\t\t\tthrow new Error(\"could not clear execute bit on \"+nonexecFile.getAbsolutePath()+\"for test\");\n\n\t\t\tGitIndex index = new GitIndex(db);\n\t\t\tindex.filemode = Convert.true; // TODO: we need a way to set this using config\n\t\t\tindex.Add(trash, execFile);\n\t\t\tindex.Add(trash, nonexecFile);\n\t\t\tTree tree = db.mapTree(index.writeTree());\n\t\t\tAssert.IsTrue(FileMode.ExecutableFile == FileMode.FromBits(tree.findBlobMember(execFile.Name).getMode()));\n\t\t\tAssert.IsTrue(FileMode.RegularFile == FileMode.FromBits(tree.findBlobMember(nonexecFile.Name).getMode()));\n\n\t\t\tindex.write();\n\n\t\t\tif (!execFile.delete())\n\t\t\t\tthrow new Error(\"Problem in test, cannot delete test file \"+execFile.getAbsolutePath());\n\t\t\tif (!nonexecFile.delete())\n\t\t\t\tthrow new Error(\"Problem in test, cannot delete test file \"+nonexecFile.getAbsolutePath());\n\t\t\tGitIndex index2 = new GitIndex(db);\n\t\t\tindex2.filemode = Convert.true; // TODO: we need a way to set this using config\n\t\t\tindex2.Read();\n\t\t\tindex2.checkout(trash);\n\t\t\tassertTrue(((bool)canExecute.invoke(execFile,(object[])null)).booleanValue());\n\t\t\tassertFalse(((bool)canExecute.invoke(nonexecFile,(object[])null)).booleanValue());\n\n\t\t\tassertFalse(index2.getEntry(execFile.Name).isModified(trash));\n\t\t\tassertFalse(index2.getEntry(nonexecFile.Name).isModified(trash));\n\n\t\t\tif (!((bool)setExecute.invoke(execFile, new object[] { Convert.false })).booleanValue())\n\t\t\t\tthrow new Error(\"could not clear set execute bit on \"+execFile.getAbsolutePath()+\"for test\");\n\t\t\tif (!((bool)setExecute.invoke(nonexecFile, new object[] { Convert.true })).booleanValue())\n\t\t\t\tthrow new Error(\"could set execute bit on \"+nonexecFile.getAbsolutePath()+\"for test\");\n\n\t\t\tassertTrue(index2.getEntry(execFile.Name).isModified(trash));\n\t\t\tassertTrue(index2.getEntry(nonexecFile.Name).isModified(trash));\n\n\t\t}\n\t\tcatch (NoSuchMethodException e)\n\t\t{\n\t\t\tSystem.err.println(\"Test ignored when running under JDK < 1.6\");\n\t\t\treturn;\n\t\t}\n\t\t\t*/\n\t\t}\n\n\t\t[Test]\n\t\tpublic void test031_executeBit_coreModeFalse()\n\t\t{\n\t\t\tif (!FS.supportsExecute())\n\t\t\t{\n\t\t\t\tAssert.Ignore(\"Test ignored since platform FS does not support the execute permission\");\n\t\t\t}\n\n\t\t\tAssert.Fail(\"Not ported yet.\");\n\n\t\t\t/*\n\t\tif (!FS.INSTANCE.supportsExecute())\n\t\t{\n\t\t\tSystem.err.println(\"Test ignored since platform FS does not support the execute permission\");\n\t\t\treturn;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\t// coremode true is the default, typically set to false\n\t\t\t// by git init (but not jgit!)\n\t\t\tMethod canExecute = typeof(File).getMethod(\"canExecute\", (Class[])null);\n\t\t\tMethod setExecute = typeof(File).getMethod(\"setExecutable\", new Class[] { bool.TYPE });\n\t\t\tFile execFile = writeTrashFile(\"exec\",\"exec\");\n\t\t\tif (!((bool)setExecute.invoke(execFile, new object[] { Convert.true })).booleanValue())\n\t\t\t\tthrow new Error(\"could not set execute bit on \"+execFile.getAbsolutePath()+\"for test\");\n\t\t\tFile nonexecFile = writeTrashFile(\"nonexec\",\"nonexec\");\n\t\t\tif (!((bool)setExecute.invoke(nonexecFile, new object[] { Convert.false })).booleanValue())\n\t\t\t\tthrow new Error(\"could not clear execute bit on \"+nonexecFile.getAbsolutePath()+\"for test\");\n\n\t\t\tGitIndex index = new GitIndex(db);\n\t\t\tindex.filemode = Convert.false; // TODO: we need a way to set this using config\n\t\t\tindex.Add(trash, execFile);\n\t\t\tindex.Add(trash, nonexecFile);\n\t\t\tTree tree = db.mapTree(index.writeTree());\n\t\t\tAssert.IsTrue(FileMode.REGULAR_FILE == FileMode.FromBits(tree.findBlobMember(execFile.Name).getMode()));\n\t\t\tAssert.IsTrue(FileMode.REGULAR_FILE == FileMode.FromBits(tree.findBlobMember(nonexecFile.Name).getMode()));\n\n\t\t\tindex.write();\n\n\t\t\tif (!execFile.delete())\n\t\t\t\tthrow new Error(\"Problem in test, cannot delete test file \"+execFile.getAbsolutePath());\n\t\t\tif (!nonexecFile.delete())\n\t\t\t\tthrow new Error(\"Problem in test, cannot delete test file \"+nonexecFile.getAbsolutePath());\n\t\t\tGitIndex index2 = new GitIndex(db);\n\t\t\tindex2.filemode = Convert.false; // TODO: we need a way to set this using config\n\t\t\tindex2.Read();\n\t\t\tindex2.checkout(trash);\n\t\t\tassertFalse(((bool)canExecute.invoke(execFile,(object[])null)).booleanValue());\n\t\t\tassertFalse(((bool)canExecute.invoke(nonexecFile,(object[])null)).booleanValue());\n\n\t\t\tassertFalse(index2.getEntry(execFile.Name).isModified(trash));\n\t\t\tassertFalse(index2.getEntry(nonexecFile.Name).isModified(trash));\n\n\t\t\tif (!((bool)setExecute.invoke(execFile, new object[] { Convert.false })).booleanValue())\n\t\t\t\tthrow new Error(\"could not clear set execute bit on \"+execFile.getAbsolutePath()+\"for test\");\n\t\t\tif (!((bool)setExecute.invoke(nonexecFile, new object[] { Convert.true })).booleanValue())\n\t\t\t\tthrow new Error(\"could set execute bit on \"+nonexecFile.getAbsolutePath()+\"for test\");\n\n\t\t\t// no change since we ignore the execute bit\n\t\t\tassertFalse(index2.getEntry(execFile.Name).isModified(trash));\n\t\t\tassertFalse(index2.getEntry(nonexecFile.Name).isModified(trash));\n\n\t\t}\n\t\tcatch (NoSuchMethodException e)\n\t\t{\n\t\t\tSystem.err.println(\"Test ignored when running under JDK < 1.6\");\n\t\t\treturn;\n\t\t}\n\t\t\t * */\n\t\t}\n\n\n        private static string Content(FileSystemInfo f)\n        {\n            using (var sr = new StreamReader(f.FullName))\n            {\n                return sr.ReadToEnd();\n            }\n        }\n\n        private static void Delete(FileSystemInfo f)\n        {\n            f.Delete();\n        }\n\n\n\n\n\t\t\n\t\t\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/T0008_testparserev.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class T0008_testparserev : SampleDataRepositoryTestCase\n    {\n        [Test]\n        public void testObjectId_existing()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0\").Name);\n        }\n\n        [Test]\n        public void testObjectId_nonexisting()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c1\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c1\").Name);\n        }\n\n        [Test]\n        public void testObjectId_objectid_implicit_firstparent()\n        {\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^\").Name);\n            Assert.AreEqual(\"1203b03dc816ccbb67773f28b3c19318654b0bc8\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^^\").Name);\n            Assert.AreEqual(\"bab66b48f836ed950c99134ef666436fb07a09a0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^^^\").Name);\n        }\n\n        [Test]\n        public void testObjectId_objectid_self()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^0\").Name);\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^0^0\").Name);\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^0^0^0\").Name);\n        }\n\n        [Test]\n        public void testObjectId_objectid_explicit_firstparent()\n        {\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^1\").Name);\n            Assert.AreEqual(\"1203b03dc816ccbb67773f28b3c19318654b0bc8\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^1^1\").Name);\n            Assert.AreEqual(\"bab66b48f836ed950c99134ef666436fb07a09a0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^1^1^1\").Name);\n        }\n\n        [Test]\n        public void testObjectId_objectid_explicit_otherparents()\n        {\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^1\").Name);\n            Assert.AreEqual(\"f73b95671f326616d66b2afb3bdfcdbbce110b44\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^2\").Name);\n            Assert.AreEqual(\"d0114ab8ac326bab30e3a657a0397578c5a1af88\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^3\").Name);\n            Assert.AreEqual(\"d0114ab8ac326bab30e3a657a0397578c5a1af88\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^03\").Name);\n        }\n\n        [Test]\n        public void testRef_refname()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"master^0\").Name);\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"master^\").Name);\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"refs/heads/master^1\").Name);\n        }\n\n        [Test]\n        public void testDistance()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0~0\").Name);\n            Assert.AreEqual(\"6e1475206e57110fcef4b92320436c1e9872a322\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0~1\").Name);\n            Assert.AreEqual(\"1203b03dc816ccbb67773f28b3c19318654b0bc8\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0~2\").Name);\n            Assert.AreEqual(\"bab66b48f836ed950c99134ef666436fb07a09a0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0~3\").Name);\n            Assert.AreEqual(\"bab66b48f836ed950c99134ef666436fb07a09a0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0~03\").Name);\n        }\n\n        [Test]\n        public void testTree()\n        {\n            Assert.AreEqual(\"6020a3b8d5d636e549ccbd0c53e2764684bb3125\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^{tree}\").Name);\n            Assert.AreEqual(\"02ba32d3649e510002c21651936b7077aa75ffa9\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^^{tree}\").Name);\n        }\n\n        [Test]\n        public void testHEAD()\n        {\n            Assert.AreEqual(\"6020a3b8d5d636e549ccbd0c53e2764684bb3125\", db.Resolve(\"HEAD^{tree}\").Name);\n        }\n\n        [Test]\n        public void testDerefCommit()\n        {\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^{}\").Name);\n            Assert.AreEqual(\"49322bb17d3acc9146f98c97d078513228bbf3c0\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^{commit}\").Name);\n            // double deref\n            Assert.AreEqual(\"6020a3b8d5d636e549ccbd0c53e2764684bb3125\", db.Resolve(\"49322bb17d3acc9146f98c97d078513228bbf3c0^{commit}^{tree}\").Name);\n        }\n\n        [Test]\n        public void testDerefTag()\n        {\n            Assert.AreEqual(\"17768080a2318cd89bba4c8b87834401e2095703\", db.Resolve(\"refs/tags/B\").Name);\n            Assert.AreEqual(\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", db.Resolve(\"refs/tags/B^{commit}\").Name);\n            Assert.AreEqual(\"032c063ce34486359e3ee3d4f9e5c225b9e1a4c2\", db.Resolve(\"refs/tags/B10th\").Name);\n            Assert.AreEqual(\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", db.Resolve(\"refs/tags/B10th^{commit}\").Name);\n            Assert.AreEqual(\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", db.Resolve(\"refs/tags/B10th^{}\").Name);\n            Assert.AreEqual(\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", db.Resolve(\"refs/tags/B10th^0\").Name);\n            Assert.AreEqual(\"d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\", db.Resolve(\"refs/tags/B10th~0\").Name);\n            Assert.AreEqual(\"0966a434eb1a025db6b71485ab63a3bfbea520b6\", db.Resolve(\"refs/tags/B10th^\").Name);\n            Assert.AreEqual(\"0966a434eb1a025db6b71485ab63a3bfbea520b6\", db.Resolve(\"refs/tags/B10th^1\").Name);\n            Assert.AreEqual(\"0966a434eb1a025db6b71485ab63a3bfbea520b6\", db.Resolve(\"refs/tags/B10th~1\").Name);\n            Assert.AreEqual(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\", db.Resolve(\"refs/tags/B10th~2\").Name);\n        }\n\n        [Test]\n        public void testDerefBlob()\n        {\n            Assert.AreEqual(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7\", db.Resolve(\"spearce-gpg-pub^{}\").Name);\n            Assert.AreEqual(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7\", db.Resolve(\"spearce-gpg-pub^{blob}\").Name);\n            Assert.AreEqual(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7\", db.Resolve(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7^{}\").Name);\n            Assert.AreEqual(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7\", db.Resolve(\"fd608fbe625a2b456d9f15c2b1dc41f252057dd7^{blob}\").Name);\n        }\n\n        [Test]\n        public void testDerefTree()\n        {\n            Assert.AreEqual(\"032c063ce34486359e3ee3d4f9e5c225b9e1a4c2\", db.Resolve(\"refs/tags/B10th\").Name);\n            Assert.AreEqual(\"856ec208ae6cadac25a6d74f19b12bb27a24fe24\", db.Resolve(\"032c063ce34486359e3ee3d4f9e5c225b9e1a4c2^{tree}\").Name);\n            Assert.AreEqual(\"856ec208ae6cadac25a6d74f19b12bb27a24fe24\", db.Resolve(\"refs/tags/B10th^{tree}\").Name);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/BaseConnectionTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class BaseConnectionTests\n    {\n        [Test]\n        public void ShouldReturnNullForAnInvalidRef()\n        {\n            var connection = new StubConnection();\n\n            Assert.IsNull(connection.GetRef(\"invalid ref\"));\n        }\n\n        [Test]\n        public void ShouldReturnValueForAValidRef()\n        {\n            var connection = new StubConnection();\n            var r = new Unpeeled(null, \"ref\", ObjectId.ZeroId);\n\n            connection.RefsMap.Add(\"ref\", r);\n\n            Assert.AreEqual(r, connection.GetRef(\"ref\"));\n        }\n\n        private class StubConnection : BaseConnection, IPushConnection\n        {\n            public override void Close()\n            {}\n\n            public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates)\n            {}\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/BundleWriterTest.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class BundleWriterTest : SampleDataRepositoryTestCase\n    {\n        private List<TransportBundleStream>\t _transportBundleStreams = new List<TransportBundleStream>();\n\n        #region Test methods\n\n        #region testWrite0\n\n        public override void tearDown()\n        {\n            _transportBundleStreams.ForEach((t) => t.Dispose());\n\n            base.tearDown();\n        }\n\n        [Test]\n        public void testWrite0()\n        {\n            // Create a tiny bundle, (well one of) the first commits only\n            byte[] bundle = makeBundle(\"refs/heads/firstcommit\", \"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\", null);\n\n            // Then we clone a new repo from that bundle and do a simple test. This\n            // makes sure\n            // we could Read the bundle we created.\n            Core.Repository newRepo = createBareRepository();\n            FetchResult fetchResult = fetchFromBundle(newRepo, bundle);\n            Core.Ref advertisedRef = fetchResult.GetAdvertisedRef(\"refs/heads/firstcommit\");\n\n            // We expect firstcommit to appear by id\n            Assert.AreEqual(\"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\", advertisedRef.ObjectId.Name);\n            // ..and by name as the bundle created a new ref\n            Assert.AreEqual(\"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\", newRepo.Resolve((\"refs/heads/firstcommit\")).Name);\n        }\n\n        #endregion\n\n        /**\n         * Incremental bundle test\n         * \n         * @throws Exception\n         */\n\n        #region testWrite1\n\n        [Test]\n        public void testWrite1()\n        {\n        \t// Create a small bundle, an early commit\n            byte[] bundle = makeBundle(\"refs/heads/aa\", db.Resolve(\"a\").Name, null);\n\n            // Then we clone a new repo from that bundle and do a simple test. This\n            // makes sure\n            // we could Read the bundle we created.\n            Core.Repository newRepo = createBareRepository();\n            FetchResult fetchResult = fetchFromBundle(newRepo, bundle);\n            Core.Ref advertisedRef = fetchResult.GetAdvertisedRef(\"refs/heads/aa\");\n\n            Assert.AreEqual(db.Resolve(\"a\").Name, advertisedRef.ObjectId.Name);\n            Assert.AreEqual(db.Resolve(\"a\").Name, newRepo.Resolve(\"refs/heads/aa\").Name);\n            Assert.IsNull(newRepo.Resolve(\"refs/heads/a\"));\n\n            // Next an incremental bundle\n            bundle = makeBundle(\n                    \"refs/heads/cc\",\n                    db.Resolve(\"c\").Name,\n                    new GitSharp.Core.RevWalk.RevWalk(db).parseCommit(db.Resolve(\"a\").ToObjectId()));\n\n            fetchResult = fetchFromBundle(newRepo, bundle);\n            advertisedRef = fetchResult.GetAdvertisedRef(\"refs/heads/cc\");\n            Assert.AreEqual(db.Resolve(\"c\").Name, advertisedRef.ObjectId.Name);\n            Assert.AreEqual(db.Resolve(\"c\").Name, newRepo.Resolve(\"refs/heads/cc\").Name);\n            Assert.IsNull(newRepo.Resolve(\"refs/heads/c\"));\n            Assert.IsNull(newRepo.Resolve(\"refs/heads/a\")); // still unknown\n\n            try\n            {\n                // Check that we actually needed the first bundle\n                Core.Repository newRepo2 = createBareRepository();\n                fetchResult = fetchFromBundle(newRepo2, bundle);\n                Assert.Fail(\"We should not be able to fetch from bundle with prerequisites that are not fulfilled\");\n            }\n            catch (MissingBundlePrerequisiteException e)\n            {\n                Assert.IsTrue(e.Message.IndexOf(db.Resolve(\"refs/heads/a\").Name) >= 0);\n            }\n        }\n\n        #endregion\n\n        #endregion\n\n        #region Other methods\n\n        #region fetchFromBundle\n\n        private FetchResult fetchFromBundle(Core.Repository newRepo, byte[] bundle)\n        {\n            var uri = new URIish(\"in-memory://\");\n            var @in = new MemoryStream(bundle);\n            var rs = new RefSpec(\"refs/heads/*:refs/heads/*\");\n            var refs = new List<RefSpec>{rs};\n            var transportBundleStream = new TransportBundleStream(newRepo, uri, @in);\n            \n            _transportBundleStreams.Add(transportBundleStream);\n\n            return transportBundleStream.fetch(NullProgressMonitor.Instance, refs);\n        }\n\n        #endregion\n\n        #region makeBundle\n\n        private byte[] makeBundle(string name, string anObjectToInclude, RevCommit assume)\n        {\n            var bw = new BundleWriter(db, NullProgressMonitor.Instance);\n            bw.include(name, ObjectId.FromString(anObjectToInclude));\n            if (assume != null)\n            {\n                bw.assume(assume);\n            }\n            var @out = new MemoryStream();\n            bw.writeBundle(@out);\n            return @out.ToArray();\n        }\n\n        #endregion\n\n        #endregion\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/IndexPackTests.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class IndexPackTest : SampleDataRepositoryTestCase\n    {\n\t\t/// <summary>\n\t\t/// Test indexing one of the test packs in the egit repo. It has deltas.\n\t\t/// </summary>\n        [Test]\n\t\tpublic void test1()\n        {\n\t\t\tFileInfo packFile = GetPack(\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\");\n\n            using (Stream @is = packFile.Open(System.IO.FileMode.Open, FileAccess.Read))\n            {\n                var tmppack = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack1\"));\n                var pack = new IndexPack(db, @is, tmppack);\n                pack.index(new TextProgressMonitor());\n\n                var idxFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack1.idx\"));\n                var tmpPackFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack1.pack\"));\n                //return;\n                using (var file = new PackFile(idxFile, tmpPackFile))\n                {\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"540a36d136cf413e4b064c2b0e0a4db60f77feab\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"5b6e7c66c276e7610d4a73c70ec1a1f7c1003259\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"6ff87c4664981e4397625791c8ea3bbb5f2279a3\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"82c6b885ff600be425b4ea96dee75dca255b69e7\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"902d5476fa249b7abc9d84c611577a81381f0327\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"aabf2ffaec9b497f0950352b3e582d73035c2035\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"c59759f143fb1fe21c197981df75a7ee00290799\")));\n                }\n            }\n        }\n\n\t\t/// <summary>\n\t\t/// This is just another pack. It so happens that we have two convenient pack to\n\t\t/// test with in the repository.\n\t\t/// </summary>\n        [Test]\n\t\tpublic void test2()\n        {\n            FileInfo packFile = GetPack(\"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\");\n\n\t\t\tusing (Stream @is = packFile.Open(System.IO.FileMode.Open, FileAccess.Read))\n\t\t\t{\n\n\t\t\t\tvar tmppack = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack2\"));\n\t\t\t\tvar pack = new IndexPack(db, @is, tmppack);\n\t\t\t\tpack.index(new TextProgressMonitor());\n\n\t\t\t\tvar idxFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack2.idx\"));\n\t\t\t\tvar tmpPackFile = new FileInfo(Path.Combine(trash.FullName, \"tmp_pack2.pack\"));\n                using (var file = new PackFile(idxFile, tmpPackFile))\n                {\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"02ba32d3649e510002c21651936b7077aa75ffa9\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"0966a434eb1a025db6b71485ab63a3bfbea520b6\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"09efc7e59a839528ac7bda9fa020dc9101278680\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"0a3d7772488b6b106fb62813c4d6d627918d9181\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"1004d0d7ac26fbf63050a234c9b88a46075719d3\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"10da5895682013006950e7da534b705252b03be6\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"1203b03dc816ccbb67773f28b3c19318654b0bc8\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"15fae9e651043de0fd1deef588aa3fbf5a7a41c6\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"16f9ec009e5568c435f473ba3a1df732d49ce8c3\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"1fd7d579fb6ae3fe942dc09c2c783443d04cf21e\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"20a8ade77639491ea0bd667bf95de8abf3a434c8\")));\n                    Assert.IsTrue(file.HasObject(ObjectId.FromString(\"2675188fd86978d5bc4d7211698b2118ae3bf658\")));\n                    // and lots more...\n                }\n\t\t\t}\n        }\n\n\t\tprivate FileInfo GetPack(string name)\n\t\t{\n\t\t\treturn new FileInfo(db.ObjectsDirectory + \"/pack/\" + name);\n\t\t}\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/LongMapTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class LongMapTest\n    {\n        private LongMap<long?> map;\n\t\n        [SetUp]\n        protected void setUp()\n        {\n            map = new LongMap<long?>();\n        }\n\t\n        [Test]\n        public void testEmptyMap()\n        {\n            Assert.IsFalse(map.containsKey(0));\n            Assert.IsFalse(map.containsKey(1));\n\t\n            Assert.IsNull(map.get(0));\n            Assert.IsNull(map.get(1));\n\t\n            Assert.IsNull(map.remove(0));\n            Assert.IsNull(map.remove(1));\n        }\n\t\n        [Test]\n        public void testInsertMinValue()\n        {\n            long min = long.MinValue;\n            Assert.IsNull(map.put(long.MinValue, min));\n            Assert.IsTrue(map.containsKey(long.MinValue));\n            Assert.AreEqual(min, map.get(long.MinValue));  // Switch from AreSame to AreEqual as valuetype as passed by value\n            Assert.IsFalse(map.containsKey(int.MinValue));\n        }\n\t\n        [Test]\n        public void testReplaceMaxValue()\n        {\n            long min = long.MaxValue;\n            long one = 1L;\n            Assert.IsNull(map.put(long.MaxValue, min));\n            Assert.AreEqual(min, map.get(long.MaxValue));\n            Assert.AreEqual(min, map.put(long.MaxValue, one));\n            Assert.AreEqual(one, map.get(long.MaxValue));\n        }\n\t\n        [Test]\n        public void testRemoveOne()\n        {\n            long start = 1;\n            Assert.IsNull(map.put(start, start));\n            Assert.AreEqual(start, map.remove(start));\n            Assert.IsFalse(map.containsKey(start));\n        }\n\t\n        [Test]\n        public void testRemoveCollision1()\n        {\n            // This test relies upon the fact that we always >>> 1 the value\n            // to derive an unsigned hash code. Thus, 0 and 1 fall into the\n            // same hash bucket. Further it relies on the fact that we add\n            // the 2nd put at the top of the chain, so removing the 1st will\n            // cause a different code path.\n            //\n            Assert.IsNull(map.put(0L, 0L));\n            Assert.IsNull(map.put(1, 1L));\n            Assert.AreEqual(0L, map.remove(0));\n\t\n            Assert.IsFalse(map.containsKey(0));\n            Assert.IsTrue(map.containsKey(1));\n        }\n\t\n        [Test]\n        public void testRemoveCollision2()\n        {\n            // This test relies upon the fact that we always >>> 1 the value\n            // to derive an unsigned hash code. Thus, 0 and 1 fall into the\n            // same hash bucket. Further it relies on the fact that we add\n            // the 2nd put at the top of the chain, so removing the 2nd will\n            // cause a different code path.\n            //\n            Assert.IsNull(map.put(0, 0L));\n            Assert.IsNull(map.put(1, 1L));\n            Assert.AreEqual(1L, map.remove(1));\n\t\n            Assert.IsTrue(map.containsKey(0));\n            Assert.IsFalse(map.containsKey(1));\n        }\n\t\n        [Test]\n        public void testSmallMap()\n        {\n            long start = 12;\n            long n = 8;\n            for (long i = start; i < start + n; i++)\n                Assert.IsNull(map.put(i, i));\n            for (long i = start; i < start + n; i++)\n                Assert.AreEqual(i, map.get(i));\n        }\n\t\n        [Test]\n        public void testLargeMap()\n        {\n            long start = int.MaxValue;\n            long n = 100000;\n            for (long i = start; i < start + n; i++)\n                Assert.IsNull(map.put(i, i));\n            for (long i = start; i < start + n; i++)\n                Assert.AreEqual(i, map.get(i));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/OpenSshConfigTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n\t[TestFixture]\n\tpublic class OpenSshConfigTest : RepositoryTestCase\n\t{\n\t\tprivate DirectoryInfo _home;\n\t\tprivate FileInfo _configFile;\n\t\tprivate OpenSshConfig _osc;\n\n\t\tpublic override void setUp()\n\t\t{\n\t\t\tbase.setUp();\n\n\t\t\t_home = new DirectoryInfo(Path.Combine(trash.FullName, \"home\"));\n\t\t\t_configFile = new FileInfo(Path.Combine(_home.FullName, \".ssh\"));\n\t\t\tDirectory.CreateDirectory(_configFile.FullName);\n\n\t\t\t_configFile = new FileInfo(Path.Combine(_configFile.FullName, \"config\"));\n\n\t\t\t// can't do\n\t\t\t//Environment.UserName = \"jex_junit\";\n\n\t\t\t_osc = new OpenSshConfig(_home, _configFile);\n\t\t}\n\n\t\tprivate void Config(string data)\n\t\t{\n\t\t\tusing (var fw = new StreamWriter(new FileStream(_configFile.FullName, System.IO.FileMode.Create, FileAccess.ReadWrite), Constants.CHARSET))\n\t\t\t{\n\t\t\t    fw.Write(data);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoConfig()\n\t\t{\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"repo.or.cz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"repo.or.cz\", h.getHostName());\n\t\t\tAssert.AreEqual(Environment.UserName, h.getUser());\n\t\t\tAssert.AreEqual(22, h.getPort());\n\t\t\tAssert.IsNull(h.getIdentityFile());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testSeparatorParsing()\n\t\t{\n\t\t\tConfig(\"Host\\tfirst\\n\" +\n\t\t\t\t   \"\\tHostName\\tfirst.tld\\n\" +\n\t\t\t\t   \"\\n\" +\n\t\t\t\t   \"Host second\\n\" +\n\t\t\t\t   \" HostName\\tsecond.tld\\n\" +\n\t\t\t\t   \"Host=third\\n\" +\n\t\t\t\t   \"HostName=third.tld\\n\\n\\n\" +\n\t\t\t\t   \"\\t Host = fourth\\n\\n\\n\" +\n\t\t\t\t   \" \\t HostName\\t=fourth.tld\\n\" +\n\t\t\t\t   \"Host\\t =     last\\n\" +\n\t\t\t\t   \"HostName  \\t    last.tld\");\n\n\t\t\tAssert.IsNotNull(_osc.lookup(\"first\"));\n\t\t\tAssert.AreEqual(\"first.tld\", _osc.lookup(\"first\").getHostName());\n\t\t\tAssert.IsNotNull(_osc.lookup(\"second\"));\n\t\t\tAssert.AreEqual(\"second.tld\", _osc.lookup(\"second\").getHostName());\n\t\t\tAssert.IsNotNull(_osc.lookup(\"third\"));\n\t\t\tAssert.AreEqual(\"third.tld\", _osc.lookup(\"third\").getHostName());\n\t\t\tAssert.IsNotNull(_osc.lookup(\"fourth\"));\n\t\t\tAssert.AreEqual(\"fourth.tld\", _osc.lookup(\"fourth\").getHostName());\n\t\t\tAssert.IsNotNull(_osc.lookup(\"last\"));\n\t\t\tAssert.AreEqual(\"last.tld\", _osc.lookup(\"last\").getHostName());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testQuoteParsing()\n\t\t{\n\t\t\tConfig(\"Host \\\"good\\\"\\n\" +\n\t\t\t\t   \" HostName=\\\"good.tld\\\"\\n\" +\n\t\t\t\t   \" Port=\\\"6007\\\"\\n\" +\n\t\t\t\t   \" User=\\\"gooduser\\\"\\n\" +\n\t\t\t\t   \"Host multiple unquoted and \\\"quoted\\\" \\\"hosts\\\"\\n\" +\n\t\t\t\t   \" Port=\\\"2222\\\"\\n\" +\n\t\t\t\t   \"Host \\\"spaced\\\"\\n\" +\n\t\t\t\t   \"# Bad host name, but testing preservation of spaces\\n\" +\n\t\t\t\t   \" HostName=\\\" spaced\\ttld \\\"\\n\" +\n\t\t\t\t   \"# Misbalanced quotes\\n\" +\n\t\t\t\t   \"Host \\\"bad\\\"\\n\" +\n\t\t\t\t   \"# OpenSSH doesn't allow this but ...\\n\" +\n\t\t\t\t   \" HostName=bad.tld\\\"\\n\");\n\n\t\t\tAssert.AreEqual(\"good.tld\", _osc.lookup(\"good\").getHostName());\n\t\t\tAssert.AreEqual(\"gooduser\", _osc.lookup(\"good\").getUser());\n\t\t\tAssert.AreEqual(6007, _osc.lookup(\"good\").getPort());\n\t\t\tAssert.AreEqual(2222, _osc.lookup(\"multiple\").getPort());\n\t\t\tAssert.AreEqual(2222, _osc.lookup(\"quoted\").getPort());\n\t\t\tAssert.AreEqual(2222, _osc.lookup(\"and\").getPort());\n\t\t\tAssert.AreEqual(2222, _osc.lookup(\"unquoted\").getPort());\n\t\t\tAssert.AreEqual(2222, _osc.lookup(\"hosts\").getPort());\n\t\t\tAssert.AreEqual(\" spaced\\ttld \", _osc.lookup(\"spaced\").getHostName());\n\t\t\tAssert.AreEqual(\"bad.tld\\\"\", _osc.lookup(\"bad\").getHostName());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_DoesNotMatch()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tHostName repo.or.cz\\n\");\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"repo.or.cz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"repo.or.cz\", h.getHostName());\n\t\t\tAssert.AreEqual(Environment.UserName, h.getUser());\n\t\t\tAssert.AreEqual(22, h.port);\n\t\t\tAssert.IsNull(h.getIdentityFile());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_OptionsSet()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tHostName repo.or.cz\\n\" + \"\\tPort 2222\\n\"\n\t\t\t\t   + \"\\tUser jex\\n\" + \"\\tIdentityFile .ssh/id_jex\\n\"\n\t\t\t\t   + \"\\tForwardX11 no\\n\");\n\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"repo.or.cz\", h.getHostName());\n\t\t\tAssert.AreEqual(\"jex\", h.getUser());\n\t\t\tAssert.AreEqual(2222, h.getPort());\n\t\t\tAssert.AreEqual(new FileInfo(Path.Combine(_home.FullName, \".ssh/id_jex\")).FullName, h.getIdentityFile().FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_OptionsKeywordCaseInsensitive()\n\t\t{\n\t\t\tConfig(\"hOsT orcz\\n\" + \"\\thOsTnAmE repo.or.cz\\n\" + \"\\tPORT 2222\\n\"\n\t\t\t\t   + \"\\tuser jex\\n\" + \"\\tidentityfile .ssh/id_jex\\n\"\n\t\t\t\t   + \"\\tForwardX11 no\\n\");\n\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"repo.or.cz\", h.getHostName());\n\t\t\tAssert.AreEqual(\"jex\", h.getUser());\n\t\t\tAssert.AreEqual(2222, h.getPort());\n\t\t\tAssert.AreEqual(new FileInfo(Path.Combine(_home.FullName, \".ssh/id_jex\")).FullName, h.getIdentityFile().FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_OptionsInherit()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tHostName repo.or.cz\\n\" + \"\\n\" + \"Host *\\n\"\n\t\t\t\t   + \"\\tHostName not.a.host.example.com\\n\" + \"\\tPort 2222\\n\"\n\t\t\t\t   + \"\\tUser jex\\n\" + \"\\tIdentityFile .ssh/id_jex\\n\"\n\t\t\t\t   + \"\\tForwardX11 no\\n\");\n\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"repo.or.cz\", h.getHostName());\n\t\t\tAssert.AreEqual(\"jex\", h.getUser());\n\t\t\tAssert.AreEqual(2222, h.getPort());\n\t\t\tAssert.AreEqual(new FileInfo(Path.Combine(_home.FullName, \".ssh/id_jex\")).FullName, h.getIdentityFile().FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_PreferredAuthenticationsDefault()\n\t\t{\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.IsNull(h.getPreferredAuthentications());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_PreferredAuthentications()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tPreferredAuthentications publickey\\n\");\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"publickey\", h.getPreferredAuthentications());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_InheritPreferredAuthentications()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tHostName repo.or.cz\\n\" + \"\\n\" + \"Host *\\n\"\n\t\t\t\t   + \"\\tPreferredAuthentications publickey, hostbased\\n\");\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(\"publickey,hostbased\", h.getPreferredAuthentications());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_BatchModeDefault()\n\t\t{\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(false, h.isBatchMode());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_BatchModeYes()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tBatchMode yes\\n\");\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(true, h.isBatchMode());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testAlias_InheritBatchMode()\n\t\t{\n\t\t\tConfig(\"Host orcz\\n\" + \"\\tHostName repo.or.cz\\n\" + \"\\n\" + \"Host *\\n\"\n\t\t\t\t   + \"\\tBatchMode yes\\n\");\n\t\t\tOpenSshConfig.Host h = _osc.lookup(\"orcz\");\n\t\t\tAssert.IsNotNull(h);\n\t\t\tAssert.AreEqual(true, h.isBatchMode());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/OperationResultTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class OperationResultTests\n    {\n        [Test]\n        public void ShouldReturnNullForAnInvalidRef()\n        {\n            var result = new PushResult();\n\n            Assert.IsNull(result.GetAdvertisedRef(\"invalid ref\"));\n        }\n\n        [Test]\n        public void ShouldReturnValueForAValidRef()\n        {\n            var result = new PushResult();\n            var r = new Unpeeled(null, \"ref\", ObjectId.ZeroId);\n\n            var refs = result.AdvertisedRefs;\n            var advRefs = refs.ToDictionary(@ref => @ref.Name);\n            \n            advRefs.Add(\"ref\", r);\n\n            result.SetAdvertisedRefs(result.URI, advRefs);\n\n            Assert.AreEqual(r, result.GetAdvertisedRef(\"ref\"));\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/PacketLineInTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n\n    [TestFixture]\n    public class PacketLineInTest\n    {\n        private MemoryStream rawIn;\n        private PacketLineIn pckIn;\n\n        private void init(string msg)\n        {\n            rawIn = new MemoryStream(Constants.encodeASCII(msg));\n            pckIn = new PacketLineIn(rawIn);\n        }\n\n        [Test]\n        public void testReadString1()\n        {\n            init(\"0006a\\n0007bc\\n\");\n            Assert.AreEqual(\"a\", pckIn.ReadString());\n            Assert.AreEqual(\"bc\", pckIn.ReadString());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadString2()\n        {\n            init(\"0032want fcfcfb1fd94829c1a1704f894fc111d14770d34e\\n\");\n            string act = pckIn.ReadString();\n            Assert.AreEqual(\"want fcfcfb1fd94829c1a1704f894fc111d14770d34e\", act);\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadString4()\n        {\n            init(\"0005a0006bc\");\n            Assert.AreEqual(\"a\", pckIn.ReadString());\n            Assert.AreEqual(\"bc\", pckIn.ReadString());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadString5()\n        {\n            init(\"000Fhi i am a s\");\n            Assert.AreEqual(\"hi i am a s\", pckIn.ReadString());\n            assertEOF();\n\n            init(\"000fhi i am a s\");\n            Assert.AreEqual(\"hi i am a s\", pckIn.ReadString());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadString_LenHELO()\n        {\n            init(\"HELO\");\n            try\n            {\n                pckIn.ReadString();\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: HELO\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadString_Len0001()\n        {\n            init(\"0001\");\n            try\n            {\n                pckIn.ReadString();\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: 0001\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadString_Len0002()\n        {\n            init(\"0002\");\n            try\n            {\n                pckIn.ReadString();\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: 0002\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadString_Len0003()\n        {\n            init(\"0003\");\n            try\n            {\n                pckIn.ReadString();\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: 0003\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadString_Len0004()\n        {\n            init(\"0004\");\n            string act = pckIn.ReadString();\n            Assert.AreEqual(string.Empty, act);\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadString_End()\n        {\n            init(\"0000\");\n            Assert.AreEqual(string.Empty, pckIn.ReadString());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadStringRaw1()\n        {\n            init(\"0005a0006bc\");\n            Assert.AreEqual(\"a\", pckIn.ReadStringRaw());\n            Assert.AreEqual(\"bc\", pckIn.ReadStringRaw());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadStringRaw2()\n        {\n            init(\"0031want fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            string act = pckIn.ReadStringRaw();\n            Assert.AreEqual(\"want fcfcfb1fd94829c1a1704f894fc111d14770d34e\", act);\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadStringRaw3()\n        {\n            init(\"0004\");\n            string act = pckIn.ReadStringRaw();\n            Assert.AreEqual(string.Empty, act);\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadStringRaw4()\n        {\n            init(\"HELO\");\n            try\n            {\n                pckIn.ReadStringRaw();\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: HELO\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadStringRaw_End()\n        {\n            init(\"0000\");\n            Assert.AreEqual(string.Empty, pckIn.ReadStringRaw());\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadACK_NAK()\n        {\n            ObjectId expid = ObjectId.FromString(\"fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            MutableObjectId actid = new MutableObjectId();\n            actid.FromString(expid.Name);\n\n            init(\"0008NAK\\n\");\n            Assert.AreEqual(PacketLineIn.AckNackResult.NAK, pckIn.readACK(actid));\n            Assert.IsTrue(actid.Equals(expid));\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadACK_ACK1()\n        {\n            ObjectId expid = ObjectId.FromString(\"fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            MutableObjectId actid = new MutableObjectId();\n            actid.FromString(expid.Name);\n\n            init(\"0031ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e\\n\");\n            Assert.AreEqual(PacketLineIn.AckNackResult.ACK, pckIn.readACK(actid));\n            Assert.IsTrue(actid.Equals(expid));\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadACK_ACKcontinue1()\n        {\n            ObjectId expid = ObjectId.FromString(\"fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            MutableObjectId actid = new MutableObjectId();\n            actid.FromString(expid.Name);\n\n            init(\"003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\\n\");\n            Assert.AreEqual(PacketLineIn.AckNackResult.ACK_CONTINUE, pckIn.readACK(actid));\n            Assert.IsTrue(actid.Equals(expid));\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadACK_ACKcommon1()\n        {\n            ObjectId expid = ObjectId\n                   .FromString(\"fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            MutableObjectId actid = new MutableObjectId();\n\n            init(\"0038ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e common\\n\");\n            Assert.AreEqual(PacketLineIn.AckNackResult.ACK_COMMON, pckIn.readACK(actid));\n            Assert.IsTrue(actid.Equals(expid));\n            assertEOF();\n        }\n        [Test]\n        public void testReadACK_ACKready1()\n        {\n            ObjectId expid = ObjectId\n                   .FromString(\"fcfcfb1fd94829c1a1704f894fc111d14770d34e\");\n            MutableObjectId actid = new MutableObjectId();\n\n            init(\"0037ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e ready\\n\");\n            Assert.AreEqual(PacketLineIn.AckNackResult.ACK_READY, pckIn.readACK(actid));\n            Assert.IsTrue(actid.Equals(expid));\n            assertEOF();\n        }\n\n        [Test]\n        public void testReadACK_Invalid1()\n        {\n            init(\"HELO\");\n            try\n            {\n                pckIn.readACK(new MutableObjectId());\n                Assert.Fail(\"incorrectly accepted invalid packet header\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Invalid packet line header: HELO\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadACK_Invalid2()\n        {\n            init(\"0009HELO\\n\");\n            try\n            {\n                pckIn.readACK(new MutableObjectId());\n                Assert.Fail(\"incorrectly accepted invalid ACK/NAK\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Expected ACK/NAK, got: HELO\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testReadACK_Invalid3()\n        {\n            string s = \"ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e neverhappen\";\n            init(\"003d\" + s + \"\\n\");\n            try\n            {\n                pckIn.readACK(new MutableObjectId());\n                Assert.Fail(\"incorrectly accepted unsupported ACK status\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Expected ACK/NAK, got: \" + s, e.Message);\n            }\n        }\n        [Test]\n        public void testReadACK_Invalid4()\n        {\n            init(\"0000\");\n            try\n            {\n                pckIn.readACK(new MutableObjectId());\n                Assert.Fail(\"incorrectly accepted no ACK/NAK\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"Expected ACK/NAK, found EOF\", e.Message);\n            }\n        }\n\n        private void assertEOF()\n        {\n            Assert.AreEqual(-1, rawIn.ReadByte());\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/PacketLineOutTest.cs",
    "content": "/*\n * Copyright (C) 2009-2010, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n\n\t[TestFixture]\n\tpublic class PacketLineOutTest\n\t{\n\t\tprivate MemoryStream rawOut;\n\t\tprivate PacketLineOut o;\n\n\t\t[SetUp]\n\t\tprotected void setUp()\n\t\t{\n\t\t\trawOut = new MemoryStream();\n\t\t\to = new PacketLineOut(rawOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWriteString1()\n\t\t{\n\t\t\to.WriteString(\"a\");\n\t\t\to.WriteString(\"bc\");\n\t\t\tassertBuffer(\"0005a0006bc\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWriteString2()\n\t\t{\n\t\t\to.WriteString(\"a\\n\");\n\t\t\to.WriteString(\"bc\\n\");\n\t\t\tassertBuffer(\"0006a\\n0007bc\\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWriteString3()\n\t\t{\n\t\t\to.WriteString(string.Empty);\n\t\t\tassertBuffer(\"0004\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWriteEnd()\n\t\t{\n\t\t\tvar flushCnt = new int[1];\n\t\t\tvar mockout = new FlushCounterStream(rawOut, flushCnt);\n\n\t\t\tnew PacketLineOut(mockout).End();\n\t\t\tassertBuffer(\"0000\");\n\t\t\tAssert.AreEqual(1, flushCnt[0]);\n\t\t}\n\n\t\tinternal class FlushCounterStream : MemoryStream\n\t\t{\n\t\t\tprivate readonly Stream _rawout;\n\t\t\tprivate readonly int[] _flushCnt;\n\n\t\t\tpublic FlushCounterStream(Stream rawout, int[] flushCnt)\n\t\t\t{\n\t\t\t\t_rawout = rawout;\n\t\t\t\t_flushCnt = flushCnt;\n\t\t\t}\n\n\t\t\tpublic override void WriteByte(byte value)\n\t\t\t{\n\t\t\t\t_rawout.WriteByte(value);\n\t\t\t}\n\n\t\t\tpublic override void Write(byte[] buffer, int offset, int count)\n\t\t\t{\n\t\t\t\t_rawout.Write(buffer, offset, count);\n\t\t\t}\n\n\t\t\tpublic override void Flush()\n\t\t\t{\n\t\t\t\t_flushCnt[0]++;\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWritePacket1()\n\t\t{\n\t\t\to.WritePacket(new[] { (byte)'a' });\n\t\t\tassertBuffer(\"0005a\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWritePacket2()\n\t\t{\n\t\t\to.WritePacket(new[] { (byte)'a', (byte)'b', (byte)'c', (byte)'d' });\n\t\t\tassertBuffer(\"0008abcd\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWritePacket3()\n\t\t{\n\t\t\tconst int buflen = SideBandOutputStream.MAX_BUF - 5;\n\t\t\tbyte[] buf = new byte[buflen];\n\t\t\tfor (int i = 0; i < buf.Length; i++)\n\t\t\t{\n\t\t\t\tbuf[i] = (byte)i;\n\t\t\t}\n\t\t\to.WritePacket(buf);\n\t\t\to.Flush();\n\n\t\t\tbyte[] act = rawOut.ToArray();\n\t\t\tstring explen = NB.DecimalToBase(buf.Length + 4, 16);\n\t\t\tAssert.AreEqual(4 + buf.Length, act.Length);\n\t\t\tAssert.AreEqual(Charset.forName(\"UTF-8\").GetString(act, 0, 4), explen);\n\t\t\tfor (int i = 0, j = 4; i < buf.Length; i++, j++)\n\t\t\t\tAssert.AreEqual(buf[i], act[j]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testFlush()\n\t\t{\n\t\t\tvar flushCnt = new int[1];\n\t\t\tvar mockout = new FlushCounterFailWriterStream(flushCnt);\n\n\t\t\tnew PacketLineOut(mockout).Flush();\n\t\t\tAssert.AreEqual(1, flushCnt[0]);\n\t\t}\n\n\t\tprivate void assertBuffer(string exp)\n\t\t{\n\t\t\tbyte[] resb = rawOut.ToArray();\n\t\t\tstring res = Constants.CHARSET.GetString(resb);\n\t\t\tAssert.AreEqual(exp, res);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/PushProcessTest.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\nusing GitSharp.Core;\nusing System;\nusing System.Collections.Generic;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class PushProcessTest : SampleDataRepositoryTestCase\n    {\n        private PushProcess process;\n        private MockTransport transport;\n        private List<RemoteRefUpdate> refUpdates;\n        private List<Core.Ref> advertisedRefs;\n        public static RemoteRefUpdate.UpdateStatus connectionUpdateStatus;\n\n        private class MockTransport : GitSharp.Core.Transport.Transport\n        {\n            private readonly List<Core.Ref> advertised;\n\n            public MockTransport(Core.Repository local, URIish uri, List<Core.Ref> advertisedRefs)\n                : base(local, uri)\n            {\n                advertised = advertisedRefs;\n            }\n\n            public override IFetchConnection openFetch()\n            {\n                throw new NotSupportedException(\"mock\");\n            }\n\n            public override IPushConnection openPush()\n            {\n                return new MockPushConnection(advertised);\n            }\n\n            public override void close()\n            {\n            }\n        }\n\n        private class MockPushConnection : BaseConnection, IPushConnection\n        {\n            public MockPushConnection(IEnumerable<Core.Ref> advertisedRefs)\n            {\n                Dictionary<string, Core.Ref> refsMap = new Dictionary<string, Core.Ref>();\n                foreach (Core.Ref r in advertisedRefs)\n                    refsMap.Add(r.Name, r);\n                available(refsMap);\n            }\n\n            public override void Close()\n            {\n            }\n\n            public void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refsToUpdate)\n            {\n                foreach (RemoteRefUpdate rru in refsToUpdate.Values)\n                {\n                    Assert.AreEqual(RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED, rru.Status);\n                    rru.Status = PushProcessTest.connectionUpdateStatus;\n                }\n            }\n        }\n\n        public override void setUp()\n        {\n            base.setUp();\n            advertisedRefs = new List<Core.Ref>();\n            transport = new MockTransport(db, new URIish(), advertisedRefs);\n            refUpdates = new List<RemoteRefUpdate>();\n            connectionUpdateStatus = RemoteRefUpdate.UpdateStatus.OK;\n        }\n\n        private PushResult testOneUpdateStatus(RemoteRefUpdate rru, Core.Ref advertisedRef, RemoteRefUpdate.UpdateStatus expectedStatus, bool? fastForward)\n        {\n            refUpdates.Add(rru);\n            if (advertisedRef != null)\n                advertisedRefs.Add(advertisedRef);\n            PushResult result = executePush();\n            Assert.AreEqual(expectedStatus, rru.Status);\n            if (fastForward.HasValue)\n                Assert.AreEqual(fastForward.Value, rru.FastForward);\n            return result;\n        }\n\n        private PushResult executePush()\n        {\n            process = new PushProcess(transport, refUpdates);\n            return process.execute(new TextProgressMonitor());\n        }\n\n        [Test]\n        public void testUpdateFastForward()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.OK, true);\n        }\n\n        [Test]\n        public void testUpdateNonFastForwardUnknownObject()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"0000000000000000000000000000000000000001\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD, null);\n        }\n\n        [Test]\n        public void testUpdateNonFastForward()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\",\n                                                      \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD, null);\n        }\n\n        [Test]\n        public void testUpdateNonFastForwardForced()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\",\n                                          \"refs/heads/master\", true, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.OK, false);\n        }\n\n        [Test]\n        public void testUpdateCreateRef()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\",\n                              \"refs/heads/master\", false, null, null);\n            testOneUpdateStatus(rru, null, RemoteRefUpdate.UpdateStatus.OK, true);\n        }\n        \n        [Test]\n        public void testUpdateDelete()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, null, \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.OK, true);\n        }\n\n        [Test]\n        public void testUpdateDeleteNonExisting()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, null, \"refs/heads/master\", false, null, null);\n            testOneUpdateStatus(rru, null, RemoteRefUpdate.UpdateStatus.NON_EXISTING, null);\n        }\n\n        [Test]\n        public void testUpdateUpToDate()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\", \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.UP_TO_DATE, null);\n        }\n\n        [Test]\n        public void testUpdateExpectedRemote()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, null,\n                                                      ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.OK, true);\n        }\n\n        [Test]\n        public void testUpdateUnexpectedRemote()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, null,\n                                                      ObjectId.FromString(\"0000000000000000000000000000000000000001\"));\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_REMOTE_CHANGED, null);\n        }\n\n        [Test]\n        public void testUpdateUnexpectedRemoteVsForce()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                          \"refs/heads/master\", true, null,\n                                          ObjectId.FromString(\"0000000000000000000000000000000000000001\"));\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_REMOTE_CHANGED, null);\n        }\n\n        [Test]\n        public void testUpdateRejectedByConnection()\n        {\n            connectionUpdateStatus = RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON;\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON, null);\n        }\n\n        [Test]\n        public void testUpdateMixedCases()\n        {\n            RemoteRefUpdate rruOk = new RemoteRefUpdate(db, null, \"refs/heads/master\", false, null, null);\n            Core.Ref refToChange = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            RemoteRefUpdate rruReject = new RemoteRefUpdate(db, null, \"refs/heads/nonexisting\", false, null, null);\n            refUpdates.Add(rruOk);\n            refUpdates.Add(rruReject);\n            advertisedRefs.Add(refToChange);\n            executePush();\n            Assert.AreEqual(RemoteRefUpdate.UpdateStatus.OK, rruOk.Status);\n            Assert.AreEqual(true, rruOk.FastForward);\n            Assert.AreEqual(RemoteRefUpdate.UpdateStatus.NON_EXISTING, rruReject.Status);\n        }\n\n        [Test]\n        public void testTrackingRefUpdateEnabled()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\", \"refs/heads/master\", false, \"refs/remotes/test/master\", null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            refUpdates.Add(rru);\n            advertisedRefs.Add(@ref);\n            PushResult result = executePush();\n            TrackingRefUpdate tru = result.GetTrackingRefUpdate(\"refs/remotes/test/master\");\n            Assert.IsNotNull(tru);\n            Assert.AreEqual(\"refs/remotes/test/master\", tru.LocalName);\n            Assert.AreEqual(RefUpdate.RefUpdateResult.NEW, tru.Result);\n        }\n\n        [Test]\n        public void testTrackingRefUpdateDisabled()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\", \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            refUpdates.Add(rru);\n            advertisedRefs.Add(@ref);\n            PushResult result = executePush();\n            Assert.IsTrue(result.TrackingRefUpdates.Count == 0);\n        }\n\n        [Test]\n        public void testTrackingRefUpdateOnReject()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\", \"refs/heads/master\", false, null, null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"2c349335b7f797072cf729c4f3bb0914ecb6dec9\"));\n            PushResult result = testOneUpdateStatus(rru, @ref, RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD, null);\n            Assert.IsTrue(result.TrackingRefUpdates.Count == 0);\n        }\n\n        [Test]\n        public void testPushResult()\n        {\n            RemoteRefUpdate rru = new RemoteRefUpdate(db, \"2c349335b7f797072cf729c4f3bb0914ecb6dec9\",\n                                                      \"refs/heads/master\", false, \"refs/remotes/test/master\", null);\n            Core.Ref @ref = new Unpeeled(Storage.Loose, \"refs/heads/master\", ObjectId.FromString(\"ac7e7e44c1885efb472ad54a78327d66bfc4ecef\"));\n            refUpdates.Add(rru);\n            advertisedRefs.Add(@ref);\n            PushResult result = executePush();\n            Assert.AreEqual(1, result.TrackingRefUpdates.Count);\n            Assert.AreEqual(1, result.AdvertisedRefs.Count);\n            Assert.AreEqual(1, result.RemoteUpdates.Count);\n            Assert.IsNotNull(result.GetTrackingRefUpdate(\"refs/remotes/test/master\"));\n            Assert.IsNotNull(result.GetAdvertisedRef(\"refs/heads/master\"));\n            Assert.IsNotNull(result.GetRemoteUpdate(\"refs/heads/master\"));\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/RefSpecTests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class RefSpecTests\n    {\n        \n        [Test]\n        public void testMasterMaster()\n        {\n            string sn = \"refs/heads/master\";\n            RefSpec rs = new RefSpec(sn + \":\" + sn);\n            Assert.IsFalse(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(sn, rs.Source);\n            Assert.AreEqual(sn, rs.Destination);\n            Assert.AreEqual(sn + \":\" + sn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r = new Unpeeled(Storage.Loose, sn, null);\n            Assert.IsTrue(rs.MatchSource(r));\n            Assert.IsTrue(rs.MatchDestination(r));\n            Assert.AreSame(rs, rs.ExpandFromSource(r));\n\n            r = new Unpeeled(Storage.Loose, sn + \"-and-more\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testSplitLastColon()\n        {\n            string lhs = \":m:a:i:n:t\";\n            string rhs = \"refs/heads/maint\";\n            RefSpec rs = new RefSpec(lhs + \":\" + rhs);\n            Assert.IsFalse(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(lhs, rs.Source);\n            Assert.AreEqual(rhs, rs.Destination);\n            Assert.AreEqual(lhs + \":\" + rhs, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n        }\n\n        [Test]\n        public void testForceMasterMaster()\n        {\n            string sn = \"refs/heads/master\";\n            RefSpec rs = new RefSpec(\"+\" + sn + \":\" + sn);\n            Assert.IsTrue(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(sn, rs.Source);\n            Assert.AreEqual(sn, rs.Destination);\n            Assert.AreEqual(\"+\" + sn + \":\" + sn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r = new Unpeeled(Storage.Loose, sn, null);\n            Assert.IsTrue(rs.MatchSource(r));\n            Assert.IsTrue(rs.MatchDestination(r));\n            Assert.AreSame(rs, rs.ExpandFromSource(r));\n\n            r = new Unpeeled(Storage.Loose, sn + \"-and-more\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testMaster()\n        {\n            string sn = \"refs/heads/master\";\n            RefSpec rs = new RefSpec(sn);\n            Assert.IsFalse(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(sn, rs.Source);\n            Assert.IsNull(rs.Destination);\n            Assert.AreEqual(sn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r = new Unpeeled(Storage.Loose, sn, null);\n            Assert.IsTrue(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n            Assert.AreSame(rs, rs.ExpandFromSource(r));\n\n            r = new Unpeeled(Storage.Loose, sn + \"-and-more\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testForceMaster()\n        {\n            string sn = \"refs/heads/master\";\n            RefSpec rs = new RefSpec(\"+\" + sn);\n            Assert.IsTrue(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(sn, rs.Source);\n            Assert.IsNull(rs.Destination);\n            Assert.AreEqual(\"+\" + sn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r = new Unpeeled(Storage.Loose, sn, null);\n            Assert.IsTrue(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n            Assert.AreSame(rs, rs.ExpandFromSource(r));\n\n            r = new Unpeeled(Storage.Loose, sn + \"-and-more\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testDeleteMaster()\n        {\n            string sn = \"refs/heads/master\";\n            RefSpec rs = new RefSpec(\":\" + sn);\n            Assert.IsFalse(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(sn, rs.Destination);\n            Assert.IsNull(rs.Source);\n            Assert.AreEqual(\":\" + sn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r = new Unpeeled(Storage.Loose, sn, null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsTrue(rs.MatchDestination(r));\n            Assert.AreSame(rs, rs.ExpandFromSource(r));\n\n            r = new Unpeeled(Storage.Loose, sn + \"-and-more\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testForceRemotesOrigin()\n        {\n            string srcn = \"refs/heads/*\";\n            string dstn = \"refs/remotes/origin/*\";\n            RefSpec rs = new RefSpec(\"+\" + srcn + \":\" + dstn);\n            Assert.IsTrue(rs.Force);\n            Assert.IsTrue(rs.Wildcard);\n            Assert.AreEqual(srcn, rs.Source);\n            Assert.AreEqual(dstn, rs.Destination);\n            Assert.AreEqual(\"+\" + srcn + \":\" + dstn, rs.ToString());\n            Assert.AreEqual(rs, new RefSpec(rs.ToString()));\n\n            Core.Ref r;\n            RefSpec expanded;\n\n            r = new Unpeeled(Storage.Loose, \"refs/heads/master\", null);\n            Assert.IsTrue(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n            expanded = rs.ExpandFromSource(r);\n            Assert.AreNotSame(rs, expanded);\n            Assert.IsTrue(expanded.Force);\n            Assert.IsFalse(expanded.Wildcard);\n            Assert.AreEqual(r.Name, expanded.Source);\n            Assert.AreEqual(\"refs/remotes/origin/master\", expanded.Destination);\n\n            r = new Unpeeled(Storage.Loose, \"refs/remotes/origin/next\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsTrue(rs.MatchDestination(r));\n\n            r = new Unpeeled(Storage.Loose, \"refs/tags/v1.0\", null);\n            Assert.IsFalse(rs.MatchSource(r));\n            Assert.IsFalse(rs.MatchDestination(r));\n        }\n\n        [Test]\n        public void testCreateEmpty()\n        {\n            RefSpec rs = new RefSpec();\n            Assert.IsFalse(rs.Force);\n            Assert.IsFalse(rs.Wildcard);\n            Assert.AreEqual(\"HEAD\", rs.Source);\n            Assert.IsNull(rs.Destination);\n            Assert.AreEqual(\"HEAD\", rs.ToString());\n        }\n\n        [Test]\n        public void testSetForceUpdate()\n        {\n            string s = \"refs/heads/*:refs/remotes/origin/*\";\n            RefSpec a = new RefSpec(s);\n            Assert.IsFalse(a.Force);\n            RefSpec b = a.SetForce(true);\n            Assert.AreNotSame(a, b);\n            Assert.IsFalse(a.Force);\n            Assert.IsTrue(b.Force);\n            Assert.AreEqual(s, a.ToString());\n            Assert.AreEqual(\"+\" + s, b.ToString());\n        }\n\n        [Test]\n        public void testSetSource()\n        {\n            RefSpec a = new RefSpec();\n            RefSpec b = a.SetSource(\"refs/heads/master\");\n            Assert.AreNotSame(a, b);\n            Assert.AreEqual(\"HEAD\", a.ToString());\n            Assert.AreEqual(\"refs/heads/master\", b.ToString());\n        }\n\n        [Test]\n        public void testSetDestination()\n        {\n            RefSpec a = new RefSpec();\n            RefSpec b = a.SetDestination(\"refs/heads/master\");\n            Assert.AreNotSame(a, b);\n            Assert.AreEqual(\"HEAD\", a.ToString());\n            Assert.AreEqual(\"HEAD:refs/heads/master\", b.ToString());\n        }\n\n        [Test]\n        public void testSetDestination_SourceNull()\n        {\n            RefSpec a = new RefSpec();\n            RefSpec b;\n\n            b = a.SetDestination(\"refs/heads/master\");\n            b = b.SetSource(null);\n            Assert.AreNotSame(a, b);\n            Assert.AreEqual(\"HEAD\", a.ToString());\n            Assert.AreEqual(\":refs/heads/master\", b.ToString());\n        }\n\n        [Test]\n        public void testSetSourceDestination()\n        {\n            RefSpec a = new RefSpec();\n            RefSpec b;\n            b = a.SetSourceDestination(\"refs/heads/*\", \"refs/remotes/origin/*\");\n            Assert.AreNotSame(a, b);\n            Assert.AreEqual(\"HEAD\", a.ToString());\n            Assert.AreEqual(\"refs/heads/*:refs/remotes/origin/*\", b.ToString());\n        }\n\n        [Test]\n        public void testExpandFromDestination_NonWildcard()\n        {\n            string src = \"refs/heads/master\";\n            string dst = \"refs/remotes/origin/master\";\n            RefSpec a = new RefSpec(src + \":\" + dst);\n            RefSpec r = a.ExpandFromDestination(dst);\n            Assert.AreSame(a, r);\n            Assert.IsFalse(r.Wildcard);\n            Assert.AreEqual(src, r.Source);\n            Assert.AreEqual(dst, r.Destination);\n        }\n\n        [Test]\n        public void testExpandFromDestination_Wildcard()\n        {\n            string src = \"refs/heads/master\";\n            string dst = \"refs/remotes/origin/master\";\n            RefSpec a = new RefSpec(\"refs/heads/*:refs/remotes/origin/*\");\n            RefSpec r = a.ExpandFromDestination(dst);\n            Assert.AreNotSame(a, r);\n            Assert.IsFalse(r.Wildcard);\n            Assert.AreEqual(src, r.Source);\n            Assert.AreEqual(dst, r.Destination);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/RemoteConfigTests.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Tests;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\nusing CoreConfig = GitSharp.Core.Config;\n\nnamespace GitSharp.Tests.GitSharp.Core.Transport\n{\n\n    [TestFixture]\n    public class RemoteConfigTests : RepositoryTestCase\n    {\n        private CoreConfig config;\n\n        public override void setUp()\n        {\n            base.setUp();\n            config = new CoreConfig();\n        }\n\n        private void readConfig(string dat)\n        {\n            config = new CoreConfig();\n            config.fromText(dat);\n        }\n\n        private void checkConfig(string exp)\n        {\n            Assert.AreEqual(exp, config.toText());\n        }\n\n        [Test]\n        public void testSimple()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\" + \"url = http://www.spearce.org/egit.git\\n\" +\n                        \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            System.Collections.Generic.List<URIish> allURIs = rc.URIs;\n\n            Assert.AreEqual(\"spearce\", rc.Name);\n            Assert.IsNotNull(allURIs);\n            Assert.IsNotNull(rc.Fetch);\n            Assert.IsNotNull(rc.Push);\n            Assert.IsNotNull(rc.TagOpt);\n            Assert.AreEqual(0, rc.Timeout);\n            Assert.AreSame(TagOpt.AUTO_FOLLOW, rc.TagOpt);\n\n            Assert.AreEqual(1, allURIs.Count);\n            Assert.AreEqual(\"http://www.spearce.org/egit.git\", allURIs[0].ToString());\n\n            Assert.AreEqual(1, rc.Fetch.Count);\n            RefSpec spec = rc.Fetch[0];\n            Assert.IsTrue(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/heads/*\", spec.Source);\n            Assert.AreEqual(\"refs/remotes/spearce/*\", spec.Destination);\n\n            Assert.AreEqual(0, rc.Push.Count);\n        }\n\n        [Test]\n        public void testSimpleNoTags()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\"\n                        + \"tagopt = --no-tags\\n\");\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            Assert.AreSame(TagOpt.NO_TAGS, rc.TagOpt);\n        }\n\n        [Test]\n        public void testSimpleAlwaysTags()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\"\n                        + \"tagopt = --tags\\n\");\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            Assert.AreSame(TagOpt.FETCH_TAGS, rc.TagOpt);\n        }\n\n        [Test]\n        public void testMirror()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"fetch = +refs/heads/*:refs/heads/*\\n\"\n                        + \"fetch = refs/tags/*:refs/tags/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            System.Collections.Generic.List<URIish> allURIs = rc.URIs;\n\n            Assert.AreEqual(\"spearce\", rc.Name);\n            Assert.IsNotNull(allURIs);\n            Assert.IsNotNull(rc.Fetch);\n            Assert.IsNotNull(rc.Push);\n\n            Assert.AreEqual(1, allURIs.Count);\n            Assert.AreEqual(\"http://www.spearce.org/egit.git\", allURIs[0].ToString());\n\n            Assert.AreEqual(2, rc.Fetch.Count);\n\n            RefSpec spec = rc.Fetch[0];\n            Assert.IsTrue(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/heads/*\", spec.Source);\n            Assert.AreEqual(\"refs/heads/*\", spec.Destination);\n\n            spec = rc.Fetch[1];\n            Assert.IsFalse(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/tags/*\", spec.Source);\n            Assert.AreEqual(\"refs/tags/*\", spec.Destination);\n\n            Assert.AreEqual(0, rc.Push.Count);\n        }\n\n        [Test]\n        public void testBackup()\n        {\n            readConfig(\"[remote \\\"backup\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"url = user@repo.or.cz:/srv/git/egit.git\\n\"\n                        + \"push = +refs/heads/*:refs/heads/*\\n\"\n                        + \"push = refs/tags/*:refs/tags/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            System.Collections.Generic.List<URIish> allURIs = rc.URIs;\n\n            Assert.AreEqual(\"backup\", rc.Name);\n            Assert.IsNotNull(allURIs);\n            Assert.IsNotNull(rc.Fetch);\n            Assert.IsNotNull(rc.Push);\n\n            Assert.AreEqual(2, allURIs.Count);\n            Assert.AreEqual(\"http://www.spearce.org/egit.git\", allURIs[0].ToString());\n            Assert.AreEqual(\"user@repo.or.cz:/srv/git/egit.git\", allURIs[1].ToString());\n\n            Assert.AreEqual(0, rc.Fetch.Count);\n\n            Assert.AreEqual(2, rc.Push.Count);\n            RefSpec spec = rc.Push[0];\n            Assert.IsTrue(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/heads/*\", spec.Source);\n            Assert.AreEqual(\"refs/heads/*\", spec.Destination);\n\n            spec = rc.Push[1];\n            Assert.IsFalse(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/tags/*\", spec.Source);\n            Assert.AreEqual(\"refs/tags/*\", spec.Destination);\n        }\n\n        [Test]\n        public void testUploadPack()\n        {\n            readConfig(\"[remote \\\"example\\\"]\\n\"\n                        + \"url = user@example.com:egit.git\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/example/*\\n\"\n                        + \"uploadpack = /path/to/git/git-upload-pack\\n\"\n                        + \"receivepack = /path/to/git/git-receive-pack\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"example\");\n            System.Collections.Generic.List<URIish> allURIs = rc.URIs;\n\n            Assert.AreEqual(\"example\", rc.Name);\n            Assert.IsNotNull(allURIs);\n            Assert.IsNotNull(rc.Fetch);\n            Assert.IsNotNull(rc.Push);\n\n            Assert.AreEqual(1, allURIs.Count);\n            Assert.AreEqual(\"user@example.com:egit.git\", allURIs[0].ToString());\n\n            Assert.AreEqual(1, rc.Fetch.Count);\n            RefSpec spec = rc.Fetch[0];\n            Assert.IsTrue(spec.Force);\n            Assert.IsTrue(spec.Wildcard);\n            Assert.AreEqual(\"refs/heads/*\", spec.Source);\n            Assert.AreEqual(\"refs/remotes/example/*\", spec.Destination);\n\n            Assert.AreEqual(0, rc.Push.Count);\n\n            Assert.AreEqual(\"/path/to/git/git-upload-pack\", rc.UploadPack);\n            Assert.AreEqual(\"/path/to/git/git-receive-pack\", rc.ReceivePack);\n        }\n\n        [Test]\n        public void testUnknown()\n        {\n            readConfig(string.Empty);\n\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.AreEqual(0, rc.URIs.Count);\n            Assert.AreEqual(0, rc.Fetch.Count);\n            Assert.AreEqual(0, rc.Push.Count);\n            Assert.AreEqual(\"git-upload-pack\", rc.UploadPack);\n            Assert.AreEqual(\"git-receive-pack\", rc.ReceivePack);\n        }\n\n        [Test]\n        public void testAddURI()\n        {\n            readConfig(string.Empty);\n\n            URIish uri = new URIish(\"/some/dir\");\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.AreEqual(0, rc.URIs.Count);\n\n            Assert.IsTrue(rc.AddURI(uri));\n            Assert.AreEqual(1, rc.URIs.Count);\n            Assert.AreSame(uri, rc.URIs[0]);\n\n            Assert.IsFalse(rc.AddURI(new URIish(uri.ToString())));\n            Assert.AreEqual(1, rc.URIs.Count);\n        }\n\n        [Test]\n        public void testRemoveFirstURI()\n        {\n            readConfig(string.Empty);\n\n            URIish a = new URIish(\"/some/dir\");\n            URIish b = new URIish(\"/another/dir\");\n            URIish c = new URIish(\"/more/dirs\");\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.IsTrue(rc.AddURI(a));\n            Assert.IsTrue(rc.AddURI(b));\n            Assert.IsTrue(rc.AddURI(c));\n\n            Assert.AreEqual(3, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n            Assert.AreSame(b, rc.URIs[1]);\n            Assert.AreEqual(c, rc.URIs[2]);\n\n            Assert.IsTrue(rc.RemoveURI(a));\n            Assert.AreSame(b, rc.URIs[0]);\n            Assert.AreSame(c, rc.URIs[1]);\n        }\n\n        [Test]\n        public void testRemoveMiddleURI()\n        {\n            readConfig(string.Empty);\n\n            URIish a = new URIish(\"/some/dir\");\n            URIish b = new URIish(\"/another/dir\");\n            URIish c = new URIish(\"/more/dirs\");\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.IsTrue(rc.AddURI(a));\n            Assert.IsTrue(rc.AddURI(b));\n            Assert.IsTrue(rc.AddURI(c));\n\n            Assert.AreEqual(3, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n            Assert.AreSame(b, rc.URIs[1]);\n            Assert.AreEqual(c, rc.URIs[2]);\n\n            Assert.IsTrue(rc.RemoveURI(b));\n            Assert.AreEqual(2, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n            Assert.AreSame(c, rc.URIs[1]);\n        }\n\n        [Test]\n        public void testRemoveLastURI()\n        {\n            readConfig(string.Empty);\n\n            URIish a = new URIish(\"/some/dir\");\n            URIish b = new URIish(\"/another/dir\");\n            URIish c = new URIish(\"/more/dirs\");\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.IsTrue(rc.AddURI(a));\n            Assert.IsTrue(rc.AddURI(b));\n            Assert.IsTrue(rc.AddURI(c));\n\n            Assert.AreEqual(3, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n            Assert.AreSame(b, rc.URIs[1]);\n            Assert.AreEqual(c, rc.URIs[2]);\n\n            Assert.IsTrue(rc.RemoveURI(c));\n            Assert.AreEqual(2, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n            Assert.AreSame(b, rc.URIs[1]);\n        }\n\n        [Test]\n        public void testRemoveOnlyURI()\n        {\n            readConfig(string.Empty);\n\n            URIish a = new URIish(\"/some/dir\");\n            RemoteConfig rc = new RemoteConfig(config, \"backup\");\n            Assert.IsTrue(rc.AddURI(a));\n\n            Assert.AreEqual(1, rc.URIs.Count);\n            Assert.AreSame(a, rc.URIs[0]);\n\n            Assert.IsTrue(rc.RemoveURI(a));\n            Assert.AreEqual(0, rc.URIs.Count);\n        }\n\n        [Test]\n        public void testCreateOrigin()\n        {\n            RemoteConfig rc = new RemoteConfig(config, Constants.DEFAULT_REMOTE_NAME);\n            rc.AddURI(new URIish(\"/some/dir\"));\n            rc.AddFetchRefSpec(new RefSpec(\"+refs/heads/*:refs/remotes/\" + rc.Name + \"/*\"));\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"origin\\\"]\\n\" + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/origin/*\\n\");\n        }\n\n        [Test]\n        public void testSaveAddURI()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            rc.AddURI(new URIish(\"/some/dir\"));\n            Assert.AreEqual(2, rc.URIs.Count);\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"spearce\\\"]\\n\"\n                    + \"\\turl = http://www.spearce.org/egit.git\\n\"\n                    + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n        }\n\n        [Test]\n        public void testSaveRemoveLastURI()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"url = /some/dir\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            Assert.AreEqual(2, rc.URIs.Count);\n            rc.RemoveURI(new URIish(\"/some/dir\"));\n            Assert.AreEqual(1, rc.URIs.Count);\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"spearce\\\"]\\n\"\n                    + \"\\turl = http://www.spearce.org/egit.git\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n        }\n\n        [Test]\n        public void testSaveRemoveFirstURI()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                        + \"url = http://www.spearce.org/egit.git\\n\"\n                        + \"url = /some/dir\\n\"\n                        + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            Assert.AreEqual(2, rc.URIs.Count);\n            rc.RemoveURI(new URIish(\"http://www.spearce.org/egit.git\"));\n            Assert.AreEqual(1, rc.URIs.Count);\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"spearce\\\"]\\n\" + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/spearce/*\\n\");\n        }\n\n        [Test]\n        public void testSaveNoTags()\n        {\n            RemoteConfig rc = new RemoteConfig(config, Constants.DEFAULT_REMOTE_NAME);\n            rc.AddURI(new URIish(\"/some/dir\"));\n            rc.AddFetchRefSpec(new RefSpec(\"+refs/heads/*:refs/remotes/\" + rc.Name + \"/*\"));\n            rc.SetTagOpt(TagOpt.NO_TAGS);\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"origin\\\"]\\n\" + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/origin/*\\n\"\n                    + \"\\ttagopt = --no-tags\\n\");\n        }\n\n        [Test]\n        public void testSaveAllTags()\n        {\n            RemoteConfig rc = new RemoteConfig(config, Constants.DEFAULT_REMOTE_NAME);\n            rc.AddURI(new URIish(\"/some/dir\"));\n            rc.AddFetchRefSpec(new RefSpec(\"+refs/heads/*:refs/remotes/\" + rc.Name + \"/*\"));\n            rc.SetTagOpt(TagOpt.FETCH_TAGS);\n            rc.Update(config);\n\n            checkConfig(\"[remote \\\"origin\\\"]\\n\" + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/origin/*\\n\"\n                    + \"\\ttagopt = --tags\\n\");\n        }\n\n        [Test]\n        public void testSimpleTimeout()\n        {\n            readConfig(\"[remote \\\"spearce\\\"]\\n\"\n                    + \"url = http://www.spearce.org/egit.git\\n\"\n                    + \"fetch = +refs/heads/*:refs/remotes/spearce/*\\n\"\n                    + \"timeout = 12\\n\");\n\n            RemoteConfig rc = new RemoteConfig(config, \"spearce\");\n            Assert.AreEqual(12, rc.Timeout);\n        }\n\n        [Test]\n        public void testSaveTimeout()\n        {\n            RemoteConfig rc = new RemoteConfig(config, Constants.DEFAULT_REMOTE_NAME);\n            rc.AddURI(new URIish(\"/some/dir\"));\n            rc.AddFetchRefSpec(new RefSpec(\"+refs/heads/*:refs/remotes/\" + rc.Name + \"/*\"));\n            rc.Timeout = 60;\n            rc.Update(config);\n            checkConfig(\"[remote \\\"origin\\\"]\\n\" + \"\\turl = /some/dir\\n\"\n                    + \"\\tfetch = +refs/heads/*:refs/remotes/origin/*\\n\"\n                    + \"\\ttimeout = 60\\n\");\n        }\n    }\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/SideBandOutputStreamTest.cs",
    "content": "/*\n * Copyright (C) 2009-2010, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n\n\t[TestFixture]\n\tpublic class SideBandOutputStreamTest\n\t{\n\t\tprivate MemoryStream rawOut;\n\n\t\t[SetUp]\n\t\tprotected void setUp()\n\t\t{\n\t\t\trawOut = new MemoryStream();\n\t\t}\n\n\t\tprivate void assertBuffer(string exp)\n\t\t{\n\t\t\tbyte[] res = rawOut.ToArray();\n\t\t\tstring ress = Constants.CHARSET.GetString(res);\n\t\t\tAssert.AreEqual(exp, ress);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_CH_DATA()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, SideBandOutputStream.SMALL_BUF, rawOut);\n\t\t\tbyte[] b = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\to.Write(b, 0, b.Length);\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0008\\x01\" + \"abc\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_CH_PROGRESS()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_PROGRESS, SideBandOutputStream.SMALL_BUF, rawOut);\n\t\t\tbyte[] b = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\to.Write(b, 0, b.Length);\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0008\\x02\" + \"abc\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_CH_ERROR()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_ERROR, SideBandOutputStream.SMALL_BUF, rawOut);\n\t\t\tbyte[] b = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\to.Write(b, 0, b.Length);\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0008\\x03\" + \"abc\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_Small()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, SideBandOutputStream.SMALL_BUF, rawOut);\n\t\t\to.WriteByte((byte)'a');\n\t\t\to.WriteByte((byte)'b');\n\t\t\to.WriteByte((byte)'c');\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0008\\x01\" + \"abc\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_SmallBlocks1()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, 6, rawOut);\n\t\t\to.WriteByte((byte)'a');\n\t\t\to.WriteByte((byte)'b');\n\t\t\to.WriteByte((byte)'c');\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0006\\x01\" + \"a0006\\x01\" + \"b0006\\x01\" + \"c\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_SmallBlocks2()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, 6, rawOut);\n\t\t\to.Write(new byte[] { (byte)'a', (byte)'b', (byte)'c' }, 0, 3);\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0006\\x01\" + \"a0006\\x01\" + \"b0006\\x01\" + \"c\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_SmallBlocks3()\n\t\t{\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, 7, rawOut);\n\t\t\to.WriteByte((byte)'a');\n\t\t\to.Write(new byte[] { (byte)'b', (byte)'c' }, 0, 2);\n\t\t\to.Flush();\n\t\t\tassertBuffer(\"0007\\x01\" + \"ab0006\\x01\" + \"c\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWrite_Large()\n\t\t{\n\t\t\tconst int buflen = SideBandOutputStream.MAX_BUF - SideBandOutputStream.HDR_SIZE;\n\t\t\tbyte[] buf = new byte[buflen];\n\t\t\tfor (int i = 0; i < buf.Length; i++)\n\t\t\t\tbuf[i] = (byte)i;\n\n\t\t\tSideBandOutputStream o;\n\t\t\to = new SideBandOutputStream(SideBandOutputStream.CH_DATA, SideBandOutputStream.MAX_BUF, rawOut);\n\t\t\to.Write(buf, 0, buf.Length);\n\t\t\to.Flush();\n\t\t\tbyte[] act = rawOut.ToArray();\n\t\t\tstring explen = NB.DecimalToBase(buf.Length + SideBandOutputStream.HDR_SIZE, 16);\n\t\t\tAssert.AreEqual(SideBandOutputStream.HDR_SIZE + buf.Length, act.Length);\n\t\t\tAssert.AreEqual(Charset.forName(\"UTF-8\").GetString(act, 0, 4), explen);\n\t\t\tAssert.AreEqual(1, act[4]);\n\t\t\tfor (int i = 0, j = SideBandOutputStream.HDR_SIZE; i < buf.Length; i++, j++)\n\t\t\t\tAssert.AreEqual(buf[i], act[j]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testFlush()\n\t\t{\n\t\t\tvar flushCnt = new int[1];\n\t\t\tvar mockout = new FlushCounterFailWriterStream(flushCnt);\n\n\t\t\tnew SideBandOutputStream(SideBandOutputStream.CH_DATA, SideBandOutputStream.SMALL_BUF,\n\t\t\t\t\t\t\t\t\t\t\t mockout).Flush();\n\n\t\t\tAssert.AreEqual(1, flushCnt[0]);\n\t\t}\n\n\t\tpublic void testConstructor_RejectsBadChannel()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(-1, SideBandOutputStream.MAX_BUF, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted -1 channel number\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"channel -1 must be in range [0, 255]\", e.Message);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(0, SideBandOutputStream.MAX_BUF, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted 0 channel number\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"channel 0 must be in range [0, 255]\", e.Message);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(256, SideBandOutputStream.MAX_BUF, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted 256 channel number\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"channel 256 must be in range [0, 255]\", e\n\t\t\t\t\t\t.Message);\n\t\t\t}\n\t\t}\n\n\t\tpublic void testConstructor_RejectsBadBufferSize()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(SideBandOutputStream.CH_DATA, -1, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted -1 for buffer size\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"packet size -1 must be >= 5\", e.Message);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(SideBandOutputStream.CH_DATA, 0, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted 0 for buffer size\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"packet size 0 must be >= 5\", e.Message);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(SideBandOutputStream.CH_DATA, 1, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted 1 for buffer size\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"packet size 1 must be >= 5\", e.Message);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnew SideBandOutputStream(SideBandOutputStream.CH_DATA, int.MaxValue, rawOut);\n\t\t\t\tAssert.Fail(\"Accepted \" + int.MaxValue + \" for buffer size\");\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tAssert.Equals(\"packet size \" + int.MaxValue\n\t\t\t\t\t\t+ \" must be <= 65520\", e.Message);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tinternal class FlushCounterFailWriterStream : MemoryStream\n\t{\n\t\tprivate readonly int[] _flushCnt;\n\n\t\tpublic FlushCounterFailWriterStream(int[] flushCnt)\n\t\t{\n\t\t\t_flushCnt = flushCnt;\n\t\t}\n\n\t\tpublic override void Write(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tAssert.Fail(\"should not write\");\n\t\t}\n\n\t\tpublic override void WriteByte(byte value)\n\t\t{\n\t\t\tAssert.Fail(\"should not write\");\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t\t_flushCnt[0]++;\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/TransportTest.cs",
    "content": "/*\n * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Transport;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GitSharp.Core.Tests.Transport\n{\n    [TestFixture]\n    public class TransportTest : SampleDataRepositoryTestCase\n    {\n        private GitSharp.Core.Transport.Transport transport;\n        private RemoteConfig remoteConfig;\n\n        public override void setUp()\n        {\n            base.setUp();\n            RepositoryConfig config = db.Config;\n            remoteConfig = new RemoteConfig(config, \"test\");\n            remoteConfig.AddURI(new URIish(\"http://everyones.loves.git/u/2\"));\n            transport = null;\n        }\n\n        public override void tearDown()\n        {\n            if (transport != null)\n            {\n                transport.Dispose();\n                transport = null;\n            }\n            base.tearDown();\n        }\n\n        [Test]\n        public void testFindRemoteRefUpdatesNoWildcardNoTracking()\n        {\n            transport = GitSharp.Core.Transport.Transport.open(db, remoteConfig);\n            ICollection<RemoteRefUpdate> result =\n                transport.findRemoteRefUpdatesFor(new List<RefSpec> {new RefSpec(\"refs/heads/master:refs/heads/x\")});\n\n            Assert.AreEqual(1, result.Count);\n            RemoteRefUpdate rru = result.ToArray()[0];\n            Assert.AreEqual(null, rru.ExpectedOldObjectId);\n            Assert.IsFalse(rru.ForceUpdate);\n            Assert.AreEqual(\"refs/heads/master\", rru.SourceRef);\n            Assert.AreEqual(db.Resolve(\"refs/heads/master\"), rru.NewObjectId);\n            Assert.AreEqual(\"refs/heads/x\", rru.RemoteName);\n        }\n\n        [Test]\n        public void testFindRemoteRefUpdatesNoWildcardNoDestination()\n        {\n            transport = GitSharp.Core.Transport.Transport.open(db, remoteConfig);\n            ICollection<RemoteRefUpdate> result =\n                transport.findRemoteRefUpdatesFor(new List<RefSpec> {new RefSpec(\"+refs/heads/master\")});\n\n            Assert.AreEqual(1, result.Count);\n            RemoteRefUpdate rru = result.ToArray()[0];\n            Assert.AreEqual(null, rru.ExpectedOldObjectId);\n            Assert.IsTrue(rru.ForceUpdate);\n            Assert.AreEqual(\"refs/heads/master\", rru.SourceRef);\n            Assert.AreEqual(db.Resolve(\"refs/heads/master\"), rru.NewObjectId);\n            Assert.AreEqual(\"refs/heads/master\", rru.RemoteName);\n        }\n\n        [Test]\n        public void testFindRemoteRefUpdatesWildcardNoTracking()\n        {\n            transport = GitSharp.Core.Transport.Transport.open(db, remoteConfig);\n            ICollection<RemoteRefUpdate> result =\n                transport.findRemoteRefUpdatesFor(new List<RefSpec> { new RefSpec(\"+refs/heads/*:refs/heads/test/*\") });\n\n            Assert.AreEqual(12, result.Count);\n            bool foundA = false;\n            bool foundB = false;\n            foreach (RemoteRefUpdate rru in result)\n            {\n                if (\"refs/heads/a\".Equals(rru.SourceRef) && \"refs/heads/test/a\".Equals(rru.RemoteName))\n                {\n                \tfoundA = true;\n                }\n                if (\"refs/heads/b\".Equals(rru.SourceRef) && \"refs/heads/test/b\".Equals(rru.RemoteName))\n                {\n                \tfoundB = true;\n                }\n            }\n            Assert.IsTrue(foundA);\n            Assert.IsTrue(foundB);\n        }\n\n        [Test]\n        public void testFindRemoteRefUpdatesTwoRefSpecs()\n        {\n            transport = GitSharp.Core.Transport.Transport.open(db, remoteConfig);\n            RefSpec specA = new RefSpec(\"+refs/heads/a:refs/heads/b\");\n            RefSpec specC = new RefSpec(\"+refs/heads/c:refs/heads/d\");\n            List<RefSpec> specs = new List<RefSpec>{specA, specC};\n            ICollection<RemoteRefUpdate> result = transport.findRemoteRefUpdatesFor(specs);\n\n            Assert.AreEqual(2, result.Count);\n            bool foundA = false;\n            bool foundC = false;\n            foreach (RemoteRefUpdate rru in result)\n            {\n                if (\"refs/heads/a\".Equals(rru.SourceRef) && \"refs/heads/b\".Equals(rru.RemoteName))\n                    foundA = true;\n                if (\"refs/heads/c\".Equals(rru.SourceRef) && \"refs/heads/d\".Equals(rru.RemoteName))\n                    foundC = true;\n            }\n            Assert.IsTrue(foundA);\n            Assert.IsTrue(foundC);\n        }\n\n        [Test]\n        public void testFindRemoteRefUpdatesTrackingRef()\n        {\n            remoteConfig.AddFetchRefSpec(new RefSpec(\"refs/heads/*:refs/remotes/test/*\"));\n            transport = GitSharp.Core.Transport.Transport.open(db, remoteConfig);\n            ICollection<RemoteRefUpdate> result =\n                transport.findRemoteRefUpdatesFor(new List<RefSpec> {new RefSpec(\"+refs/heads/a:refs/heads/a\")});\n\n            Assert.AreEqual(1, result.Count);\n            TrackingRefUpdate tru = result.ToArray()[0].TrackingRefUpdate;\n            Assert.AreEqual(\"refs/remotes/test/a\", tru.LocalName);\n            Assert.AreEqual(\"refs/heads/a\", tru.RemoteName);\n            Assert.AreEqual(db.Resolve(\"refs/heads/a\"), tru.NewObjectId);\n            Assert.AreEqual(null, tru.OldObjectId);\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Transport/URIishTests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing GitSharp.Core.Transport;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Transport\n{\n    [TestFixture]\n    public class URIishTest\n    {\n        private const string GIT_SCHEME = \"git://\";\n\n        [Test]\n        public void testUnixFile()\n        {\n            const string str = \"/home/m y\";\n            var u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(str, u.Path);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testWindowsFile()\n        {\n            const string str = \"D:/m y\";\n            URIish u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(str, u.Path);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testWindowsFile2()\n        {\n            const string str = \"D:\\\\m y\";\n            var u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(\"D:/m y\", u.Path);\n            Assert.AreEqual(\"D:/m y\", u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testUNC()\n        {\n            const string str = \"\\\\\\\\some\\\\place\";\n            var u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(\"//some/place\", u.Path);\n            Assert.AreEqual(\"//some/place\", u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testFileProtoUnix()\n        {\n            const string str = \"file:///home/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"file\", u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(\"/home/m y\", u.Path);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testFileProtoWindows()\n        {\n            const string str = \"file:///D:/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"file\", u.Scheme);\n            Assert.IsFalse(u.IsRemote);\n            Assert.AreEqual(\"D:/m y\", u.Path);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGitProtoUnix()\n        {\n            const string str = \"git://example.com/home/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"git\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(\"/home/m y\", u.Path);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGitProtoUnixPort()\n        {\n            const string str = \"git://example.com:333/home/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"git\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(\"/home/m y\", u.Path);\n            Assert.AreEqual(333, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGitProtoWindowsPort()\n        {\n            const string str = \"git://example.com:338/D:/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"git\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"D:/m y\", u.Path);\n            Assert.AreEqual(338, u.Port);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGitProtoWindows()\n        {\n            const string str = \"git://example.com/D:/m y\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"git\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"D:/m y\", u.Path);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testScpStyleWithoutUser()\n        {\n            const string str = \"example.com:some/p ath\";\n            var u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testScpStyleWithUser()\n        {\n            const string str = \"user@example.com:some/p ath\";\n            var u = new URIish(str);\n            Assert.IsNull(u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"some/p ath\", u.Path);\n            Assert.AreEqual(\"user\", u.User);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGitSshProto()\n        {\n            const string str = \"git+ssh://example.com/some/p ath\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"git+ssh\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"/some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testSshGitProto()\n        {\n            const string str = \"ssh+git://example.com/some/p ath\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"ssh+git\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"/some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testSshProto()\n        {\n            const string str = \"ssh://example.com/some/p ath\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"ssh\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"/some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(-1, u.Port);\n            Assert.AreEqual(str, u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testSshProtoWithUserAndPort()\n        {\n            const string str = \"ssh://user@example.com:33/some/p ath\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"ssh\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"/some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(\"user\", u.User);\n            Assert.IsNull(u.Pass);\n            Assert.AreEqual(33, u.Port);\n            Assert.AreEqual(str, u.ToPrivateString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testSshProtoWithUserPassAndPort()\n        {\n            const string str = \"ssh://user:pass@example.com:33/some/p ath\";\n            var u = new URIish(str);\n            Assert.AreEqual(\"ssh\", u.Scheme);\n            Assert.IsTrue(u.IsRemote);\n            Assert.AreEqual(\"/some/p ath\", u.Path);\n            Assert.AreEqual(\"example.com\", u.Host);\n            Assert.AreEqual(\"user\", u.User);\n            Assert.AreEqual(\"pass\", u.Pass);\n            Assert.AreEqual(33, u.Port);\n            Assert.AreEqual(str, u.ToPrivateString());\n            Assert.AreEqual(u.SetPass(null).ToPrivateString(), u.ToString());\n            Assert.AreEqual(u, new URIish(str));\n        }\n\n        [Test]\n        public void testGetNullHumanishName()\n        {\n            AssertHelper.Throws<InvalidOperationException>(() => new URIish().getHumanishName(), \"path must be not null\");\n        }\n\n        [Test]\n        public void testGetEmptyHumanishName()\n        {\n            AssertHelper.Throws<InvalidOperationException>(() => new URIish(GIT_SCHEME).getHumanishName(), \"empty path is useless\");\n        }\n\n        [Test]\n        public void testGetAbsEmptyHumanishName()\n        {\n            AssertHelper.Throws<InvalidOperationException>(() => new URIish().getHumanishName(), \"empty path is useless\");\n        }\n\n        [Test]\n        public void testGetValidWithEmptySlashDotGitHumanishName()\n        {\n            string humanishName = new URIish(\"/a/b/.git\").getHumanishName();\n            Assert.AreEqual(\"b\", humanishName);\n        }\n\n        [Test]\n        public void testGetWithSlashDotGitHumanishName()\n        {\n            Assert.AreEqual(\"\", new URIish(\"/.git\").getHumanishName());\n        }\n\n        [Test]\n        public void testGetTwoSlashesDotGitHumanishName()\n        {\n            Assert.AreEqual(\"\", new URIish(\"/.git\").getHumanishName());\n        }\n\n        [Test]\n        public void testGetValidHumanishName()\n        {\n            string humanishName = new URIish(GIT_SCHEME + \"abc\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidSlashHumanishName()\n        {\n            string humanishName = new URIish(GIT_SCHEME + \"abc/\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetSlashValidSlashHumanishName()\n        {\n            string humanishName = new URIish(\"/abc/\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetSlashValidSlashDotGitSlashHumanishName()\n        {\n            string humanishName = new URIish(\"/abc/.git\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetSlashSlashDotGitSlashHumanishName()\n        {\n            string humanishName = new URIish(GIT_SCHEME + \"/abc//.git\")\n                .getHumanishName();\n            Assert.AreEqual(\"\", humanishName, \"may return an empty humanish name\");\n        }\n\n        [Test]\n        public void testGetSlashesValidSlashHumanishName()\n        {\n            string humanishName = new URIish(\"/a/b/c/\").getHumanishName();\n            Assert.AreEqual(\"c\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidDotGitHumanishName()\n        {\n            string humanishName = new URIish(GIT_SCHEME + \"abc.git\")\n                .getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidDotGitSlashHumanishName()\n        {\n            string humanishName = new URIish(GIT_SCHEME + \"abc.git/\")\n                .getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidWithSlashDotGitHumanishName()\n        {\n            string humanishName = new URIish(\"/abc.git\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidWithSlashDotGitSlashHumanishName()\n        {\n            string humanishName = new URIish(\"/abc.git/\").getHumanishName();\n            Assert.AreEqual(\"abc\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidWithSlashesDotGitHumanishName()\n        {\n            string humanishName = new URIish(\"/a/b/c.git\").getHumanishName();\n            Assert.AreEqual(\"c\", humanishName);\n        }\n\n        [Test]\n        public void testGetValidWithSlashesDotGitSlashHumanishName()\n        {\n            string humanishName = new URIish(\"/a/b/c.git/\").getHumanishName();\n            Assert.AreEqual(\"c\", humanishName);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeIteratorLeafOnlyTest.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class TreeIteratorLeafOnlyTest : RepositoryTestCase\n\t{\n\t\t/// <summary>\n\t\t/// Empty tree\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\tTreeIterator i = MakeIterator(tree);\n\t\t\tAssert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// One file\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF1()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n\t\t\tAssert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"x\", i.next().Name);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// two files\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF2()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a\");\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n\t\t\tAssert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a\", i.next().Name);\n\t\t\tAssert.AreEqual(\"x\", i.next().Name);\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Empty tree\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleT()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddTree(\"a\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n\t\t\tAssert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTricky()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a.b\");\n\t\t\ttree.AddFile(\"a.c\");\n\t\t\ttree.AddFile(\"a/b.b/b\");\n\t\t\ttree.AddFile(\"a/b\");\n\t\t\ttree.AddFile(\"a/c\");\n\t\t\ttree.AddFile(\"a=c\");\n\t\t\ttree.AddFile(\"a=d\");\n\n\t\t\tTreeIterator i = MakeIterator(tree);\n\t\t\tAssert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a.b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a.c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/b.b/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a=c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a=d\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n        private static TreeIterator MakeIterator(Core.Tree tree)\n\t\t{\n\t\t\treturn new TreeIterator(tree);\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeIteratorPostOrderTest.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class TreeIteratorPostOrderTest : RepositoryTestCase\n    {\n\t\t/// <summary>\n\t\t/// Empty tree\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n\t\t\tvar tree = new Core.Tree(db);\n\t\t\tTreeIterator i = makeIterator(tree);\n\t\t\tAssert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// one file\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF1()\n\t\t{\n\t\t\tvar tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = makeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"x\", i.next().Name);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// two files\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF2()\n\t\t{\n\t\t\tvar tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a\");\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = makeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a\", i.next().Name);\n            Assert.AreEqual(\"x\", i.next().Name);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Empty tree\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleT()\n\t\t{\n\t\t\tvar tree = new Core.Tree(db);\n\t\t\ttree.AddTree(\"a\");\n\t\t\tTreeIterator i = makeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTricky()\n\t\t{\n\t\t\tvar tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a.b\");\n\t\t\ttree.AddFile(\"a.c\");\n\t\t\ttree.AddFile(\"a/b.b/b\");\n\t\t\ttree.AddFile(\"a/b\");\n\t\t\ttree.AddFile(\"a/c\");\n\t\t\ttree.AddFile(\"a=c\");\n\t\t\ttree.AddFile(\"a=d\");\n\n\t\t\tTreeIterator i = makeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a.b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a.c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/b.b/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/b.b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a/c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a=c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"a=d\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n            Assert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\tprivate static TreeIterator makeIterator(Core.Tree tree)\n\t\t{\n\t\t\treturn new TreeIterator(tree, TreeIterator.Order.POSTORDER);\n\t\t}\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeIteratorPreOrderTest.cs",
    "content": "/*\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class TreeIteratorPreOrderTest : RepositoryTestCase\n    {\n\t\t/// <summary>\n\t\t/// Empty tree\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void testEmpty()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\tTreeIterator i = MakeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// one file\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF1()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(string.Empty, i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"x\", i.next().Name);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// two files\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleF2()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a\");\n\t\t\ttree.AddFile(\"x\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a\", i.next().Name);\n\t\t\tAssert.AreEqual(\"x\", i.next().Name);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t///\t<summary>\n\t\t/// Empty tree\n\t\t///\t</summary>\n\t\t///\t<exception cref=\"IOException\"> </exception>\n\t\t[Test]\n\t\tpublic void testSimpleT()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddTree(\"a\");\n\t\t\tTreeIterator i = MakeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTricky()\n\t\t{\n            Core.Tree tree = new Core.Tree(db);\n\t\t\ttree.AddFile(\"a.b\");\n\t\t\ttree.AddFile(\"a.c\");\n\t\t\ttree.AddFile(\"a/b.b/b\");\n\t\t\ttree.AddFile(\"a/b\");\n\t\t\ttree.AddFile(\"a/c\");\n\t\t\ttree.AddFile(\"a=c\");\n\t\t\ttree.AddFile(\"a=d\");\n\n\t\t\tTreeIterator i = MakeIterator(tree);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a.b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a.c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a/b.b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a/b.b/b\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a/c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a=c\", i.next().FullName);\n            Assert.IsTrue(i.hasNext());\n\t\t\tAssert.AreEqual(\"a=d\", i.next().FullName);\n            Assert.IsFalse(i.hasNext());\n\t\t}\n\n        private static TreeIterator MakeIterator(Core.Tree tree)\n\t\t{\n\t\t\treturn new TreeIterator(tree, TreeIterator.Order.PREORDER);\n\t\t}\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/AbstractTreeIteratorTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Tor Arne Vestbø <torarnv@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n\t[TestFixture]\n\tpublic class AbstractTreeIteratorTest\n\t{\n\t    private static string prefix(string path)\n\t    {\n\t        int s = path.LastIndexOf('/');\n\t        return s > 0 ? path.Slice(0, s) : \"\";\n\t    }\n\t\n\t    public class FakeTreeIterator : WorkingTreeIterator\n\t    {\n\t        public FakeTreeIterator(string pathName, FileMode fileMode) : base(prefix(pathName))\n\t        {\n\t            Mode = fileMode.Bits;\n\t\n\t            int s = pathName.LastIndexOf('/');\n\t            byte[] name = Constants.encode(pathName.Substring(s + 1));\n\t            ensurePathCapacity(PathOffset + name.Length, PathOffset);\n\t            Array.Copy(name, 0, Path, PathOffset, name.Length);\n\t            PathLen = PathOffset + name.Length;\n\t        }\n\t\n\t        public new void ensurePathCapacity(int capacity, int length)\n\t        {\n\t            base.ensurePathCapacity(capacity, length);\n\t        }\n\t\n\t        public override AbstractTreeIterator createSubtreeIterator(Core.Repository repo)\n\t        {\n\t            return null;\n\t        }\n\t    }\n\t\n\t    [Test]\n\t    public void testPathCompare()\n\t    {\n\t\t\tAssert.IsTrue(new FakeTreeIterator(\"a\", FileMode.RegularFile).pathCompare(\n\t\t\t\t\tnew FakeTreeIterator(\"a\", FileMode.Tree)) < 0);\n\t\n\t\t\tAssert.IsTrue(new FakeTreeIterator(\"a\", FileMode.Tree).pathCompare(\n\t\t\t\t\tnew FakeTreeIterator(\"a\", FileMode.RegularFile)) > 0);\n\t\n\t\t\tAssert.IsTrue(new FakeTreeIterator(\"a\", FileMode.RegularFile).pathCompare(\n\t\t\t\t\tnew FakeTreeIterator(\"a\", FileMode.RegularFile)) == 0);\n\t\n\t\t\tAssert.IsTrue(new FakeTreeIterator(\"a\", FileMode.Tree).pathCompare(\n\t\t\t\t\tnew FakeTreeIterator(\"a\", FileMode.Tree)) == 0);\n\t\t}\n\t\n\t    [Test]\n\t    public void testGrowPath()\n\t    {\n\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"ab\", FileMode.Tree);\n\t\t\tbyte[] origpath = i.Path;\n\t\t\tAssert.AreEqual(i.Path[0], 'a');\n\t\t\tAssert.AreEqual(i.Path[1], 'b');\n\t\n\t\t\ti.growPath(2);\n\t\n\t        Assert.AreNotSame(origpath, i.Path);\n\t        Assert.AreEqual(origpath.Length * 2, i.Path.Length);\n\t        Assert.AreEqual(i.Path[0], 'a');\n\t        Assert.AreEqual(i.Path[1], 'b');\n\t\t}\n\t\n\t    [Test]\n\t    public void testEnsurePathCapacityFastCase()\n\t    {\n\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"ab\", FileMode.Tree);\n\t\t\tint want = 50;\n\t        byte[] origpath = i.Path;\n\t        Assert.AreEqual(i.Path[0], 'a');\n\t        Assert.AreEqual(i.Path[1], 'b');\n\t        Assert.IsTrue(want < i.Path.Length);\n\t\n\t\t\ti.ensurePathCapacity(want, 2);\n\t\n\t        Assert.AreSame(origpath, i.Path);\n\t        Assert.AreEqual(i.Path[0], 'a');\n\t        Assert.AreEqual(i.Path[1], 'b');\n\t\t}\n\t\n\t    [Test]\n\t    public void testEnsurePathCapacityGrows()\n\t    {\n\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"ab\", FileMode.Tree);\n\t\t\tint want = 384;\n\t        byte[] origpath = i.Path;\n\t        Assert.AreEqual(i.Path[0], 'a');\n\t        Assert.AreEqual(i.Path[1], 'b');\n\t        Assert.IsTrue(i.Path.Length < want);\n\t\n\t\t\ti.ensurePathCapacity(want, 2);\n\t\n\t        Assert.AreNotSame(origpath, i.Path);\n\t        Assert.AreEqual(512, i.Path.Length);\n\t        Assert.AreEqual(i.Path[0], 'a');\n\t        Assert.AreEqual(i.Path[1], 'b');\n\t\t}\n\t\n\t    [Test]\n\t    public void testEntryFileMode()\n\t    {\n\t\t\tforeach (FileMode m in new [] { FileMode.Tree,\n\t\t\t\t\tFileMode.RegularFile, FileMode.ExecutableFile,\n\t\t\t\t\tFileMode.GitLink, FileMode.Symlink }) {\n\t\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"a\", m);\n\t\t\t\tAssert.AreEqual(m.Bits, i.EntryRawMode);\n\t\t\t\tAssert.AreSame(m, i.EntryFileMode);\n\t\t\t}\n\t\t}\n\t\n\t    [Test]\n\t    public void testEntryPath()\n\t    {\n\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"a/b/cd\", FileMode.Tree);\n\t\t\tAssert.AreEqual(\"a/b/cd\", i.EntryPathString);\n\t\t\tAssert.AreEqual(2, i.NameLength);\n\t\t\tbyte[] b = new byte[3];\n\t\t\tb[0] = 0x0a;\n\t\t\ti.getName(b, 1);\n\t\t\tAssert.AreEqual(0x0a, b[0]);\n\t\t\tAssert.AreEqual('c', b[1]);\n\t\t\tAssert.AreEqual('d', b[2]);\n\t\t}\n\t\n\t    [Test]\n\t\tpublic void testCreateEmptyTreeIterator() {\n\t\t\tFakeTreeIterator i = new FakeTreeIterator(\"a/b/cd\", FileMode.Tree);\n\t\t\tEmptyTreeIterator e = i.createEmptyTreeIterator();\n\t\t\tAssert.IsNotNull(e);\n\t\t\tAssert.AreEqual(i.EntryPathString + \"/\", e.EntryPathString);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/CanonicalTreeParserTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * with@out modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software with@out specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n\t[TestFixture]\n\tpublic class CanonicalTreeParserTest\n\t{\n\t\t#region Setup/Teardown\n\n\t\t[SetUp]\n\t\tpublic void setUp()\n\t\t{\n\t\t\ttree1 = mktree(Entry(m644, \"a\", hash_a));\n\t\t\ttree2 = mktree(Entry(m644, \"a\", hash_a), Entry(m644, \"foo\", hash_foo));\n\t\t\ttree3 = mktree(Entry(m644, \"a\", hash_a), Entry(mt, \"b_sometree\", hash_sometree), Entry(m644, \"foo\", hash_foo));\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate readonly CanonicalTreeParser ctp = new CanonicalTreeParser();\n\t\tprivate readonly FileMode m644 = FileMode.RegularFile;\n\t\tprivate readonly FileMode mt = FileMode.Tree;\n\t\tprivate readonly ObjectId hash_a = ObjectId.FromString(\"6b9c715d21d5486e59083fb6071566aa6ecd4d42\");\n\t\tprivate readonly ObjectId hash_foo = ObjectId.FromString(\"a213e8e25bb2442326e86cbfb9ef56319f482869\");\n\t\tprivate readonly ObjectId hash_sometree = ObjectId.FromString(\"daf4bdb0d7bb24319810fe0e73aa317663448c93\");\n\n\t\tprivate byte[] tree1;\n\t\tprivate byte[] tree2;\n\t\tprivate byte[] tree3;\n\n\t\tprivate static byte[] mktree(params byte[][] data)\n\t\t{\n\t\t\tvar @out = new MemoryStream();\n\t\t\tforeach (var e in data)\n\t\t\t{\n\t\t\t\t@out.Write(e, 0, e.Length);\n\t\t\t}\n\t\t\treturn @out.ToArray();\n\t\t}\n\n\t\tprivate static byte[] Entry(FileMode mode, string name, AnyObjectId id)\n\t\t{\n\t\t\tvar @out = new MemoryStream();\n\t\t\tmode.CopyTo(@out);\n\t\t\t@out.WriteByte((byte) ' ');\n\t\t\tbyte[] bytes = Constants.encode(name);\n\t\t\t@out.Write(bytes, 0, bytes.Length);\n\t\t\t@out.WriteByte(0);\n\t\t\tid.copyRawTo(@out);\n\t\t\treturn @out.ToArray();\n\t\t}\n\n\t\tprivate string Path()\n\t\t{\n\t\t\treturn RawParseUtils.decode(Constants.CHARSET, ctp.Path, ctp.PathOffset, ctp.PathLen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testBackwards_ConfusingPathName()\n\t\t{\n\t\t\tconst string aVeryConfusingName = \"confusing 644 entry 755 and others\";\n\t\t\tctp.reset(mktree(Entry(m644, \"a\", hash_a), Entry(mt, aVeryConfusingName,\n\t\t\t                                                hash_sometree), Entry(m644, \"foo\", hash_foo)));\n\t\t\tctp.next(3);\n\t\t\tAssert.IsTrue(ctp.eof());\n\n\t\t\tctp.back(2);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(mt.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(aVeryConfusingName, Path());\n\t\t\tAssert.AreEqual(hash_sometree, ctp.getEntryObjectId());\n\n\t\t\tctp.back(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEmptyTree_AtEOF()\n\t\t{\n\t\t\tctp.reset(new byte[0]);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testFreakingHugePathName()\n\t\t{\n\t\t\tint n = AbstractTreeIterator.DEFAULT_PATH_SIZE*4;\n\t\t\tvar b = new StringBuilder(n);\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tb.Append('q');\n\t\t\t}\n\t\t\tstring name = b.ToString();\n\t\t\tctp.reset(Entry(m644, name, hash_a));\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(name, RawParseUtils.decode(Constants.CHARSET, ctp.Path, ctp.PathOffset, ctp.PathLen));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testOneEntry_Backwards()\n\t\t{\n\t\t\tctp.reset(tree1);\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.first());\n\t\t\tAssert.IsTrue(ctp.eof());\n\n\t\t\tctp.back(1);\n\t\t\tAssert.IsTrue(ctp.first());\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testOneEntry_Forward()\n\t\t{\n\t\t\tctp.reset(tree1);\n\n\t\t\tAssert.IsTrue(ctp.first());\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.first());\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testOneEntry_Seek1IsEOF()\n\t\t{\n\t\t\tctp.reset(tree1);\n\t\t\tctp.next(1);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testThreeEntries_BackwardsTwo()\n\t\t{\n\t\t\tctp.reset(tree3);\n\t\t\tctp.next(3);\n\t\t\tAssert.IsTrue(ctp.eof());\n\n\t\t\tctp.back(2);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(mt.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"b_sometree\", Path());\n\t\t\tAssert.AreEqual(hash_sometree, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"foo\", Path());\n\t\t\tAssert.AreEqual(hash_foo, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testThreeEntries_Seek2()\n\t\t{\n\t\t\tctp.reset(tree3);\n\n\t\t\tctp.next(2);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"foo\", Path());\n\t\t\tAssert.AreEqual(hash_foo, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testThreeEntries_Seek3IsEOF()\n\t\t{\n\t\t\tctp.reset(tree3);\n\t\t\tctp.next(3);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTwoEntries_BackwardsOneAtATime()\n\t\t{\n\t\t\tctp.reset(tree2);\n\t\t\tctp.next(2);\n\t\t\tAssert.IsTrue(ctp.eof());\n\n\t\t\tctp.back(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"foo\", Path());\n\t\t\tAssert.AreEqual(hash_foo, ctp.getEntryObjectId());\n\n\t\t\tctp.back(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTwoEntries_BackwardsTwo()\n\t\t{\n\t\t\tctp.reset(tree2);\n\t\t\tctp.next(2);\n\t\t\tAssert.IsTrue(ctp.eof());\n\n\t\t\tctp.back(2);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"foo\", Path());\n\t\t\tAssert.AreEqual(hash_foo, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTwoEntries_ForwardOneAtATime()\n\t\t{\n\t\t\tctp.reset(tree2);\n\n\t\t\tAssert.IsTrue(ctp.first());\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"a\", Path());\n\t\t\tAssert.AreEqual(hash_a, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.eof());\n\t\t\tAssert.AreEqual(m644.Bits, ctp.Mode);\n\t\t\tAssert.AreEqual(\"foo\", Path());\n\t\t\tAssert.AreEqual(hash_foo, ctp.getEntryObjectId());\n\n\t\t\tctp.next(1);\n\t\t\tAssert.IsFalse(ctp.first());\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTwoEntries_Seek2IsEOF()\n\t\t{\n\t\t\tctp.reset(tree2);\n\t\t\tctp.next(2);\n\t\t\tAssert.IsTrue(ctp.eof());\n\t\t}\n\n\t    [Test]\n\t    public void testBackwords_Prebuilts1()\n\t    {\n\t        // What is interesting about this test is the ObjectId for the\n\t        // \"darwin-x86\" path entry ends in an octal digit (37 == '7').\n\t        // Thus when scanning backwards we could over scan and consume\n\t        // part of the SHA-1, and miss the path terminator.\n\t        //\n\t        ObjectId common = ObjectId\n\t            .FromString(\"af7bf97cb9bce3f60f1d651a0ef862e9447dd8bc\");\n\t        ObjectId darwinx86 = ObjectId\n\t            .FromString(\"e927f7398240f78face99e1a738dac54ef738e37\");\n\t        ObjectId linuxx86 = ObjectId\n\t            .FromString(\"ac08dd97120c7cb7d06e98cd5b152011183baf21\");\n\t        ObjectId windows = ObjectId\n\t            .FromString(\"6c4c64c221a022bb973165192cca4812033479df\");\n\n\t        ctp.reset(mktree(Entry(mt, \"common\", common), Entry(mt, \"darwin-x86\", darwinx86),\n                Entry(mt, \"linux-x86\", linuxx86), Entry(mt, \"windows\", windows)));\n\t        ctp.next(3);\n\t        Assert.AreEqual(\"windows\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(windows, ctp.getEntryObjectId());\n\n\t        ctp.back(1);\n\t        Assert.AreEqual(\"linux-x86\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(linuxx86, ctp.getEntryObjectId());\n\n\t        ctp.next(1);\n\t        Assert.AreEqual(\"windows\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(windows, ctp.getEntryObjectId());\n\t    }\n\n\t    [Test]\n\t    public void testBackwords_Prebuilts2()\n\t    {\n\t        // What is interesting about this test is the ObjectId for the\n\t        // \"darwin-x86\" path entry ends in an octal digit (37 == '7').\n\t        // Thus when scanning backwards we could over scan and consume\n\t        // part of the SHA-1, and miss the path terminator.\n\t        //\n\t        ObjectId common = ObjectId\n\t            .FromString(\"af7bf97cb9bce3f60f1d651a0ef862e9447dd8bc\");\n\t        ObjectId darwinx86 = ObjectId\n\t            .FromString(\"0000000000000000000000000000000000000037\");\n\t        ObjectId linuxx86 = ObjectId\n\t            .FromString(\"ac08dd97120c7cb7d06e98cd5b152011183baf21\");\n\t        ObjectId windows = ObjectId\n\t            .FromString(\"6c4c64c221a022bb973165192cca4812033479df\");\n\n\t        ctp.reset(mktree(Entry(mt, \"common\", common), \n                Entry(mt, \"darwin-x86\", darwinx86), Entry(mt, \"linux-x86\", linuxx86), \n                Entry(mt, \"windows\", windows)));\n\t        ctp.next(3);\n\t        Assert.AreEqual(\"windows\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(windows, ctp.getEntryObjectId());\n\n\t        ctp.back(1);\n\t        Assert.AreEqual(\"linux-x86\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(linuxx86, ctp.getEntryObjectId());\n\n\t        ctp.next(1);\n\t        Assert.AreEqual(\"windows\", ctp.EntryPathString);\n\t        Assert.AreSame(mt, ctp.EntryFileMode);\n\t        Assert.AreEqual(windows, ctp.getEntryObjectId());\n\t    }\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/EmptyTreeIteratorTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.TreeWalk;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n\t[TestFixture]\n\tpublic class EmptyTreeIteratorTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic virtual void testAtEOF()\n\t\t{\n\t\t\tEmptyTreeIterator etp = new EmptyTreeIterator();\n\t\t\tAssert.IsTrue(etp.first());\n\t\t\tAssert.IsTrue(etp.eof());\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testCreateSubtreeIterator()\n\t\t{\n\t\t\tEmptyTreeIterator etp = new EmptyTreeIterator();\n\t\t\tAbstractTreeIterator sub = etp.createSubtreeIterator(db);\n\t\t\tAssert.IsNotNull(sub);\n\t\t\tAssert.IsTrue(sub.first());\n\t\t\tAssert.IsTrue(sub.eof());\n\t\t\tAssert.IsTrue(sub is EmptyTreeIterator);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testEntryObjectId()\n\t\t{\n\t\t\tEmptyTreeIterator etp = new EmptyTreeIterator();\n\t\t\tAssert.AreSame(ObjectId.ZeroId, etp.getEntryObjectId());\n\t\t\tAssert.IsNotNull(etp.idBuffer());\n\t\t\tAssert.AreEqual(0, etp.idOffset());\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, ObjectId.FromRaw(etp.idBuffer()));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testNextDoesNothing()\n\t\t{\n\t\t\tEmptyTreeIterator etp = new EmptyTreeIterator();\n\t\t\tetp.next(1);\n\t\t\tAssert.IsTrue(etp.first());\n\t\t\tAssert.IsTrue(etp.eof());\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, ObjectId.FromRaw(etp.idBuffer()));\n\n\t\t\tetp.next(1);\n\t\t\tAssert.IsTrue(etp.first());\n\t\t\tAssert.IsTrue(etp.eof());\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, ObjectId.FromRaw(etp.idBuffer()));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testBackDoesNothing()\n\t\t{\n\t\t\tEmptyTreeIterator etp = new EmptyTreeIterator();\n\t\t\tetp.back(1);\n\t\t\tAssert.IsTrue(etp.first());\n\t\t\tAssert.IsTrue(etp.eof());\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, ObjectId.FromRaw(etp.idBuffer()));\n\n\t\t\tetp.back(1);\n\t\t\tAssert.IsTrue(etp.first());\n\t\t\tAssert.IsTrue(etp.eof());\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, ObjectId.FromRaw(etp.idBuffer()));\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testStopWalkCallsParent()\n\t\t{\n\t\t\tbool[] called = new bool[1];\n\t\t\tAssert.IsFalse(called[0]);\n\n\t\t\t// [ammachado]: Anonymous inner classes are not convertable to .NET:\n\t\t\tEmptyTreeIterator parent = new AnonymousTreeIterator(called);\n\n\n\t\t\tparent.createSubtreeIterator(db).stopWalk();\n\t\t\tAssert.IsTrue(called[0]);\n\t\t}\n\n\t\tclass AnonymousTreeIterator : EmptyTreeIterator\n\t\t{\n\t\t\tprivate readonly bool[] called;\n\n\t\t\tpublic AnonymousTreeIterator(bool[] called)\n\t\t\t{\n\t\t\t\tthis.called = called;\n\t\t\t}\n\n\t\t\tpublic override void stopWalk()\n\t\t\t{\n\t\t\t\tcalled[0] = true;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/FileTreeIteratorTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n    [TestFixture]\n    public class FileTreeIteratorTest : RepositoryTestCase\n    {\n        private static readonly string[] Paths = { \"a,\", \"a,b\", \"a/b\", \"a0b\" };\n        private long[] _mtime;\n\n        public override void setUp()\n        {\n            base.setUp();\n\n            // We build the entries backwards so that on POSIX systems we\n            // are likely to get the entries in the trash directory in the\n            // opposite order of what they should be in for the iteration.\n            // This should stress the sorting code better than doing it in\n            // the correct order.\n            //\n            // [ammachado] Does Windows NTFS works in the same way? AFAIK, it orders by name\n            _mtime = new long[Paths.Length];\n            for (int i = Paths.Length - 1; i >= 0; i--)\n            {\n                string s = Paths[i];\n                FileInfo fi = writeTrashFile(s, s);\n                _mtime[i] = fi.lastModified();\n            }\n        }\n\n        [Test]\n        public void testEmptyIfRootIsFile()\n        {\n            string path = Path.Combine(trash.FullName, Paths[0]);\n            var di = new DirectoryInfo(path);\n            var fi = new FileInfo(path);\n            Assert.IsTrue(fi.Exists);\n\n            var fti = new FileTreeIterator(di);\n            Assert.IsTrue(fti.first());\n\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => Assert.IsTrue(fti.eof()), \"Test fails under mono due to http://bugzilla.novell.com/show_bug.cgi?id=539791,Fixed upstream\");\n        }\n\n        [Test]\n        public void testEmptyIfRootDoesNotExist()\n        {\n            string path = Path.Combine(trash.FullName, \"not-existing-File\");\n            var di = new DirectoryInfo(path);\n            Assert.IsFalse(di.Exists);\n\n            var fti = new FileTreeIterator(di);\n            Assert.IsTrue(fti.first());\n            Assert.IsTrue(fti.eof());\n        }\n\n        [Test]\n        public void testEmptyIfRootIsEmpty()\n        {\n            string path = Path.Combine(trash.FullName, \"not-existing-File\");\n            var di = new DirectoryInfo(path);\n            Assert.IsFalse(di.Exists);\n\n            di.Mkdirs();\n            di.Refresh();\n            Assert.IsTrue(di.Exists);\n\n            var fti = new FileTreeIterator(di);\n            Assert.IsTrue(fti.first());\n            Assert.IsTrue(fti.eof());\n        }\n\n        [Test]\n        public void testSimpleIterate()\n        {\n            var top = new FileTreeIterator(trash);\n\n            Assert.IsTrue(top.first());\n            Assert.IsFalse(top.eof());\n            Assert.IsTrue(FileMode.RegularFile == top.EntryFileMode);\n            Assert.AreEqual(Paths[0], NameOf(top));\n            Assert.AreEqual(Paths[0].Length, top.getEntryLength());\n            Assert.AreEqual(_mtime[0], top.getEntryLastModified());\n\n            top.next(1);\n            Assert.IsFalse(top.first());\n            Assert.IsFalse(top.eof());\n            Assert.IsTrue(FileMode.RegularFile == top.EntryFileMode);\n            Assert.AreEqual(Paths[1], NameOf(top));\n            Assert.AreEqual(Paths[1].Length, top.getEntryLength());\n            Assert.AreEqual(_mtime[1], top.getEntryLastModified());\n\n            top.next(1);\n            Assert.IsFalse(top.first());\n            Assert.IsFalse(top.eof());\n            Assert.IsTrue(FileMode.Tree == top.EntryFileMode);\n\n            AbstractTreeIterator sub = top.createSubtreeIterator(db);\n            Assert.IsTrue(sub is FileTreeIterator);\n            var subfti = (FileTreeIterator)sub;\n            Assert.IsTrue(sub.first());\n            Assert.IsFalse(sub.eof());\n            Assert.AreEqual(Paths[2], NameOf(sub));\n            Assert.AreEqual(Paths[2].Length, subfti.getEntryLength());\n            Assert.AreEqual(_mtime[2], subfti.getEntryLastModified());\n\n            sub.next(1);\n            Assert.IsTrue(sub.eof());\n\n            top.next(1);\n            Assert.IsFalse(top.first());\n            Assert.IsFalse(top.eof());\n            Assert.IsTrue(FileMode.RegularFile == top.EntryFileMode);\n            Assert.AreEqual(Paths[3], NameOf(top));\n            Assert.AreEqual(Paths[3].Length, top.getEntryLength());\n            Assert.AreEqual(_mtime[3], top.getEntryLastModified());\n\n            top.next(1);\n            Assert.IsTrue(top.eof());\n        }\n\n        [Test]\n        public void testComputeFileObjectId()\n        {\n            var top = new FileTreeIterator(trash);\n\n            MessageDigest md = Constants.newMessageDigest();\n            md.Update(Constants.encodeASCII(Constants.TYPE_BLOB));\n            md.Update((byte)' ');\n            md.Update(Constants.encodeASCII(Paths[0].Length));\n            md.Update(0);\n            md.Update(Constants.encode(Paths[0]));\n            ObjectId expect = ObjectId.FromRaw(md.Digest());\n\n            Assert.AreEqual(expect, top.getEntryObjectId());\n\n            // Verify it was cached by removing the File and getting it again.\n            File.Delete(Path.Combine(trash.FullName, Paths[0]));\n            Assert.AreEqual(expect, top.getEntryObjectId());\n        }\n\n        private static string NameOf(AbstractTreeIterator i)\n        {\n            return RawParseUtils.decode(Constants.CHARSET, i.Path, 0, i.PathLen);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/Filter/AlwaysCloneTreeFilter.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\n\nnamespace GitSharp.Core.Tests.TreeWalk.Filter\n{\n    class AlwaysCloneTreeFilter : TreeFilter\n    {\n        public override TreeFilter Clone()\n        {\n            return new AlwaysCloneTreeFilter();\n        }\n\n        public override bool include(GitSharp.Core.TreeWalk.TreeWalk walker)\n        {\n            return false;\n        }\n\n        public override bool shouldBeRecursive()\n        {\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/Filter/NotTreeFilterTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk.Filter\n{\n    [TestFixture]\n    public class NotTreeFilterTest : RepositoryTestCase\n    {\n\n        [Test]\n        public void testWrap()\n        {\n            GitSharp.Core.TreeWalk.TreeWalk tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            TreeFilter a = TreeFilter.ALL;\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.IsNotNull(n);\n            Assert.IsTrue(a.include(tw));\n            Assert.IsFalse(n.include(tw));\n        }\n\n        [Test]\n        public void testNegateIsUnwrap()\n        {\n            TreeFilter a = PathFilter.create(\"a/b\");\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.AreSame(a, n.negate());\n        }\n\n        [Test]\n        public void testShouldBeRecursive_ALL()\n        {\n            TreeFilter a = TreeFilter.ALL;\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.AreEqual(a.shouldBeRecursive(), n.shouldBeRecursive());\n        }\n\n        [Test]\n        public void testShouldBeRecursive_PathFilter()\n        {\n            TreeFilter a = PathFilter.create(\"a/b\");\n            Assert.IsTrue(a.shouldBeRecursive());\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.IsTrue(n.shouldBeRecursive());\n        }\n\n        [Test]\n        public void testCloneIsDeepClone()\n        {\n            TreeFilter a = new AlwaysCloneTreeFilter();\n            Assert.AreNotSame(a, a.Clone());\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.AreNotSame(n, n.Clone());\n        }\n\n        [Test]\n        public void testCloneIsSparseWhenPossible()\n        {\n            TreeFilter a = TreeFilter.ALL;\n            Assert.AreSame(a, a.Clone());\n            TreeFilter n = NotTreeFilter.create(a);\n            Assert.AreSame(n, n.Clone());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/Filter/PathSuffixFilterTestCase.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk.Filter\n{\n    [TestFixture]\n    public class PathSuffixFilterTestCase : RepositoryTestCase {\n        [Test]\n        public void testNonRecursiveFiltering()\n        {\n            var ow = new ObjectWriter(db);\n            ObjectId aSth = ow.WriteBlob(\"a.sth\".getBytes());\n            ObjectId aTxt = ow.WriteBlob(\"a.txt\".getBytes());\n            DirCache dc = DirCache.read(db);\n            DirCacheBuilder builder = dc.builder();\n            var aSthEntry = new DirCacheEntry(\"a.sth\");\n            aSthEntry.setFileMode(FileMode.RegularFile);\n            aSthEntry.setObjectId(aSth);\n            var aTxtEntry = new DirCacheEntry(\"a.txt\");\n            aTxtEntry.setFileMode(FileMode.RegularFile);\n            aTxtEntry.setObjectId(aTxt);\n            builder.add(aSthEntry);\n            builder.add(aTxtEntry);\n            builder.finish();\n            ObjectId treeId = dc.writeTree(ow);\n\n\n            var tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            tw.setFilter(PathSuffixFilter.create(\".txt\"));\n            tw.addTree(treeId);\n\n            var paths = new LinkedList<string>();\n            while (tw.next())\n            {\n                paths.AddLast(tw.getPathString());\n            }\n\n            var expected = new LinkedList<string>();\n            expected.AddLast(\"a.txt\");\n\n            Assert.AreEqual(expected, paths);\n        }\n\n        [Test]\n        public void testRecursiveFiltering()\n        {\n            var ow = new ObjectWriter(db);\n            ObjectId aSth = ow.WriteBlob(\"a.sth\".getBytes());\n            ObjectId aTxt = ow.WriteBlob(\"a.txt\".getBytes());\n            ObjectId bSth = ow.WriteBlob(\"b.sth\".getBytes());\n            ObjectId bTxt = ow.WriteBlob(\"b.txt\".getBytes());\n            DirCache dc = DirCache.read(db);\n            DirCacheBuilder builder = dc.builder();\n            var aSthEntry = new DirCacheEntry(\"a.sth\");\n            aSthEntry.setFileMode(FileMode.RegularFile);\n            aSthEntry.setObjectId(aSth);\n            var aTxtEntry = new DirCacheEntry(\"a.txt\");\n            aTxtEntry.setFileMode(FileMode.RegularFile);\n            aTxtEntry.setObjectId(aTxt);\n            builder.add(aSthEntry);\n            builder.add(aTxtEntry);\n            var bSthEntry = new DirCacheEntry(\"sub/b.sth\");\n            bSthEntry.setFileMode(FileMode.RegularFile);\n            bSthEntry.setObjectId(bSth);\n            var bTxtEntry = new DirCacheEntry(\"sub/b.txt\");\n            bTxtEntry.setFileMode(FileMode.RegularFile);\n            bTxtEntry.setObjectId(bTxt);\n            builder.add(bSthEntry);\n            builder.add(bTxtEntry);\n            builder.finish();\n            ObjectId treeId = dc.writeTree(ow);\n\n\n            var tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            tw.Recursive = true;\n            tw.setFilter(PathSuffixFilter.create(\".txt\"));\n            tw.addTree(treeId);\n\n            var paths = new LinkedList<string>();\n            while (tw.next())\n            {\n                paths.AddLast(tw.getPathString());\n            }\n\n            var expected = new LinkedList<string>();\n            expected.AddLast(\"a.txt\");\n            expected.AddLast(\"sub/b.txt\");\n\n            Assert.AreEqual(expected, paths);\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/Filter/TreeFilterTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk.Filter\n{\n    [TestFixture]\n    public class TreeFilterTest : RepositoryTestCase\n    {\n\n        [Test]\n        public void testALL_IncludesAnything()\n        {\n            GitSharp.Core.TreeWalk.TreeWalk tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            Assert.IsTrue(TreeFilter.ALL.include(tw));\n        }\n\n        [Test]\n        public void testALL_ShouldNotBeRecursive()\n        {\n            Assert.IsFalse(TreeFilter.ALL.shouldBeRecursive());\n        }\n\n        [Test]\n        public void testALL_IdentityClone()\n        {\n            Assert.AreSame(TreeFilter.ALL, TreeFilter.ALL.Clone());\n        }\n\n        [Test]\n        public void testNotALL_IncludesNothing()\n        {\n            GitSharp.Core.TreeWalk.TreeWalk tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            Assert.IsFalse(TreeFilter.ALL.negate().include(tw));\n        }\n\n        [Test]\n        public void testANY_DIFF_IncludesSingleTreeCase()\n        {\n            GitSharp.Core.TreeWalk.TreeWalk tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n            Assert.IsTrue(TreeFilter.ANY_DIFF.include(tw));\n        }\n\n        [Test]\n        public void testANY_DIFF_ShouldNotBeRecursive()\n        {\n            Assert.IsFalse(TreeFilter.ANY_DIFF.shouldBeRecursive());\n        }\n\n        [Test]\n        public void testANY_DIFF_IdentityClone()\n        {\n            Assert.AreSame(TreeFilter.ANY_DIFF, TreeFilter.ANY_DIFF.Clone());\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/NameConflictTreeWalkTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.TreeWalk;\nusing NUnit.Framework;\nusing FileMode=GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\t\n\t[TestFixture]\n\tpublic class NameConflictTreeWalkTest : RepositoryTestCase\n\t{\n\t\tprivate static readonly FileMode TREE = FileMode.Tree;\n\n\t\tprivate static readonly FileMode SYMLINK = FileMode.Symlink;\n\n\t\tprivate static readonly FileMode MISSING = FileMode.Missing;\n\n\t\tprivate static readonly FileMode REGULAR_FILE = FileMode.RegularFile;\n\n\t\tprivate static readonly FileMode EXECUTABLE_FILE = FileMode.ExecutableFile;\n\n\t\t[Test]\n\t\tpublic virtual void testNoDF_NoGap()\n\t\t{\n\t\t\tDirCache tree0 = DirCache.read(db);\n\t\t\tDirCache tree1 = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b0 = tree0.builder();\n\t\t\t\tDirCacheBuilder b1 = tree1.builder();\n\n\t\t\t\tb0.add(makeEntry(\"a\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a.b\", EXECUTABLE_FILE));\n\t\t\t\tb1.add(makeEntry(\"a/b\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a0b\", SYMLINK));\n\n\t\t\t\tb0.finish();\n\t\t\t\tb1.finish();\n\t\t\t\tAssert.AreEqual(3, tree0.getEntryCount());\n\t\t\t\tAssert.AreEqual(1, tree1.getEntryCount());\n\t\t\t}\n\n\t\t\tGitSharp.Core.TreeWalk.TreeWalk tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.addTree(new DirCacheIterator(tree0));\n\t\t\ttw.addTree(new DirCacheIterator(tree1));\n\n\t\t\tassertModes(\"a\", REGULAR_FILE, MISSING, tw);\n\t\t\tassertModes(\"a.b\", EXECUTABLE_FILE, MISSING, tw);\n\t\t\tassertModes(\"a\", MISSING, TREE, tw);\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"a/b\", MISSING, REGULAR_FILE, tw);\n\t\t\tassertModes(\"a0b\", SYMLINK, MISSING, tw);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDF_NoGap()\n\t\t{\n\t\t\tDirCache tree0 = DirCache.read(db);\n\t\t\tDirCache tree1 = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b0 = tree0.builder();\n\t\t\t\tDirCacheBuilder b1 = tree1.builder();\n\n\t\t\t\tb0.add(makeEntry(\"a\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a.b\", EXECUTABLE_FILE));\n\t\t\t\tb1.add(makeEntry(\"a/b\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a0b\", SYMLINK));\n\n\t\t\t\tb0.finish();\n\t\t\t\tb1.finish();\n\t\t\t\tAssert.AreEqual(3, tree0.getEntryCount());\n\t\t\t\tAssert.AreEqual(1, tree1.getEntryCount());\n\t\t\t}\n\n\t\t\tNameConflictTreeWalk tw = new NameConflictTreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.addTree(new DirCacheIterator(tree0));\n\t\t\ttw.addTree(new DirCacheIterator(tree1));\n\n\t\t\tassertModes(\"a\", REGULAR_FILE, TREE, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"a/b\", MISSING, REGULAR_FILE, tw);\n\t\t\tassertModes(\"a.b\", EXECUTABLE_FILE, MISSING, tw);\n\t\t\tassertModes(\"a0b\", SYMLINK, MISSING, tw);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDF_GapByOne()\n\t\t{\n\t\t\tDirCache tree0 = DirCache.read(db);\n\t\t\tDirCache tree1 = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b0 = tree0.builder();\n\t\t\t\tDirCacheBuilder b1 = tree1.builder();\n\n\t\t\t\tb0.add(makeEntry(\"a\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a.b\", EXECUTABLE_FILE));\n\t\t\t\tb1.add(makeEntry(\"a.b\", EXECUTABLE_FILE));\n\t\t\t\tb1.add(makeEntry(\"a/b\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a0b\", SYMLINK));\n\n\t\t\t\tb0.finish();\n\t\t\t\tb1.finish();\n\t\t\t\tAssert.AreEqual(3, tree0.getEntryCount());\n\t\t\t\tAssert.AreEqual(2, tree1.getEntryCount());\n\t\t\t}\n\n\t\t\tNameConflictTreeWalk tw = new NameConflictTreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.addTree(new DirCacheIterator(tree0));\n\t\t\ttw.addTree(new DirCacheIterator(tree1));\n\n\t\t\tassertModes(\"a\", REGULAR_FILE, TREE, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"a/b\", MISSING, REGULAR_FILE, tw);\n\t\t\tassertModes(\"a.b\", EXECUTABLE_FILE, EXECUTABLE_FILE, tw);\n\t\t\tassertModes(\"a0b\", SYMLINK, MISSING, tw);\n\t\t}\n\n\t\t[Test]\n\t\tpublic virtual void testDF_SkipsSeenSubtree()\n\t\t{\n\t\t\tDirCache tree0 = DirCache.read(db);\n\t\t\tDirCache tree1 = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b0 = tree0.builder();\n\t\t\t\tDirCacheBuilder b1 = tree1.builder();\n\n\t\t\t\tb0.add(makeEntry(\"a\", REGULAR_FILE));\n\t\t\t\tb1.add(makeEntry(\"a.b\", EXECUTABLE_FILE));\n\t\t\t\tb1.add(makeEntry(\"a/b\", REGULAR_FILE));\n\t\t\t\tb0.add(makeEntry(\"a0b\", SYMLINK));\n\t\t\t\tb1.add(makeEntry(\"a0b\", SYMLINK));\n\n\t\t\t\tb0.finish();\n\t\t\t\tb1.finish();\n\t\t\t\tAssert.AreEqual(2, tree0.getEntryCount());\n\t\t\t\tAssert.AreEqual(3, tree1.getEntryCount());\n\t\t\t}\n\n\t\t\tNameConflictTreeWalk tw = new NameConflictTreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.addTree(new DirCacheIterator(tree0));\n\t\t\ttw.addTree(new DirCacheIterator(tree1));\n\n\t\t\tassertModes(\"a\", REGULAR_FILE, TREE, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"a/b\", MISSING, REGULAR_FILE, tw);\n\t\t\tassertModes(\"a.b\", MISSING, EXECUTABLE_FILE, tw);\n\t\t\tassertModes(\"a0b\", SYMLINK, SYMLINK, tw);\n\t\t}\n\n\t\tprivate DirCacheEntry makeEntry(string path, FileMode mode)\n\t\t{\n\t\t\tbyte[] pathBytes = Constants.encode(path);\n\t\t\tDirCacheEntry ent = new DirCacheEntry(path);\n\t\t\tent.setFileMode(mode);\n\t\t\tent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(pathBytes.Length, new MemoryStream(pathBytes)));\n\t\t\treturn ent;\n\t\t}\n\n\t\tprivate static void assertModes(string path, FileMode mode0, FileMode mode1, GitSharp.Core.TreeWalk.TreeWalk tw)\n\t\t{\n\t\t\tAssert.IsTrue(tw.next(), \"has \" + path);\n\t\t\tAssert.AreEqual(path, tw.getPathString());\n\t\t\tAssert.AreEqual(mode0, tw.getFileMode(0));\n\t\t\tAssert.AreEqual(mode1, tw.getFileMode(1));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/PostOrderTreeWalkTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing NUnit.Framework;\nusing FileMode=GitSharp.Core.FileMode;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n\t[TestFixture]\n\tpublic class PostOrderTreeWalkTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void testInitialize_NoPostOrder()\n\t\t{\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\tAssert.IsFalse(tw.PostOrderTraversal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testInitialize_TogglePostOrder()\n\t\t{\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\tAssert.IsFalse(tw.PostOrderTraversal);\n\t\t\ttw.PostOrderTraversal = true;\n\t\t\tAssert.IsTrue(tw.PostOrderTraversal);\n\t\t\ttw.PostOrderTraversal = false;\n\t\t\tAssert.IsFalse(tw.PostOrderTraversal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testResetDoesNotAffectPostOrder()\n\t\t{\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db) { PostOrderTraversal = true };\n\t\t\tAssert.IsTrue(tw.PostOrderTraversal);\n\t\t\ttw.reset();\n\t\t\tAssert.IsTrue(tw.PostOrderTraversal);\n\n\t\t\ttw.PostOrderTraversal = false;\n\t\t\tAssert.IsFalse(tw.PostOrderTraversal);\n\t\t\ttw.reset();\n\t\t\tAssert.IsFalse(tw.PostOrderTraversal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoPostOrder()\n\t\t{\n\t\t\tDirCache tree = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = tree.builder();\n\n\t\t\t\tb.add(makeFile(\"a\"));\n\t\t\t\tb.add(makeFile(\"b/c\"));\n\t\t\t\tb.add(makeFile(\"b/d\"));\n\t\t\t\tb.add(makeFile(\"q\"));\n\n\t\t\t\tb.finish();\n\t\t\t\tAssert.AreEqual(4, tree.getEntryCount());\n\t\t\t}\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.PostOrderTraversal = false;\n\t\t\ttw.addTree(new DirCacheIterator(tree));\n\n\t\t\tassertModes(\"a\", FileMode.RegularFile, tw);\n\t\t\tassertModes(\"b\", FileMode.Tree, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\tAssert.IsFalse(tw.isPostChildren());\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"b/c\", FileMode.RegularFile, tw);\n\t\t\tassertModes(\"b/d\", FileMode.RegularFile, tw);\n\t\t\tassertModes(\"q\", FileMode.RegularFile, tw);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWithPostOrder_EnterSubtree()\n\t\t{\n\t\t\tDirCache tree = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = tree.builder();\n\n\t\t\t\tb.add(makeFile(\"a\"));\n\t\t\t\tb.add(makeFile(\"b/c\"));\n\t\t\t\tb.add(makeFile(\"b/d\"));\n\t\t\t\tb.add(makeFile(\"q\"));\n\n\t\t\t\tb.finish();\n\t\t\t\tAssert.AreEqual(4, tree.getEntryCount());\n\t\t\t}\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.PostOrderTraversal = true;\n\t\t\ttw.addTree(new DirCacheIterator(tree));\n\n\t\t\tassertModes(\"a\", FileMode.RegularFile, tw);\n\n\t\t\tassertModes(\"b\", FileMode.Tree, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\tAssert.IsFalse(tw.isPostChildren());\n\t\t\ttw.enterSubtree();\n\t\t\tassertModes(\"b/c\", FileMode.RegularFile, tw);\n\t\t\tassertModes(\"b/d\", FileMode.RegularFile, tw);\n\n\t\t\tassertModes(\"b\", FileMode.Tree, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\tAssert.IsTrue(tw.isPostChildren());\n\n\t\t\tassertModes(\"q\", FileMode.RegularFile, tw);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testWithPostOrder_NoEnterSubtree()\n\t\t{\n\t\t\tDirCache tree = DirCache.read(db);\n\t\t\t{\n\t\t\t\tDirCacheBuilder b = tree.builder();\n\n\t\t\t\tb.add(makeFile(\"a\"));\n\t\t\t\tb.add(makeFile(\"b/c\"));\n\t\t\t\tb.add(makeFile(\"b/d\"));\n\t\t\t\tb.add(makeFile(\"q\"));\n\n\t\t\t\tb.finish();\n\t\t\t\tAssert.AreEqual(4, tree.getEntryCount());\n\t\t\t}\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset();\n\t\t\ttw.PostOrderTraversal = true;\n\t\t\ttw.addTree(new DirCacheIterator(tree));\n\n\t\t\tassertModes(\"a\", FileMode.RegularFile, tw);\n\n\t\t\tassertModes(\"b\", FileMode.Tree, tw);\n\t\t\tAssert.IsTrue(tw.isSubtree());\n\t\t\tAssert.IsFalse(tw.isPostChildren());\n\n\t\t\tassertModes(\"q\", FileMode.RegularFile, tw);\n\t\t}\n\n\t\tprivate DirCacheEntry makeFile(string path)\n\t\t{\n\t\t\tbyte[] pathBytes = Constants.encode(path);\n\t\t\tvar ent = new DirCacheEntry(path);\n\t\t\tent.setFileMode(FileMode.RegularFile);\n\t\t\tent.setObjectId(new ObjectWriter(db).ComputeBlobSha1(pathBytes.Length, new MemoryStream(pathBytes)));\n\t\t\treturn ent;\n\t\t}\n\n\t\tprivate static void assertModes(string path, FileMode mode0, GitSharp.Core.TreeWalk.TreeWalk tw)\n\t\t{\n\t\t\tAssert.IsTrue(tw.next(), \"has \" + path);\n\t\t\tAssert.AreEqual(path, tw.getPathString());\n\t\t\tAssert.AreEqual(mode0, tw.getFileMode(0));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/TreeWalk/TreeWalkBasicDiffTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.TreeWalk.Filter;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.TreeWalk\n{\n\t[TestFixture]\n\tpublic class TreeWalkBasicDiffTest : RepositoryTestCase\n\t{\n\t\t[Test]\n\t\tpublic void testMissingSubtree_DetectFileAdded_FileModified()\n\t\t{\n\t\t\tvar ow = new ObjectWriter(db);\n\t\t\tObjectId aFileId = ow.WriteBlob(Constants.CHARSET.GetBytes(\"a\"));\n\t\t\tObjectId bFileId = ow.WriteBlob(Constants.CHARSET.GetBytes(\"b\"));\n\t\t\tObjectId cFileId1 = ow.WriteBlob(Constants.CHARSET.GetBytes(\"c-1\"));\n\t\t\tObjectId cFileId2 = ow.WriteBlob(Constants.CHARSET.GetBytes(\"c-2\"));\n\n\t\t\t// Create sub-a/empty, sub-c/empty = hello.\n\t\t\tFunc<ObjectId> oldTree = () =>\n\t\t\t                         \t{\n                                            var root = new Core.Tree(db);\n\n                                            Core.Tree subA = root.AddTree(\"sub-a\");\n\t\t\t                         \t\tsubA.AddFile(\"empty\").Id = aFileId;\n\t\t\t                         \t\tsubA.Id = ow.WriteTree(subA);\n\n                                            Core.Tree subC = root.AddTree(\"sub-c\");\n\t\t\t                         \t\tsubC.AddFile(\"empty\").Id = cFileId1;\n\t\t\t                         \t\tsubC.Id = ow.WriteTree(subC);\n\n\t\t\t                         \t\treturn ow.WriteTree(root);\n\t\t\t                         \t};\n\n\t\t\t// Create sub-a/empty, sub-b/empty, sub-c/empty.\n\t\t\tFunc<ObjectId> newTree = () =>\n\t\t\t                         \t{\n                                            var root = new Core.Tree(db);\n\n                                            Core.Tree subA = root.AddTree(\"sub-a\");\n\t\t\t                         \t\tsubA.AddFile(\"empty\").Id = aFileId;\n\t\t\t                         \t\tsubA.Id = ow.WriteTree(subA);\n\n                                            Core.Tree subB = root.AddTree(\"sub-b\");\n\t\t\t                         \t\tsubB.AddFile(\"empty\").Id = bFileId;\n\t\t\t                         \t\tsubB.Id = ow.WriteTree(subB);\n\n                                            Core.Tree subC = root.AddTree(\"sub-c\");\n\t\t\t                         \t\tsubC.AddFile(\"empty\").Id = cFileId2;\n\t\t\t                         \t\tsubC.Id = ow.WriteTree(subC);\n\n\t\t\t                         \t\treturn ow.WriteTree(root);\n\t\t\t                         \t};\n\n\t\t\tvar tw = new GitSharp.Core.TreeWalk.TreeWalk(db);\n\t\t\ttw.reset(new[] { oldTree.Invoke(), newTree.Invoke() });\n\t\t\ttw.Recursive = true;\n\t\t\ttw.setFilter(TreeFilter.ANY_DIFF);\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"sub-b/empty\", tw.getPathString());\n\t\t\tAssert.AreEqual(FileMode.Missing, tw.getFileMode(0));\n\t\t\tAssert.AreEqual(FileMode.RegularFile, tw.getFileMode(1));\n\t\t\tAssert.AreEqual(ObjectId.ZeroId, tw.getObjectId(0));\n\t\t\tAssert.AreEqual(bFileId, tw.getObjectId(1));\n\n\t\t\tAssert.IsTrue(tw.next());\n\t\t\tAssert.AreEqual(\"sub-c/empty\", tw.getPathString());\n\t\t\tAssert.AreEqual(FileMode.RegularFile, tw.getFileMode(0));\n\t\t\tAssert.AreEqual(FileMode.RegularFile, tw.getFileMode(1));\n\t\t\tAssert.AreEqual(cFileId1, tw.getObjectId(0));\n\t\t\tAssert.AreEqual(cFileId2, tw.getObjectId(1));\n\n\t\t\tAssert.IsFalse(tw.next());\n\t\t}\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/AssertHelper.cs",
    "content": "﻿using System;\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    public enum AssertedPlatform\n    {\r\n        Windows,\r\n        Mono\r\n    }\n\n    public static class AssertHelper\n    {\r\n        public static TException Throws<TException>(Action codeBlock) where TException : Exception\r\n        {\r\n            return Throws<TException>(codeBlock, null);\r\n        }\r\n\r\n        public static TException Throws<TException>(Action codeBlock, string failExplanation) where TException : Exception\r\n        {\n            const string expectedFormat = \"Exception of type '{0}' was expected.\";\n            const string insteadFormat = \"Instead, exception of type '{0}' was thrown.\";\n\n            string expectedMessage = string.Format(expectedFormat, typeof(TException).FullName);\n\n            if (failExplanation != null)\r            {\r\n                expectedMessage = failExplanation + Environment.NewLine + expectedMessage;\r\n            }\n\n            Exception exception = GetExceptionFrom(codeBlock);\n\n            if (exception == null)\n            {\n                Assert.Fail(expectedMessage);\n                return null;\n            }\n\n            if (!(typeof(TException).IsAssignableFrom(exception.GetType())))\n            {\n                string insteadMessage = string.Format(insteadFormat, exception.GetType());\n                Assert.Fail(string.Format(\"{0} {1}\", expectedMessage, insteadMessage));\n            }\n\n            return (TException)exception;\n        }\n        \n        public static bool IsRunningOn(AssertedPlatform assertedPlatform)\n        {\n            SystemReader systemReader = SystemReader.getInstance();\r\n            \r\n            bool isRunningOnUnknownOS = (systemReader.getOperatingSystem() == PlatformType.Unknown);\r\n            if (isRunningOnUnknownOS)\r\n            {\r\n                return false;\r\n            }\r\n            \r\n            \r\n            bool isRunningOnWindows = (systemReader.getOperatingSystem() == PlatformType.Windows);\r\n            if (isRunningOnWindows && assertedPlatform == AssertedPlatform.Windows)\r\n            {\r\n                return true;\r\n            }\r\n\r\n            if (!isRunningOnWindows && assertedPlatform == AssertedPlatform.Mono)\r\n            {\r\n                return true;\r\n            }\n\n            return false;\n        }\n\n        public static void IgnoreOn(AssertedPlatform assertedPlatform, Action codeBlock, string ignoreExplaination)\n        {\r\n            if (IsRunningOn(assertedPlatform))\r\n            {\r\n                Assert.Ignore(ignoreExplaination);\r\n                return;\r\n            }\r\n\r\n            codeBlock();\r\n        }\n\n        private static Exception GetExceptionFrom(Action code)\n        {\n            try\n            {\n                code();\n                return null;\n            }\n            catch (Exception e)\n            {\n                return e;\n            }\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/AssertHelperFixture.cs",
    "content": "using System;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class AssertHelperFixture\n    {\n        [Test]\n        public void TestPassWhenThrowingTheCorrectException()\n        {\n            AssertHelper.Throws<InvalidOperationException>(() => { throw new InvalidOperationException(); });\n        }\n\n        [Test]\n        public void WhenOfTheCorrectTypeThrownExceptionCanBeFurtherExamined()\n        {\n            var e = AssertHelper.Throws<InvalidOperationException>(() => { throw new InvalidOperationException(\"Hi from below\"); });\n            Assert.AreEqual(\"Hi from below\", e.Message);\n        }\n\n        [Test]\n        public void ThrownExceptionCanBeDerivedFromExpected()\n        {\n            var e = AssertHelper.Throws<Exception>(() => { throw new InvalidOperationException(\"Was invalid.\"); });\n\n            var castE = (InvalidOperationException)e;\n            Assert.AreEqual(\"Was invalid.\", castE.Message);\n        }\n\n        [Test]\n        public void ThrownExceptionHasToBeOfTheExactType()\n        {\n            try\n            {\n                AssertHelper.Throws<ArgumentOutOfRangeException>(() => { throw new InvalidOperationException(); });\n            }\n            catch (AssertionException e)\n            {\n                StringAssert.Contains(typeof (ArgumentOutOfRangeException).FullName, e.Message);\n                StringAssert.Contains(typeof (InvalidOperationException).FullName, e.Message);\n                return;\n            }\n\n            Assert.Fail();\n        }\n\n        [Test]\n        public void NotThrowingExceptionLeadsTheTestToFail()\n        {\n            try\n            {\n                AssertHelper.Throws<ArgumentOutOfRangeException>(() => { return; });\n            }\n            catch (AssertionException e)\n            {\n                StringAssert.Contains(typeof (ArgumentOutOfRangeException).FullName, e.Message);\n                return;\n            }\n\n            Assert.Fail();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/ByteArrayExtensionsFixture.cs",
    "content": "﻿using System.Linq;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class ByteArrayExtensionsFixture\n    {\n        [Test]\n        public void ReadLine_CanExtractWithNoLineEnding()\n        {\n            byte[] input = \"no newline\".getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue(input.SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanNotExtractWithOutOfRangePosition()\n        {\n            byte[] input = \"no newline\".getBytes();\n            var parsedLined = input.ReadLine(10);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(-1, parsedLined.NextIndex);\n            Assert.IsNull(parsedLined.Buffer);\n        }\n\n        [Test]\n        public void ReadLine_CanNotExtractAnEmptyByteArray()\n        {\n            var input = new byte[0];\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(-1, parsedLined.NextIndex);\n            Assert.IsNull(parsedLined.Buffer);\n        }\n\n        [Test]\n        public void ReadLine_CanExtractAByteArrayContainingOnlyALF()\n        {\n            byte[] input = \"\\n\".getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(1, parsedLined.NextIndex);\n            Assert.IsTrue(new byte[0].SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractAByteArrayContainingOnlyACRLF()\n        {\n            byte[] input = \"\\r\\n\".getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(2, parsedLined.NextIndex);\n            Assert.IsTrue(new byte[0].SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractWithACRAtTheEnd()\n        {\n            byte[] input = \"no newline\\r\".getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue(input.SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractWithACRAtTheBegining()\n        {\n            byte[] input = \"\\rno newline\".getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue(input.SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractFirstLineDelimitedWithALF()\n        {\n            const string firstLine = \"first line\";\n            byte[] input = (firstLine + \"\\nsecondline\").getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(firstLine.Length + 1, parsedLined.NextIndex);\n            Assert.IsTrue((firstLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractFirstLineDelimitedWithACRLF()\n        {\n            const string firstLine = \"first line\";\n            byte[] input = (firstLine + \"\\r\\nsecondline\").getBytes();\n            var parsedLined = input.ReadLine(0);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(firstLine.Length + 2, parsedLined.NextIndex);\n            Assert.IsTrue((firstLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractSecondLineDelimitedWithALF()\n        {\n            const string firstLine = \"first line\";\n            const string secondLine = \"second line\";\n            byte[] input = (firstLine + \"\\n\" + secondLine).getBytes();\n            var parsedLined = input.ReadLine(firstLine.Length + 1);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue((secondLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractSecondLineDelimitedWithACRLF()\n        {\n            const string firstLine = \"first line\";\n            const string secondLine = \"second line\";\n            byte[] input = (firstLine + \"\\r\\n\" + secondLine).getBytes();\n            var parsedLined = input.ReadLine(firstLine.Length + 2);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue((secondLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractSecondLineDelimitedWithALF2()\n        {\n            const string firstLine = \"first line\";\n            const string secondLine = \"second line\";\n            byte[] input = (firstLine + \"\\n\" + secondLine + \"\\n\").getBytes();\n            var parsedLined = input.ReadLine(firstLine.Length + 1);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue((secondLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void ReadLine_CanExtractSecondLineDelimitedWithACRLF2()\n        {\n            const string firstLine = \"first line\";\n            const string secondLine = \"second line\";\n            byte[] input = (firstLine + \"\\r\\n\" + secondLine + \"\\r\\n\").getBytes();\n            var parsedLined = input.ReadLine(firstLine.Length + 2);\n            Assert.IsNotNull(parsedLined);\n            Assert.AreEqual(input.Length, parsedLined.NextIndex);\n            Assert.IsTrue((secondLine.getBytes()).SequenceEqual(parsedLined.Buffer));\n        }\n\n        [Test]\n        public void StartsWith_ReturnTrueeWhenInputStartsWithPrefix()\n        {\n            const string input = \"hello world!\";\n            const string prefix = \"hell\";\n\n            Assert.IsTrue(input.getBytes().StartsWith(prefix.getBytes()));\n        }\n        [Test]\n        public void StartsWith_ReturnFalseWhenInputDoesNotStartWithPrefix()\n        {\n            const string input = \"hello world!\";\n            const string prefix = \"help\";\n\n            Assert.IsFalse(input.getBytes().StartsWith(prefix.getBytes()));\n        }\n        [Test]\n        public void StartsWith_ReturnFalseWhenPrefixIsLongerThanInput()\n        {\n            const string input = \"hello world!\";\n            const string prefix = \"hello world! this is too long.\";\n\n            Assert.IsFalse(input.getBytes().StartsWith(prefix.getBytes()));\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/CPUTimeStopWatch.cs",
    "content": "/*\n * Copyright (C) 2009, Christian Halstrick <christian.halstrick@sap.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Diagnostics;\n\n/*\n * A simple stopwatch which measures elapsed CPU time of the current thread. CPU\n * time is the time spent on executing your own code plus the time spent on\n * executing operating system calls triggered by your application.\n * <p>\n * This stopwatch needs a VM which supports getting CPU Time information for the\n * current thread. The static method createInstance() will take care to return\n * only a new instance of this class if the VM is capable of returning CPU time.\n */\npublic class CPUTimeStopWatch {\n    private Stopwatch _stopWatch;\n\t/**\n\t * use this method instead of the constructor to be sure that the underlying\n\t * VM provides all features needed by this class.\n\t *\n\t * @return a new instance of {@link #CPUTimeStopWatch()} or\n\t *         <code>null</code> if the VM does not support getting CPU time\n\t *         information\n\t */\n\tpublic static CPUTimeStopWatch createInstance() {\n\t    return new CPUTimeStopWatch();\n\t}\n\n\t/**\n\t * Starts the stopwatch. If the stopwatch is already started this will\n\t * restart the stopwatch.\n\t */\n\tpublic void start() {\n        _stopWatch = new Stopwatch();\n        _stopWatch.Start();\n\t}\n\n\t/**\n\t * Stops the stopwatch and return the elapsed CPU time in nanoseconds.\n\t * Should be called only on started stopwatches.\n\t *\n\t * @return the elapsed CPU time in nanoseconds. When called on non-started\n\t *         stopwatches (either because {@link #start()} was never called or\n\t *         {@link #stop()} was called after the last call to\n\t *         {@link #start()}) this method will return 0.\n\t */\n\tpublic long stop() {\n        _stopWatch.Stop();\n\t    return _stopWatch.ElapsedTicks;\n    }\n\n\t/**\n\t * Return the elapsed CPU time in nanoseconds. In contrast to\n\t * {@link #stop()} the stopwatch will continue to run after this call.\n\t *\n\t * @return the elapsed CPU time in nanoseconds. When called on non-started\n\t *         stopwatches (either because {@link #start()} was never called or\n\t *         {@link #stop()} was called after the last call to\n\t *         {@link #start()}) this method will return 0.\n\t */\n\tpublic long readout() {\n\t\treturn (!_stopWatch.IsRunning) ? 0 : _stopWatch.ElapsedTicks;\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/ExtensionsFixture.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class ExtensionsFixture\n    {\n        private string _extensionlessFilePath;\n        private string _mkDirsPath;\n\n        [TestFixtureSetUp]\n        public void InitFixtureContext()\n        {\n            _extensionlessFilePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n            File.WriteAllText(_extensionlessFilePath, \"dummy\");\n\n            _mkDirsPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); \n        }\n\n        [TestFixtureTearDown]\n        public void CleanUpFixtureContext()\n        {\n            File.Delete(_extensionlessFilePath);\n            Directory.Delete(_mkDirsPath, true);\n        }\n        \n        [Test]\n        public void IsDirectory()\n        {\n            var filePath = Assembly.GetExecutingAssembly().Location;\n            var directoryPath = Environment.CurrentDirectory;\n\n            Assert.IsTrue(new FileInfo(directoryPath).IsDirectory());\n            Assert.IsTrue(new DirectoryInfo(directoryPath).IsDirectory());\n\n            Assert.IsFalse(new FileInfo(filePath).IsDirectory());\n            Assert.IsFalse(new DirectoryInfo(filePath).IsDirectory());\n            \n            Assert.IsFalse(new DirectoryInfo(_extensionlessFilePath).IsDirectory());\n            Assert.IsFalse(new FileInfo(_extensionlessFilePath).IsDirectory());\n        }\n\n        [Test]\n        public void IsFile()\n        {\n            var filePath = Assembly.GetExecutingAssembly().Location;\n            var directoryPath = Environment.CurrentDirectory;\n\n            Assert.IsTrue(new FileInfo(filePath).IsFile());\n            Assert.IsTrue(new DirectoryInfo(filePath).IsFile());\n\n            Assert.IsFalse(new FileInfo(directoryPath).IsFile());\n            Assert.IsFalse(new DirectoryInfo(directoryPath).IsFile());\n\n            Assert.IsTrue(new DirectoryInfo(_extensionlessFilePath).IsFile());\n            Assert.IsTrue(new FileInfo(_extensionlessFilePath).IsFile());\n        }\n\n        [Test]\n        public void getCurrentTime()\n        {\n            Assert.AreEqual(new DateTimeOffset(2009, 08, 15, 20, 12, 58, 668, new TimeSpan(-3, -30, 0)), 1250379778668L.MillisToDateTimeOffset((int)new TimeSpan(-3, -30, 0).TotalMinutes));\n            Assert.AreEqual(new DateTime(2009, 08, 15, 23, 42, 58, 668), 1250379778668L.MillisToUtcDateTime());\n        }\n\n        [Test]\n        public void MkDirs()\n        {\n            var dir = Path.Combine(_mkDirsPath, \"subDir1/subDir2\");\n\n            var dirInfo = new DirectoryInfo(dir);\n            Assert.IsFalse(dirInfo.Exists);\n\n            var ret = dirInfo.Mkdirs();\n\n            Assert.IsTrue(ret);\n            Assert.IsTrue(dirInfo.Exists);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/IO/TimeoutStreamTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2010, Henon <meinrad.recheis@gmail.com>\n *\n * This program and the accompanying materials are made available\n * under the terms of the Eclipse Distribution License v1.0 which\n * accompanies this distribution, is reproduced below, and is\n * available at http://www.eclipse.org/org/documents/edl-v10.php\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n\n\t[TestFixture]\n\tpublic class TimeoutStreamTest\n\t{\n\t\tprivate static int timeout = 250;\n\n\t\tprivate PipeStream _stream;\n\n\t\tprivate StreamWriter _writer;\n\n\t\tprivate TimeoutStream _timeoutstream;\n\n\t\tprivate long start;\n\n\t\t[SetUp]\n\t\tpublic void setUp()\n\t\t{\n\t\t\t_stream = new PipeStream();\n\t\t\t_writer = new StreamWriter(_stream);\n\t\t\t//timer = new InterruptTimer();\n\t\t\t_timeoutstream = new TimeoutStream(_stream);\n\t\t\t_timeoutstream.setTimeout(timeout);\n\t\t}\n\n\t\t//protected void tearDown()  {\n\t\t//   timer.terminate();\n\t\t//   for (Thread t : active())\n\t\t//      assertFalse(t instanceof InterruptTimer.AlarmThread);\n\t\t//   super.tearDown();\n\t\t//}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readByte_Success1()\n\t\t{\n\t\t\t_writer.Write('a');\n\t\t\t_writer.Flush();\n\t\t\tAssert.AreEqual((byte)'a', _timeoutstream.ReadByte());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readByte_Success2()\n\t\t{\n\t\t\tbyte[] exp = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\t_stream.Write(exp, 0, exp.Length);\n\t\t\tAssert.AreEqual(exp[0], _timeoutstream.ReadByte());\n\t\t\tAssert.AreEqual(exp[1], _timeoutstream.ReadByte());\n\t\t\tAssert.AreEqual(exp[2], _timeoutstream.ReadByte());\n\t\t\t_stream.Close(); // note [henon]: we can't distinguish a read from closed stream (returns -1 in java) from read timeout, so this testcase is different than in jgit\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_timeoutstream.ReadByte();\n\t\t\t\tAssert.Fail(\"incorrectly read a byte\");\n\t\t\t}\n\t\t\tcatch (TimeoutException)\n\t\t\t{\n\t\t\t\t// expected\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readByte_Timeout()\n\t\t{\n\t\t\tbeginRead();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_timeoutstream.ReadByte();\n\t\t\t\tAssert.Fail(\"incorrectly read a byte\");\n\t\t\t}\n\t\t\tcatch (TimeoutException)\n\t\t\t{\n\t\t\t\t// expected\n\t\t\t}\n\t\t\tassertTimeout();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readBuffer_Success1()\n\t\t{\n\t\t\tbyte[] exp = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\tbyte[] act = new byte[exp.Length];\n\t\t\t_stream.Write(exp, 0, exp.Length);\n\t\t\tIO.ReadFully(_timeoutstream, act, 0, act.Length);\n\t\t\tAssert.AreEqual(exp, act);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readBuffer_Success2()\n\t\t{\n\t\t\tvar s = new MemoryStream();\n\t\t\tvar t = new TimeoutStream(s);\n\t\t\tt.setTimeout(timeout);\n\t\t\tbyte[] exp = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\tbyte[] act = new byte[exp.Length];\n\t\t\ts.Write(exp, 0, exp.Length);\n\t\t\ts.Seek(0, SeekOrigin.Begin);\n\t\t\tIO.ReadFully(t, act, 0, 1);\n\t\t\tIO.ReadFully(t, act, 1, 1);\n\t\t\tIO.ReadFully(t, act, 2, 1);\n\t\t\tAssert.AreEqual(exp, act);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_readBuffer_Timeout()\n\t\t{\n\t\t\tbeginRead();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tIO.ReadFully(_timeoutstream, new byte[512], 0, 512);\n\t\t\t\tAssert.Fail(\"incorrectly read bytes\");\n\t\t\t}\n\t\t\tcatch (TimeoutException)\n\t\t\t{\n\t\t\t\t// expected\n\t\t\t}\n\t\t\tassertTimeout();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_skip_Success()\n\t\t{\n\t\t\tvar s = new MemoryStream();\n\t\t\tvar t = new TimeoutStream(s);\n\t\t\tbyte[] exp = new byte[] { (byte)'a', (byte)'b', (byte)'c' };\n\t\t\ts.Write(exp, 0, exp.Length);\n\t\t\ts.Seek(0, SeekOrigin.Begin);\n\t\t\tAssert.AreEqual(2, t.skip(2));\n\t\t\tAssert.AreEqual((byte)'c', t.ReadByte());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testTimeout_skip_Timeout()\n\t\t{\n\t\t\tbeginRead();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_timeoutstream.skip(1024);\n\t\t\t\tAssert.Fail(\"incorrectly skipped bytes\");\n\t\t\t}\n\t\t\tcatch (TimeoutException)\n\t\t\t{\n\t\t\t\t// expected\n\t\t\t}\n\t\t\tassertTimeout();\n\t\t}\n\n\t\tprivate void beginRead()\n\t\t{\n\t\t\tstart = now();\n\t\t}\n\n\t\tprivate void assertTimeout()\n\t\t{\n\t\t\t// Our timeout was supposed to be ~250 ms. Since this is a timing\n\t\t\t// test we can't assume we spent *exactly* the timeout period, as\n\t\t\t// there may be other activity going on in the system. Instead we\n\t\t\t// look for the delta between the start and end times to be within\n\t\t\t// 50 ms of the expected timeout.\n\t\t\t//\n\t\t\tlong wait = now() - start;\n\t\t\tAssert.IsTrue(Math.Abs(wait - timeout) < 50);\n\t\t}\n\n\t\t//private static List<Thread> active() {\n\t\t//   Thread[] all = new Thread[16];\n\t\t//   int n = Thread.currentThread().getThreadGroup().enumerate(all);\n\t\t//   while (n == all.length) {\n\t\t//      all = new Thread[all.length * 2];\n\t\t//      n = Thread.currentThread().getThreadGroup().enumerate(all);\n\t\t//   }\n\t\t//   return Arrays.asList(all).subList(0, n);\n\t\t//}\n\n\t\tprivate static long now()\n\t\t{\n\t\t\treturn DateTimeOffset.Now.ToMillisecondsSinceEpoch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/IntListTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class IntListTest\n    {\n        [Test]\n        public void testEmpty_DefaultCapacity()\n        {\n            IntList i = new IntList();\n            Assert.AreEqual(0, i.size());\n            try\n            {\n                i.get(0);\n                Assert.Fail(\"Accepted 0 index on empty list\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                Assert.IsTrue(true);\n            }\n        }\n\n        [Test]\n        public void testEmpty_SpecificCapacity()\n        {\n            IntList i = new IntList(5);\n            Assert.AreEqual(0, i.size());\n            try\n            {\n                i.get(0);\n                Assert.Fail(\"Accepted 0 index on empty list\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                Assert.IsTrue(true);\n            }\n        }\n\n        [Test]\n        public void testAdd_SmallGroup()\n        {\n            IntList i = new IntList();\n            int n = 5;\n            for (int v = 0; v < n; v++)\n                i.add(10 + v);\n\n            Assert.AreEqual(n, i.size());\n\n            for (int v = 0; v < n; v++)\n                Assert.AreEqual(10 + v, i.get(v));\n\n            try\n            {\n                i.get(n);\n                Assert.Fail(\"Accepted out of bound index on list\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                Assert.IsTrue(true);\n            }\n        }\n\n        [Test]\n        public void testAdd_ZeroCapacity()\n        {\n            IntList i = new IntList(0);\n            Assert.AreEqual(0, i.size());\n            i.add(1);\n            Assert.AreEqual(1, i.get(0));\n        }\n\n        [Test]\n        public void testAdd_LargeGroup()\n        {\n            IntList i = new IntList();\n            int n = 500;\n            for (int v = 0; v < n; v++)\n                i.add(10 + v);\n\n            Assert.AreEqual(n, i.size());\n\n            for (int v = 0; v < n; v++)\n                Assert.AreEqual(10 + v, i.get(v));\n\n            try\n            {\n                i.get(n);\n                Assert.Fail(\"Accepted out of bound index on list\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                Assert.IsTrue(true);\n            }\n        }\n\n        [Test]\n        public void testFillTo0()\n        {\n            IntList i = new IntList();\n            i.fillTo(0, int.MinValue);\n            Assert.AreEqual(0, i.size());\n        }\n\n        [Test]\n        public void testFillTo1()\n        {\n            IntList i = new IntList();\n            i.fillTo(1, int.MinValue);\n            Assert.AreEqual(1, i.size());\n            i.add(0);\n            Assert.AreEqual(int.MinValue, i.get(0));\n            Assert.AreEqual(0, i.get(1));\n        }\n\n        [Test]\n        public void testFillTo100()\n        {\n            IntList i = new IntList();\n            i.fillTo(100, int.MinValue);\n            Assert.AreEqual(100, i.size());\n            i.add(3);\n            Assert.AreEqual(int.MinValue, i.get(99));\n            Assert.AreEqual(3, i.get(100));\n        }\n\n        [Test]\n        public void testClear()\n        {\n            IntList i = new IntList();\n            int n = 5;\n            for (int v = 0; v < n; v++)\n                i.add(10 + v);\n            Assert.AreEqual(n, i.size());\n\n            i.clear();\n            Assert.AreEqual(0, i.size());\n\n            try\n            {\n                i.get(0);\n                Assert.Fail(\"Accepted 0 index on empty list\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                Assert.IsTrue(true);\n            }\n        }\n\n        [Test]\n        public void testSet()\n        {\n            IntList i = new IntList();\n            i.add(1);\n            Assert.AreEqual(1, i.size());\n            Assert.AreEqual(1, i.get(0));\n\n            i.set(0, 5);\n            Assert.AreEqual(5, i.get(0));\n\n            AssertHelper.Throws<ArgumentException>(() => i.set(5, 5), \"accepted set of 5 beyond end of list\");\n\n            i.set(1, 2);\n            Assert.AreEqual(2, i.size());\n            Assert.AreEqual(2, i.get(1));\n        }\n\n        [Test]\n        public void testToString()\n        {\n            IntList i = new IntList();\n            i.add(1);\n            Assert.AreEqual(\"[1]\", i.toString());\n            i.add(13);\n            i.add(5);\n            Assert.AreEqual(\"[1, 13, 5]\", i.toString());\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/LinkedListFixture.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class LinkedListFixture\n    {\n        [Test]\n        public void EmptyList()\n        {\n            var list = new LinkedList<int>();\n            var iter = new LinkedListIterator<int>(list);\n\n            AssertEndOfListHasBeenReached(iter);\n            AssertHelper.Throws<IndexOutOfRangeException>(iter.remove);\n        }\n\n        [Test]\n        public void FilledList_NavigateForward()\n        {\n            var list = new LinkedList<int>();\n            list.AddLast(1);\n            list.AddLast(2);\n            list.AddLast(3);\n\n            var iter = new LinkedListIterator<int>(list);\n\n            Assert.AreEqual(3, list.Count);\n\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(1, iter.next());\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(2, iter.next());\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(3, iter.next());\n\n            Assert.AreEqual(3, list.Count);\n\n            AssertEndOfListHasBeenReached(iter);\n        }\n\n        [Test]\n        public void FilledList_NavigateForwardAndRemoval()\n        {\n            var list = new LinkedList<int>();\n            list.AddLast(1);\n            list.AddLast(2);\n            list.AddLast(3);\n            var iter = new LinkedListIterator<int>(list);\n\n            Assert.AreEqual(3, list.Count);\n\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(1, iter.next());\n            iter.remove();\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(2, iter.next());\n            Assert.IsTrue(iter.hasNext());\n            Assert.AreEqual(3, iter.next());\n\n            Assert.AreEqual(2, list.Count);\n\n            AssertEndOfListHasBeenReached(iter);\n        }\n\n        private static void AssertEndOfListHasBeenReached(LinkedListIterator<int> iter)\n        {\n            Assert.IsFalse(iter.hasNext());\n            AssertHelper.Throws<IndexOutOfRangeException>(() => iter.next());\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/LocalDiskRepositoryTestCase.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n * contributors may be used to endorse or promote products derived from this\n * software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n\n/*\n * JUnit TestCase with specialized support for temporary local repository.\n * <p>\n * A temporary directory is created for each test, allowing each test to use a\n * fresh environment. The temporary directory is cleaned up after the test ends.\n * <p>\n * Callers should not use {@link RepositoryCache} from within these tests as it\n * may wedge file descriptors open past the end of the test.\n * <p>\n * A system property {@code jgit.junit.usemmap} defines whether memory mapping\n * is used. Memory mapping has an effect on the file system, in that memory\n * mapped files in Java cannot be deleted as long as the mapped arrays have not\n * been reclaimed by the garbage collector. The programmer cannot control this\n * with precision, so temporary files may hang around longer than desired during\n * a test, or tests may fail altogether if there is insufficient file\n * descriptors or address space for the test process.\n */\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing GitSharp.Core.Util.JavaHelper;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    public abstract class LocalDiskRepositoryTestCase  {\n#warning setting useMMAP to true makes many tests fail. This has to be investigated.\n        private static bool useMMAP = false; \n    \n        // Java line below has not been ported\n        //useMMAP = \"true\".equals(System.getProperty(\"jgit.junit.usemmap\"));\n\n        /** A fake (but stable) identity for author fields in the test. */\n        protected PersonIdent author;\n\n        /** A fake (but stable) identity for committer fields in the test. */\n        protected PersonIdent committer;\n\n        private DirectoryInfo trash = new DirectoryInfo(Path.Combine(\"target\", \"trash\"));\n\n        private List<Core.Repository> toClose = new List<Core.Repository>();\n\n        private MockSystemReader mockSystemReader;\n\n        [SetUp]\n        public virtual void setUp(){\n            recursiveDelete(testName() + \" (SetUp)\", trash, false, true);\n\n            mockSystemReader = new MockSystemReader();\n            mockSystemReader.userGitConfig = new FileBasedConfig(new FileInfo(Path.Combine(trash.FullName, \"usergitconfig\")));\n            SystemReader.setInstance(mockSystemReader);\n\n            long now = mockSystemReader.getCurrentTime();\n            int tz = mockSystemReader.getTimezone(now);\n            author = new PersonIdent(\"J. Author\", \"jauthor@example.com\");\n            author = new PersonIdent(author, now, tz);\n\n            committer = new PersonIdent(\"J. Committer\", \"jcommitter@example.com\");\n            committer = new PersonIdent(committer, now, tz);\n\n            WindowCacheConfig c = new WindowCacheConfig();\n            c.PackedGitLimit = (128 * WindowCacheConfig.Kb);\n            c.PackedGitWindowSize = (8 * WindowCacheConfig.Kb);\n            c.PackedGitMMAP = (useMMAP);\n            c.DeltaBaseCacheLimit = (8 * WindowCacheConfig.Kb);\n            WindowCache.reconfigure(c);\n        }\n\n        [TearDown]\n        public virtual void tearDown()  {\n            RepositoryCache.clear();\n            foreach (Core.Repository r in toClose)\n                r.Dispose();\n            toClose.Clear();\n\n            // Since memory mapping is controlled by the GC we need to\n            // tell it this is a good time to clean up and unlock\n            // memory mapped files.\n            //\n            if (useMMAP)\n                System.GC.Collect();\n\n            recursiveDelete(testName() + \" (TearDown)\", trash, false, true);\n\n        }\n\n        [TestFixtureTearDown]\n        public virtual void FixtureTearDown()\n        {\n            recursiveDelete(testName() + \" (FixtureTearDown)\", trash, false, true);\n        }\n\n        /** Increment the {@link #author} and {@link #committer} times. */\n        protected void tick() {\n            long delta = (long)TimeSpan.FromMinutes(5).TotalMilliseconds;\n            long now = author.When + delta;\n            int tz = mockSystemReader.getTimezone(now);\n\n            author = new PersonIdent(author, now, tz);\n            committer = new PersonIdent(committer, now, tz);\n        }\n\n        /**\n\t * Recursively delete a directory, failing the test if the delete fails.\n\t *\n\t * @param dir\n\t *            the recursively directory to delete, if present.\n\t */\n        protected void recursiveDelete(FileSystemInfo dir) {\n            recursiveDelete(testName(), dir, false, true);\n        }\n\n        private static bool recursiveDelete(string testName, FileSystemInfo fs, bool silent,  bool failOnError)\n        {\n            Debug.Assert(!(silent && failOnError));\n\n            if (fs.IsFile())\n            {\n                fs.DeleteFile();\n                return silent;\n            }\n\n            var dir = new DirectoryInfo(fs.FullName);\n            if (!dir.Exists) return silent;\n\n            try\n            {\n                FileSystemInfo[] ls = dir.GetFileSystemInfos();\n\n                foreach (FileSystemInfo e in ls)\n                {\n                    silent = recursiveDelete(testName, e, silent, failOnError);\n                }\n\n                dir.Delete();\n            }\n            catch (IOException e)\n            {\n                ReportDeleteFailure(testName, failOnError, fs, e.Message);\n            }\n\n            return silent;\n        }\n\n        private static void ReportDeleteFailure(string name, bool failOnError, FileSystemInfo fsi, string message)\n        {\n            string severity = failOnError ? \"Error\" : \"Warning\";\n            string msg = severity + \": Failed to delete \" + fsi.FullName;\n\n            if (name != null)\n            {\n                msg += \" in \" + name;\n            }\n\n            msg += Environment.NewLine;\n            msg += message;\n\n            if (failOnError)\n            {\n                Assert.Fail(msg);\n            }\n            else\n            {\n                Console.WriteLine(msg);\n            }\n        }\n\n        /**\n\t * Creates a new empty bare repository.\n\t *\n\t * @return the newly created repository, opened for access\n\t * @throws IOException\n\t *             the repository could not be created in the temporary area\n\t */\n        protected Core.Repository createBareRepository()  {\n            return createRepository(true /* bare */);\n        }\n\n        /**\n\t * Creates a new empty repository within a new empty working directory.\n\t *\n\t * @return the newly created repository, opened for access\n\t * @throws IOException\n\t *             the repository could not be created in the temporary area\n\t */\n        protected Core.Repository createWorkRepository()  {\n            return createRepository(false /* not bare */);\n        }\n\n        /**\n\t * Creates a new empty repository.\n\t *\n\t * @param bare\n\t *            true to create a bare repository; false to make a repository\n\t *            within its working directory\n\t * @return the newly created repository, opened for access\n\t * @throws IOException\n\t *             the repository could not be created in the temporary area\n\t */\n        private Core.Repository createRepository(bool bare) {\n            String uniqueId = GetType().Name + Guid.NewGuid().ToString();\n            String gitdirName = \"test\" + uniqueId + (bare ? \"\" : \"/\") + Constants.DOT_GIT;\n            DirectoryInfo gitdir = new DirectoryInfo(Path.Combine(trash.FullName, gitdirName));\n            Core.Repository db = new Core.Repository(gitdir);\n\n            Assert.IsFalse(gitdir.Exists);\n            db.Create();\n            toClose.Add(db);\n            return db;\n        }\n\n        /**\n\t * Run a hook script in the repository, returning the exit status.\n\t *\n\t * @param db\n\t *            repository the script should see in GIT_DIR environment\n\t * @param hook\n\t *            path of the hook script to execute, must be executable file\n\t *            type on this platform\n\t * @param args\n\t *            arguments to pass to the hook script\n\t * @return exit status code of the invoked hook\n\t * @throws IOException\n\t *             the hook could not be executed\n\t * @throws InterruptedException\n\t *             the caller was interrupted before the hook completed\n\t */\n        protected int runHook(Core.Repository db, FileInfo hook,\n                              params string[] args) {\n            String[] argv = new String[1 + args.Length];\n            argv[0] = hook.FullName;\n            System.Array.Copy(args, 0, argv, 1, args.Length);\n\n            IDictionary<String, String> env = cloneEnv();\n            env.put(\"GIT_DIR\", db.Directory.FullName);\n            putPersonIdent(env, \"AUTHOR\", author);\n            putPersonIdent(env, \"COMMITTER\", committer);\n\n            DirectoryInfo cwd = db.WorkingDirectory;\n\n            throw new NotImplementedException(\"Not ported yet.\");\n            //Process p = Runtime.getRuntime().exec(argv, toEnvArray(env), cwd);\n            //p.getOutputStream().close();\n            //p.getErrorStream().close();\n            //p.getInputStream().close();\n            //return p.waitFor();\n                              }\n\n        private static void putPersonIdent(IDictionary<String, String> env,\n                                           string type, PersonIdent who) {\n            string ident = who.ToExternalString();\n            string date = ident.Substring(ident.IndexOf(\"> \") + 2);\n            env.put(\"GIT_\" + type + \"_NAME\", who.Name);\n            env.put(\"GIT_\" + type + \"_EMAIL\", who.EmailAddress);\n            env.put(\"GIT_\" + type + \"_DATE\", date);\n                                           }\n\n        /**\n\t * Create a string to a UTF-8 temporary file and return the path.\n\t *\n\t * @param body\n\t *            complete content to write to the file. If the file should end\n\t *            with a trailing LF, the string should end with an LF.\n\t * @return path of the temporary file created within the trash area.\n\t * @throws IOException\n\t *             the file could not be written.\n\t */\n        protected FileInfo write(string body) {\n\n            string filepath = Path.Combine(trash.FullName, \"temp\" + Guid.NewGuid() + \".txt\");\n\n            try\n            {\n                File.WriteAllText(filepath, body);\n            }\n            catch (Exception)\n            {\n                File.Delete(filepath);\n                throw;\n            }\n\n            return new FileInfo(filepath);\n        }\n\n        /**\n\t * Write a string as a UTF-8 file.\n\t *\n\t * @param f\n\t *            file to write the string to. Caller is responsible for making\n\t *            sure it is in the trash directory or will otherwise be cleaned\n\t *            up at the end of the test. If the parent directory does not\n\t *            exist, the missing parent directories are automatically\n\t *            created.\n\t * @param body\n\t *            content to write to the file.\n\t * @throws IOException\n\t *             the file could not be written.\n\t */\n        protected void write(FileInfo f, string body) {\n            f.Directory.Mkdirs();\n\n            using (var s = new StreamWriter(f.FullName, false, Charset.forName(\"UTF-8\")))\n            {\n                s.Write(body);\n            }\n        }\n\n        /**\n\t * Fully read a UTF-8 file and return as a string.\n\t *\n\t * @param f\n\t *            file to read the content of.\n\t * @return UTF-8 decoded content of the file, empty string if the file\n\t *         exists but has no content.\n\t * @throws IOException\n\t *             the file does not exist, or could not be read.\n\t */\n        protected String read(FileInfo f) {\n            using(var s = new StreamReader(f.FullName, Charset.forName(\"UTF-8\")))\n            {\n                return s.ReadToEnd();\n            }\n        }\n\n        private static String[] toEnvArray(IDictionary<String, String> env) {\n            String[] envp = new String[env.Count];\n            int i = 0;\n            foreach (KeyValuePair<string, string> e in env) {\n                envp[i++] = e.Key + \"=\" + e.Value;\n            }\n            return envp;\n        }\n\n        private static IDictionary<String, String> cloneEnv() \n        {\n            var dic = new Dictionary<string, string>();\t    \n        \n            foreach (DictionaryEntry e in Environment.GetEnvironmentVariables())\n            {\n                dic.Add(e.Key.ToString(), e.Value.ToString());\n            }\n\n            return dic;\n        }\n\n        private String testName() {\n            return this.GetType().FullName;\n            //return getClass().getName() + \".\" + getName();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/Md5MessageDigestTest.cs",
    "content": "using System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class Md5MessageDigestTest\n    {\n        [Test]\n        public void EmptyString()\n        {\n            var expected = new byte[] { 256 - 44, 29, 256 - 116, 256 - 39, 256 - 113, 0, 256 - 78, 4, 256 - 23, 256 - 128, 9, 256 - 104, 256 - 20, 256 - 8, 66, 126 };\n\n            MessageDigest md = CreateSUT();\n\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(16, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void ShortStringOneUpdate()\n        {\n            var expected = new byte[] { 101, 256 - 19, 26, 256 - 3, 85, 256 - 19, 125, 33, 256 - 20, 256 - 96, 256 - 100, 256 - 24, 256 - 54, 69, 256 - 87, 14 };\n\n            MessageDigest md = CreateSUT();\n\n            md.Update(\"nulltoken\".getBytes());\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(16, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void ShortStringTwoUpdates()\n        {\n            var expected = new byte[] { 101, 256 - 19, 26, 256 - 3, 85, 256 - 19, 125, 33, 256 - 20, 256 - 96, 256 - 100, 256 - 24, 256 - 54, 69, 256 - 87, 14 };\n\n            MessageDigest md = CreateSUT();\n\n            md.Update(\"null\".getBytes());\n            md.Update(\"token\".getBytes());\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(16, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void LongStringOneUpdate()\n        {\n            var expected = new byte[] { 256 - 3, 33, 256 - 57, 74, 256 - 58, 256 - 26, 72, 20, 85, 113, 119, 21, 256 - 74, 81, 120, 83 };\n\n            MessageDigest md = CreateSUT();\n\n            var sb = new StringBuilder();\n            for (int i = 0; i < 20; i++)\n            {\n                sb.Append(\"nulltoken\");\n            }\n            md.Update(sb.ToString().getBytes());\n\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(16, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void BlowTheHeap()\n        {\n            Assert.DoesNotThrow(() =>\n            {\n                MessageDigest md = CreateSUT();\n                var bytes = new byte[10000];\n                for (int i = 0; i < 100000; i++)\n                {\n                    md.Update(bytes);\n                }\n            });\n        }\n\n        private static MessageDigest CreateSUT()\n        {\n            return MessageDigest.getInstance(\"MD5\");\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/MockFileBasedConfig.cs",
    "content": "/*\n * Copyright (C) 2009, Yann Simon <yann.simon.fr@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n * contributors may be used to endorse or promote products derived from this\n * software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.IO;\nusing GitSharp.Core;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    public class MockFileBasedConfig : FileBasedConfig\n    {\n        public MockFileBasedConfig(FileInfo cfgLocation) : base(null)\n        {\n        }\n\n        public override void load()\n        {\n            // Do nothing\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/MockSystemReader.cs",
    "content": "/*\n * Copyright (C) 2009, Yann Simon <yann.simon.fr@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n * contributors may be used to endorse or promote products derived from this\n * software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    public class MockSystemReader : SystemReader\n    {\n        public readonly IDictionary<String, String> values = new Dictionary<String, String>();\n\n        public FileBasedConfig userGitConfig;\n        public PlatformType operatingSystem;\n\n        public MockSystemReader()\n        {\n            init(Constants.OS_USER_NAME_KEY);\n            init(Constants.GIT_AUTHOR_NAME_KEY);\n            init(Constants.GIT_AUTHOR_EMAIL_KEY);\n            init(Constants.GIT_COMMITTER_NAME_KEY);\n            init(Constants.GIT_COMMITTER_EMAIL_KEY);\n            userGitConfig = new MockFileBasedConfig(null);\n            operatingSystem = SystemReader.getInstance().getOperatingSystem();\n        }\n\n        private void init(string n)\n        {\n            setProperty(n, n);\n        }\n\n        public void clearProperties()\n        {\n            values.Clear();\n        }\n\n        public void setProperty(string key, string value)\n        {\n            values.put(key, value);\n        }\n\n        public override string getenv(string variable)\n        {\n            return values.GetValue(variable);\n        }\n\n        public override string getProperty(string key)\n        {\n            return values.GetValue(key);\n        }\n\n        public override FileBasedConfig openUserConfig()\n        {\n            return userGitConfig;\n        }\n\n        public override string getHostname()\n        {\n            return \"fake.host.example.com\";\n        }\n\n        public override long getCurrentTime()\n        {\n            return 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009\n        }\n\n        public override int getTimezone(long when)\n        {\n            TimeZoneInfo newFoundLandTimeZoneInfo = null;\n            var expectedOffset = new TimeSpan(-3, -30, 0);\n            foreach (TimeZoneInfo timeZoneInfo in TimeZoneInfo.GetSystemTimeZones())\n            {\n                if (timeZoneInfo.BaseUtcOffset != expectedOffset)\n                {\n                    continue;\n                }\n\n                newFoundLandTimeZoneInfo = timeZoneInfo;\n                break;\n            }\n\n            if (newFoundLandTimeZoneInfo == null)\n            {\n                Assert.Fail(\"No -03:30 TimeZone has been found\");\n            }\n\n            return (int)newFoundLandTimeZoneInfo.GetUtcOffset(when.MillisToUtcDateTime()).TotalMinutes;\n        }\n\n        public override FileBasedConfig getConfigFile(ConfigFileType fileType)\n        {\n            return SystemReader.getInstance().getConfigFile(fileType);\n        }\n\n        public override FileBasedConfig getConfigFile(string fileLocation)\n        {\n            return SystemReader.getInstance().getConfigFile(fileLocation);\n        }\n        \n        public override PlatformType getOperatingSystem()\n        {\n            return operatingSystem;\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/NBTests.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class NBTest\n    {\n        [Test]\n        public void testCompareUInt32()\n        {\n            Assert.IsTrue(NB.CompareUInt32(0, 0) == 0);\n            Assert.IsTrue(NB.CompareUInt32(1, 0) > 0);\n            Assert.IsTrue(NB.CompareUInt32(0, 1) < 0);\n            Assert.IsTrue(NB.CompareUInt32(-1, 0) > 0);\n            Assert.IsTrue(NB.CompareUInt32(0, -1) < 0);\n            Assert.IsTrue(NB.CompareUInt32(-1, 1) > 0);\n            Assert.IsTrue(NB.CompareUInt32(1, -1) < 0);\n        }\n\n        [Test]\n        public void testDecodeUInt16()\n        {\n            Assert.AreEqual(0, NB.decodeUInt16(b(0, 0), 0));\n            Assert.AreEqual(0, NB.decodeUInt16(Padb(3, 0, 0), 3));\n\n            Assert.AreEqual(3, NB.decodeUInt16(b(0, 3), 0));\n            Assert.AreEqual(3, NB.decodeUInt16(Padb(3, 0, 3), 3));\n\n            Assert.AreEqual(0xde03, NB.decodeUInt16(b(0xde, 3), 0));\n            Assert.AreEqual(0xde03, NB.decodeUInt16(Padb(3, 0xde, 3), 3));\n\n            Assert.AreEqual(0x03de, NB.decodeUInt16(b(3, 0xde), 0));\n            Assert.AreEqual(0x03de, NB.decodeUInt16(Padb(3, 3, 0xde), 3));\n\n            Assert.AreEqual(0xffff, NB.decodeUInt16(b(0xff, 0xff), 0));\n            Assert.AreEqual(0xffff, NB.decodeUInt16(Padb(3, 0xff, 0xff), 3));\n        }\n\n        [Test]\n        public  void testDecodeInt32()\n        {\n            Assert.AreEqual(0, NB.DecodeInt32(b(0, 0, 0, 0), 0));\n            Assert.AreEqual(0, NB.DecodeInt32(Padb(3, 0, 0, 0, 0), 3));\n\n            Assert.AreEqual(3, NB.DecodeInt32(b(0, 0, 0, 3), 0));\n            Assert.AreEqual(3, NB.DecodeInt32(Padb(3, 0, 0, 0, 3), 3));\n            unchecked\n            {\n                Assert.AreEqual((int)0xdeadbeef, NB.DecodeInt32(b(0xde, 0xad, 0xbe, 0xef), 0));\n                Assert.AreEqual((int)0xdeadbeef, NB.DecodeInt32(Padb(3, 0xde, 0xad, 0xbe, 0xef), 3));\n            }\n            Assert.AreEqual(0x0310adef, NB.DecodeInt32(b(0x03, 0x10, 0xad, 0xef), 0));\n            Assert.AreEqual(0x0310adef, NB.DecodeInt32(Padb(3, 0x03, 0x10, 0xad, 0xef), 3));\n            unchecked\n            {\n                Assert.AreEqual((int)0xffffffff, NB.DecodeInt32(b(0xff, 0xff, 0xff, 0xff), 0));\n                Assert.AreEqual((int)0xffffffff, NB.DecodeInt32(Padb(3, 0xff, 0xff, 0xff, 0xff), 3));\n            }\n        }\n\n        [Test]\n        public void testDecodeUInt32()\n        {\n            Assert.AreEqual(0L, NB.decodeUInt32(b(0, 0, 0, 0), 0));\n            Assert.AreEqual(0L, NB.decodeUInt32(Padb(3, 0, 0, 0, 0), 3));\n\n            Assert.AreEqual(3L, NB.decodeUInt32(b(0, 0, 0, 3), 0));\n            Assert.AreEqual(3L, NB.decodeUInt32(Padb(3, 0, 0, 0, 3), 3));\n\n            Assert.AreEqual(0xdeadbeefL, NB.decodeUInt32(b(0xde, 0xad, 0xbe, 0xef), 0));\n            Assert.AreEqual(0xdeadbeefL, NB.decodeUInt32(Padb(3, 0xde, 0xad, 0xbe,\n                    0xef), 3));\n\n            Assert.AreEqual(0x0310adefL, NB.decodeUInt32(b(0x03, 0x10, 0xad, 0xef), 0));\n            Assert.AreEqual(0x0310adefL, NB.decodeUInt32(Padb(3, 0x03, 0x10, 0xad,\n                    0xef), 3));\n\n            Assert.AreEqual(0xffffffffL, NB.decodeUInt32(b(0xff, 0xff, 0xff, 0xff), 0));\n            Assert.AreEqual(0xffffffffL, NB.decodeUInt32(Padb(3, 0xff, 0xff, 0xff,\n                    0xff), 3));\n        }\n\n        [Test]\n        public void testDecodeUInt64()\n        {\n            Assert.AreEqual(0L, NB.DecodeUInt64(b(0, 0, 0, 0, 0, 0, 0, 0), 0));\n            Assert.AreEqual(0L, NB.DecodeUInt64(Padb(3, 0, 0, 0, 0, 0, 0, 0, 0), 3));\n\n            Assert.AreEqual(3L, NB.DecodeUInt64(b(0, 0, 0, 0, 0, 0, 0, 3), 0));\n            Assert.AreEqual(3L, NB.DecodeUInt64(Padb(3, 0, 0, 0, 0, 0, 0, 0, 3), 3));\n\n            Assert.AreEqual(0xdeadbeefL, NB.DecodeUInt64(b(0, 0, 0, 0, 0xde, 0xad, 0xbe, 0xef), 0));\n            Assert.AreEqual(0xdeadbeefL, NB.DecodeUInt64(Padb(3, 0, 0, 0, 0, 0xde, 0xad, 0xbe, 0xef), 3));\n\n            Assert.AreEqual(0x0310adefL, NB.DecodeUInt64(b(0, 0, 0, 0, 0x03, 0x10, 0xad, 0xef), 0));\n            Assert.AreEqual(0x0310adefL, NB.DecodeUInt64(Padb(3, 0, 0, 0, 0, 0x03, 0x10, 0xad, 0xef), 3));\n            unchecked\n            {\n                Assert.AreEqual((long)0xc0ffee78deadbeefL, NB.DecodeUInt64(b(0xc0, 0xff, 0xee,\n                        0x78, 0xde, 0xad, 0xbe, 0xef), 0));\n                Assert.AreEqual((long)0xc0ffee78deadbeefL, NB.DecodeUInt64(Padb(3, 0xc0, 0xff,\n                        0xee, 0x78, 0xde, 0xad, 0xbe, 0xef), 3));\n\n                Assert.AreEqual(0x00000000ffffffffL, NB.DecodeUInt64(b(0, 0, 0, 0, 0xff,\n                        0xff, 0xff, 0xff), 0));\n                Assert.AreEqual(0x00000000ffffffffL, NB.DecodeUInt64(Padb(3, 0, 0, 0, 0,\n                        0xff, 0xff, 0xff, 0xff), 3));\n                Assert.AreEqual((long)0xffffffffffffffffL, NB.DecodeUInt64(b(0xff, 0xff, 0xff,\n                        0xff, 0xff, 0xff, 0xff, 0xff), 0));\n                Assert.AreEqual((long)0xffffffffffffffffL, NB.DecodeUInt64(Padb(3, 0xff, 0xff,\n                        0xff, 0xff, 0xff, 0xff, 0xff, 0xff), 3));\n            }\n        }\n\n        [Test]\n        public void testEncodeInt16()\n        {\n            var @out = new byte[16];\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 0, 0);\n            AssertOutput(b(0, 0), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 3, 0);\n            AssertOutput(b(0, 0), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 0, 3);\n            AssertOutput(b(0, 3), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 3, 3);\n            AssertOutput(b(0, 3), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 0, 0xdeac);\n            AssertOutput(b(0xde, 0xac), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 3, 0xdeac);\n            AssertOutput(b(0xde, 0xac), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt16(@out, 3, -1);\n            AssertOutput(b(0xff, 0xff), @out, 3);\n        }\n\n        [Test]\n        public void testEncodeInt32()\n        {\n            var @out = new byte[16];\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 0, 0);\n            AssertOutput(b(0, 0, 0, 0), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 3, 0);\n            AssertOutput(b(0, 0, 0, 0), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 0, 3);\n            AssertOutput(b(0, 0, 0, 3), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 3, 3);\n            AssertOutput(b(0, 0, 0, 3), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 0, 0xdeac);\n            AssertOutput(b(0, 0, 0xde, 0xac), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 3, 0xdeac);\n            AssertOutput(b(0, 0, 0xde, 0xac), @out, 3);\n\n            PrepareOutput(@out);\n            unchecked\n            {\n                NB.encodeInt32(@out, 0, (int)0xdeac9853);\n            }\n            AssertOutput(b(0xde, 0xac, 0x98, 0x53), @out, 0);\n\n            PrepareOutput(@out);\n            unchecked\n            {\n                NB.encodeInt32(@out, 3, (int)0xdeac9853);\n            }\n            AssertOutput(b(0xde, 0xac, 0x98, 0x53), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt32(@out, 3, -1);\n            AssertOutput(b(0xff, 0xff, 0xff, 0xff), @out, 3);\n        }\n\n        [Test]\n        public void testEncodeInt64()\n        {\n            var @out = new byte[16];\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 0, 0L);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0, 0), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 3, 0L);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0, 0), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 0, 3L);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0, 3), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 3, 3L);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0, 3), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 0, 0xdeacL);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0xde, 0xac), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 3, 0xdeacL);\n            AssertOutput(b(0, 0, 0, 0, 0, 0, 0xde, 0xac), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 0, 0xdeac9853L);\n            AssertOutput(b(0, 0, 0, 0, 0xde, 0xac, 0x98, 0x53), @out, 0);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 3, 0xdeac9853L);\n            AssertOutput(b(0, 0, 0, 0, 0xde, 0xac, 0x98, 0x53), @out, 3);\n\n            PrepareOutput(@out);\n            unchecked\n            {\n                NB.encodeInt64(@out, 0, (long)0xac431242deac9853L);\n            }\n            AssertOutput(b(0xac, 0x43, 0x12, 0x42, 0xde, 0xac, 0x98, 0x53), @out, 0);\n\n            PrepareOutput(@out);\n            unchecked\n            {\n                NB.encodeInt64(@out, 3, (long)0xac431242deac9853L);\n            }\n            AssertOutput(b(0xac, 0x43, 0x12, 0x42, 0xde, 0xac, 0x98, 0x53), @out, 3);\n\n            PrepareOutput(@out);\n            NB.encodeInt64(@out, 3, -1L);\n            AssertOutput(b(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), @out, 3);\n        }\n\n\t\t[Test]\n\t\tpublic void TestDecimalToBase()\n\t\t{\n\t\t\tstring x = NB.DecimalToBase(15, 16);\n\t\t\tAssert.IsTrue(string.Compare(x, \"F\", true) == 0);\n\n\t\t\tx = NB.DecimalToBase(8, 8);\n\t\t\tAssert.IsTrue(string.Compare(x, \"10\", true) == 0);\n\t\t}\n\n        private static void PrepareOutput(byte[] buf)\n        {\n            for (int i = 0; i < buf.Length; i++)\n                buf[i] = (byte)(0x77 + i);\n        }\n\n        private static void AssertOutput(byte[] expect, byte[] buf, int offset)\n        {\n            for (int i = 0; i < offset; i++)\n                Assert.AreEqual((byte)(0x77 + i), buf[i]);\n            for (int i = 0; i < expect.Length; i++)\n                Assert.AreEqual(expect[i], buf[offset + i]);\n            for (int i = offset + expect.Length; i < buf.Length; i++)\n                Assert.AreEqual((byte)(0x77 + i), buf[i]);\n        }\n\n        private static byte[] b(int a, int b)\n        {\n            return new[] { (byte)a, (byte)b };\n        }\n\n        private static byte[] Padb(int len, int a, int b)\n        {\n            var r = new byte[len + 2];\n            for (int i = 0; i < len; i++)\n                r[i] = 0xaf;\n            r[len] = (byte)a;\n            r[len + 1] = (byte)b;\n            return r;\n        }\n\n        private static byte[] b(int a, int b, int c, int d)\n        {\n            return new[] { (byte)a, (byte)b, (byte)c, (byte)d };\n        }\n\n        private static byte[] Padb(int len, int a, int b,\n                 int c, int d)\n        {\n            var r = new byte[len + 4];\n            for (int i = 0; i < len; i++)\n                r[i] = 0xaf;\n            r[len] = (byte)a;\n            r[len + 1] = (byte)b;\n            r[len + 2] = (byte)c;\n            r[len + 3] = (byte)d;\n            return r;\n        }\n\n        private static byte[] b(int a, int b, int c, int d,\n                 int e, int f, int g, int h)\n        {\n            return new[] { (byte) a, (byte) b, (byte) c, (byte) d, (byte) e,\n\t\t\t\t(byte) f, (byte) g, (byte) h };\n        }\n\n        private static byte[] Padb(int len, int a, int b,\n                 int c, int d, int e, int f, int g,\n                 int h)\n        {\n            var r = new byte[len + 8];\n            for (int i = 0; i < len; i++)\n                r[i] = 0xaf;\n            r[len] = (byte)a;\n            r[len + 1] = (byte)b;\n            r[len + 2] = (byte)c;\n            r[len + 3] = (byte)d;\n            r[len + 4] = (byte)e;\n            r[len + 5] = (byte)f;\n            r[len + 6] = (byte)g;\n            r[len + 7] = (byte)h;\n            return r;\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/PathUtils.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n\t[TestFixture]\n\tpublic class PathUtilsTest\n\t{\n\t\t[Test]\n\t\tpublic void RelativePath()\n\t\t{\n\t\t\tAssert.AreEqual(Join(\"foo\",\"bar\",\"baz\"), PathUtil.RelativePath(@\"\\foo\\bar\\baz\", @\"\\foo\\bar\\baz\\foo\\bar\\baz\"));\n\t\t\tAssert.AreEqual(Join(\"foo\", \"bar\", \"baz\"), PathUtil.RelativePath(@\"/foo/bar/baz\", @\"/foo/bar/baz/foo/bar/\\//\\baz\"));\n\t\t\tAssert.AreEqual(Join(\"..\",\"..\"), PathUtil.RelativePath(@\"\\foo\\bar\\baz\", @\"\\foo\"));\n\t\t\tAssert.AreEqual(\"path\", PathUtil.RelativePath(@\"foo/bar/baz\", @\"path\"));\n\t\t\tAssert.AreEqual(Join(\"..\", \"..\"), PathUtil.RelativePath(@\"\\foo\\bar\\baz\", @\"../..\"));\n\t\t\tAssert.AreEqual(\"hmm.txt\", PathUtil.RelativePath(@\"\\foo\\bar\\baz\", @\"hmm.txt\"));\n\t\t\tAssert.AreEqual(\"\", PathUtil.RelativePath(@\"\\foo\\bar\\baz\", @\"/foo/bar\\baz\"));\n\t\t\tAssert.AreEqual(Join(\"\",\"foo\",\"bar\",\"baz\"), PathUtil.RelativePath(@\"foo\\bar\\baz\", @\"/foo/bar\\baz\"));\n\t\t}\n\n\t\tprivate string Join(params string[] parts)\n\t\t{\n\t\t\treturn string.Join(Path.DirectorySeparatorChar.ToString(), parts);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/QuotedStringBourneStyleTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in_str source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in_str binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in_str the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class QuotedStringBourneStyleTest\n    {\n        private static void AssertQuote(string inStr, string exp)\n        {\n            string r = QuotedString.BOURNE.quote(inStr);\n            Assert.AreNotSame(inStr, r);\n            Assert.IsFalse(inStr.Equals(r));\n            Assert.AreEqual('\\'' + exp + '\\'', r);\n        }\n\n        private static void AssertDequote(string exp, string inStr)\n        {\n            byte[] b = Constants.encode('\\'' + inStr + '\\'');\n            String r = QuotedString.BOURNE.dequote(b, 0, b.Length);\n            Assert.AreEqual(exp, r);\n        }\n\n        [Test]\n        public void testDequote_BareA()\n        {\n            const string in_str = \"a\";\n            byte[] b = Constants.encode(in_str);\n            Assert.AreEqual(in_str, QuotedString.BOURNE.dequote(b, 0, b.Length));\n        }\n\n        [Test]\n        public void testDequote_BareABCZ_OnlyBC()\n        {\n            const string in_str = \"abcz\";\n            byte[] b = Constants.encode(in_str);\n            int p = in_str.IndexOf('b');\n            Assert.AreEqual(\"bc\", QuotedString.BOURNE.dequote(b, p, p + 2));\n        }\n\n        [Test]\n        public void testDequote_Empty1()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE.dequote(new byte[0], 0, 0));\n        }\n\n        [Test]\n        public void testDequote_Empty2()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE.dequote(new[] {(byte) '\\'', (byte) '\\''}, 0, 2));\n        }\n\n        [Test]\n        public void testDequote_LoneBackslash()\n        {\n            AssertDequote(\"\\\\\", \"\\\\\");\n        }\n\n        [Test]\n        public void testDequote_NamedEscapes()\n        {\n            AssertDequote(\"'\", \"'\\\\''\");\n            AssertDequote(\"!\", \"'\\\\!'\");\n\n            AssertDequote(\"a'b\", \"a'\\\\''b\");\n            AssertDequote(\"a!b\", \"a'\\\\!'b\");\n        }\n\n        [Test]\n        public void testDequote_SoleSq()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE.dequote(new[] {(byte) '\\''}, 0, 1));\n        }\n\n        [Test]\n        public void testQuote_BareA()\n        {\n            AssertQuote(\"a\", \"a\");\n        }\n\n        [Test]\n        public void testQuote_Empty()\n        {\n            Assert.AreEqual(\"''\", QuotedString.BOURNE.quote(string.Empty));\n        }\n\n        [Test]\n        public void testQuote_NamedEscapes()\n        {\n            AssertQuote(\"'\", \"'\\\\''\");\n            AssertQuote(\"!\", \"'\\\\!'\");\n\n            AssertQuote(\"a'b\", \"a'\\\\''b\");\n            AssertQuote(\"a!b\", \"a'\\\\!'b\");\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/QuotedStringBourneUserPathStyleTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class QuotedStringBourneUserPathStyleTest\n    {\n        private static void assertQuote(String in_str, String exp)\n        {\n            String r = QuotedString.BOURNE_USER_PATH.quote(in_str);\n            Assert.AreNotSame(in_str, r);\n            Assert.IsFalse(in_str.Equals(r));\n            Assert.AreEqual('\\'' + exp + '\\'', r);\n        }\n\n        private static void assertDequote(String exp, String in_str)\n        {\n            byte[] b = Constants.encode('\\'' + in_str + '\\'');\n            string r = QuotedString.BOURNE_USER_PATH.dequote(b, 0, b.Length);\n            Assert.AreEqual(exp, r);\n        }\n\n        [Test]\n        public void testQuote_Empty()\n        {\n            Assert.AreEqual(\"''\", QuotedString.BOURNE_USER_PATH.quote(string.Empty));\n        }\n\n        [Test]\n        public void testDequote_Empty1()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE.dequote(new byte[0], 0, 0));\n        }\n\n        [Test]\n        public void testDequote_Empty2()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE_USER_PATH.dequote(new byte[] { (byte)'\\'', (byte)'\\'' }, 0,\n                                                                                2));\n        }\n\n        [Test]\n        public void testDequote_SoleSq()\n        {\n            Assert.AreEqual(string.Empty, QuotedString.BOURNE_USER_PATH.dequote(new byte[] { (byte)'\\'' }, 0, 1));\n        }\n\n        [Test]\n        public void testQuote_BareA()\n        {\n            assertQuote(\"a\", \"a\");\n        }\n\n        [Test]\n        public void testDequote_BareA()\n        {\n            String in_str = \"a\";\n            byte[] b = Constants.encode(in_str);\n            Assert.AreEqual(in_str, QuotedString.BOURNE_USER_PATH.dequote(b, 0, b.Length));\n        }\n\n        [Test]\n        public void testDequote_BareABCZ_OnlyBC()\n        {\n            String in_str = \"abcz\";\n            byte[] b = Constants.encode(in_str);\n            int p = in_str.IndexOf('b');\n            Assert.AreEqual(\"bc\", QuotedString.BOURNE_USER_PATH.dequote(b, p, p + 2));\n        }\n\n        [Test]\n        public void testDequote_LoneBackslash()\n        {\n            assertDequote(\"\\\\\", \"\\\\\");\n        }\n\n        [Test]\n        public void testQuote_NamedEscapes()\n        {\n            assertQuote(\"'\", \"'\\\\''\");\n            assertQuote(\"!\", \"'\\\\!'\");\n\n            assertQuote(\"a'b\", \"a'\\\\''b\");\n            assertQuote(\"a!b\", \"a'\\\\!'b\");\n        }\n\n        [Test]\n        public void testDequote_NamedEscapes()\n        {\n            assertDequote(\"'\", \"'\\\\''\");\n            assertDequote(\"!\", \"'\\\\!'\");\n\n            assertDequote(\"a'b\", \"a'\\\\''b\");\n            assertDequote(\"a!b\", \"a'\\\\!'b\");\n        }\n\n        [Test]\n        public void testQuote_User()\n        {\n            Assert.AreEqual(\"~foo/\", QuotedString.BOURNE_USER_PATH.quote(\"~foo\"));\n            Assert.AreEqual(\"~foo/\", QuotedString.BOURNE_USER_PATH.quote(\"~foo/\"));\n            Assert.AreEqual(\"~/\", QuotedString.BOURNE_USER_PATH.quote(\"~/\"));\n\n            Assert.AreEqual(\"~foo/'a'\", QuotedString.BOURNE_USER_PATH.quote(\"~foo/a\"));\n            Assert.AreEqual(\"~/'a'\", QuotedString.BOURNE_USER_PATH.quote(\"~/a\"));\n        }\n\n        [Test]\n        public void testDequote_User()\n        {\n            Assert.AreEqual(\"~foo\", QuotedString.BOURNE_USER_PATH.dequote(\"~foo\"));\n            Assert.AreEqual(\"~foo/\", QuotedString.BOURNE_USER_PATH.dequote(\"~foo/\"));\n            Assert.AreEqual(\"~/\", QuotedString.BOURNE_USER_PATH.dequote(\"~/\"));\n\n            Assert.AreEqual(\"~foo/a\", QuotedString.BOURNE_USER_PATH.dequote(\"~foo/'a'\"));\n            Assert.AreEqual(\"~/a\", QuotedString.BOURNE_USER_PATH.dequote(\"~/'a'\"));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/QuotedStringGitPathStyleTest.cs",
    "content": "/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing System.Text;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class QuotedStringGitPathStyleTest\n    {\n        private static readonly QuotedString.GitPathStyle GitPath = QuotedString.GitPathStyle.GIT_PATH;\n\n        private static void AssertQuote(String exp, String in_str)\n        {\n            String r = GitPath.quote(in_str);\n            Assert.AreNotSame(in_str, r);\n            Assert.IsFalse(in_str.Equals(r));\n            Assert.AreEqual('\"' + exp + '\"', r);\n        }\n\n        private static void AssertDequote(string exp, string inStr)\n        {\n            byte[] b = ('\"' + inStr + '\"').getBytes(\"ISO-8859-1\");\n\t\t    \n            String r = GitPath.dequote(b, 0, b.Length);\n            Assert.AreEqual(exp, r);\n        }\n\n        [Test]\n        public void testQuote_Empty()\n        {\n            Assert.AreEqual(\"\\\"\\\"\", GitPath.quote(string.Empty));\n        }\n\n        [Test]\n        public void testDequote_Empty1()\n        {\n            Assert.AreEqual(string.Empty, GitPath.dequote(new byte[0], 0, 0));\n        }\n\n        [Test]\n        public void testDequote_Empty2()\n        {\n            Assert.AreEqual(string.Empty, GitPath.dequote(new byte[] { (byte)'\"', (byte)'\"' }, 0, 2));\n        }\n\n        [Test]\n        public void testDequote_SoleDq()\n        {\n            Assert.AreEqual(\"\\\"\", GitPath.dequote(new byte[] { (byte)'\"' }, 0, 1));\n        }\n\n        [Test]\n        public void testQuote_BareA()\n        {\n            String in_str = \"a\";\n            Assert.AreSame(in_str, GitPath.quote(in_str));\n        }\n\n        [Test]\n        public void testDequote_BareA()\n        {\n            String in_str = \"a\";\n            byte[] b = Constants.encode(in_str);\n            Assert.AreEqual(in_str, GitPath.dequote(b, 0, b.Length));\n        }\n\n        [Test]\n        public void testDequote_BareABCZ_OnlyBC()\n        {\n            String in_str = \"abcz\";\n            byte[] b = Constants.encode(in_str);\n            int p = in_str.IndexOf('b');\n            Assert.AreEqual(\"bc\", GitPath.dequote(b, p, p + 2));\n        }\n\n        [Test]\n        public void testDequote_LoneBackslash()\n        {\n            AssertDequote(\"\\\\\", \"\\\\\");\n        }\n\n        [Test]\n        public void testQuote_NamedEscapes()\n        {\n            AssertQuote(\"\\\\a\", \"\\u0007\");\n            AssertQuote(\"\\\\b\", \"\\b\");\n            AssertQuote(\"\\\\f\", \"\\f\");\n            AssertQuote(\"\\\\n\", \"\\n\");\n            AssertQuote(\"\\\\r\", \"\\r\");\n            AssertQuote(\"\\\\t\", \"\\t\");\n            AssertQuote(\"\\\\v\", \"\\u000B\");\n            AssertQuote(\"\\\\\\\\\", \"\\\\\");\n            AssertQuote(\"\\\\\\\"\", \"\\\"\");\n        }\n\n        [Test]\n        public void testDequote_NamedEscapes()\n        {\n            AssertDequote(\"\\u0007\", \"\\\\a\");\n            AssertDequote(\"\\b\", \"\\\\b\");\n            AssertDequote(\"\\f\", \"\\\\f\");\n            AssertDequote(\"\\n\", \"\\\\n\");\n            AssertDequote(\"\\r\", \"\\\\r\");\n            AssertDequote(\"\\t\", \"\\\\t\");\n            AssertDequote(\"\\u000B\", \"\\\\v\");\n            AssertDequote(\"\\\\\", \"\\\\\\\\\");\n            AssertDequote(\"\\\"\", \"\\\\\\\"\");\n        }\n\n        [Test]\n        public void testDequote_OctalAll()\n        {\n            for (int i = 0; i < 127; i++)\n            {\n                AssertDequote(string.Empty + (char) i, octalEscape(i));\n            }\n\n            for (int i = 128; i < 256; i++)\n            {\n                int f = 0xC0 | (i >> 6);\n                int s = 0x80 | (i & 0x3f);\n                AssertDequote(string.Empty + (char) i, octalEscape(f)+octalEscape(s));\n            }\n        }\n\n        private String octalEscape(int i)\n        {\n            String s = Convert.ToString(i, 8);\n            while (s.Length < 3) {\n                s = \"0\" + s;\n            }\n            return \"\\\\\"+s;\n        }\n\n        [Test]\n        public void testQuote_OctalAll()\n        {\n            AssertQuote(\"\\\\001\", new string((char)1,1));\n            AssertQuote(\"\\\\176\", \"~\");\n            AssertQuote(\"\\\\303\\\\277\", \"\\u00ff\"); // \\u00ff in UTF-8\n        }\n\n        [Test]\n        public void testDequote_UnknownEscapeQ()\n        {\n            AssertDequote(\"\\\\q\", \"\\\\q\");\n        }\n\n        [Test]\n        public void testDequote_FooTabBar()\n        {\n            AssertDequote(\"foo\\tbar\", \"foo\\\\tbar\");\n        }\n\n        [Test]\n        public void testDequote_Latin1()\n        {\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => AssertDequote(\"\\u00c5ngstr\\u00f6m\", \"\\\\305ngstr\\\\366m\"), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=549914\");\n        }\n\n        [Test]\n        public void testDequote_UTF8()\n        {\n            AssertDequote(\"\\u00c5ngstr\\u00f6m\", \"\\\\303\\\\205ngstr\\\\303\\\\266m\");\n        }\n\n        [Test]\n        public void testDequote_RawUTF8()\n        {\n            AssertDequote(\"\\u00c5ngstr\\u00f6m\", @\"\\303\\205ngstr\\303\\266m\");\n        }\n\n        [Test]\n        public void testDequote_RawLatin1()\n        {\n            AssertHelper.IgnoreOn(AssertedPlatform.Mono, () => AssertDequote(\"\\u00c5ngstr\\u00f6m\", (char)NB.BaseToDecimal(\"305\", 8)  + \"ngstr\" + (char)NB.BaseToDecimal(\"366\", 8) + \"m\"), \"Will fail in mono due to https://bugzilla.novell.com/show_bug.cgi?id=549914\");\n        }\n\n        [Test]\n        public void testQuote_Ang()\n        {\n            AssertQuote(\"\\\\303\\\\205ngstr\\\\303\\\\266m\", \"\\u00c5ngstr\\u00f6m\");\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/RawParseUtils_HexParseTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    \n    [TestFixture]\n    public class RawParseUtils_HexParseTest\n    {\n        \n        [Test]\n        public void testInt4_1()\n        {\n            Assert.AreEqual(0, RawParseUtils.parseHexInt4((byte)'0'));\n            Assert.AreEqual(1, RawParseUtils.parseHexInt4((byte)'1'));\n            Assert.AreEqual(2, RawParseUtils.parseHexInt4((byte)'2'));\n            Assert.AreEqual(3, RawParseUtils.parseHexInt4((byte)'3'));\n            Assert.AreEqual(4, RawParseUtils.parseHexInt4((byte)'4'));\n            Assert.AreEqual(5, RawParseUtils.parseHexInt4((byte)'5'));\n            Assert.AreEqual(6, RawParseUtils.parseHexInt4((byte)'6'));\n            Assert.AreEqual(7, RawParseUtils.parseHexInt4((byte)'7'));\n            Assert.AreEqual(8, RawParseUtils.parseHexInt4((byte)'8'));\n            Assert.AreEqual(9, RawParseUtils.parseHexInt4((byte)'9'));\n            Assert.AreEqual(10, RawParseUtils.parseHexInt4((byte)'a'));\n            Assert.AreEqual(11, RawParseUtils.parseHexInt4((byte)'b'));\n            Assert.AreEqual(12, RawParseUtils.parseHexInt4((byte)'c'));\n            Assert.AreEqual(13, RawParseUtils.parseHexInt4((byte)'d'));\n            Assert.AreEqual(14, RawParseUtils.parseHexInt4((byte)'e'));\n            Assert.AreEqual(15, RawParseUtils.parseHexInt4((byte)'f'));\n\n            Assert.AreEqual(10, RawParseUtils.parseHexInt4((byte)'A'));\n            Assert.AreEqual(11, RawParseUtils.parseHexInt4((byte)'B'));\n            Assert.AreEqual(12, RawParseUtils.parseHexInt4((byte)'C'));\n            Assert.AreEqual(13, RawParseUtils.parseHexInt4((byte)'D'));\n            Assert.AreEqual(14, RawParseUtils.parseHexInt4((byte)'E'));\n            Assert.AreEqual(15, RawParseUtils.parseHexInt4((byte)'F'));\n\n            assertNotHex('q');\n            assertNotHex(' ');\n            assertNotHex('.');\n        }\n\n        [Test]\n        public void testInt16()\n        {\n            Assert.AreEqual(0x0000, parse16(\"0000\"));\n            Assert.AreEqual(0x0001, parse16(\"0001\"));\n            Assert.AreEqual(0x1234, parse16(\"1234\"));\n            Assert.AreEqual(0xdead, parse16(\"dead\")); \n            Assert.AreEqual(0xbeef, parse16(\"BEEF\"));\n            Assert.AreEqual(0x4321, parse16(\"4321\"));\n            Assert.AreEqual(0xffff, parse16(\"ffff\"));\n\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse16(\"noth\"));\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse16(\"01\"));\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse16(\"000.\"));\n        }\n\n        [Test]\n        public void testInt32()\n        {\n            Assert.AreEqual(0x00000000, parse32(\"00000000\"));\n            Assert.AreEqual(0x00000001, parse32(\"00000001\"));\n            Assert.AreEqual(0xc0ffEE42, (uint)parse32(\"c0ffEE42\"));\n            Assert.AreEqual(0xffffffff, (uint)parse32(\"ffffffff\"));\n            Assert.AreEqual(-1, parse32(\"ffffffff\"));\n\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse32(\"noth\"));\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse32(\"notahexs\"));\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse32(\"01\"));\n            AssertHelper.Throws<IndexOutOfRangeException>(() => parse32(\"0000000.\"));\n        }\n\n        private static int parse16(string str)\n        {\n            return RawParseUtils.parseHexInt16(Constants.encodeASCII(str), 0);\n        }\n\n        private static int parse32(string str)\n        {\n            return RawParseUtils.parseHexInt32(Constants.encodeASCII(str), 0);\n        }\n\n        private static void assertNotHex(char c)\n        {\n            AssertHelper.Throws<IndexOutOfRangeException>(() => RawParseUtils.parseHexInt4((byte) c));\n        }\n\n    }\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/RawParseUtils_LineMapTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class RawParseUtils_LineMapTest\n    {\n        // private static readonly System.Text.ASCIIEncoding asciienc = new System.Text.ASCIIEncoding();\n\n        [Test]\n        public void testEmpty()\n        {\n            IntList map = RawParseUtils.lineMap(new byte[] {}, 0, 0);\n            Assert.IsNotNull(map);\n            Assert.AreEqual(2, map.size());\n            Assert.AreEqual(int.MinValue, map.get(0));\n            Assert.AreEqual(0, map.get(1));\n        }\n\n        [Test]\n        public void testOneBlankLine()\n        {\n            IntList map = RawParseUtils.lineMap(new byte[] { (byte)'\\n' }, 0, 1);\n            Assert.AreEqual(3, map.size());\n            Assert.AreEqual(int.MinValue, map.get(0));\n            Assert.AreEqual(0, map.get(1));\n            Assert.AreEqual(1, map.get(2));\n        }\n\n        [Test]\n        public void testTwoLineFooBar()\n        {\n            byte[] buf = \"foo\\nbar\\n\".getBytes(\"ISO-8859-1\");\n            IntList map = RawParseUtils.lineMap(buf, 0, buf.Length);\n            Assert.AreEqual(4, map.size());\n            Assert.AreEqual(int.MinValue, map.get(0));\n            Assert.AreEqual(0, map.get(1));\n            Assert.AreEqual(4, map.get(2));\n            Assert.AreEqual(buf.Length, map.get(3));\n        }\n\n        [Test]\n        public void testTwoLineNoLF()\n        {\n            byte[] buf = \"foo\\nbar\".getBytes(\"ISO-8859-1\");\n            IntList map = RawParseUtils.lineMap(buf, 0, buf.Length);\n            Assert.AreEqual(4, map.size());\n            Assert.AreEqual(int.MinValue, map.get(0));\n            Assert.AreEqual(0, map.get(1));\n            Assert.AreEqual(4, map.get(2));\n            Assert.AreEqual(buf.Length, map.get(3));\n        }\n\n        [Test]\n        public void testFourLineBlanks()\n        {\n            byte[] buf = \"foo\\n\\n\\nbar\\n\".getBytes(\"ISO-8859-1\");\n            IntList map = RawParseUtils.lineMap(buf, 0, buf.Length);\n            Assert.AreEqual(6, map.size());\n            Assert.AreEqual(int.MinValue, map.get(0));\n            Assert.AreEqual(0, map.get(1));\n            Assert.AreEqual(4, map.get(2));\n            Assert.AreEqual(5, map.get(3));\n            Assert.AreEqual(6, map.get(4));\n            Assert.AreEqual(buf.Length, map.get(5));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/RawParseUtils_MatchTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n * Copyright (C) 2009, Gil Ran <gilrun@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class RawParseUtils_MatchTest\n    {\n        [Test]\n        public void testMatch_Equal()\n        {\n            byte[] src = Constants.encodeASCII(\" differ\\n\");\n            byte[] dst = Constants.encodeASCII(\"foo differ\\n\");\n            Assert.IsTrue(RawParseUtils.match(dst, 3, src) == 3 + src.Length);\n        }\n\n        [Test]\n        public void testMatch_NotEqual()\n        {\n            byte[] src = Constants.encodeASCII(\" differ\\n\");\n            byte[] dst = Constants.encodeASCII(\"a differ\\n\");\n            Assert.IsTrue(RawParseUtils.match(dst, 2, src) < 0);\n        }\n\n        [Test]\n        public void testMatch_Prefix()\n        {\n            byte[] src = Constants.encodeASCII(\"author \");\n            byte[] dst = Constants.encodeASCII(\"author A. U. Thor\");\n            Assert.IsTrue(RawParseUtils.match(dst, 0, src) == src.Length);\n            Assert.IsTrue(RawParseUtils.match(dst, 1, src) < 0);\n        }\n\n        [Test]\n        public void testMatch_TooSmall()\n        {\n            byte[] src = Constants.encodeASCII(\"author \");\n            byte[] dst = Constants.encodeASCII(\"author autho\");\n            Assert.IsTrue(RawParseUtils.match(dst, src.Length + 1, src) < 0);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/RefListTest.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class RefListTest\n    {\n        private static readonly ObjectId ID = ObjectId\n            .FromString(\"41eb0d88f833b558bddeb269b7ab77399cdf98ed\");\n\n        private static readonly global::GitSharp.Core.Ref REF_A = newRef(\"A\");\n\n        private static readonly global::GitSharp.Core.Ref REF_B = newRef(\"B\");\n\n        private static readonly global::GitSharp.Core.Ref REF_c = newRef(\"c\");\n\n        [Test]\n        public void testEmpty()\n        {\n            RefList<global::GitSharp.Core.Ref> list = RefList<global::GitSharp.Core.Ref>.emptyList();\n            Assert.AreEqual(0, list.size());\n            Assert.IsTrue(list.isEmpty());\n            Assert.IsFalse(list.iterator().hasNext());\n            Assert.AreEqual(-1, list.find(\"a\"));\n            Assert.AreEqual(-1, list.find(\"z\"));\n            Assert.IsFalse(list.contains(\"a\"));\n            Assert.IsNull(list.get(\"a\"));\n            try\n            {\n                list.get(0);\n                Assert.Fail(\"RefList.emptyList should have 0 element array\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testEmptyBuilder()\n        {\n            RefList<global::GitSharp.Core.Ref> list = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>().toRefList();\n            Assert.AreEqual(0, list.size());\n            Assert.IsFalse(list.iterator().hasNext());\n            Assert.AreEqual(-1, list.find(\"a\"));\n            Assert.AreEqual(-1, list.find(\"z\"));\n            Assert.IsFalse(list.contains(\"a\"));\n            Assert.IsNull(list.get(\"a\"));\n            Assert.IsTrue(list.asList().Count == 0);\n            Assert.AreEqual(\"[]\", list.ToString());\n\n            // default array capacity should be 16, with no bounds checking.\n            Assert.IsNull(list.get(16 - 1));\n            try\n            {\n                list.get(16);\n                Assert.Fail(\"default RefList should have 16 element array\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testBuilder_AddThenSort()\n        {\n            var builder = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>(1);\n            builder.add(REF_B);\n            builder.add(REF_A);\n\n            RefList<global::GitSharp.Core.Ref> list = builder.toRefList();\n            Assert.AreEqual(2, list.size());\n            Assert.AreSame(REF_B, list.get(0));\n            Assert.AreSame(REF_A, list.get(1));\n\n            builder.sort();\n            list = builder.toRefList();\n            Assert.AreEqual(2, list.size());\n            Assert.AreSame(REF_A, list.get(0));\n            Assert.AreSame(REF_B, list.get(1));\n        }\n\n        [Test]\n        public void testBuilder_AddAll()\n        {\n            var builder = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>(1);\n            global::GitSharp.Core.Ref[] src = { REF_A, REF_B, REF_c, REF_A };\n            builder.addAll(src, 1, 2);\n\n            RefList<global::GitSharp.Core.Ref> list = builder.toRefList();\n            Assert.AreEqual(2, list.size());\n            Assert.AreSame(REF_B, list.get(0));\n            Assert.AreSame(REF_c, list.get(1));\n        }\n\n        [Test]\n        public void testBuilder_Set()\n        {\n            var builder = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>();\n            builder.add(REF_A);\n            builder.add(REF_A);\n\n            Assert.AreEqual(2, builder.size());\n            Assert.AreSame(REF_A, builder.get(0));\n            Assert.AreSame(REF_A, builder.get(1));\n\n            RefList<global::GitSharp.Core.Ref> list = builder.toRefList();\n            Assert.AreEqual(2, list.size());\n            Assert.AreSame(REF_A, list.get(0));\n            Assert.AreSame(REF_A, list.get(1));\n            builder.set(1, REF_B);\n\n            list = builder.toRefList();\n            Assert.AreEqual(2, list.size());\n            Assert.AreSame(REF_A, list.get(0));\n            Assert.AreSame(REF_B, list.get(1));\n        }\n\n        [Test]\n        public void testBuilder_Remove()\n        {\n            var builder = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>();\n            builder.add(REF_A);\n            builder.add(REF_B);\n            builder.remove(0);\n\n            Assert.AreEqual(1, builder.size());\n            Assert.AreSame(REF_B, builder.get(0));\n        }\n\n        [Test]\n        public void testSet()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_A);\n            RefList<global::GitSharp.Core.Ref> two = one.set(1, REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified\n            Assert.AreEqual(2, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_A, one.get(1));\n\n            // but two is\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n        }\n\n        [Test]\n        public void testAddToEmptyList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList();\n            RefList<global::GitSharp.Core.Ref> two = one.add(0, REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(0, one.size());\n            Assert.AreEqual(1, two.size());\n            Assert.IsFalse(two.isEmpty());\n            Assert.AreSame(REF_B, two.get(0));\n        }\n\n        [Test]\n        public void testAddToFrontOfList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A);\n            RefList<global::GitSharp.Core.Ref> two = one.add(0, REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(1, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_B, two.get(0));\n            Assert.AreSame(REF_A, two.get(1));\n        }\n\n        [Test]\n        public void testAddToEndOfList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A);\n            RefList<global::GitSharp.Core.Ref> two = one.add(1, REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(1, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n        }\n\n        [Test]\n        public void testAddToMiddleOfListByInsertionPosition()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_c);\n\n            Assert.AreEqual(-2, one.find(REF_B.Name));\n\n            RefList<global::GitSharp.Core.Ref> two = one.add(one.find(REF_B.Name), REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(2, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_c, one.get(1));\n\n            Assert.AreEqual(3, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n            Assert.AreSame(REF_c, two.get(2));\n        }\n\n        [Test]\n        public void testPutNewEntry()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.put(REF_B);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(2, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_c, one.get(1));\n\n            Assert.AreEqual(3, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n            Assert.AreSame(REF_c, two.get(2));\n        }\n\n        [Test]\n        public void testPutReplaceEntry()\n        {\n            global::GitSharp.Core.Ref otherc = newRef(REF_c.Name);\n            Assert.AreNotSame(REF_c, otherc);\n\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.put(otherc);\n            Assert.AreNotSame(one, two);\n\n            // one is not modified, but two is\n            Assert.AreEqual(2, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_c, one.get(1));\n\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(otherc, two.get(1));\n        }\n\n        [Test]\n        public void testRemoveFrontOfList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_B, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.remove(0);\n            Assert.AreNotSame(one, two);\n\n            Assert.AreEqual(3, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_B, one.get(1));\n            Assert.AreSame(REF_c, one.get(2));\n\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_B, two.get(0));\n            Assert.AreSame(REF_c, two.get(1));\n        }\n\n        [Test]\n        public void testRemoveMiddleOfList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_B, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.remove(1);\n            Assert.AreNotSame(one, two);\n\n            Assert.AreEqual(3, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_B, one.get(1));\n            Assert.AreSame(REF_c, one.get(2));\n\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_c, two.get(1));\n        }\n\n        [Test]\n        public void testRemoveEndOfList()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_B, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.remove(2);\n            Assert.AreNotSame(one, two);\n\n            Assert.AreEqual(3, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_B, one.get(1));\n            Assert.AreSame(REF_c, one.get(2));\n\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n        }\n\n        [Test]\n        public void testRemoveMakesEmpty()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A);\n            RefList<global::GitSharp.Core.Ref> two = one.remove(1);\n            Assert.AreNotSame(one, two);\n            Assert.AreSame(two, RefList<global::GitSharp.Core.Ref>.emptyList());\n        }\n\n        [Test]\n        public void testToString()\n        {\n            var exp = new StringBuilder();\n            exp.Append(\"[\");\n            exp.Append(REF_A);\n            exp.Append(\", \");\n            exp.Append(REF_B);\n            exp.Append(\"]\");\n\n            RefList<global::GitSharp.Core.Ref> list = toList(REF_A, REF_B);\n            Assert.AreEqual(exp.ToString(), list.ToString());\n        }\n\n        [Test]\n        public void testBuilder_ToString()\n        {\n            var exp = new StringBuilder();\n            exp.Append(\"[\");\n            exp.Append(REF_A);\n            exp.Append(\", \");\n            exp.Append(REF_B);\n            exp.Append(\"]\");\n\n            var list = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>();\n            list.add(REF_A);\n            list.add(REF_B);\n            Assert.AreEqual(exp.ToString(), list.ToString());\n        }\n\n        [Test]\n        public void testFindContainsGet()\n        {\n            RefList<global::GitSharp.Core.Ref> list = toList(REF_A, REF_B, REF_c);\n\n            Assert.AreEqual(0, list.find(\"A\"));\n            Assert.AreEqual(1, list.find(\"B\"));\n            Assert.AreEqual(2, list.find(\"c\"));\n\n            Assert.AreEqual(-1, list.find(\"0\"));\n            Assert.AreEqual(-2, list.find(\"AB\"));\n            Assert.AreEqual(-3, list.find(\"a\"));\n            Assert.AreEqual(-4, list.find(\"z\"));\n\n            Assert.AreSame(REF_A, list.get(\"A\"));\n            Assert.AreSame(REF_B, list.get(\"B\"));\n            Assert.AreSame(REF_c, list.get(\"c\"));\n            Assert.IsNull(list.get(\"AB\"));\n            Assert.IsNull(list.get(\"z\"));\n\n            Assert.IsTrue(list.contains(\"A\"));\n            Assert.IsTrue(list.contains(\"B\"));\n            Assert.IsTrue(list.contains(\"c\"));\n            Assert.IsFalse(list.contains(\"AB\"));\n            Assert.IsFalse(list.contains(\"z\"));\n        }\n\n        [Test]\n        public void testIterable()\n        {\n            RefList<global::GitSharp.Core.Ref> list = toList(REF_A, REF_B, REF_c);\n\n            int idx = 0;\n            foreach (global::GitSharp.Core.Ref @ref in list)\n                Assert.AreSame(list.get(idx++), @ref);\n            Assert.AreEqual(3, idx);\n\n            var i = RefList<global::GitSharp.Core.Ref>.emptyList().iterator();\n            try\n            {\n                i.next();\n                Assert.Fail(\"did not throw NoSuchElementException\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                // expected\n            }\n\n            i = list.iterator();\n            Assert.IsTrue(i.hasNext());\n            Assert.AreSame(REF_A, i.next());\n            try\n            {\n                i.remove();\n                Assert.Fail(\"did not throw UnsupportedOperationException\");\n            }\n            catch (NotSupportedException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testCopyLeadingPrefix()\n        {\n            RefList<global::GitSharp.Core.Ref> one = toList(REF_A, REF_B, REF_c);\n            RefList<global::GitSharp.Core.Ref> two = one.copy(2).toRefList();\n            Assert.AreNotSame(one, two);\n\n            Assert.AreEqual(3, one.size());\n            Assert.AreSame(REF_A, one.get(0));\n            Assert.AreSame(REF_B, one.get(1));\n            Assert.AreSame(REF_c, one.get(2));\n\n            Assert.AreEqual(2, two.size());\n            Assert.AreSame(REF_A, two.get(0));\n            Assert.AreSame(REF_B, two.get(1));\n        }\n\n        [Test]\n        public void testCopyConstructorReusesArray()\n        {\n            var one = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>();\n            one.add(REF_A);\n\n            var two = new RefList<global::GitSharp.Core.Ref>(one.toRefList());\n            one.set(0, REF_B);\n            Assert.AreSame(REF_B, two.get(0));\n        }\n\n        private static RefList<global::GitSharp.Core.Ref> toList(params global::GitSharp.Core.Ref[] refs)\n        {\n            var b = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>(refs.Length);\n            b.addAll(refs, 0, refs.Length);\n            return b.toRefList();\n        }\n\n        private static global::GitSharp.Core.Ref newRef(string name)\n        {\n            return new Unpeeled(Storage.Loose, name, ID);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/RefMapTest.cs",
    "content": "/*\n * Copyright (C) 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nusing System;\nusing System.Text;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class RefMapTest\n    {\n        private static ObjectId ID_ONE = ObjectId\n            .FromString(\"41eb0d88f833b558bddeb269b7ab77399cdf98ed\");\n\n        private static ObjectId ID_TWO = ObjectId\n            .FromString(\"698dd0b8d0c299f080559a1cffc7fe029479a408\");\n\n        private RefList<global::GitSharp.Core.Ref> packed;\n\n        private RefList<global::GitSharp.Core.Ref> loose;\n\n        private RefList<global::GitSharp.Core.Ref> resolved;\n\n        [SetUp]\n        protected void setUp()\n        {\n            packed = RefList<global::GitSharp.Core.Ref>.emptyList();\n            loose = RefList<global::GitSharp.Core.Ref>.emptyList();\n            resolved = RefList<global::GitSharp.Core.Ref>.emptyList();\n        }\n\n        [Test]\n        public void testEmpty_NoPrefix1()\n        {\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.IsTrue(map.isEmpty()); // before size was computed\n            Assert.AreEqual(0, map.size());\n            Assert.IsTrue(map.isEmpty()); // after size was computed\n\n            Assert.IsFalse(map.entrySet().iterator().hasNext());\n            Assert.IsFalse(map.keySet().iterator().hasNext());\n            Assert.IsFalse(map.containsKey(\"a\"));\n            Assert.IsNull(map.get(\"a\"));\n        }\n\n        [Test]\n        public void testEmpty_NoPrefix2()\n        {\n            RefMap map = new RefMap();\n            Assert.IsTrue(map.isEmpty()); // before size was computed\n            Assert.AreEqual(0, map.size());\n            Assert.IsTrue(map.isEmpty()); // after size was computed\n\n            Assert.IsFalse(map.entrySet().iterator().hasNext());\n            Assert.IsFalse(map.keySet().iterator().hasNext());\n            Assert.IsFalse(map.containsKey(\"a\"));\n            Assert.IsNull(map.get(\"a\"));\n        }\n\n        [Test]\n        public void testNotEmpty_NoPrefix()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            packed = toList(master);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.IsFalse(map.isEmpty()); // before size was computed\n            Assert.AreEqual(1, map.size());\n            Assert.IsFalse(map.isEmpty()); // after size was computed\n            Assert.AreSame(master, map.values().iterator().next());\n        }\n\n        [Test]\n        public void testEmpty_WithPrefix()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            packed = toList(master);\n\n            RefMap map = new RefMap(\"refs/tags/\", packed, loose, resolved);\n            Assert.IsTrue(map.isEmpty()); // before size was computed\n            Assert.AreEqual(0, map.size());\n            Assert.IsTrue(map.isEmpty()); // after size was computed\n\n            Assert.IsFalse(map.entrySet().iterator().hasNext());\n            Assert.IsFalse(map.keySet().iterator().hasNext());\n        }\n\n        [Test]\n        public void testNotEmpty_WithPrefix()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            packed = toList(master);\n\n            RefMap map = new RefMap(\"refs/heads/\", packed, loose, resolved);\n            Assert.IsFalse(map.isEmpty()); // before size was computed\n            Assert.AreEqual(1, map.size());\n            Assert.IsFalse(map.isEmpty()); // after size was computed\n            Assert.AreSame(master, map.values().iterator().next());\n        }\n\n        [Test]\n        public void testClear()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            loose = toList(master);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.AreSame(master, map.get(\"refs/heads/master\"));\n\n            map.clear();\n            Assert.IsNull(map.get(\"refs/heads/master\"));\n            Assert.IsTrue(map.isEmpty());\n            Assert.AreEqual(0, map.size());\n        }\n\n        [Test]\n        public void testIterator_RefusesRemove()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            loose = toList(master);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            IteratorBase<global::GitSharp.Core.Ref> itr = map.values().iterator();\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(master, itr.next());\n            try\n            {\n                itr.remove();\n                Assert.Fail(\"iterator allowed remove\");\n            }\n            catch (NotSupportedException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testIterator_FailsAtEnd()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            loose = toList(master);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            IteratorBase<global::GitSharp.Core.Ref> itr = map.values().iterator();\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(master, itr.next());\n            try\n            {\n                itr.next();\n                Assert.Fail(\"iterator allowed next\");\n            }\n            catch (IndexOutOfRangeException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testIterator_MissingUnresolvedSymbolicRefIsBug()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            global::GitSharp.Core.Ref headR = newRef(\"HEAD\", master);\n\n            loose = toList(master);\n            // loose should have added newRef(\"HEAD\", \"refs/heads/master\")\n            resolved = toList(headR);\n\n            var map = new RefMap(\"\", packed, loose, resolved);\n            IteratorBase<global::GitSharp.Core.Ref> itr = map.values().iterator();\n            \n            try\n            {\n                itr.hasNext();\n                Assert.Fail(\"iterator did not catch bad input\");\n            }\n            catch (InvalidOperationException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testMerge_HeadMaster()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            global::GitSharp.Core.Ref headU = newRef(\"HEAD\", \"refs/heads/master\");\n            global::GitSharp.Core.Ref headR = newRef(\"HEAD\", master);\n\n            loose = toList(headU, master);\n            resolved = toList(headR);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.AreEqual(2, map.size());\n            Assert.IsFalse(map.isEmpty());\n            Assert.IsTrue(map.containsKey(\"refs/heads/master\"));\n            Assert.AreSame(master, map.get(\"refs/heads/master\"));\n\n            // resolved overrides loose given same name\n            Assert.AreSame(headR, map.get(\"HEAD\"));\n\n            IteratorBase<global::GitSharp.Core.Ref> itr = map.values().iterator();\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(headR, itr.next());\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(master, itr.next());\n            Assert.IsFalse(itr.hasNext());\n        }\n\n        [Test]\n        public void testMerge_PackedLooseLoose()\n        {\n            global::GitSharp.Core.Ref refA = newRef(\"A\", ID_ONE);\n            global::GitSharp.Core.Ref refB_ONE = newRef(\"B\", ID_ONE);\n            global::GitSharp.Core.Ref refB_TWO = newRef(\"B\", ID_TWO);\n            global::GitSharp.Core.Ref refc = newRef(\"c\", ID_ONE);\n\n            packed = toList(refA, refB_ONE);\n            loose = toList(refB_TWO, refc);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.AreEqual(3, map.size());\n            Assert.IsFalse(map.isEmpty());\n            Assert.IsTrue(map.containsKey(refA.Name));\n            Assert.AreSame(refA, map.get(refA.Name));\n\n            // loose overrides packed given same name\n            Assert.AreSame(refB_TWO, map.get(refB_ONE.Name));\n\n            var itr = map.values().iterator();\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(refA, itr.next());\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(refB_TWO, itr.next());\n            Assert.IsTrue(itr.hasNext());\n            Assert.AreSame(refc, itr.next());\n            Assert.IsFalse(itr.hasNext());\n        }\n\n        [Test]\n        public void testMerge_WithPrefix()\n        {\n            global::GitSharp.Core.Ref a = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref b = newRef(\"refs/heads/foo/bar/B\", ID_TWO);\n            global::GitSharp.Core.Ref c = newRef(\"refs/heads/foo/rab/C\", ID_TWO);\n            global::GitSharp.Core.Ref g = newRef(\"refs/heads/g\", ID_ONE);\n            packed = toList(a, b, c, g);\n\n            RefMap map = new RefMap(\"refs/heads/foo/\", packed, loose, resolved);\n            Assert.AreEqual(2, map.size());\n\n            Assert.AreSame(b, map.get(\"bar/B\"));\n            Assert.AreSame(c, map.get(\"rab/C\"));\n            Assert.IsNull(map.get(\"refs/heads/foo/bar/B\"));\n            Assert.IsNull(map.get(\"refs/heads/A\"));\n\n            Assert.IsTrue(map.containsKey(\"bar/B\"));\n            Assert.IsTrue(map.containsKey(\"rab/C\"));\n            Assert.IsFalse(map.containsKey(\"refs/heads/foo/bar/B\"));\n            Assert.IsFalse(map.containsKey(\"refs/heads/A\"));\n\n            IteratorBase<RefMap.Ent> itr = map.entrySet().iterator();\n            RefMap.Ent ent;\n            Assert.IsTrue(itr.hasNext());\n            ent = itr.next();\n            Assert.AreEqual(\"bar/B\", ent.getKey());\n            Assert.AreSame(b, ent.getValue());\n            Assert.IsTrue(itr.hasNext());\n            ent = itr.next();\n            Assert.AreEqual(\"rab/C\", ent.getKey());\n            Assert.AreSame(c, ent.getValue());\n            Assert.IsFalse(itr.hasNext());\n        }\n\n        [Test]\n        public void testPut_KeyMustMatchName_NoPrefix()\n        {\n            global::GitSharp.Core.Ref refA = newRef(\"refs/heads/A\", ID_ONE);\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            try\n            {\n                map.put(\"FOO\", refA);\n                Assert.Fail(\"map accepted invalid key/value pair\");\n            }\n            catch (ArgumentException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testPut_KeyMustMatchName_WithPrefix()\n        {\n            global::GitSharp.Core.Ref refA = newRef(\"refs/heads/A\", ID_ONE);\n            RefMap map = new RefMap(\"refs/heads/\", packed, loose, resolved);\n            try\n            {\n                map.put(\"FOO\", refA);\n                Assert.Fail(\"map accepted invalid key/value pair\");\n            }\n            catch (ArgumentException)\n            {\n                // expected\n            }\n        }\n\n        [Test]\n        public void testPut_NoPrefix()\n        {\n            global::GitSharp.Core.Ref refA_one = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref refA_two = newRef(\"refs/heads/A\", ID_TWO);\n\n            packed = toList(refA_one);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.AreSame(refA_one, map.get(refA_one.Name));\n            Assert.AreSame(refA_one, map.put(refA_one.Name, refA_two));\n\n            // map changed, but packed, loose did not\n            Assert.AreSame(refA_two, map.get(refA_one.Name));\n            Assert.AreSame(refA_one, packed.get(0));\n            Assert.AreEqual(0, loose.size());\n\n            Assert.AreSame(refA_two, map.put(refA_one.Name, refA_one));\n            Assert.AreSame(refA_one, map.get(refA_one.Name));\n        }\n\n        [Test]\n        public void testPut_WithPrefix()\n        {\n            global::GitSharp.Core.Ref refA_one = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref refA_two = newRef(\"refs/heads/A\", ID_TWO);\n\n            packed = toList(refA_one);\n\n            RefMap map = new RefMap(\"refs/heads/\", packed, loose, resolved);\n            Assert.AreSame(refA_one, map.get(\"A\"));\n            Assert.AreSame(refA_one, map.put(\"A\", refA_two));\n\n            // map changed, but packed, loose did not\n            Assert.AreSame(refA_two, map.get(\"A\"));\n            Assert.AreSame(refA_one, packed.get(0));\n            Assert.AreEqual(0, loose.size());\n\n            Assert.AreSame(refA_two, map.put(\"A\", refA_one));\n            Assert.AreSame(refA_one, map.get(\"A\"));\n        }\n\n        [Test]\n        public void testPut_CollapseResolved()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            global::GitSharp.Core.Ref headU = newRef(\"HEAD\", \"refs/heads/master\");\n            global::GitSharp.Core.Ref headR = newRef(\"HEAD\", master);\n            global::GitSharp.Core.Ref a = newRef(\"refs/heads/A\", ID_ONE);\n\n            loose = toList(headU, master);\n            resolved = toList(headR);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.IsNull(map.put(a.getName(), a));\n            Assert.AreSame(a, map.get(a.getName()));\n            Assert.AreSame(headR, map.get(\"HEAD\"));\n        }\n\n        [Test]\n        public void testRemove()\n        {\n            global::GitSharp.Core.Ref master = newRef(\"refs/heads/master\", ID_ONE);\n            global::GitSharp.Core.Ref headU = newRef(\"HEAD\", \"refs/heads/master\");\n            global::GitSharp.Core.Ref headR = newRef(\"HEAD\", master);\n\n            packed = toList(master);\n            loose = toList(headU, master);\n            resolved = toList(headR);\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.IsNull(map.remove(\"not.a.reference\"));\n\n            Assert.AreSame(master, map.remove(\"refs/heads/master\"));\n            Assert.IsNull(map.get(\"refs/heads/master\"));\n\n            Assert.AreSame(headR, map.remove(\"HEAD\"));\n            Assert.IsNull(map.get(\"HEAD\"));\n\n            Assert.IsTrue(map.isEmpty());\n        }\n\n        [Test]\n        public void testToString_NoPrefix()\n        {\n            global::GitSharp.Core.Ref a = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref b = newRef(\"refs/heads/B\", ID_TWO);\n\n            packed = toList(a, b);\n\n            StringBuilder exp = new StringBuilder();\n            exp.Append(\"[\");\n            exp.Append(a.ToString());\n            exp.Append(\", \");\n            exp.Append(b.ToString());\n            exp.Append(\"]\");\n\n            RefMap map = new RefMap(\"\", packed, loose, resolved);\n            Assert.AreEqual(exp.ToString(), map.ToString());\n        }\n\n        [Test]\n        public void testToString_WithPrefix()\n        {\n            global::GitSharp.Core.Ref a = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref b = newRef(\"refs/heads/foo/B\", ID_TWO);\n            global::GitSharp.Core.Ref c = newRef(\"refs/heads/foo/C\", ID_TWO);\n            global::GitSharp.Core.Ref g = newRef(\"refs/heads/g\", ID_ONE);\n\n            packed = toList(a, b, c, g);\n\n            StringBuilder exp = new StringBuilder();\n            exp.Append(\"[\");\n            exp.Append(b.ToString());\n            exp.Append(\", \");\n            exp.Append(c.ToString());\n            exp.Append(\"]\");\n\n            RefMap map = new RefMap(\"refs/heads/foo/\", packed, loose, resolved);\n            Assert.AreEqual(exp.ToString(), map.ToString());\n        }\n\n        [Test]\n        public void testEntryType()\n        {\n            global::GitSharp.Core.Ref a = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref b = newRef(\"refs/heads/B\", ID_TWO);\n\n            packed = toList(a, b);\n\n            RefMap map = new RefMap(\"refs/heads/\", packed, loose, resolved);\n            IteratorBase<RefMap.Ent> itr = map.entrySet().iterator();\n            RefMap.Ent ent_a = itr.next();\n            RefMap.Ent ent_b = itr.next();\n\n            Assert.AreEqual(ent_a.GetHashCode(), \"A\".GetHashCode());\n            Assert.IsTrue(ent_a.Equals(ent_a));\n            Assert.IsFalse(ent_a.Equals(ent_b));\n\n            Assert.AreEqual(a.ToString(), ent_a.ToString());\n        }\n\n        [Test]\n        public void testEntryTypeSet()\n        {\n            global::GitSharp.Core.Ref refA_one = newRef(\"refs/heads/A\", ID_ONE);\n            global::GitSharp.Core.Ref refA_two = newRef(\"refs/heads/A\", ID_TWO);\n\n            packed = toList(refA_one);\n\n            RefMap map = new RefMap(\"refs/heads/\", packed, loose, resolved);\n            Assert.AreSame(refA_one, map.get(\"A\"));\n\n            RefMap.Ent ent = map.entrySet().iterator().next();\n            Assert.AreEqual(\"A\", ent.getKey());\n            Assert.AreSame(refA_one, ent.getValue());\n\n            Assert.AreSame(refA_one, ent.setValue(refA_two));\n            Assert.AreSame(refA_two, ent.getValue());\n            Assert.AreSame(refA_two, map.get(\"A\"));\n            Assert.AreEqual(1, map.size());\n        }\n\n        private RefList<global::GitSharp.Core.Ref> toList(params global::GitSharp.Core.Ref[] refs)\n        {\n            var b = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>(refs.Length);\n            b.addAll(refs, 0, refs.Length);\n            return b.toRefList();\n        }\n\n        private static global::GitSharp.Core.Ref newRef(String name, String dst)\n        {\n            return newRef(name,\n                    new Unpeeled(Storage.New, dst, null));\n        }\n\n        private static global::GitSharp.Core.Ref newRef(String name, global::GitSharp.Core.Ref dst)\n        {\n            return new SymbolicRef(name, dst);\n        }\n\n        private static global::GitSharp.Core.Ref newRef(String name, ObjectId id)\n        {\n            return new Unpeeled(Storage.Loose, name, id);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/Sha1MessageDigestTest.cs",
    "content": "﻿using System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class Sha1MessageDigestTest\n    {\n        [Test]\n        public void EmptyString()\n        {\n            var expected = new byte[] { 256 - 38, 57, 256 - 93, 256 - 18, 94, 107, 75, 13, 50, 85, 256 - 65, 256 - 17, 256 - 107, 96, 24, 256 - 112, 256 - 81, 256 - 40, 7, 9 };\n\n            MessageDigest md = CreateSUT();\n\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(20, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void ShortStringOneUpdate()\n        {\n            var expected = new byte[] { 48, 15, 76, 31, 256 - 27, 18, 256 - 16, 66, 256 - 67, 256 - 20, 8, 70, 256 - 23, 114, 104, 256 - 49, 113, 97, 55, 256 - 65 };\n\n            MessageDigest md = CreateSUT();\n\n            md.Update(\"nulltoken\".getBytes());\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(20, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void ShortStringTwoUpdates()\n        {\n            var expected = new byte[] { 48, 15, 76, 31, 256 - 27, 18, 256 - 16, 66, 256 - 67, 256 - 20, 8, 70, 256 - 23, 114, 104, 256 - 49, 113, 97, 55, 256 - 65 };\n\n            MessageDigest md = CreateSUT();\n\n            md.Update(\"null\".getBytes());\n            md.Update(\"token\".getBytes());\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(20, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void LongStringOneUpdate()\n        {\n            var expected = new byte[] { 256 - 25, 115, 256 - 78, 84, 256 - 32, 116, 38, 256 - 76, 256 - 96, 85, 256 - 69, 256 - 88, 89, 256 - 81, 256 - 41, 35, 256 - 99, 39, 256 - 52, 86 };\n\n            MessageDigest md = CreateSUT();\n\n            var sb = new StringBuilder();\n            for (int i = 0; i < 20; i++)\n            {\n                sb.Append(\"nulltoken\");\n            }\n            md.Update(sb.ToString().getBytes());\n\n            byte[] result = md.Digest();\n\n            Assert.AreEqual(20, result.Length);\n            Assert.IsTrue(expected.SequenceEqual(result));\n        }\n\n        [Test]\n        public void BlowTheHeap()\n        {\n            Assert.DoesNotThrow(() =>\n            {\n                MessageDigest md = CreateSUT();\n                var bytes = new byte[10000];\n                for (int i = 0; i < 100000; i++)\n                {\n                    md.Update(bytes);\n                }\n            });\n        }\n\n        private static MessageDigest CreateSUT()\n        {\n            return MessageDigest.getInstance(\"SHA-1\");\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/StringExtensionsFixture.cs",
    "content": "﻿using System;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class StringExtensionsFixture\n    {\n        [Test]\n        public void GetBytesShouldNotGenerateABOMWhenWorkingInUTF8()\n        {\n            string filePath = Path.GetTempFileName();\n\n            File.WriteAllBytes(filePath, \"a\".getBytes(\"UTF-8\"));\n\n            Assert.AreEqual(1, new FileInfo(filePath).Length);\n        }\n\n        [Test]\n        public void GetBytesShouldThrowIfPassedAnUnknownEncodingAlias()\n        {\n            AssertHelper.Throws<ArgumentException>(() => \"a\".getBytes(\"Dummy\"));\n        }\n\n        [Test]\n        public void SliceShouldReturnExpectedResult()\n        {\n            Assert.AreEqual(\"urge\", \"hamburger\".Slice(4, 8));\n            Assert.AreEqual(\"mile\", \"smiles\".Slice(1, 5));\n        }\n\n        [Test]\n        public void SliceShouldThrowIfBeginIndexIsNegative()\n        {\n            AssertHelper.Throws<ArgumentOutOfRangeException>(() => \"hamburger\".Slice(-1, 8));\n        }\n\n        [Test]\n        public void SliceShouldThrowIfEndIndexIsGreaterThanTheLengthOfTheString()\n        {\n            AssertHelper.Throws<ArgumentOutOfRangeException>(() => \"hamburger\".Slice(4, 42));\n        }\n\n        [Test]\n        public void SliceShouldThrowIfBeginIndexIsGreaterThanEndIndex()\n        {\n            AssertHelper.Throws<ArgumentOutOfRangeException>(() => \"hamburger\".Slice(8, 4));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_1()\n        {\n            Assert.AreEqual(-1, \"\".compareTo(\"a\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_2()\n        {\n            Assert.AreEqual(-2, \"\".compareTo(\"aa\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_3()\n        {\n            Assert.AreEqual(1, \"a\".compareTo(\"\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_4()\n        {\n            Assert.AreEqual(2, \"aa\".compareTo(\"\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_5()\n        {\n            Assert.AreEqual(2, \"bb\".compareTo(\"\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_6()\n        {\n            Assert.AreEqual(-1, \"AB\".compareTo(\"B\"));\n        }\n\n        [Test]\n        public void DifferentLength_compareTo_7()\n        {\n            Assert.AreEqual(1, \"B\".compareTo(\"AB\"));\n        }\n\n        [Test]\n        public void SameLength_compareTo_1()\n        {\n            Assert.AreEqual(0, \"A\".compareTo(\"A\"));\n        }\n        [Test]\n        public void SameLength_compareTo_2()\n        {\n            Assert.AreEqual(32, \"a\".compareTo(\"A\"));\n        }\n        [Test]\n        public void SameLength_compareTo_3()\n        {\n            Assert.AreEqual(-32, \"A\".compareTo(\"a\"));\n        }\n\n        [Test]\n        public void SameLength_compareTo_4()\n        {\n            Assert.AreEqual(32, \"aaa\".compareTo(\"aaA\"));\n        }\n        [Test]\n        public void SameLength_compareTo_5()\n        {\n            Assert.AreEqual(-32, \"aaA\".compareTo(\"aaa\"));\n        }\n\n        [Test]\n        public void SameLength_compareTo_6()\n        {\n            Assert.AreEqual(32, \"aaaa\".compareTo(\"aaAB\"));\n        }\n        [Test]\n        public void SameLength_compareTo_7()\n        {\n            Assert.AreEqual(31, \"aaAb\".compareTo(\"aaAC\"));\n        }\n        [Test]\n        public void SameLength_compareTo_8()\n        {\n            Assert.AreEqual(2, \"aaCb\".compareTo(\"aaAa\"));\n        }\n\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/StringUtilsTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests.Util\n{\n\n    [TestFixture]\n    public class StringUtilsTest\n    {\n        \n        [Test]\n        public void testToLowerCaseChar()\n        {\n            Assert.AreEqual('a', StringUtils.toLowerCase('A'));\n            Assert.AreEqual('z', StringUtils.toLowerCase('Z'));\n\n            Assert.AreEqual('a', StringUtils.toLowerCase('a'));\n            Assert.AreEqual('z', StringUtils.toLowerCase('z'));\n\n            Assert.AreEqual((char)0, StringUtils.toLowerCase((char)0));\n            Assert.AreEqual((char)0xffff, StringUtils.toLowerCase((char)0xffff));\n        }\n\n        [Test]\n        public void testToLowerCaseString()\n        {\n            Assert.AreEqual(\"\\n abcdefghijklmnopqrstuvwxyz\\n\", StringUtils.toLowerCase(\"\\n ABCDEFGHIJKLMNOPQRSTUVWXYZ\\n\"));\n        }\n\n        [Test]\n        public void testEqualsIgnoreCase1()\n        {\n            const string a = \"FOO\";\n            Assert.IsTrue(StringUtils.equalsIgnoreCase(a, a));\n        }\n\n        [Test]\n        public void testEqualsIgnoreCase2()\n        {\n            Assert.IsFalse(StringUtils.equalsIgnoreCase(\"a\", \"\"));\n        }\n\n        [Test]\n        public void testEqualsIgnoreCase3()\n        {\n            Assert.IsFalse(StringUtils.equalsIgnoreCase(\"a\", \"b\"));\n            Assert.IsFalse(StringUtils.equalsIgnoreCase(\"ac\", \"ab\"));\n        }\n        [Test]\n        public void testEqualsIgnoreCase4()\n        {\n            Assert.IsTrue(StringUtils.equalsIgnoreCase(\"a\", \"a\"));\n            Assert.IsTrue(StringUtils.equalsIgnoreCase(\"A\", \"a\"));\n            Assert.IsTrue(StringUtils.equalsIgnoreCase(\"a\", \"A\"));\n        }\n\n    }\n\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/TemporaryBufferTest.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing GitSharp.Core.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing System.IO;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class TemporaryBufferTest\n    {\n        private string getName()\n        {\n            return this.ToString();\n        }\n\n        [Test]\n        public void testEmpty()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            try\n            {\n                b.close();\n                Assert.AreEqual(0, b.Length);\n                byte[] r = b.ToArray();\n                Assert.IsNotNull(r);\n                Assert.AreEqual(0, r.Length);\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testOneByte()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte test = (byte)new TestRng(getName()).nextInt();\n            try\n            {\n                b.write(test);\n                b.close();\n                Assert.AreEqual(1, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(1, r.Length);\n                    Assert.AreEqual(test, r[0]);\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(1, r.Length);\n                    Assert.AreEqual(test, r[0]);\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testOneBlock_BulkWrite()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(Block.SZ);\n            try\n            {\n                b.write(test, 0, 2);\n                b.write(test, 2, 4);\n                b.write(test, 6, test.Length - 6 - 2);\n                b.write(test, test.Length - 2, 2);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testOneBlockAndHalf_BulkWrite()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName()).nextBytes(Block.SZ * 3 / 2);\n            try\n            {\n                b.write(test, 0, 2);\n                b.write(test, 2, 4);\n                b.write(test, 6, test.Length - 6 - 2);\n                b.write(test, test.Length - 2, 2);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testOneBlockAndHalf_SingleWrite()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(Block.SZ * 3 / 2);\n            try\n            {\n                for (int i = 0; i < test.Length; i++)\n                    b.write(test[i]);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testOneBlockAndHalf_Copy()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(Block.SZ * 3 / 2);\n            try\n            {\n                var @in = new MemoryStream(test);\n                // [caytchen] StreamReader buffers data After the very first Read, thus advancing the Position in the underlying stream - causing this test to fail\n                //var inReader = new StreamReader(@in);\n                b.write(@in.ReadByte());\n                b.copy(@in);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testLarge_SingleWrite()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName()).nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 3);\n            try\n            {\n                b.write(test);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testInCoreLimit_SwitchOnAppendByte()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT + 1);\n            try\n            {\n                b.write(test, 0, test.Length - 1);\n                b.write(test[test.Length - 1]);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testInCoreLimit_SwitchBeforeAppendByte()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 3);\n            try\n            {\n                b.write(test, 0, test.Length - 1);\n                b.write(test[test.Length - 1]);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testInCoreLimit_SwitchOnCopy()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            byte[] test = new TestRng(getName())\n                   .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2);\n            try\n            {\n                MemoryStream @in = new MemoryStream(test,\n                       TemporaryBuffer.DEFAULT_IN_CORE_LIMIT, test.Length\n                               - TemporaryBuffer.DEFAULT_IN_CORE_LIMIT);\n                b.write(test, 0, TemporaryBuffer.DEFAULT_IN_CORE_LIMIT);\n                b.copy(@in);\n                b.close();\n                Assert.AreEqual(test.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(test.Length, r.Length);\n                    Assert.IsTrue(test.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testDestroyWhileOpen()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            try\n            {\n                b.write(new TestRng(getName())\n                        .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2));\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testRandomWrites()\n        {\n            TemporaryBuffer b = new LocalFileBuffer();\n            TestRng rng = new TestRng(getName());\n            int max = TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2;\n            byte[] expect = new byte[max];\n            try\n            {\n                int written = 0;\n                bool onebyte = true;\n                while (written < max)\n                {\n                    if (onebyte)\n                    {\n                        byte v = (byte)rng.nextInt();\n                        b.write(v);\n                        expect[written++] = v;\n                    }\n                    else\n                    {\n                        int len = Math.Min(rng.nextInt() & 127, max - written);\n                        byte[] tmp = rng.nextBytes(len);\n                        b.write(tmp, 0, len);\n                        Array.Copy(tmp, 0, expect, written, len);\n                        written += len;\n                    }\n                    onebyte = !onebyte;\n                }\n                Assert.AreEqual(expect.Length, written);\n                b.close();\n\n                Assert.AreEqual(expect.Length, b.Length);\n                {\n                    byte[] r = b.ToArray();\n                    Assert.IsNotNull(r);\n                    Assert.AreEqual(expect.Length, r.Length);\n                    Assert.IsTrue(expect.SequenceEqual(r));\n                }\n                {\n                    byte[] r;\n                    using (MemoryStream o = new MemoryStream())\n                    {\n                        b.writeTo(o, null);\n                        r = o.ToArray();\n                    }\n                    Assert.AreEqual(expect.Length, r.Length);\n                    Assert.IsTrue(expect.SequenceEqual(r));\n                }\n            }\n            finally\n            {\n                b.destroy();\n            }\n        }\n\n        [Test]\n        public void testHeap()\n        {\n            using (TemporaryBuffer b = new HeapBuffer(2 * 8 * 1024))\n            {\n                byte[] r = new byte[8*1024];\n                b.write(r);\n                b.write(r);\n\n                var e = AssertHelper.Throws<IOException>(() => b.write(1), \"accepted too many bytes of data\");\n                Assert.AreEqual(\"In-memory buffer limit exceeded\", e.Message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/TestRepository.cs",
    "content": "/*\n * Copyright (C) 2009, 2010, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from this\n * software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n\n/* Wrapper to make creating test data easier. */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.DirectoryCache;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.RevWalk;\nusing GitSharp.Core.TreeWalk;\nusing GitSharp.Core.TreeWalk.Filter;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\nusing FileMode = GitSharp.Core.FileMode;\nusing CoreRevWalk = GitSharp.Core.RevWalk.RevWalk;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    public class TestRepository\n    {\n        private static PersonIdent author;\n\n        private static PersonIdent committer;\n\n        static TestRepository()\n        {\n            MockSystemReader m = new MockSystemReader();\n            long now = m.getCurrentTime();\n            int tz = m.getTimezone(now);\n\n            String an = \"J. Author\";\n            String ae = \"jauthor@example.com\";\n            author = new PersonIdent(an, ae, now, tz);\n\n            String cn = \"J. Committer\";\n            String ce = \"jcommitter@example.com\";\n            committer = new PersonIdent(cn, ce, now, tz);\n        }\n\n        private global::GitSharp.Core.Repository db;\n\n        private CoreRevWalk pool;\n\n        private ObjectWriter writer;\n\n        private long now;\n\n        /**\n     * Wrap a repository with test building tools.\n     *\n     * @param db\n     *            the test repository to write into.\n     * @throws Exception\n     */\n        public TestRepository(global::GitSharp.Core.Repository db)\n            : this(db, new CoreRevWalk(db))\n        {\n        }\n\n        /**\n     * Wrap a repository with test building tools.\n     *\n     * @param db\n     *            the test repository to write into.\n     * @param rw\n     *            the RevObject pool to use for object lookup.\n     * @throws Exception\n     */\n        public TestRepository(global::GitSharp.Core.Repository db, CoreRevWalk rw)\n        {\n            this.db = db;\n            this.pool = rw;\n            this.writer = new ObjectWriter(db);\n            this.now = 1236977987000L;\n        }\n\n        /** @return the repository this helper class operates against. */\n        public global::GitSharp.Core.Repository getRepository()\n        {\n            return db;\n        }\n\n        /** @return get the RevWalk pool all objects are allocated through. */\n        public CoreRevWalk getRevWalk()\n        {\n            return pool;\n        }\n\n        /** @return current time adjusted by {@link #tick(int)}. */\n        public DateTime getClock()\n        {\n            return now.MillisToUtcDateTime();\n        }\n\n        /**\n     * Adjust the current time that will used by the next commit.\n     *\n     * @param secDelta\n     *            number of seconds to add to the current time.\n     */\n        public void tick(int secDelta)\n        {\n            now += secDelta * 1000L;\n        }\n\n        /**\n     * Create a new blob object in the repository.\n     *\n     * @param content\n     *            file content, will be UTF-8 encoded.\n     * @return reference to the blob.\n     * @throws Exception\n     */\n        public RevBlob blob(String content)\n        {\n            return blob(content.getBytes(\"UTF-8\"));\n        }\n\n        /**\n     * Create a new blob object in the repository.\n     *\n     * @param content\n     *            binary file content.\n     * @return reference to the blob.\n     * @throws Exception\n     */\n        public RevBlob blob(byte[] content)\n        {\n            return pool.lookupBlob(writer.WriteBlob(content));\n        }\n\n        /**\n     * Construct a regular file mode tree entry.\n     *\n     * @param path\n     *            path of the file.\n     * @param blob\n     *            a blob, previously constructed in the repository.\n     * @return the entry.\n     * @throws Exception\n     */\n        public DirCacheEntry file(String path, RevBlob blob)\n        {\n            DirCacheEntry e = new DirCacheEntry(path);\n            e.setFileMode(FileMode.RegularFile);\n            e.setObjectId(blob);\n            return e;\n        }\n\n        /**\n     * Construct a tree from a specific listing of file entries.\n     *\n     * @param entries\n     *            the files to include in the tree. The collection does not need\n     *            to be sorted properly and may be empty.\n     * @return reference to the tree specified by the entry list.\n     * @throws Exception\n     */\n        public RevTree tree(params DirCacheEntry[] entries)\n        {\n            DirCache dc = DirCache.newInCore();\n            DirCacheBuilder b = dc.builder();\n            foreach (DirCacheEntry e in entries)\n                b.add(e);\n            b.finish();\n            return pool.lookupTree(dc.writeTree(writer));\n        }\n\n        /**\n     * Lookup an entry stored in a tree, failing if not present.\n     *\n     * @param tree\n     *            the tree to search.\n     * @param path\n     *            the path to find the entry of.\n     * @return the parsed object entry at this path, never null.\n     * @throws AssertionFailedError\n     *             if the path does not exist in the given tree.\n     * @throws Exception\n     */\n        public RevObject get(RevTree tree, String path)\n        {\n            TreeWalk tw = new TreeWalk(db);\n            tw.setFilter(PathFilterGroup.createFromStrings(new[] { path }));\n            tw.reset(tree);\n            while (tw.next())\n            {\n                if (tw.isSubtree() && !path.Equals(tw.getPathString()))\n                {\n                    tw.enterSubtree();\n                    continue;\n                }\n                ObjectId entid = tw.getObjectId(0);\n                FileMode entmode = tw.getFileMode(0);\n                return pool.lookupAny(entid, (int)entmode.ObjectType);\n            }\n            Assert.Fail(\"Can't find \" + path + \" in tree \" + tree.Name);\n            return null; // never reached.\n        }\n\n        /*\n     * Create a new commit.\n     * <p>\n     * See {@link #commit(int, RevTree, RevCommit...)}. The tree is the empty\n     * tree (no files or subdirectories).\n     *\n     * @param parents\n     *            zero or more parents of the commit.\n     * @return the new commit.\n     * @throws Exception\n     */\n        public RevCommit commit(params RevCommit[] parents)\n        {\n            return commit(1, tree(), parents);\n        }\n\n        /*\n     * Create a new commit.\n     * <p>\n     * See {@link #commit(int, RevTree, RevCommit...)}.\n     *\n     * @param tree\n     *            the root tree for the commit.\n     * @param parents\n     *            zero or more parents of the commit.\n     * @return the new commit.\n     * @throws Exception\n     */\n        public RevCommit commit(RevTree tree, params RevCommit[] parents)\n        {\n            return commit(1, tree, parents);\n        }\n\n        /*\n     * Create a new commit.\n     * <p>\n     * See {@link #commit(int, RevTree, RevCommit...)}. The tree is the empty\n     * tree (no files or subdirectories).\n     *\n     * @param secDelta\n     *            number of seconds to advance {@link #tick(int)} by.\n     * @param parents\n     *            zero or more parents of the commit.\n     * @return the new commit.\n     * @throws Exception\n     */\n        public RevCommit commit(int secDelta, params RevCommit[] parents)\n        {\n            return commit(secDelta, tree(), parents);\n        }\n\n        /*\n     * Create a new commit.\n     * <p>\n     * The author and committer identities are stored using the current\n     * timestamp, after being incremented by {@code secDelta}. The message body\n     * is empty.\n     *\n     * @param secDelta\n     *            number of seconds to advance {@link #tick(int)} by.\n     * @param tree\n     *            the root tree for the commit.\n     * @param parents\n     *            zero or more parents of the commit.\n     * @return the new commit.\n     * @throws Exception\n     */\n        public RevCommit commit(int secDelta, RevTree tree,\n                                params RevCommit[] parents)\n        {\n            tick(secDelta);\n\n            global::GitSharp.Core.Commit c = new global::GitSharp.Core.Commit(db);\n            c.TreeId = (tree);\n            c.ParentIds = (parents);\n            c.Author = (new PersonIdent(author, now.MillisToUtcDateTime()));\n            c.Committer = (new PersonIdent(committer, now.MillisToUtcDateTime()));\n            c.Message = (\"\");\n            return pool.lookupCommit(writer.WriteCommit(c));\n        }\n\n        /* @return a new commit builder. */\n        public CommitBuilder commit()\n        {\n            return new CommitBuilder(this);\n        }\n\n        /*\n     * Construct an annotated tag object pointing at another object.\n     * <p>\n     * The tagger is the committer identity, at the current time as specified by\n     * {@link #tick(int)}. The time is not increased.\n     * <p>\n     * The tag message is empty.\n     *\n     * @param name\n     *            name of the tag. Traditionally a tag name should not start\n     *            with {@code refs/tags/}.\n     * @param dst\n     *            object the tag should be pointed at.\n     * @return the annotated tag object.\n     * @throws Exception\n     */\n        public RevTag tag(String name, RevObject dst)\n        {\n            global::GitSharp.Core.Tag t = new global::GitSharp.Core.Tag(db);\n            t.TagType = (Constants.typeString(dst.Type));\n            t.Id = (dst.ToObjectId());\n            t.TagName = (name);\n            t.Tagger = (new PersonIdent(committer, now.MillisToUtcDateTime()));\n            t.Message = (\"\");\n            return (RevTag)pool.lookupAny(writer.WriteTag(t), Constants.OBJ_TAG);\n        }\n\n        /**\n     * Update a reference to point to an object.\n     *\n     * @param ref\n     *            the name of the reference to update to. If {@code ref} does\n     *            not start with {@code refs/} and is not the magic names\n     *            {@code HEAD} {@code FETCH_HEAD} or {@code MERGE_HEAD}, then\n     *            {@code refs/heads/} will be prefixed in front of the given\n     *            name, thereby assuming it is a branch.\n     * @param to\n     *            the target object.\n     * @return the target object.\n     * @throws Exception\n     */\n        public RevCommit update(String @ref, CommitBuilder to)\n        {\n            return update(@ref, to.create());\n        }\n\n        /*\n     * Update a reference to point to an object.\n     *\n     * @param <T>\n     *            type of the target object.\n     * @param ref\n     *            the name of the reference to update to. If {@code ref} does\n     *            not start with {@code refs/} and is not the magic names\n     *            {@code HEAD} {@code FETCH_HEAD} or {@code MERGE_HEAD}, then\n     *            {@code refs/heads/} will be prefixed in front of the given\n     *            name, thereby assuming it is a branch.\n     * @param obj\n     *            the target object.\n     * @return the target object.\n     * @throws Exception\n     */\n        public T update<T>(String @ref, T obj) where T : ObjectId\n        {\n            if (Constants.HEAD.Equals(@ref))\n            {\n            }\n            else if (\"FETCH_HEAD\".Equals(@ref))\n            {\n            }\n            else if (\"MERGE_HEAD\".Equals(@ref))\n            {\n            }\n            else if (@ref.StartsWith(Constants.R_REFS))\n            {\n            }\n            else\n                @ref = Constants.R_HEADS + @ref;\n\n            RefUpdate u = db.UpdateRef(@ref);\n            u.NewObjectId = (obj);\n            switch (u.forceUpdate())\n            {\n                case RefUpdate.RefUpdateResult.FAST_FORWARD:\n                case RefUpdate.RefUpdateResult.FORCED:\n                case RefUpdate.RefUpdateResult.NEW:\n                case RefUpdate.RefUpdateResult.NO_CHANGE:\n                    updateServerInfo();\n                    return obj;\n\n                default:\n                    throw new IOException(\"Cannot write \" + @ref + \" \" + u.Result);\n            }\n        }\n\n        public class MockRefWriter : RefWriter\n        {\n            private readonly global::GitSharp.Core.Repository _db;\n\n            public MockRefWriter(global::GitSharp.Core.Repository db, IEnumerable<global::GitSharp.Core.Ref> refs)\n                : base(refs)\n            {\n                _db = db;\n            }\n\n            protected override void writeFile(string file, byte[] content)\n            {\n                FileInfo p = PathUtil.CombineFilePath(_db.Directory, file);\n                LockFile lck = new LockFile(p);\n                if (!lck.Lock())\n                    throw new ObjectWritingException(\"Can't write \" + p);\n                try\n                {\n                    lck.Write(content);\n                }\n                catch (IOException)\n                {\n                    throw new ObjectWritingException(\"Can't write \" + p);\n                }\n                if (!lck.Commit())\n                    throw new ObjectWritingException(\"Can't write \" + p);\n            }\n        }\n\n        /*\n     * Update the dumb client server info files.\n     *\n     * @throws Exception\n     */\n        public void updateServerInfo()\n        {\n            if (db.ObjectDatabase is ObjectDirectory)\n            {\n                RefWriter rw = new MockRefWriter(db, db.getAllRefs().Values);\n                rw.writePackedRefs();\n                rw.writeInfoRefs();\n            }\n        }\n\n        /*\n     * Ensure the body of the given object has been parsed.\n     *\n     * @param <T>\n     *            type of object, e.g. {@link RevTag} or {@link RevCommit}.\n     * @param object\n     *            reference to the (possibly unparsed) object to force body\n     *            parsing of.\n     * @return {@code object}\n     * @throws Exception\n     */\n        public T parseBody<T>(T @object) where T : RevObject\n        {\n            pool.parseBody(@object);\n            return @object;\n        }\n\n        /*\n     * Create a new branch builder for this repository.\n     *\n     * @param ref\n     *            name of the branch to be constructed. If {@code ref} does not\n     *            start with {@code refs/} the prefix {@code refs/heads/} will\n     *            be added.\n     * @return builder for the named branch.\n     */\n        public BranchBuilder branch(String @ref)\n        {\n            if (Constants.HEAD.Equals(@ref))\n            {\n            }\n            else if (@ref.StartsWith(Constants.R_REFS))\n            {\n            }\n            else\n                @ref = Constants.R_HEADS + @ref;\n            return new BranchBuilder(this, @ref);\n        }\n\n        /** Helper to build a branch with one or more commits */\n        public class BranchBuilder\n        {\n            private readonly TestRepository _testRepository;\n            public String @ref;\n\n            public BranchBuilder(TestRepository testRepository, String @ref)\n            {\n                _testRepository = testRepository;\n                this.@ref = @ref;\n            }\n\n            /**\n         * @return construct a new commit builder that updates this branch. If\n         *         the branch already exists, the commit builder will have its\n         *         first parent as the current commit and its tree will be\n         *         initialized to the current files.\n         * @throws Exception\n         *             the commit builder can't read the current branch state\n         */\n            public CommitBuilder commit()\n            {\n                return new CommitBuilder(_testRepository);\n            }\n\n            /**\n         * Forcefully update this branch to a particular commit.\n         *\n         * @param to\n         *            the commit to update to.\n         * @return {@code to}.\n         * @throws Exception\n         */\n            public RevCommit update(CommitBuilder to)\n            {\n                return update(to.create());\n            }\n\n            /**\n         * Forcefully update this branch to a particular commit.\n         *\n         * @param to\n         *            the commit to update to.\n         * @return {@code to}.\n         * @throws Exception\n         */\n            public RevCommit update(RevCommit to)\n            {\n                return _testRepository.update(@ref, to);\n            }\n        }\n\n        /** Helper to generate a commit. */\n        public class CommitBuilder\n        {\n            private readonly TestRepository _testRepository;\n            private BranchBuilder branch;\n\n            private DirCache tree = DirCache.newInCore();\n\n            private List<RevCommit> parents = new List<RevCommit>();\n\n            private int _tick = 1;\n\n            private String _message = \"\";\n\n            private RevCommit self;\n\n            public CommitBuilder(TestRepository testRepository)\n            {\n                _testRepository = testRepository;\n                branch = null;\n            }\n\n            CommitBuilder(TestRepository testRepository, BranchBuilder b)\n            {\n                _testRepository = testRepository;\n                branch = b;\n\n                global::GitSharp.Core.Ref @ref = _testRepository.db.getRef(branch.@ref);\n                if (@ref != null)\n                {\n                    parent(_testRepository.pool.parseCommit(@ref.ObjectId));\n                }\n            }\n\n            CommitBuilder(TestRepository testRepository, CommitBuilder prior)\n            {\n                _testRepository = testRepository;\n                branch = prior.branch;\n\n                DirCacheBuilder b = tree.builder();\n                for (int i = 0; i < prior.tree.getEntryCount(); i++)\n                    b.add(prior.tree.getEntry(i));\n                b.finish();\n\n                parents.Add(prior.create());\n            }\n\n            public CommitBuilder parent(RevCommit p)\n            {\n                if (parents.isEmpty())\n                {\n                    DirCacheBuilder b = tree.builder();\n                    _testRepository.parseBody(p);\n                    b.addTree(new byte[0], DirCacheEntry.STAGE_0, _testRepository.db, p.Tree);\n                    b.finish();\n                }\n                parents.Add(p);\n                return this;\n            }\n\n            public CommitBuilder noParents()\n            {\n                parents.Clear();\n                return this;\n            }\n\n            public CommitBuilder noFiles()\n            {\n                tree.clear();\n                return this;\n            }\n\n            public CommitBuilder add(String path, String content)\n            {\n                return add(path, _testRepository.blob(content));\n            }\n\n            public class MockPathEdit : DirCacheEditor.PathEdit\n            {\n                private readonly RevBlob _id;\n\n                public MockPathEdit(RevBlob id, string entryPath)\n                    : base(entryPath)\n                {\n                    _id = id;\n                }\n\n                public override void Apply(DirCacheEntry ent)\n                {\n                    ent.setFileMode(FileMode.RegularFile);\n                    ent.setObjectId(_id);\n                }\n            }\n\n            public CommitBuilder add(String path, RevBlob id)\n            {\n                DirCacheEditor e = tree.editor();\n                e.add(new MockPathEdit(id, path));\n                e.finish();\n                return this;\n            }\n\n            public CommitBuilder rm(String path)\n            {\n                DirCacheEditor e = tree.editor();\n                e.add(new DirCacheEditor.DeletePath(path));\n                e.add(new DirCacheEditor.DeleteTree(path));\n                e.finish();\n                return this;\n            }\n\n            public CommitBuilder message(String m)\n            {\n                _message = m;\n                return this;\n            }\n\n            public CommitBuilder tick(int secs)\n            {\n                _tick = secs;\n                return this;\n            }\n\n            public RevCommit create()\n            {\n                if (self == null)\n                {\n                    _testRepository.tick(_tick);\n\n                    global::GitSharp.Core.Commit c = new global::GitSharp.Core.Commit(_testRepository.db);\n                    c.TreeId = (_testRepository.pool.lookupTree(tree.writeTree(_testRepository.writer)));\n                    c.ParentIds = (parents.ToArray());\n                    c.Author = (new PersonIdent(author, _testRepository.now.MillisToUtcDateTime()));\n                    c.Committer = (new PersonIdent(committer, _testRepository.now.MillisToUtcDateTime()));\n                    c.Message = (_message);\n\n                    self = _testRepository.pool.lookupCommit(_testRepository.writer.WriteCommit((c)));\n\n                    if (branch != null)\n                        branch.update(self);\n                }\n                return self;\n            }\n\n            public CommitBuilder child()\n            {\n                return new CommitBuilder(_testRepository, this);\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/TestRng.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Google Inc.\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GitSharp.Core.Tests.Util\n{\n\n    /** Toy RNG to ensure we get predictable numbers during unit tests. */\n    public class TestRng\n    {\n        private int next;\n\n        public TestRng(string seed)\n        {\n            next = 0;\n            for (int i = 0; i < seed.Length; i++)\n                next = next * 11 + (byte)(seed[i]);\n        }\n\n        public byte[] nextBytes(int cnt)\n        {\n            byte[] r = new byte[cnt];\n            for (int i = 0; i < cnt; i++)\n                r[i] = (byte)nextInt();\n            return r;\n        }\n\n        public int nextInt()\n        {\n            next = next * 1103515245 + 12345;\n            return next;\n        }\n    }\n\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/UnionInputStreamTest.cs",
    "content": "﻿/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\nusing System.Linq;\n\nnamespace GitSharp.Tests.GitSharp.Core.Util\n{\n    [TestFixture]\n    public class UnionInputStreamTest\n    {\n        [Test]\n        public void testEmptyStream()\n        {\n            var u = new UnionInputStream();\n            Assert.IsTrue(u.isEmpty());\n            Assert.AreEqual(-1, u.read());\n            Assert.AreEqual(-1, u.Read(new byte[1], 0, 1));\n            Assert.AreEqual(0, u.available());\n            Assert.AreEqual(0, u.skip(1));\n            u.Close();\n        }\n\n        [Test]\n        public void testReadSingleBytes()\n        {\n            var u = new UnionInputStream();\n\n            Assert.IsTrue(u.isEmpty());\n            u.add(new MemoryStream(new byte[] { 1, 0, 2 }));\n            u.add(new MemoryStream(new byte[] { 3 }));\n            u.add(new MemoryStream(new byte[] { 4, 5 }));\n\n            Assert.IsFalse(u.isEmpty());\n            Assert.AreEqual(3, u.available());\n            Assert.AreEqual(1, u.read());\n            Assert.AreEqual(0, u.read());\n            Assert.AreEqual(2, u.read());\n            Assert.AreEqual(0, u.available());\n\n            Assert.AreEqual(3, u.read());\n            Assert.AreEqual(0, u.available());\n\n            Assert.AreEqual(4, u.read());\n            Assert.AreEqual(1, u.available());\n            Assert.AreEqual(5, u.read());\n            Assert.AreEqual(0, u.available());\n            Assert.AreEqual(-1, u.read());\n\n            Assert.IsTrue(u.isEmpty());\n            u.add(new MemoryStream(new byte[] { (byte)255 }));\n            Assert.AreEqual(255, u.read());\n            Assert.AreEqual(-1, u.read());\n            Assert.IsTrue(u.isEmpty());\n        }\n\n        [Test]\n        public void testReadByteBlocks()\n        {\n            var u = new UnionInputStream();\n            u.add(new MemoryStream(new byte[] { 1, 0, 2 }));\n            u.add(new MemoryStream(new byte[] { 3 }));\n            u.add(new MemoryStream(new byte[] { 4, 5 }));\n\n            var r = new byte[5];\n            Assert.AreEqual(5, u.Read(r, 0, 5));\n            Assert.IsTrue(r.SequenceEqual(new byte[] { 1, 0, 2, 3, 4 }));\n            Assert.AreEqual(1, u.Read(r, 0, 5));\n            Assert.AreEqual(5, r[0]);\n            Assert.AreEqual(-1, u.Read(r, 0, 5));\n        }\n\n        [Test]\n        public void testArrayConstructor()\n        {\n            var u = new UnionInputStream(\n                new MemoryStream(new byte[] { 1, 0, 2 }),\n                new MemoryStream(new byte[] { 3 }),\n                new MemoryStream(new byte[] { 4, 5 }));\n\n            var r = new byte[5];\n            Assert.AreEqual(5, u.Read(r, 0, 5));\n            Assert.IsTrue(r.SequenceEqual(new byte[] { 1, 0, 2, 3, 4 }));\n            Assert.AreEqual(1, u.Read(r, 0, 5));\n            Assert.AreEqual(5, r[0]);\n            Assert.AreEqual(-1, u.Read(r, 0, 5));\n        }\n\n        [Test]\n        public void testMarkSupported()\n        {\n            var u = new UnionInputStream();\n            Assert.IsFalse(u.markSupported());\n            u.add(new MemoryStream(new byte[] { 1, 0, 2 }));\n            Assert.IsFalse(u.markSupported());\n        }\n\n        [Test]\n        public void testSkip()\n        {\n            var u = new UnionInputStream();\n            u.add(new MemoryStream(new byte[] { 1, 0, 2 }));\n            u.add(new MemoryStream(new byte[] { 3 }));\n            u.add(new MemoryStream(new byte[] { 4, 5 }));\n            Assert.AreEqual(0, u.skip(0));\n            Assert.AreEqual(4, u.skip(4));\n            Assert.AreEqual(4, u.read());\n            Assert.AreEqual(1, u.skip(5));\n            Assert.AreEqual(0, u.skip(5));\n            Assert.AreEqual(-1, u.read());\n\n            u.add(new MockMemoryStream(new byte[] { 20, 30 }, null)); // can't mock skip behavior :-(\n            Assert.AreEqual(2, u.skip(8));\n            Assert.AreEqual(-1, u.read());\n        }\n\n        private class MockMemoryStream : MemoryStream\n        {\n            private readonly Action _closeBehavior;\n\n            public MockMemoryStream(byte[] buffer, Action closeBehavior)\n                : base(buffer)\n            {\n                _closeBehavior = closeBehavior;\n            }\n\n            public override void Close()\n            {\n                base.Close();\n                if (_closeBehavior == null)\n                {\n                    return;\n                }\n\n                _closeBehavior();\n            }\n        }\n\n        [Test]\n        public void testAutoCloseDuringRead()\n        {\n            var u = new UnionInputStream();\n            var closed = new bool[2];\n            u.add(new MockMemoryStream(new byte[] { 1 }, () => { closed[0] = true; }));\n            u.add(new MockMemoryStream(new byte[] { 2 }, () => { closed[1] = true; }));\n\n            Assert.IsFalse(closed[0]);\n            Assert.IsFalse(closed[1]);\n\n            Assert.AreEqual(1, u.read());\n            Assert.IsFalse(closed[0]);\n            Assert.IsFalse(closed[1]);\n\n            Assert.AreEqual(2, u.read());\n            Assert.IsTrue(closed[0]);\n            Assert.IsFalse(closed[1]);\n\n            Assert.AreEqual(-1, u.read());\n            Assert.IsTrue(closed[0]);\n            Assert.IsTrue(closed[1]);\n        }\n\n        [Test]\n        public void testCloseDuringClose()\n        {\n            var u = new UnionInputStream();\n            var closed = new bool[2];\n            u.add(new MockMemoryStream(new byte[] { 1 }, () => { closed[0] = true; }));\n            u.add(new MockMemoryStream(new byte[] { 2 }, () => { closed[1] = true; }));\n\n            Assert.IsFalse(closed[0]);\n            Assert.IsFalse(closed[1]);\n\n            u.Close();\n\n            Assert.IsTrue(closed[0]);\n            Assert.IsTrue(closed[1]);\n        }\n\n        [Test]\n        public void testExceptionDuringClose()\n        {\n            var u = new UnionInputStream();\n            u.add(new MockMemoryStream(new byte[] { 1 }, () => { throw new IOException(\"I AM A TEST\"); }));\n\n            try\n            {\n                u.Close();\n                Assert.Fail(\"close ignored inner stream exception\");\n            }\n            catch (IOException e)\n            {\n                Assert.AreEqual(\"I AM A TEST\", e.Message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/Util/VariousUtilityTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Tests.Util\n{\n    [TestFixture]\n    public class VariousUtilityTests\n    {\n        [Test]\n        public void TestBitCount()\n        {\n            Assert.AreEqual(1, (2 << 5).BitCount());\n            Assert.AreEqual(1, 1.BitCount());\n            Assert.AreEqual(2, 3.BitCount());\n        }\n\n        [Test]\n        public void TestNumberOfTrailingZeros()\n        {\n            Assert.AreEqual(0, 1.NumberOfTrailingZeros());\n            Assert.AreEqual(1, 2.NumberOfTrailingZeros());\n            Assert.AreEqual(6, (2 << 5).NumberOfTrailingZeros());\n            Assert.AreEqual(0, ((2 << 5)+1).NumberOfTrailingZeros());\n        }\n\n    }\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/ValidRefNameTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing GitSharp.Core;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class ValidRefNameTest\n\t{\n\t\tprivate static void assertValid(bool exp, string name)\n\t\t{\n\t\t\tAssert.AreEqual(exp, Core.Repository.IsValidRefName(name), \"\\\"\" + name + \"\\\"\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testEmptyString()\n\t\t{\n\t\t\tassertValid(false, string.Empty);\n\t\t\tassertValid(false, \"/\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testMustHaveTwoComponents()\n\t\t{\n\t\t\tassertValid(false, \"master\");\n\t\t\tassertValid(true, \"heads/master\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidHead()\n\t\t{\n\t\t\tassertValid(true, \"refs/heads/master\");\n\t\t\tassertValid(true, \"refs/heads/pu\");\n\t\t\tassertValid(true, \"refs/heads/z\");\n\t\t\tassertValid(true, \"refs/heads/FoO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidTag()\n\t\t{\n\t\t\tassertValid(true, \"refs/tags/v1.0\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoLockSuffix()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/master.lock\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoDirectorySuffix()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/master/\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoSpace()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/i haz space\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoAsciiControlCharacters()\n\t\t{\n\t\t\tfor (char c = '\\0'; c < ' '; c++)\n\t\t\t\tassertValid(false, \"refs/heads/mast\" + c + \"er\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoBareDot()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/.\");\n\t\t\tassertValid(false, \"refs/heads/..\");\n\t\t\tassertValid(false, \"refs/heads/./master\");\n\t\t\tassertValid(false, \"refs/heads/../master\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoLeadingOrTrailingDot()\n\t\t{\n\t\t\tassertValid(false, \".\");\n\t\t\tassertValid(false, \"refs/heads/.bar\");\n\t\t\tassertValid(false, \"refs/heads/..bar\");\n\t\t\tassertValid(false, \"refs/heads/bar.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testContainsDot()\n\t\t{\n\t\t\tassertValid(true, \"refs/heads/m.a.s.t.e.r\");\n\t\t\tassertValid(false, \"refs/heads/master..pu\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testNoMagicRefCharacters()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/master^\");\n\t\t\tassertValid(false, \"refs/heads/^master\");\n\t\t\tassertValid(false, \"^refs/heads/master\");\n\n\t\t\tassertValid(false, \"refs/heads/master~\");\n\t\t\tassertValid(false, \"refs/heads/~master\");\n\t\t\tassertValid(false, \"~refs/heads/master\");\n\n\t\t\tassertValid(false, \"refs/heads/master:\");\n\t\t\tassertValid(false, \"refs/heads/:master\");\n\t\t\tassertValid(false, \":refs/heads/master\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testShellGlob()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/master?\");\n\t\t\tassertValid(false, \"refs/heads/?master\");\n\t\t\tassertValid(false, \"?refs/heads/master\");\n\n\t\t\tassertValid(false, \"refs/heads/master[\");\n\t\t\tassertValid(false, \"refs/heads/[master\");\n\t\t\tassertValid(false, \"[refs/heads/master\");\n\n\t\t\tassertValid(false, \"refs/heads/master*\");\n\t\t\tassertValid(false, \"refs/heads/*master\");\n\t\t\tassertValid(false, \"*refs/heads/master\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testValidSpecialCharacters()\n\t\t{\n\t\t\tassertValid(true, \"refs/heads/!\");\n\t\t\tassertValid(true, \"refs/heads/\\\"\");\n\t\t\tassertValid(true, \"refs/heads/#\");\n\t\t\tassertValid(true, \"refs/heads/$\");\n\t\t\tassertValid(true, \"refs/heads/%\");\n\t\t\tassertValid(true, \"refs/heads/&\");\n\t\t\tassertValid(true, \"refs/heads/'\");\n\t\t\tassertValid(true, \"refs/heads/(\");\n\t\t\tassertValid(true, \"refs/heads/)\");\n\t\t\tassertValid(true, \"refs/heads/+\");\n\t\t\tassertValid(true, \"refs/heads/,\");\n\t\t\tassertValid(true, \"refs/heads/-\");\n\t\t\tassertValid(true, \"refs/heads/;\");\n\t\t\tassertValid(true, \"refs/heads/<\");\n\t\t\tassertValid(true, \"refs/heads/=\");\n\t\t\tassertValid(true, \"refs/heads/>\");\n\t\t\tassertValid(true, \"refs/heads/@\");\n\t\t\tassertValid(true, \"refs/heads/]\");\n\t\t\tassertValid(true, \"refs/heads/_\");\n\t\t\tassertValid(true, \"refs/heads/`\");\n\t\t\tassertValid(true, \"refs/heads/{\");\n\t\t\tassertValid(true, \"refs/heads/|\");\n\t\t\tassertValid(true, \"refs/heads/}\");\n\n\t\t\t// This is valid on UNIX, but not on Windows\n\t\t\t// hence we make in invalid due to non-portability\n\t\t\t//\n\t\t\tassertValid(false, \"refs/heads/\\\\\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testUnicodeNames()\n\t\t{\n\t\t\tassertValid(true, \"refs/heads/\\u00e5ngstr\\u00f6m\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testRefLogQueryIsValidRef()\n\t\t{\n\t\t\tassertValid(false, \"refs/heads/master@{1}\");\n\t\t\tassertValid(false, \"refs/heads/master@{1.hour.ago}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/WindowCacheGetTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n\t[TestFixture]\n\tpublic class WindowCacheGetTest : SampleDataRepositoryTestCase\n\t{\n\t\tprivate IList<TestObject> _toLoad;\n\n\t\tpublic override void setUp()\n\t\t{\n\t\t\tbase.setUp();\n\n\t\t\t_toLoad = new List<TestObject>();\n\t\t\tusing (var br = new StreamReader(\"Resources/all_packed_objects.txt\", Constants.CHARSET))\n\t\t\t{\n\t\t\t\tstring line;\n\t\t\t\twhile ((line = br.ReadLine()) != null)\n\t\t\t\t{\n\t\t\t\t\tstring[] parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\t\tvar testObject = new TestObject\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tId = ObjectId.FromString(parts[0]),\n\t\t\t\t\t\t\t\t\tType = parts[1],\n\t\t\t\t\t\t\t\t\tRawSize = Convert.ToInt32(parts[2]),\n                                    // parts[3] is the size-in-pack\n\t\t\t\t\t\t\t\t\tOffset = Convert.ToInt64(parts[4])\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t_toLoad.Add(testObject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAssert.AreEqual(96, _toLoad.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testCache_Defaults()\n\t\t{\n\t\t\tvar cfg = new WindowCacheConfig();\n\t\t\tWindowCache.reconfigure(cfg);\n\t\t\tDoCacheTests();\n\t\t\tCheckLimits(cfg);\n\n\t\t\tWindowCache cache = WindowCache.Instance;\n\t\t\tAssert.AreEqual(6, cache.getOpenFiles());\n\t\t\tAssert.AreEqual(17346, cache.getOpenBytes());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void testCache_TooFewFiles()\n\t\t{\n\t\t\tvar cfg = new WindowCacheConfig { PackedGitOpenFiles = 2 };\n\t\t\tWindowCache.reconfigure(cfg);\n\t\t\tDoCacheTests();\n\t\t\tCheckLimits(cfg);\n\t\t}\n\n    [Test]\n    public void testCache_TooSmallLimit()\n\t\t{\n\t\t\tvar cfg = new WindowCacheConfig { PackedGitWindowSize = 4096, PackedGitLimit = 4096 };\n\t\t\tWindowCache.reconfigure(cfg);\n\t\t\tDoCacheTests();\n\t\t\tCheckLimits(cfg);\n\t\t}\n\n\t\tprivate static void CheckLimits(WindowCacheConfig cfg)\n\t\t{\n\t\t\tWindowCache cache = WindowCache.Instance;\n\t\t\tAssert.IsTrue(cache.getOpenFiles() <= cfg.PackedGitOpenFiles);\n\t\t\tAssert.IsTrue(cache.getOpenBytes() <= cfg.PackedGitLimit);\n\t\t\tAssert.IsTrue(0 < cache.getOpenFiles());\n\t\t\tAssert.IsTrue(0 < cache.getOpenBytes());\n\t\t}\n\n\t\tprivate void DoCacheTests()\n\t\t{\n\t\t\tforeach (TestObject o in _toLoad)\n\t\t\t{\n\t\t\t\tObjectLoader or = db.OpenObject(new WindowCursor(), o.Id);\n\t\t\t\tAssert.IsNotNull(or);\n\t\t\t\tAssert.IsTrue(or is PackedObjectLoader);\n\t\t\t\tAssert.AreEqual(o.Type, Constants.typeString(or.Type));\n\t\t\t\tAssert.AreEqual(o.RawSize, or.RawSize);\n\t\t\t\tAssert.AreEqual(o.Offset, ((PackedObjectLoader)or).ObjectOffset);\n\t\t\t}\n\t\t}\n\n\t\t#region Nested Types\n\n\t\tprivate class TestObject\n\t\t{\n\t\t\tprivate string _type;\n\n\t\t\tpublic ObjectId Id { get; set; }\n\t\t\tpublic int RawSize { get; set; }\n\t\t\tpublic long Offset { get; set; }\n\n\t\t\tpublic string Type\n\t\t\t{\n\t\t\t\tget { return _type; }\n\t\t\t\tset\n\t\t\t\t{\n\t\t\t\t\t_type = value;\n\t\t\t\t\tbyte[] typeRaw = Constants.encode(value + \" \");\n\t\t\t\t\tvar ptr = new MutableInteger();\n\t\t\t\t\tConstants.decodeTypeString(Id, typeRaw, (byte)' ', ptr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/WindowCacheReconfigureTest.cs",
    "content": "/*\n * Copyright (C) 2009, Google Inc.\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing GitSharp.Core;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class WindowCacheReconfigureTest : RepositoryTestCase\n    {\n        [Test]\n        public void testConfigureCache_PackedGitLimit_0()\n        {\n            var cfg = new WindowCacheConfig { PackedGitLimit = 0 };\n            AssertHelper.Throws<ArgumentException>(() => WindowCache.reconfigure(cfg));\n        }\n\n        [Test]\n        public void testConfigureCache_PackedGitWindowSize_0()\n        {\n            try\n            {\n                var cfg = new WindowCacheConfig { PackedGitWindowSize = 0 };\n                WindowCache.reconfigure(cfg);\n                Assert.Fail(\"incorrectly permitted PackedGitWindowSize = 0\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Invalid window size\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testConfigureCache_PackedGitWindowSize_512()\n        {\n            try\n            {\n                var cfg = new WindowCacheConfig { PackedGitWindowSize = 512 };\n                WindowCache.reconfigure(cfg);\n                Assert.Fail(\"incorrectly permitted PackedGitWindowSize = 512\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Invalid window size\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testConfigureCache_PackedGitWindowSize_4097()\n        {\n            try\n            {\n                var cfg = new WindowCacheConfig { PackedGitWindowSize = 4097 };\n                WindowCache.reconfigure(cfg);\n                Assert.Fail(\"incorrectly permitted PackedGitWindowSize = 4097\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Window size must be power of 2\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testConfigureCache_PackedGitOpenFiles_0()\n        {\n            try\n            {\n                var cfg = new WindowCacheConfig { PackedGitOpenFiles = 0 };\n                WindowCache.reconfigure(cfg);\n                Assert.Fail(\"incorrectly permitted PackedGitOpenFiles = 0\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Open files must be >= 1\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testConfigureCache_PackedGitWindowSizeAbovePackedGitLimit()\n        {\n            try\n            {\n                var cfg = new WindowCacheConfig { PackedGitLimit = 1024, PackedGitWindowSize = 8192 };\n                WindowCache.reconfigure(cfg);\n                Assert.Fail(\"incorrectly permitted PackedGitWindowSize > PackedGitLimit\");\n            }\n            catch (ArgumentException e)\n            {\n                Assert.AreEqual(\"Window size must be < limit\", e.Message);\n            }\n        }\n\n        [Test]\n        public void testConfigureCache_Limits1()\n        {\n            // This test is just to force coverage over some lower bounds for\n            // the table. We don't want the table to wind up with too small\n            // of a size. This is highly dependent upon the table allocation\n            // algorithm actually implemented in WindowCache.\n            //\n            var cfg = new WindowCacheConfig { PackedGitLimit = 6 * 4096 / 5, PackedGitWindowSize = 4096 };\n            WindowCache.reconfigure(cfg);\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/WorkDirCheckoutTest.cs",
    "content": "/*\n * Copyright (C) 2007, Dave Watson <dwatson@mimvista.com>\n * Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System.Collections.Generic;\nusing System.IO;\nusing GitSharp.Core;\nusing GitSharp.Core.Exceptions;\nusing GitSharp.Core.Tests.Util;\nusing GitSharp.Tests.GitSharp.Core.Util;\nusing NUnit.Framework;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Tests\n{\n    [TestFixture]\n    public class WorkDirCheckoutTest : RepositoryTestCase\n    {\n        // Methods\n        [Test]\n        public void testCheckingOutWithConflicts()\n        {\n            var index = new GitIndex(db);\n            index.add(trash, writeTrashFile(\"bar\", \"bar\"));\n            index.add(trash, writeTrashFile(\"foo/bar/baz/qux\", \"foo/bar\"));\n            recursiveDelete(new FileInfo(Path.Combine(trash.FullName, \"bar\")));\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n            writeTrashFile(\"bar/baz/qux/foo\", \"another nasty one\");\n            writeTrashFile(\"foo\", \"troublesome little bugger\");\n            \n            var workDirCheckout1 = new WorkDirCheckout(db, trash, index, index);\n\n            AssertHelper.Throws<CheckoutConflictException>(workDirCheckout1.checkout);\n\n\n            var workDirCheckout2 = new WorkDirCheckout(db, trash, index, index) { FailOnConflict = false };\n            workDirCheckout2.checkout();\n\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"bar\")).IsFile());\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"foo/bar/baz/qux\")).IsFile());\n\n            var index2 = new GitIndex(db);\n            recursiveDelete(new FileInfo(Path.Combine(trash.FullName, \"bar\")));\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n            index2.add(trash, writeTrashFile(\"bar/baz/qux/foo\", \"bar\"));\n            writeTrashFile(\"bar/baz/qux/bar\", \"evil? I thought it said WEEVIL!\");\n            index2.add(trash, writeTrashFile(\"foo\", \"lalala\"));\n\n            workDirCheckout2 = new WorkDirCheckout(db, trash, index2, index) { FailOnConflict = false };\n            workDirCheckout2.checkout();\n\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"bar\")).IsFile());\n            Assert.IsTrue(new FileInfo(Path.Combine(trash.FullName, \"foo/bar/baz/qux\")).IsFile());\n            Assert.IsNotNull(index2.GetEntry(\"bar\"));\n            Assert.IsNotNull(index2.GetEntry(\"foo/bar/baz/qux\"));\n            Assert.IsNull(index2.GetEntry(\"bar/baz/qux/foo\"));\n            Assert.IsNull(index2.GetEntry(\"foo\"));\n        }\n\n        [Test]\n        public void testFindingConflicts()\n        {\n            var index = new GitIndex(db);\n            index.add(trash, writeTrashFile(\"bar\", \"bar\"));\n            index.add(trash, writeTrashFile(\"foo/bar/baz/qux\", \"foo/bar\"));\n            recursiveDelete(new FileInfo(Path.Combine(trash.FullName, \"bar\")));\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n            writeTrashFile(\"bar/baz/qux/foo\", \"another nasty one\");\n            writeTrashFile(\"foo\", \"troublesome little bugger\");\n\n            var workDirCheckout = new WorkDirCheckout(db, trash, index, index);\n            workDirCheckout.PrescanOneTree();\n            List<string> conflictingEntries = workDirCheckout.Conflicts;\n            Assert.AreEqual(\"bar/baz/qux/foo\", conflictingEntries[0]);\n            Assert.AreEqual(\"foo\", conflictingEntries[1]);\n\n            var index2 = new GitIndex(db);\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"bar\")));\n            recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, \"foo\")));\n\n            index2.add(trash, writeTrashFile(\"bar/baz/qux/foo\", \"bar\"));\n            index2.add(trash, writeTrashFile(\"foo\", \"lalala\"));\n            \n            workDirCheckout = new WorkDirCheckout(db, trash, index2, index);\n            workDirCheckout.PrescanOneTree();\n\n            conflictingEntries = workDirCheckout.Conflicts;\n            List<string> removedEntries = workDirCheckout.Removed;\n            Assert.IsTrue(conflictingEntries.Count == 0);\n            Assert.IsTrue(removedEntries.Contains(\"bar/baz/qux/foo\"));\n            Assert.IsTrue(removedEntries.Contains(\"foo\"));\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/XInputStream.cs",
    "content": "﻿/*\n * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Git Development Community nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nusing System;\nusing System.IO;\nusing GitSharp.Core.Util;\n\nnamespace GitSharp.Core.Tests\n{\n    internal class XInputStream : IDisposable\n    {\n        private readonly byte[] _intbuf = new byte[8];\n        private FileStream _filestream;\n\n        internal XInputStream(FileStream s)\n        {\n            _filestream = s;\n        }\n\n        internal long Length\n        {\n            get { return _filestream.Length; }\n        }\n\n        #region IDisposable Members\n\n        public void Dispose()\n        {\n            CleanUp();\n        }\n\n        private void CleanUp()\n        {\n            if (_filestream == null)\n            {\n                return;\n            }\n\n            _filestream.Dispose();\n            _filestream = null;\n        }\n\n        #endregion\n\n        internal byte[] ReadFully(int len)\n        {\n            var b = new byte[len];\n            _filestream.Read(b, 0, len);\n            return b;\n        }\n\n        internal void ReadFully(byte[] b, int o, int len)\n        {\n            int r;\n            while (len > 0 && (r = _filestream.Read(b, o, len)) > 0)\n            {\n                o += r;\n                len -= r;\n            }\n            if (len > 0)\n            {\n                throw new EndOfStreamException();\n            }\n        }\n\n        internal int ReadUInt8()\n        {\n            int r = _filestream.ReadByte();\n            if (r < 0)\n            {\n                throw new EndOfStreamException();\n            }\n            return r;\n        }\n\n        internal long ReadUInt32()\n        {\n            ReadFully(_intbuf, 0, 4);\n            return NB.decodeUInt32(_intbuf, 0);\n        }\n\n        internal void Close()\n        {\n            CleanUp();\n        }\n    }\n}"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/sample/README",
    "content": "Hello World\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Core/sample/unpacked",
    "content": "hi this is a loose object\n"
  },
  {
    "path": "GitSharp.Tests/GitSharp.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>GitSharp.Tests</RootNamespace>\n    <AssemblyName>GitSharp.Tests</AssemblyName>\n    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SourceAnalysisOverrideSettingsFile>C:\\Users\\rolenun\\AppData\\Roaming\\ICSharpCode/SharpDevelop3.0\\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\n    <NoStdLib>False</NoStdLib>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <UpgradeBackupLocation />\n    <PublishUrl>http://localhost/GitSharp.Tests/</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Web</InstallFrom>\n    <UpdateEnabled>true</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>true</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>Full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE;NDESK_OPTIONS</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>bin\\Debug\\GitSharp.Tests.XML</DocumentationFile>\n    <NoWarn>1591</NoWarn>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\n    <RegisterForComInterop>False</RegisterForComInterop>\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\n    <BaseAddress>4194304</BaseAddress>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\tools\\nunit\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\">\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\SharedAssemblyInfo.cs\">\n      <Link>Properties\\SharedAssemblyInfo.cs</Link>\n    </Compile>\n    <Compile Include=\"GitSharp.Core\\AbbreviatedObjectIdTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\CanReadMsysgitIndexFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheEntryTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\SymbolicRefTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RefDirectoryTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ObjectIdRefTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ConcurrentRepackTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ConstantsEncodingTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Crc32Tests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\DiffFormatterReflowTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\DiffTestDataGenerator.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\EditListTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\EditTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\MyersDiffPerformanceTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\MyersDiffTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Diff\\RawTextTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheBasicTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheBuilderIteratorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheBuilderTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheCGitCompatabilityTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheFindTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheIteratorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheLargePathTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\DirectoryCache\\DirCacheTreeTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\FnMatch\\FileNameMatcherTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\IgnoreHandlerTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\IndexDiffTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\IndexModifiedTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\IndexTreeWalkerTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Merge\\CherryPickTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Merge\\MergeAlgorithmTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Merge\\SimpleMergeTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ObjectCheckerTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackIndexTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackIndexTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackIndexV1Tests.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackIndexV2Tests.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackReverseIndexTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\PackWriterTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\BasePatchTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\EditListTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\FileHeaderTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\GetTextTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\PatchCcErrorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\PatchCcTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\PatchErrorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Patch\\PatchTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ReadTreeTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ReflogConfigTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\ReflogReaderTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RefTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RefUpdateTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RepositoryCacheTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RepositoryConfigTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RepositoryTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\AlwaysEmptyRevQueueTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\DateRevQueueTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\FIFORevQueueTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\FooterLineTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\LIFORevQueueTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\ObjectWalkTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevCommitParseTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevFlagSetTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevObjectTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevQueueTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevTagParseTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkCullTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkFilterTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkMergeBaseTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkPathFilter1Test.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkPathFilter6012Test.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkSortTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\RevWalk\\RevWalkTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\SampleDataRepositoryTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\SubmoduleTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0001_ObjectId.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0001_PersonIdent.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0002_Tree.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0003_Basic_Config.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0003_Basic_Write.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0004_PackReader.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0007_Index.cs\" />\n    <Compile Include=\"GitSharp.Core\\T0008_testparserev.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\BaseConnectionTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\BundleWriterTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\IndexPackTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\LongMapTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\OpenSshConfigTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\OperationResultTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\PacketLineInTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\PacketLineOutTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\PushProcessTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\RefSpecTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\RemoteConfigTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\SideBandOutputStreamTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\TransportTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Transport\\URIishTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeIteratorLeafOnlyTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeIteratorPostOrderTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeIteratorPreOrderTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\AbstractTreeIteratorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\CanonicalTreeParserTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\EmptyTreeIteratorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\FileTreeIteratorTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\Filter\\AlwaysCloneTreeFilter.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\Filter\\NotTreeFilterTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\Filter\\PathSuffixFilterTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\Filter\\TreeFilterTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\NameConflictTreeWalkTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\PostOrderTreeWalkTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\TreeWalk\\TreeWalkBasicDiffTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\AssertHelper.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\AssertHelperFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\ByteArrayExtensionsFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\IO\\TimeoutStreamTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\UnionInputStreamTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\LinkedListFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\CPUTimeStopWatch.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\ExtensionsFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\IntListTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\LocalDiskRepositoryTestCase.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\Md5MessageDigestTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\PathUtils.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\Sha1MessageDigestTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\MockFileBasedConfig.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\MockSystemReader.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\NBTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\QuotedStringBourneStyleTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\QuotedStringBourneUserPathStyleTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\QuotedStringGitPathStyleTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\RawParseUtils_HexParseTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\RawParseUtils_LineMapTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\RawParseUtils_MatchTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\RefListTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\RefMapTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\StringExtensionsFixture.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\StringUtilsTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\TemporaryBufferTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\TestRepository.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\TestRng.cs\" />\n    <Compile Include=\"GitSharp.Core\\Util\\VariousUtilityTests.cs\" />\n    <Compile Include=\"GitSharp.Core\\ValidRefNameTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\WindowCacheGetTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\WindowCacheReconfigureTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\WorkDirCheckoutTest.cs\" />\n    <Compile Include=\"GitSharp.Core\\XInputStream.cs\" />\n    <Compile Include=\"GitSharp\\AbstractTreeNodeTests.cs\" />\n    <Compile Include=\"GitSharp\\ApiTestCase.cs\" />\n    <Compile Include=\"GitSharp\\BlobTests.cs\" />\n    <Compile Include=\"GitSharp\\BranchTest.cs\" />\n    <Compile Include=\"GitSharp\\CloneTests.cs\" />\n    <Compile Include=\"GitSharp\\CommitDateTests.cs\" />\n    <Compile Include=\"GitSharp\\CommitTests.cs\" />\n    <Compile Include=\"GitSharp\\DiffTests.cs\" />\n    <Compile Include=\"GitSharp\\EncodingTests.cs\" />\n    <Compile Include=\"GitSharp\\FindGitDirectoryTests.cs\" />\n    <Compile Include=\"GitSharp\\IgnoreTests.cs\" />\n    <Compile Include=\"GitSharp\\IndexTest.cs\" />\n    <Compile Include=\"GitSharp\\InitTests.cs\" />\n    <Compile Include=\"GitSharp\\MergeTests.cs\" />\n    <Compile Include=\"GitSharp\\ObjectEqualityTests.cs\" />\n    <Compile Include=\"GitSharp\\RefModelTests.cs\" />\n    <Compile Include=\"GitSharp\\RepositoryConfigTest.cs\" />\n    <Compile Include=\"GitSharp\\RepositoryStatusTests.cs\" />\n    <Compile Include=\"GitSharp\\RepositoryTests.cs\" />\n    <Compile Include=\"GitSharp\\StatusTests.cs\" />\n    <Compile Include=\"GitSharp\\TextTests.cs\" />\n    <Compile Include=\"Git\\CLI\\CustomOptionTests.cs\" />\n    <Compile Include=\"Git\\CLI\\OptionContextTest.cs\" />\n    <Compile Include=\"Git\\CLI\\OptionSetTest.cs\" />\n    <Compile Include=\"Git\\CLI\\OptionTest.cs\" />\n    <Compile Include=\"Git\\CLI\\Utils.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <None Include=\"GitSharp.Core\\sample\\README\" />\n    <None Include=\"GitSharp.Core\\sample\\unpacked\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Resources\\all_packed_objects.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <Resource Include=\"README.txt\" />\n    <Content Include=\"Resources\\CorruptIndex\\.gitted\\objects\\info\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\CorruptIndex\\.gitted\\objects\\pack\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\CorruptIndex\\a.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\CorruptIndex\\b.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\info\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\pack\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\OneFileRepository\\.gitted\\objects\\info\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\OneFileRepository\\.gitted\\objects\\pack\\marker.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\OneFileRepository\\dummy.txt\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\COMMIT_EDITMSG\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\config\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\description\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\gitk.cache\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\HEAD\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\applypatch-msg.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\commit-msg.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\post-commit.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\post-receive.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\post-update.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\pre-applypatch.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\pre-commit.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\pre-rebase.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\prepare-commit-msg.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\hooks\\update.sample\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\index\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\info\\exclude\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\info\\refs\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\logs\\HEAD\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\logs\\refs\\heads\\first\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\logs\\refs\\heads\\master\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\3f\\a4c1907a23c8c345ba65bd9bc17336b012259b\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\66\\d7e337f35ff98d6bddd7e730655080454c3fdd\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\76\\e984096c69db581a6d48eb444e5490d727ebac\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\a1\\3973bc29346193c4a023fc83cc5b0645784262\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\info\\packs\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\pack\\pack-845b2ba3349cc201321e752b01c5ada8102a9a08.idx\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\objects\\pack\\pack-845b2ba3349cc201321e752b01c5ada8102a9a08.pack\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\ORIG_HEAD\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\packed-refs\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\refs\\heads\\first\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\refs\\heads\\master\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n    <Content Include=\"Resources\\sample.git\\refs\\tags\\my_tag\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Resources\\Diff\\E.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\E_PostImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\E_PreImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext0.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext1.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext10.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext100.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext3.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\testContext5.out\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\X.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\X_PostImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\X_PreImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Y.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Y_PostImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Y_PreImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Z.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Z_PostImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Diff\\Z_PreImage\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.index.aaaa\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.index.badchecksum\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.index.ZZZZ\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testEditList_Types.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_BodyTooLong.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_CcTruncatedOld.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_DisconnectedHunk.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_GarbageBetweenFiles.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_GitBinaryNoForwardHunk.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_TruncatedNew.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testError_TruncatedOld.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testGetText_BothISO88591.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testGetText_Convert.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testGetText_DiffCc.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testGetText_NoBinary.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_AddNoNewline.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_CcDeleteFile.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_CcNewFile.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_ConfigCaseInsensitive.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_FixNoNewline.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_GitBinaryDelta.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_GitBinaryLiteral.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_NoBinary.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\Patch\\testParse_OneFileCc.patch\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\COMMIT_EDITMSG\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\description\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\applypatch-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\post-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\post-receive.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\post-update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\pre-applypatch.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\pre-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\pre-rebase.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\prepare-commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\hooks\\update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\index\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\info\\exclude\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\logs\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\logs\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\objects\\1a\\602d9bd07ce5272ddaa64e21da12dbca2b8c9f\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\objects\\2e\\65efe2a145dda7ee51d1741299f848e5bf752e\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\objects\\63\\d8dbd40c23542e740659a7168a0ce3138ea748\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\objects\\dc\\8d7f3d2d19bdf3a6daa007102bc7bef76aa8ac\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\CorruptIndex\\.gitted\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\create-second-pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.index\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.lsfiles\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\gitgit.lstree\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\index_originating_from_msysgit\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\description\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\applypatch-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\post-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\post-receive.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\post-update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\pre-applypatch.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\pre-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\pre-rebase.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\prepare-commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\hooks\\update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\index\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\info\\exclude\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\logs\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\logs\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\24\\ed0e20ceff5e2cdf768345b6853213f840ff8f\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\2f\\3c75408acf76bb7122b91c418d015252708552\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\4b\\825dc642cb6eb9a060e54bf8d69288fbee4904\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\54\\75030f2b57d9956d23ef4ead6f9a4983c234b5\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\6d\\c9b6c490154e9627a8aed8ca74039a34084677\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\9b\\c63090dd221bace8b2e5f278580946be26efdd\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\a8\\a51035f70bec2d3e00c0a11a33ff709a6ab40e\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\objects\\fe\\0856a5873decc1a8e47f63c5707520121b2e9e\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\JapaneseRepo\\.gitted\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\COMMIT_EDITMSG\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\description\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\applypatch-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\post-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\post-receive.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\post-update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\pre-applypatch.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\pre-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\pre-rebase.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\prepare-commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\hooks\\update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\index\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\info\\exclude\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\logs\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\logs\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\objects\\5a\\44c05f31a48e1492e7b375e502d97c3e72a1bc\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\objects\\be\\cce7158b7ef8a86c4ddf2fe235df6923f94ec8\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\objects\\f3\\ca78a01f1baa4eaddcc349c97dcab95a379981\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\OneFileRepository\\.gitted\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-546ff360fe3488adb20860ce3436a2d6373d2796.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-546ff360fe3488adb20860ce3436a2d6373d2796.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-cbdeda40019ae0e6e789088ea0f51f164f489d14.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-cbdeda40019ae0e6e789088ea0f51f164f489d14.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\pack-huge.idx\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\packed-refs\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\single_file_commit\\16c0beaf7523eb3ef5df45bd42dd4fc6343de864\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\single_file_commit\\917c130bd4fa5bf2df0c399dc1b03401860aa448\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\single_file_commit\\95ea6a6859af6791464bd8b6de76ad5a6f9fad81\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\single_file_commit\\i-am-a-file\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\COMMIT_EDITMSG\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\config\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\description\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\applypatch-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\post-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\post-receive.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\post-update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\pre-applypatch.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\pre-commit.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\pre-rebase.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\prepare-commit-msg.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\hooks\\update.sample\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\index\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\info\\exclude\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\logs\\HEAD\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\logs\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\16\\3678aef05371dc8636cbae9486233fddbede36\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\7c\\0646bfd53c1f0ed45ffd81563f30017717ca58\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\83\\36793a1b803478c1c654847373f0f106c467ce\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\92\\2522d0a1c9a031f5c6e11d3e20423e44806a3b\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\b8\\1197d9c02c98247424be82a7dd55dc419f39e5\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\c3\\88fdefe1f4aa420eef11abd4e88fd38236dfb5\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\info\\dummy\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\objects\\pack\\dummy\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Resources\\SubmoduleRepository.git\\refs\\heads\\master\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\GitSharp\\GitSharp.csproj\">\n      <Project>{7311850F-619A-4241-B09F-157792C75FBA}</Project>\n      <Name>GitSharp</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\GitSharp.Core\\GitSharp.Core.csproj\">\n      <Project>{C46EDD61-C202-465A-93F1-ADE20A83BB59}</Project>\n      <Name>GitSharp.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Git\\Git.csproj\">\n      <Project>{2A467118-E885-44FC-B7AF-DFAD937F6012}</Project>\n      <Name>Git</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Git\\Platform\\\" />\n    <Folder Include=\"Resources\\CorruptIndex\\.gitted\\refs\\tags\\\" />\n    <Folder Include=\"Resources\\JapaneseRepo\\.gitted\\refs\\tags\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\n      <Visible>False</Visible>\n      <ProductName>Windows Installer 3.1</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "GitSharp.Tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyTitle(\"GitSharp.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "GitSharp.Tests/README.txt",
    "content": "﻿GitSharp.Tests holds all unit tests. Most of them are ported from jgit. \nYou can run or debug this test suite by executing a test runner  of your\nchoice. We recommend Gallio Icarus (http://www.gallio.org/).\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/COMMIT_EDITMSG",
    "content": "Commit made through msysgit.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/HEAD",
    "content": "ref: refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/config",
    "content": "[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tsymlinks = false\n\tignorecase = true\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/description",
    "content": "Unnamed repository; edit this file 'description' to name the repository.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/applypatch-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message taken by\n# applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.  The hook is\n# allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"applypatch-msg\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/commit-msg\" &&\n\texec \"$GIT_DIR/hooks/commit-msg\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message.\n# Called by git-commit with one argument, the name of the file\n# that has the commit message.  The hook should exit with non-zero\n# status after issuing an appropriate message if it wants to stop the\n# commit.  The hook is allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"commit-msg\".\n\n# Uncomment the below to add a Signed-off-by line to the message.\n# Doing this in a hook is a bad idea in general, but the prepare-commit-msg\n# hook is more suited to it.\n#\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n\n# This example catches duplicate Signed-off-by lines.\n\ntest \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" || {\n\techo >&2 Duplicate Signed-off-by lines.\n\texit 1\n}\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/post-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script that is called after a successful\n# commit is made.\n#\n# To enable this hook, rename this file to \"post-commit\".\n\n: Nothing\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/post-receive.sample",
    "content": "#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  <oldrev> <newrev> <refname>\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n#\n# see contrib/hooks/ for an sample, or uncomment the next line and\n# rename the file to \"post-receive\".\n\n#. /usr/share/doc/git-core/contrib/hooks/post-receive-email\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/post-update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare a packed repository for use over\n# dumb transports.\n#\n# To enable this hook, rename this file to \"post-update\".\n\nexec git-update-server-info\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/pre-applypatch.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed\n# by applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-applypatch\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/pre-commit\" &&\n\texec \"$GIT_DIR/hooks/pre-commit\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/pre-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed.\n# Called by git-commit with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\nif git-rev-parse --verify HEAD >/dev/null 2>&1\nthen\n\tagainst=HEAD\nelse\n\t# Initial commit: diff against an empty tree object\n\tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\nexec git diff-index --check --cached $against --\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/pre-rebase.sample",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2006, 2008 Junio C Hamano\n#\n# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n# its job, and can prevent the command from running by exiting with\n# non-zero status.\n#\n# The hook is called with the following parameters:\n#\n# $1 -- the upstream the series was forked from.\n# $2 -- the branch being rebased (or empty when rebasing the current branch).\n#\n# This sample shows how to prevent topic branches that are already\n# merged to 'next' branch from getting rebased, because allowing it\n# would result in rebasing already published history.\n\npublish=next\nbasebranch=\"$1\"\nif test \"$#\" = 2\nthen\n\ttopic=\"refs/heads/$2\"\nelse\n\ttopic=`git symbolic-ref HEAD` ||\n\texit 0 ;# we do not interrupt rebasing detached HEAD\nfi\n\ncase \"$topic\" in\nrefs/heads/??/*)\n\t;;\n*)\n\texit 0 ;# we do not interrupt others.\n\t;;\nesac\n\n# Now we are dealing with a topic branch being rebased\n# on top of master.  Is it OK to rebase it?\n\n# Does the topic really exist?\ngit show-ref -q \"$topic\" || {\n\techo >&2 \"No such branch $topic\"\n\texit 1\n}\n\n# Is topic fully merged to master?\nnot_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\nif test -z \"$not_in_master\"\nthen\n\techo >&2 \"$topic is fully merged to master; better remove it.\"\n\texit 1 ;# we could allow it, but there is no point.\nfi\n\n# Is topic ever merged to next?  If so you should not be rebasing it.\nonly_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\nonly_next_2=`git-rev-list ^master           ${publish} | sort`\nif test \"$only_next_1\" = \"$only_next_2\"\nthen\n\tnot_in_topic=`git-rev-list \"^$topic\" master`\n\tif test -z \"$not_in_topic\"\n\tthen\n\t\techo >&2 \"$topic is already up-to-date with master\"\n\t\texit 1 ;# we could allow it, but there is no point.\n\telse\n\t\texit 0\n\tfi\nelse\n\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n\tperl -e '\n\t\tmy $topic = $ARGV[0];\n\t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n\t\tmy (%not_in_next) = map {\n\t\t\t/^([0-9a-f]+) /;\n\t\t\t($1 => 1);\n\t\t} split(/\\n/, $ARGV[1]);\n\t\tfor my $elem (map {\n\t\t\t\t/^([0-9a-f]+) (.*)$/;\n\t\t\t\t[$1 => $2];\n\t\t\t} split(/\\n/, $ARGV[2])) {\n\t\t\tif (!exists $not_in_next{$elem->[0]}) {\n\t\t\t\tif ($msg) {\n\t\t\t\t\tprint STDERR $msg;\n\t\t\t\t\tundef $msg;\n\t\t\t\t}\n\t\t\t\tprint STDERR \" $elem->[1]\\n\";\n\t\t\t}\n\t\t}\n\t' \"$topic\" \"$not_in_next\" \"$not_in_master\"\n\texit 1\nfi\n\nexit 0\n\n################################################################\n\nThis sample hook safeguards topic branches that have been\npublished from being rewound.\n\nThe workflow assumed here is:\n\n * Once a topic branch forks from \"master\", \"master\" is never\n   merged into it again (either directly or indirectly).\n\n * Once a topic branch is fully cooked and merged into \"master\",\n   it is deleted.  If you need to build on top of it to correct\n   earlier mistakes, a new topic branch is created by forking at\n   the tip of the \"master\".  This is not strictly necessary, but\n   it makes it easier to keep your history simple.\n\n * Whenever you need to test or publish your changes to topic\n   branches, merge them into \"next\" branch.\n\nThe script, being an example, hardcodes the publish branch name\nto be \"next\", but it is trivial to make it configurable via\n$GIT_DIR/config mechanism.\n\nWith this workflow, you would want to know:\n\n(1) ... if a topic branch has ever been merged to \"next\".  Young\n    topic branches can have stupid mistakes you would rather\n    clean up before publishing, and things that have not been\n    merged into other branches can be easily rebased without\n    affecting other people.  But once it is published, you would\n    not want to rewind it.\n\n(2) ... if a topic branch has been fully merged to \"master\".\n    Then you can delete it.  More importantly, you should not\n    build on top of it -- other people may already want to\n    change things related to the topic as patches against your\n    \"master\", so if you need further changes, it is better to\n    fork the topic (perhaps with the same name) afresh from the\n    tip of \"master\".\n\nLet's look at this example:\n\n\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n\t\t  /       /           /           /\n\t\t /   a---a---b A     /           /\n\t\t/   /               /           /\n\t       /   /   c---c---c---c B         /\n\t      /   /   /             \\         /\n\t     /   /   /   b---b C     \\       /\n\t    /   /   /   /             \\     /\n    ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n\n\nA, B and C are topic branches.\n\n * A has one fix since it was merged up to \"next\".\n\n * B has finished.  It has been fully merged up to \"master\" and \"next\",\n   and is ready to be deleted.\n\n * C has not merged to \"next\" at all.\n\nWe would want to allow C to be rebased, refuse A, and encourage\nB to be deleted.\n\nTo compute (1):\n\n\tgit-rev-list ^master ^topic next\n\tgit-rev-list ^master        next\n\n\tif these match, topic has not merged in next at all.\n\nTo compute (2):\n\n\tgit-rev-list master..topic\n\n\tif this is empty, it is fully merged to \"master\".\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/prepare-commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare the commit log message.\n# Called by git-commit with the name of the file that has the\n# commit message, followed by the description of the commit\n# message's source.  The hook's purpose is to edit the commit\n# message file.  If the hook fails with a non-zero status,\n# the commit is aborted.\n#\n# To enable this hook, rename this file to \"prepare-commit-msg\".\n\n# This hook includes three examples.  The first comments out the\n# \"Conflicts:\" part of a merge commit.\n#\n# The second includes the output of \"git diff --name-status -r\"\n# into the message, just before the \"git status\" output.  It is\n# commented because it doesn't cope with --amend or with squashed\n# commits.\n#\n# The third example adds a Signed-off-by line to the message, that can\n# still be edited.  This is rarely a good idea.\n\ncase \"$2,$3\" in\n  merge,)\n    perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' \"$1\" ;;\n\n# ,|template,)\n#   perl -i.bak -pe '\n#      print \"\\n\" . `git diff --cached --name-status -r`\n#\t if /^#/ && $first++ == 0' \"$1\" ;;\n\n  *) ;;\nesac\n\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/hooks/update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to blocks unannotated tags from entering.\n# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n# hooks.denycreatebranch\n#   This boolean sets whether remotely creating branches will be denied\n#   in the repository.  By default this is allowed.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" >&2\n\techo \" (if you want, you could supply GIT_DIR then run\" >&2\n\techo \"  $0 <ref> <oldrev> <newrev>)\" >&2\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"Usage: $0 <ref> <oldrev> <newrev>\" >&2\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\ndenycreatebranch=$(git config --bool hooks.denycreatebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\ncase \"$projectdesc\" in\n\"Unnamed repository\"* | \"\")\n\techo \"*** Project description file hasn't been set\" >&2\n\texit 1\n\t;;\nesac\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nzero=\"0000000000000000000000000000000000000000\"\nif [ \"$newrev\" = \"$zero\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git-cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" >&2\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\tif [ \"$oldrev\" = \"$zero\" -a \"$denycreatebranch\" = \"true\" ]; then\n\t\t\techo \"*** Creating a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" >&2\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/info/exclude",
    "content": "# git-ls-files --others --exclude-from=.git/info/exclude\n# Lines that start with '#' are comments.\n# For a project mostly in C, the following would be a good set of\n# exclude patterns (uncomment them if you want to use them):\n# *.[oa]\n# *~\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/logs/HEAD",
    "content": "0000000000000000000000000000000000000000 dc8d7f3d2d19bdf3a6daa007102bc7bef76aa8ac nulltoken <emeric.fermas@gmail.com> 1256476701 +0100\tcommit (initial): Commit made through msysgit.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/logs/refs/heads/master",
    "content": "0000000000000000000000000000000000000000 dc8d7f3d2d19bdf3a6daa007102bc7bef76aa8ac nulltoken <emeric.fermas@gmail.com> 1256476701 +0100\tcommit (initial): Commit made through msysgit.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/objects/info/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/objects/pack/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/.gitted/refs/heads/master",
    "content": "dc8d7f3d2d19bdf3a6daa007102bc7bef76aa8ac\n"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/a.txt",
    "content": "a"
  },
  {
    "path": "GitSharp.Tests/Resources/CorruptIndex/b.txt",
    "content": "b"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/.gitattributes",
    "content": "*.patch -crlf\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/E.patch",
    "content": "diff --git a/E b/E\nindex e69de29..7898192 100644\n--- a/E\n+++ b/E\n@@ -0,0 +1 @@\n+a\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/E_PostImage",
    "content": "a\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/E_PreImage",
    "content": ""
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/X.patch",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -2,2 +2,3 @@ a\n b\n+c\n d\n@@ -16,4 +17,2 @@ p\n q\n-r\n-s\n t\n@@ -22,4 +21,8 @@ v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/X_PostImage",
    "content": "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nt\nu\nv\nw\n0\n1\n2\n3\n4\n5\nz\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/X_PreImage",
    "content": "a\nb\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nw\nx\ny\nz\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Y.patch",
    "content": "diff --git a/Y b/Y\nindex 2e65efe..7898192 100644\n--- a/Y\n+++ b/Y\n@@ -1 +1 @@\n-a\n\\ No newline at end of file\n+a\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Y_PostImage",
    "content": "a\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Y_PreImage",
    "content": "a"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Z.patch",
    "content": "diff --git a/Z b/Z\nindex 7898192..2e65efe 100644\n--- a/Z\n+++ b/Z\n@@ -1 +1 @@\n-a\n+a\n\\ No newline at end of file\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Z_PostImage",
    "content": "a"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/Z_PreImage",
    "content": "a\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext0.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -2,0 +3 @@\n+c\n@@ -17,2 +17,0 @@\n-r\n-s\n@@ -23,2 +22,6 @@\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext1.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -2,2 +2,3 @@\n b\n+c\n d\n@@ -16,4 +17,2 @@\n q\n-r\n-s\n t\n@@ -22,4 +21,8 @@\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext10.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -1,25 +1,28 @@\n a\n b\n+c\n d\n e\n f\n g\n h\n i\n j\n k\n l\n m\n n\n o\n p\n q\n-r\n-s\n t\n u\n v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext100.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -1,25 +1,28 @@\n a\n b\n+c\n d\n e\n f\n g\n h\n i\n j\n k\n l\n m\n n\n o\n p\n q\n-r\n-s\n t\n u\n v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext3.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -1,5 +1,6 @@\n a\n b\n+c\n d\n e\n f\n@@ -14,12 +15,14 @@\n o\n p\n q\n-r\n-s\n t\n u\n v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Diff/testContext5.out",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -1,7 +1,8 @@\n a\n b\n+c\n d\n e\n f\n g\n h\n@@ -12,14 +13,16 @@\n m\n n\n o\n p\n q\n-r\n-s\n t\n u\n v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/HEAD",
    "content": "ref: refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/config",
    "content": "[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tsymlinks = false\n\tignorecase = true\n[gui]\n\tgeometry = 965x490+426+345 201 158\n[user]\n\temail = paupawsan-learning@yahoo.com\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/description",
    "content": "Unnamed repository; edit this file 'description' to name the repository.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/applypatch-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message taken by\n# applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.  The hook is\n# allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"applypatch-msg\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/commit-msg\" &&\n\texec \"$GIT_DIR/hooks/commit-msg\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message.\n# Called by git-commit with one argument, the name of the file\n# that has the commit message.  The hook should exit with non-zero\n# status after issuing an appropriate message if it wants to stop the\n# commit.  The hook is allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"commit-msg\".\n\n# Uncomment the below to add a Signed-off-by line to the message.\n# Doing this in a hook is a bad idea in general, but the prepare-commit-msg\n# hook is more suited to it.\n#\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n\n# This example catches duplicate Signed-off-by lines.\n\ntest \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" || {\n\techo >&2 Duplicate Signed-off-by lines.\n\texit 1\n}\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/post-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script that is called after a successful\n# commit is made.\n#\n# To enable this hook, rename this file to \"post-commit\".\n\n: Nothing\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/post-receive.sample",
    "content": "#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  <oldrev> <newrev> <refname>\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n#\n# see contrib/hooks/ for an sample, or uncomment the next line and\n# rename the file to \"post-receive\".\n\n#. /usr/share/doc/git-core/contrib/hooks/post-receive-email\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/post-update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare a packed repository for use over\n# dumb transports.\n#\n# To enable this hook, rename this file to \"post-update\".\n\nexec git-update-server-info\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/pre-applypatch.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed\n# by applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-applypatch\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/pre-commit\" &&\n\texec \"$GIT_DIR/hooks/pre-commit\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/pre-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed.\n# Called by git-commit with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\n# If you want to allow non-ascii filenames set this variable to true.\nallownonascii=$(git config hooks.allownonascii)\n\n# Cross platform projects tend to avoid non-ascii filenames; prevent\n# them from being added to the repository. We exploit the fact that the\n# printable range starts at the space character and ends with tilde.\nif [ \"$allownonascii\" != \"true\" ] &&\n\ttest \"$(git diff --cached --name-only --diff-filter=A -z |\n\t  LC_ALL=C tr -d '[ -~]\\0')\"\nthen\n\techo \"Error: Attempt to add a non-ascii filename.\"\n\techo\n\techo \"This can cause problems if you want to work together\"\n\techo \"with people on other platforms than you.\"\n\techo\n\techo \"To be portable it is adviseable to rename the file ...\"\n\techo\n\techo \"If you know what you are doing you can disable this\"\n\techo \"check using:\"\n\techo\n\techo \"  git config hooks.allownonascii true\"\n\techo\n\texit 1\nfi\n\nif git-rev-parse --verify HEAD >/dev/null 2>&1\nthen\n\tagainst=HEAD\nelse\n\t# Initial commit: diff against an empty tree object\n\tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\nexec git diff-index --check --cached $against --\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/pre-rebase.sample",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2006, 2008 Junio C Hamano\n#\n# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n# its job, and can prevent the command from running by exiting with\n# non-zero status.\n#\n# The hook is called with the following parameters:\n#\n# $1 -- the upstream the series was forked from.\n# $2 -- the branch being rebased (or empty when rebasing the current branch).\n#\n# This sample shows how to prevent topic branches that are already\n# merged to 'next' branch from getting rebased, because allowing it\n# would result in rebasing already published history.\n\npublish=next\nbasebranch=\"$1\"\nif test \"$#\" = 2\nthen\n\ttopic=\"refs/heads/$2\"\nelse\n\ttopic=`git symbolic-ref HEAD` ||\n\texit 0 ;# we do not interrupt rebasing detached HEAD\nfi\n\ncase \"$topic\" in\nrefs/heads/??/*)\n\t;;\n*)\n\texit 0 ;# we do not interrupt others.\n\t;;\nesac\n\n# Now we are dealing with a topic branch being rebased\n# on top of master.  Is it OK to rebase it?\n\n# Does the topic really exist?\ngit show-ref -q \"$topic\" || {\n\techo >&2 \"No such branch $topic\"\n\texit 1\n}\n\n# Is topic fully merged to master?\nnot_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\nif test -z \"$not_in_master\"\nthen\n\techo >&2 \"$topic is fully merged to master; better remove it.\"\n\texit 1 ;# we could allow it, but there is no point.\nfi\n\n# Is topic ever merged to next?  If so you should not be rebasing it.\nonly_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\nonly_next_2=`git-rev-list ^master           ${publish} | sort`\nif test \"$only_next_1\" = \"$only_next_2\"\nthen\n\tnot_in_topic=`git-rev-list \"^$topic\" master`\n\tif test -z \"$not_in_topic\"\n\tthen\n\t\techo >&2 \"$topic is already up-to-date with master\"\n\t\texit 1 ;# we could allow it, but there is no point.\n\telse\n\t\texit 0\n\tfi\nelse\n\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n\tperl -e '\n\t\tmy $topic = $ARGV[0];\n\t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n\t\tmy (%not_in_next) = map {\n\t\t\t/^([0-9a-f]+) /;\n\t\t\t($1 => 1);\n\t\t} split(/\\n/, $ARGV[1]);\n\t\tfor my $elem (map {\n\t\t\t\t/^([0-9a-f]+) (.*)$/;\n\t\t\t\t[$1 => $2];\n\t\t\t} split(/\\n/, $ARGV[2])) {\n\t\t\tif (!exists $not_in_next{$elem->[0]}) {\n\t\t\t\tif ($msg) {\n\t\t\t\t\tprint STDERR $msg;\n\t\t\t\t\tundef $msg;\n\t\t\t\t}\n\t\t\t\tprint STDERR \" $elem->[1]\\n\";\n\t\t\t}\n\t\t}\n\t' \"$topic\" \"$not_in_next\" \"$not_in_master\"\n\texit 1\nfi\n\nexit 0\n\n################################################################\n\nThis sample hook safeguards topic branches that have been\npublished from being rewound.\n\nThe workflow assumed here is:\n\n * Once a topic branch forks from \"master\", \"master\" is never\n   merged into it again (either directly or indirectly).\n\n * Once a topic branch is fully cooked and merged into \"master\",\n   it is deleted.  If you need to build on top of it to correct\n   earlier mistakes, a new topic branch is created by forking at\n   the tip of the \"master\".  This is not strictly necessary, but\n   it makes it easier to keep your history simple.\n\n * Whenever you need to test or publish your changes to topic\n   branches, merge them into \"next\" branch.\n\nThe script, being an example, hardcodes the publish branch name\nto be \"next\", but it is trivial to make it configurable via\n$GIT_DIR/config mechanism.\n\nWith this workflow, you would want to know:\n\n(1) ... if a topic branch has ever been merged to \"next\".  Young\n    topic branches can have stupid mistakes you would rather\n    clean up before publishing, and things that have not been\n    merged into other branches can be easily rebased without\n    affecting other people.  But once it is published, you would\n    not want to rewind it.\n\n(2) ... if a topic branch has been fully merged to \"master\".\n    Then you can delete it.  More importantly, you should not\n    build on top of it -- other people may already want to\n    change things related to the topic as patches against your\n    \"master\", so if you need further changes, it is better to\n    fork the topic (perhaps with the same name) afresh from the\n    tip of \"master\".\n\nLet's look at this example:\n\n\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n\t\t  /       /           /           /\n\t\t /   a---a---b A     /           /\n\t\t/   /               /           /\n\t       /   /   c---c---c---c B         /\n\t      /   /   /             \\         /\n\t     /   /   /   b---b C     \\       /\n\t    /   /   /   /             \\     /\n    ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n\n\nA, B and C are topic branches.\n\n * A has one fix since it was merged up to \"next\".\n\n * B has finished.  It has been fully merged up to \"master\" and \"next\",\n   and is ready to be deleted.\n\n * C has not merged to \"next\" at all.\n\nWe would want to allow C to be rebased, refuse A, and encourage\nB to be deleted.\n\nTo compute (1):\n\n\tgit-rev-list ^master ^topic next\n\tgit-rev-list ^master        next\n\n\tif these match, topic has not merged in next at all.\n\nTo compute (2):\n\n\tgit-rev-list master..topic\n\n\tif this is empty, it is fully merged to \"master\".\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/prepare-commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare the commit log message.\n# Called by git-commit with the name of the file that has the\n# commit message, followed by the description of the commit\n# message's source.  The hook's purpose is to edit the commit\n# message file.  If the hook fails with a non-zero status,\n# the commit is aborted.\n#\n# To enable this hook, rename this file to \"prepare-commit-msg\".\n\n# This hook includes three examples.  The first comments out the\n# \"Conflicts:\" part of a merge commit.\n#\n# The second includes the output of \"git diff --name-status -r\"\n# into the message, just before the \"git status\" output.  It is\n# commented because it doesn't cope with --amend or with squashed\n# commits.\n#\n# The third example adds a Signed-off-by line to the message, that can\n# still be edited.  This is rarely a good idea.\n\ncase \"$2,$3\" in\n  merge,)\n    perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' \"$1\" ;;\n\n# ,|template,)\n#   perl -i.bak -pe '\n#      print \"\\n\" . `git diff --cached --name-status -r`\n#\t if /^#/ && $first++ == 0' \"$1\" ;;\n\n  *) ;;\nesac\n\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/hooks/update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to blocks unannotated tags from entering.\n# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowmodifytag\n#   This boolean sets whether a tag may be modified after creation. By default\n#   it won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n# hooks.denycreatebranch\n#   This boolean sets whether remotely creating branches will be denied\n#   in the repository.  By default this is allowed.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" >&2\n\techo \" (if you want, you could supply GIT_DIR then run\" >&2\n\techo \"  $0 <ref> <oldrev> <newrev>)\" >&2\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"Usage: $0 <ref> <oldrev> <newrev>\" >&2\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\ndenycreatebranch=$(git config --bool hooks.denycreatebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\nallowmodifytag=$(git config --bool hooks.allowmodifytag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\ncase \"$projectdesc\" in\n\"Unnamed repository\"* | \"\")\n\techo \"*** Project description file hasn't been set\" >&2\n\texit 1\n\t;;\nesac\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nzero=\"0000000000000000000000000000000000000000\"\nif [ \"$newrev\" = \"$zero\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git-cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" >&2\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\tif [ \"$allowmodifytag\" != \"true\" ] && git rev-parse $refname > /dev/null 2>&1\n\t\tthen\n\t\t\techo \"*** Tag '$refname' already exists.\" >&2\n\t\t\techo \"*** Modifying a tag is not allowed in this repository.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\tif [ \"$oldrev\" = \"$zero\" -a \"$denycreatebranch\" = \"true\" ]; then\n\t\t\techo \"*** Creating a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" >&2\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/info/exclude",
    "content": "# git-ls-files --others --exclude-from=.git/info/exclude\n# Lines that start with '#' are comments.\n# For a project mostly in C, the following would be a good set of\n# exclude patterns (uncomment them if you want to use them):\n# *.[oa]\n# *~\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/logs/HEAD",
    "content": "0000000000000000000000000000000000000000 24ed0e20ceff5e2cdf768345b6853213f840ff8f PauPaw <paupawsan-learning@yahoo.com> 1257246223 +0900\tcommit (initial): R~bg̃bZ[W{łĂ݂܂B\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/logs/refs/heads/master",
    "content": "0000000000000000000000000000000000000000 24ed0e20ceff5e2cdf768345b6853213f840ff8f PauPaw <paupawsan-learning@yahoo.com> 1257246223 +0900\tcommit (initial): R~bg̃bZ[W{łĂ݂܂B\n"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/objects/24/ed0e20ceff5e2cdf768345b6853213f840ff8f",
    "content": "x\u0001Aj\u00021\u0018FSd/L&&\u0013(G\ncBg\"\fҝI\rܔ\u000b[(M7\u001e\u00031WpxI˄̯9F++\r\u0007\u0019%4F%-yaJ댺v\u001b6nHsv3nJ\u0019׏zR?=-@\u000b(X\u001bγ=m[wq CFZ!%\u0017/\u001e\u0007q\u0018up@X\"?re"
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/objects/2f/3c75408acf76bb7122b91c418d015252708552",
    "content": "x\u0001\n0\u0014F\u0014E_\u0006DjE|\u0003q\u0016lS\u0014\u0011\\n:\u0006|\u0006\u0003p\u000bmD*d>T=i,V\u000b\u00039s(&-Hr!0:\f\u0014\u001f7\u001e\u0005e\u0007\u000fX%n%]0p\u001b[\\=\f]U\u001d\u0010.kEf\\r:g1t(?\u0017\u001b\u0018\u0017T("
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/objects/info/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/objects/pack/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/JapaneseRepo/.gitted/refs/heads/master",
    "content": "24ed0e20ceff5e2cdf768345b6853213f840ff8f\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/COMMIT_EDITMSG",
    "content": "Adding one file.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/HEAD",
    "content": "ref: refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/config",
    "content": "[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tsymlinks = false\n\tignorecase = true\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/description",
    "content": "Unnamed repository; edit this file 'description' to name the repository.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/applypatch-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message taken by\n# applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.  The hook is\n# allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"applypatch-msg\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/commit-msg\" &&\n\texec \"$GIT_DIR/hooks/commit-msg\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message.\n# Called by git-commit with one argument, the name of the file\n# that has the commit message.  The hook should exit with non-zero\n# status after issuing an appropriate message if it wants to stop the\n# commit.  The hook is allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"commit-msg\".\n\n# Uncomment the below to add a Signed-off-by line to the message.\n# Doing this in a hook is a bad idea in general, but the prepare-commit-msg\n# hook is more suited to it.\n#\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n\n# This example catches duplicate Signed-off-by lines.\n\ntest \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" || {\n\techo >&2 Duplicate Signed-off-by lines.\n\texit 1\n}\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/post-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script that is called after a successful\n# commit is made.\n#\n# To enable this hook, rename this file to \"post-commit\".\n\n: Nothing\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/post-receive.sample",
    "content": "#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  <oldrev> <newrev> <refname>\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n#\n# see contrib/hooks/ for an sample, or uncomment the next line and\n# rename the file to \"post-receive\".\n\n#. /usr/share/doc/git-core/contrib/hooks/post-receive-email\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/post-update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare a packed repository for use over\n# dumb transports.\n#\n# To enable this hook, rename this file to \"post-update\".\n\nexec git-update-server-info\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/pre-applypatch.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed\n# by applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-applypatch\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/pre-commit\" &&\n\texec \"$GIT_DIR/hooks/pre-commit\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/pre-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed.\n# Called by git-commit with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\nif git-rev-parse --verify HEAD >/dev/null 2>&1\nthen\n\tagainst=HEAD\nelse\n\t# Initial commit: diff against an empty tree object\n\tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\nexec git diff-index --check --cached $against --\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/pre-rebase.sample",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2006, 2008 Junio C Hamano\n#\n# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n# its job, and can prevent the command from running by exiting with\n# non-zero status.\n#\n# The hook is called with the following parameters:\n#\n# $1 -- the upstream the series was forked from.\n# $2 -- the branch being rebased (or empty when rebasing the current branch).\n#\n# This sample shows how to prevent topic branches that are already\n# merged to 'next' branch from getting rebased, because allowing it\n# would result in rebasing already published history.\n\npublish=next\nbasebranch=\"$1\"\nif test \"$#\" = 2\nthen\n\ttopic=\"refs/heads/$2\"\nelse\n\ttopic=`git symbolic-ref HEAD` ||\n\texit 0 ;# we do not interrupt rebasing detached HEAD\nfi\n\ncase \"$topic\" in\nrefs/heads/??/*)\n\t;;\n*)\n\texit 0 ;# we do not interrupt others.\n\t;;\nesac\n\n# Now we are dealing with a topic branch being rebased\n# on top of master.  Is it OK to rebase it?\n\n# Does the topic really exist?\ngit show-ref -q \"$topic\" || {\n\techo >&2 \"No such branch $topic\"\n\texit 1\n}\n\n# Is topic fully merged to master?\nnot_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\nif test -z \"$not_in_master\"\nthen\n\techo >&2 \"$topic is fully merged to master; better remove it.\"\n\texit 1 ;# we could allow it, but there is no point.\nfi\n\n# Is topic ever merged to next?  If so you should not be rebasing it.\nonly_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\nonly_next_2=`git-rev-list ^master           ${publish} | sort`\nif test \"$only_next_1\" = \"$only_next_2\"\nthen\n\tnot_in_topic=`git-rev-list \"^$topic\" master`\n\tif test -z \"$not_in_topic\"\n\tthen\n\t\techo >&2 \"$topic is already up-to-date with master\"\n\t\texit 1 ;# we could allow it, but there is no point.\n\telse\n\t\texit 0\n\tfi\nelse\n\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n\tperl -e '\n\t\tmy $topic = $ARGV[0];\n\t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n\t\tmy (%not_in_next) = map {\n\t\t\t/^([0-9a-f]+) /;\n\t\t\t($1 => 1);\n\t\t} split(/\\n/, $ARGV[1]);\n\t\tfor my $elem (map {\n\t\t\t\t/^([0-9a-f]+) (.*)$/;\n\t\t\t\t[$1 => $2];\n\t\t\t} split(/\\n/, $ARGV[2])) {\n\t\t\tif (!exists $not_in_next{$elem->[0]}) {\n\t\t\t\tif ($msg) {\n\t\t\t\t\tprint STDERR $msg;\n\t\t\t\t\tundef $msg;\n\t\t\t\t}\n\t\t\t\tprint STDERR \" $elem->[1]\\n\";\n\t\t\t}\n\t\t}\n\t' \"$topic\" \"$not_in_next\" \"$not_in_master\"\n\texit 1\nfi\n\nexit 0\n\n################################################################\n\nThis sample hook safeguards topic branches that have been\npublished from being rewound.\n\nThe workflow assumed here is:\n\n * Once a topic branch forks from \"master\", \"master\" is never\n   merged into it again (either directly or indirectly).\n\n * Once a topic branch is fully cooked and merged into \"master\",\n   it is deleted.  If you need to build on top of it to correct\n   earlier mistakes, a new topic branch is created by forking at\n   the tip of the \"master\".  This is not strictly necessary, but\n   it makes it easier to keep your history simple.\n\n * Whenever you need to test or publish your changes to topic\n   branches, merge them into \"next\" branch.\n\nThe script, being an example, hardcodes the publish branch name\nto be \"next\", but it is trivial to make it configurable via\n$GIT_DIR/config mechanism.\n\nWith this workflow, you would want to know:\n\n(1) ... if a topic branch has ever been merged to \"next\".  Young\n    topic branches can have stupid mistakes you would rather\n    clean up before publishing, and things that have not been\n    merged into other branches can be easily rebased without\n    affecting other people.  But once it is published, you would\n    not want to rewind it.\n\n(2) ... if a topic branch has been fully merged to \"master\".\n    Then you can delete it.  More importantly, you should not\n    build on top of it -- other people may already want to\n    change things related to the topic as patches against your\n    \"master\", so if you need further changes, it is better to\n    fork the topic (perhaps with the same name) afresh from the\n    tip of \"master\".\n\nLet's look at this example:\n\n\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n\t\t  /       /           /           /\n\t\t /   a---a---b A     /           /\n\t\t/   /               /           /\n\t       /   /   c---c---c---c B         /\n\t      /   /   /             \\         /\n\t     /   /   /   b---b C     \\       /\n\t    /   /   /   /             \\     /\n    ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n\n\nA, B and C are topic branches.\n\n * A has one fix since it was merged up to \"next\".\n\n * B has finished.  It has been fully merged up to \"master\" and \"next\",\n   and is ready to be deleted.\n\n * C has not merged to \"next\" at all.\n\nWe would want to allow C to be rebased, refuse A, and encourage\nB to be deleted.\n\nTo compute (1):\n\n\tgit-rev-list ^master ^topic next\n\tgit-rev-list ^master        next\n\n\tif these match, topic has not merged in next at all.\n\nTo compute (2):\n\n\tgit-rev-list master..topic\n\n\tif this is empty, it is fully merged to \"master\".\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/prepare-commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare the commit log message.\n# Called by git-commit with the name of the file that has the\n# commit message, followed by the description of the commit\n# message's source.  The hook's purpose is to edit the commit\n# message file.  If the hook fails with a non-zero status,\n# the commit is aborted.\n#\n# To enable this hook, rename this file to \"prepare-commit-msg\".\n\n# This hook includes three examples.  The first comments out the\n# \"Conflicts:\" part of a merge commit.\n#\n# The second includes the output of \"git diff --name-status -r\"\n# into the message, just before the \"git status\" output.  It is\n# commented because it doesn't cope with --amend or with squashed\n# commits.\n#\n# The third example adds a Signed-off-by line to the message, that can\n# still be edited.  This is rarely a good idea.\n\ncase \"$2,$3\" in\n  merge,)\n    perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' \"$1\" ;;\n\n# ,|template,)\n#   perl -i.bak -pe '\n#      print \"\\n\" . `git diff --cached --name-status -r`\n#\t if /^#/ && $first++ == 0' \"$1\" ;;\n\n  *) ;;\nesac\n\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/hooks/update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to blocks unannotated tags from entering.\n# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n# hooks.denycreatebranch\n#   This boolean sets whether remotely creating branches will be denied\n#   in the repository.  By default this is allowed.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" >&2\n\techo \" (if you want, you could supply GIT_DIR then run\" >&2\n\techo \"  $0 <ref> <oldrev> <newrev>)\" >&2\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"Usage: $0 <ref> <oldrev> <newrev>\" >&2\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\ndenycreatebranch=$(git config --bool hooks.denycreatebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\ncase \"$projectdesc\" in\n\"Unnamed repository\"* | \"\")\n\techo \"*** Project description file hasn't been set\" >&2\n\texit 1\n\t;;\nesac\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nzero=\"0000000000000000000000000000000000000000\"\nif [ \"$newrev\" = \"$zero\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git-cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" >&2\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\tif [ \"$oldrev\" = \"$zero\" -a \"$denycreatebranch\" = \"true\" ]; then\n\t\t\techo \"*** Creating a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" >&2\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/info/exclude",
    "content": "# git-ls-files --others --exclude-from=.git/info/exclude\n# Lines that start with '#' are comments.\n# For a project mostly in C, the following would be a good set of\n# exclude patterns (uncomment them if you want to use them):\n# *.[oa]\n# *~\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/logs/HEAD",
    "content": "0000000000000000000000000000000000000000 f3ca78a01f1baa4eaddcc349c97dcab95a379981 nulltoken <emeric.fermas@gmail.com> 1255117188 +0200\tcommit (initial): Adding one file.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/logs/refs/heads/master",
    "content": "0000000000000000000000000000000000000000 f3ca78a01f1baa4eaddcc349c97dcab95a379981 nulltoken <emeric.fermas@gmail.com> 1255117188 +0200\tcommit (initial): Adding one file.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/objects/f3/ca78a01f1baa4eaddcc349c97dcab95a379981",
    "content": "x\u0001K\n \u0014F]ŝ\u0017k\u0014\r.Ř?\u0007Xf\r\u001e8\u0006w\u0001>q0\u001elf\rN*.Np:\u001aE8ǻugΣ}P遂K>\u0012RX[{+5\u001d׶zP=eH\u0003=H"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/objects/info/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/objects/pack/marker.txt",
    "content": "﻿Nothing interesting here. Only a file to make sure parent directory is being considered by git."
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/.gitted/refs/heads/master",
    "content": "f3ca78a01f1baa4eaddcc349c97dcab95a379981\n"
  },
  {
    "path": "GitSharp.Tests/Resources/OneFileRepository/dummy.txt",
    "content": "Dummy indeed"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/.gitattributes",
    "content": "*.patch -crlf\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testEditList_Types.patch",
    "content": "diff --git a/X b/X\nindex a3648a1..2d44096 100644\n--- a/X\n+++ b/X\n@@ -2,2 +2,3 @@ a\n b\n+c\n d\n@@ -16,4 +17,2 @@ p\n q\n-r\n-s\n t\n@@ -22,4 +21,8 @@ v\n w\n-x\n-y\n+0\n+1\n+2\n+3\n+4\n+5\n z\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_BodyTooLong.patch",
    "content": "diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\nindex da7e704..34ce04a 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n@@ -109,4 +109,11 @@ assertTrue(Arrays.equals(values.toArray(), repositoryConfig\n        .getStringList(\"my\", null, \"somename\")));\n    checkFile(cfgFile, \"[my]\\n\\tsomename = value1\\n\\tsomename = value2\\n\");\n  }\n+\n+ public void test006_readCaseInsensitive() throws IOException {\n+   final File path = writeTrashFile(\"config_001\", \"[Foo]\\nBar\\n\");\n+   RepositoryConfig repositoryConfig = new RepositoryConfig(null, path);\n+BAD LINE\n+   assertEquals(true, repositoryConfig.getBoolean(\"foo\", null, \"bar\", false));\n+   assertEquals(\"\", repositoryConfig.getString(\"foo\", null, \"bar\"));\n+ }\n }\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_CcTruncatedOld.patch",
    "content": "commit 1a56639bbea8e8cbfbe5da87746de97f9217ce9b\nDate:   Tue May 13 00:43:56 2008 +0200\n      ...\n\ndiff --cc org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\nindex 169356b,dd8c317..fd85931\nmode 100644,100644..100755\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n@@@ -55,12 -163,13 +163,15 @@@ public class UIText extends NLS \n  \n  \t/** */\n  \tpublic static String ResourceHistory_toggleCommentWrap;\n+ \n  \t/** */\n +\t/** */\n  \tpublic static String ResourceHistory_toggleRevDetail;\n  \t/** */\n  \tpublic static String ResourceHistory_toggleRevComment;\n  \t/** */\n  \tpublic static String ResourceHistory_toggleTooltips;\n  \n\ncommit 1a56639bbea8e8cbfbe5da87746de97f9217ce9b\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_DisconnectedHunk.patch",
    "content": "From: A. U. Thor\n\n@@ -109,4 +109,11 @@ assertTrue(Arrays.equals(values.toArray(), repositoryConfig\n        .getStringList(\"my\", null, \"somename\")));\n    checkFile(cfgFile, \"[my]\\n\\tsomename = value1\\n\\tsomename = value2\\n\");\n  }\n+\n+ public void test006_readCaseInsensitive() throws IOException {\n+   final File path = writeTrashFile(\"config_001\", \"[Foo]\\nBar\\n\");\n+   RepositoryConfig repositoryConfig = new RepositoryConfig(null, path);\n+   assertEquals(true, repositoryConfig.getBoolean(\"foo\", null, \"bar\", false));\n+   assertEquals(\"\", repositoryConfig.getString(\"foo\", null, \"bar\"));\n+ }\n }\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 45c2f8a..3291bba 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -236,9 +236,9 @@ protected boolean getBoolean(final String section, String subsection,\n      return defaultValue;\n \n    n = n.toLowerCase();\n-   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equals(n) || \"true\".equals(n) || \"1\".equals(n)) {\n+   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equalsIgnoreCase(n) || \"true\".equalsIgnoreCase(n) || \"1\".equals(n)) {\n      return true;\n-   } else if (\"no\".equals(n) || \"false\".equals(n) || \"0\".equals(n)) {\n+   } else if (\"no\".equalsIgnoreCase(n) || \"false\".equalsIgnoreCase(n) || \"0\".equalsIgnoreCase(n)) {\n      return false;\n    } else {\n      throw new IllegalArgumentException(\"Invalid boolean value: \"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_GarbageBetweenFiles.patch",
    "content": "diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\nindex da7e704..34ce04a 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n@@ -109,4 +109,11 @@ assertTrue(Arrays.equals(values.toArray(), repositoryConfig\n        .getStringList(\"my\", null, \"somename\")));\n    checkFile(cfgFile, \"[my]\\n\\tsomename = value1\\n\\tsomename = value2\\n\");\n  }\n+\n+ public void test006_readCaseInsensitive() throws IOException {\n+   final File path = writeTrashFile(\"config_001\", \"[Foo]\\nBar\\n\");\n+   RepositoryConfig repositoryConfig = new RepositoryConfig(null, path);\n+   assertEquals(true, repositoryConfig.getBoolean(\"foo\", null, \"bar\", false));\n+   assertEquals(\"\", repositoryConfig.getString(\"foo\", null, \"bar\"));\n+ }\n }\nI AM NOT HERE\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 45c2f8a..3291bba 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -236,9 +236,9 @@ protected boolean getBoolean(final String section, String subsection,\n      return defaultValue;\n \n    n = n.toLowerCase();\n-   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equals(n) || \"true\".equals(n) || \"1\".equals(n)) {\n+   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equalsIgnoreCase(n) || \"true\".equalsIgnoreCase(n) || \"1\".equals(n)) {\n      return true;\n-   } else if (\"no\".equals(n) || \"false\".equals(n) || \"0\".equals(n)) {\n+   } else if (\"no\".equalsIgnoreCase(n) || \"false\".equalsIgnoreCase(n) || \"0\".equalsIgnoreCase(n)) {\n      return false;\n    } else {\n      throw new IllegalArgumentException(\"Invalid boolean value: \"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_GitBinaryNoForwardHunk.patch",
    "content": " create mode 100644 org.spearce.egit.ui/icons/toolbar/pushe.png\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetchd.png b/org.spearce.egit.ui/icons/toolbar/fetchd.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..4433c543f2a52b586a3ed5e31b138244107bc239\nGIT binary patch\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetche.png b/org.spearce.egit.ui/icons/toolbar/fetche.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..0ffeb419e6ab302caa5e58661854b33853dc43dc\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_TruncatedNew.patch",
    "content": "diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 45c2f8a..3291bba 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -236,9 +236,9 @@ protected boolean getBoolean(final String section, String subsection,\n      return defaultValue;\n \n    n = n.toLowerCase();\n-   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equals(n) || \"true\".equals(n) || \"1\".equals(n)) {\n      return true;\n-   } else if (\"no\".equals(n) || \"false\".equals(n) || \"0\".equals(n)) {\n+   } else if (\"no\".equalsIgnoreCase(n) || \"false\".equalsIgnoreCase(n) || \"0\".equalsIgnoreCase(n)) {\n      return false;\n    } else {\n      throw new IllegalArgumentException(\"Invalid boolean value: \"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testError_TruncatedOld.patch",
    "content": "diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 45c2f8a..3291bba 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -236,9 +236,9 @@ protected boolean getBoolean(final String section, String subsection,\n      return defaultValue;\n \n    n = n.toLowerCase();\n-   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equals(n) || \"true\".equals(n) || \"1\".equals(n)) {\n+   if (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equalsIgnoreCase(n) || \"true\".equalsIgnoreCase(n) || \"1\".equals(n)) {\n      return true;\n+   } else if (\"no\".equalsIgnoreCase(n) || \"false\".equalsIgnoreCase(n) || \"0\".equalsIgnoreCase(n)) {\n      return false;\n    } else {\n      throw new IllegalArgumentException(\"Invalid boolean value: \"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testGetText_BothISO88591.patch",
    "content": "diff --git a/X b/X\nindex 014ef30..8c80a36 100644\n--- a/X\n+++ b/X\n@@ -1,7 +1,7 @@\n a\n b\n c\n-ngstrm\n+line 4 ngstrm\n d\n e\n f\n@@ -13,6 +13,6 @@ k\n l\n m\n n\n-ngstrm\n+ngstrm; line 16\n o\n p\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testGetText_Convert.patch",
    "content": "diff --git a/X b/X\nindex 014ef30..209db0d 100644\n--- a/X\n+++ b/X\n@@ -1,7 +1,7 @@\n a\n b\n c\n-ngstrm\n+Ångström\n d\n e\n f\n@@ -13,6 +13,6 @@ k\n l\n m\n n\n-ngstrm\n+Ångström\n o\n p\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testGetText_DiffCc.patch",
    "content": "diff --cc X\nindex bdfc9f4,209db0d..474bd69\n--- a/X\n+++ b/X\n@@@ -1,7 -1,7 +1,7 @@@\n  a\n--b\n  c\n +test ngstrm\n+ Ångström\n  d\n  e\n  f\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testGetText_NoBinary.patch",
    "content": "diff --git a/org.spearce.egit.ui/icons/toolbar/fetchd.png b/org.spearce.egit.ui/icons/toolbar/fetchd.png\nnew file mode 100644\nindex 0000000..4433c54\nBinary files /dev/null and b/org.spearce.egit.ui/icons/toolbar/fetchd.png differ\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_AddNoNewline.patch",
    "content": "From ca4719a4b2d93a469f61d1ddfb3e39ecbabfcd69 Mon Sep 17 00:00:00 2001\nFrom: Shawn O. Pearce <sop@google.com>\nDate: Fri, 12 Dec 2008 12:35:14 -0800\nSubject: [PATCH] introduce no lf again\n\n---\n a |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/a b/a\nindex f2ad6c7..c59d9b6 100644\n--- a/a\n+++ b/a\n@@ -1 +1 @@\n-c\n+d\n\\ No newline at end of file\n-- \n1.6.1.rc2.306.ge5d5e\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_CcDeleteFile.patch",
    "content": "commit 740709ece2412856c0c3eabd4dc4a4cf115b0de6\nMerge: 5c19b43... 13a2c0d...\nAuthor: Shawn O. Pearce <sop@google.com>\nDate:   Fri Dec 12 13:26:52 2008 -0800\n\n    Merge branch 'b' into d\n\ndiff --cc a\nindex 7898192,2e65efe..0000000\ndeleted file mode 100644,100644\n--- a/a\n+++ /dev/null\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_CcNewFile.patch",
    "content": "commit 6cb8160a4717d51fd3cc0baf721946daa60cf921\nMerge: 5c19b43... 13a2c0d...\nAuthor: Shawn O. Pearce <sop@google.com>\nDate:   Fri Dec 12 13:26:52 2008 -0800\n\n    Merge branch 'b' into d\n\ndiff --cc d\nindex 0000000,0000000..4bcfe98\nnew file mode 100644\n--- /dev/null\n+++ b/d\n@@@ -1,0 -1,0 +1,1 @@@\n++d\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_ConfigCaseInsensitive.patch",
    "content": "From ce9b593ddf2530613f6da9d7f7e4a5ff93da8b36 Mon Sep 17 00:00:00 2001\nFrom: Robin Rosenberg <robin.rosenberg@dewire.com>\nDate: Mon, 13 Oct 2008 00:50:59 +0200\nSubject: [PATCH] git config file is case insensitive\n\nKeys are now always compared with ignore case rules.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../org/spearce/jgit/lib/RepositoryConfigTest.java |    7 +++++++\n .../src/org/spearce/jgit/lib/RepositoryConfig.java |    8 ++++----\n 2 files changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\nindex da7e704..34ce04a 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n@@ -109,4 +109,11 @@ assertTrue(Arrays.equals(values.toArray(), repositoryConfig\n \t\t\t\t.getStringList(\"my\", null, \"somename\")));\n \t\tcheckFile(cfgFile, \"[my]\\n\\tsomename = value1\\n\\tsomename = value2\\n\");\n \t}\n+\n+\tpublic void test006_readCaseInsensitive() throws IOException {\n+\t\tfinal File path = writeTrashFile(\"config_001\", \"[Foo]\\nBar\\n\");\n+\t\tRepositoryConfig repositoryConfig = new RepositoryConfig(null, path);\n+\t\tassertEquals(true, repositoryConfig.getBoolean(\"foo\", null, \"bar\", false));\n+\t\tassertEquals(\"\", repositoryConfig.getString(\"foo\", null, \"bar\"));\n+\t}\n }\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 45c2f8a..3291bba 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -236,9 +236,9 @@ protected boolean getBoolean(final String section, String subsection,\n \t\t\treturn defaultValue;\n \n \t\tn = n.toLowerCase();\n-\t\tif (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equals(n) || \"true\".equals(n) || \"1\".equals(n)) {\n+\t\tif (MAGIC_EMPTY_VALUE.equals(n) || \"yes\".equalsIgnoreCase(n) || \"true\".equalsIgnoreCase(n) || \"1\".equals(n)) {\n \t\t\treturn true;\n-\t\t} else if (\"no\".equals(n) || \"false\".equals(n) || \"0\".equals(n)) {\n+\t\t} else if (\"no\".equalsIgnoreCase(n) || \"false\".equalsIgnoreCase(n) || \"0\".equalsIgnoreCase(n)) {\n \t\t\treturn false;\n \t\t} else {\n \t\t\tthrow new IllegalArgumentException(\"Invalid boolean value: \"\n@@ -300,7 +300,7 @@ public String getString(final String section, String subsection, final String na\n \t\tfinal Set<String> result = new HashSet<String>();\n \n \t\tfor (final Entry e : entries) {\n-\t\t\tif (section.equals(e.base) && e.extendedBase != null)\n+\t\t\tif (section.equalsIgnoreCase(e.base) && e.extendedBase != null)\n \t\t\t\tresult.add(e.extendedBase);\n \t\t}\n \t\tif (baseConfig != null)\n@@ -954,7 +954,7 @@ private static boolean eq(final String a, final String b) {\n \t\t\t\treturn true;\n \t\t\tif (a == null || b == null)\n \t\t\t\treturn false;\n-\t\t\treturn a.equals(b);\n+\t\t\treturn a.equalsIgnoreCase(b);\n \t\t}\n \t}\n }\n-- \n1.6.1.rc2.299.gead4c\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_FixNoNewline.patch",
    "content": "From 1beb3ec1fe68ff18b0287396096442e12c34787a Mon Sep 17 00:00:00 2001\nFrom: Shawn O. Pearce <sop@google.com>\nDate: Fri, 12 Dec 2008 12:29:45 -0800\nSubject: [PATCH] make c and add lf\n\n---\n a |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/a b/a\nindex 2e65efe..f2ad6c7 100644\n--- a/a\n+++ b/a\n@@ -1 +1 @@\n-a\n\\ No newline at end of file\n+c\n-- \n1.6.1.rc2.306.ge5d5e\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_GitBinaryDelta.patch",
    "content": "From 7e49721ad0efdec3a81e20bc58e385ea5d2b87b7 Mon Sep 17 00:00:00 2001\nFrom: Shawn O. Pearce <sop@google.com>\nDate: Fri, 12 Dec 2008 12:45:17 -0800\nSubject: [PATCH] make zero have a 3\n\n---\n zero.bin |  Bin 4096 -> 4096 bytes\n 1 files changed, 0 insertions(+), 0 deletions(-)\n\ndiff --git a/zero.bin b/zero.bin\nindex 08e7df176454f3ee5eeda13efa0adaa54828dfd8..d70d8710b6d32ff844af0ee7c247e4b4b051867f 100644\nGIT binary patch\ndelta 12\nTcmZorXi%6C%4ociaTPxR8IA+R\n\ndelta 11\nScmZorXi(Uguz-JJK>`37u>@iO\n\n-- \n1.6.1.rc2.306.ge5d5e\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_GitBinaryLiteral.patch",
    "content": "From 8363f12135a7d0ff0b5fea7d5a35d294c0479518 Mon Sep 17 00:00:00 2001\nFrom: Robin Rosenberg <robin.rosenberg.lists@dewire.com>\nDate: Tue, 23 Sep 2008 22:19:19 +0200\nSubject: [PATCH] Push and fetch icons for the toolbar\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n org.spearce.egit.ui/icons/toolbar/fetchd.png |  Bin 0 -> 359 bytes\n org.spearce.egit.ui/icons/toolbar/fetche.png |  Bin 0 -> 393 bytes\n org.spearce.egit.ui/icons/toolbar/pushd.png  |  Bin 0 -> 372 bytes\n org.spearce.egit.ui/icons/toolbar/pushe.png  |  Bin 0 -> 404 bytes\n org.spearce.egit.ui/plugin.xml               |   32 ++++++++++++++-----------\n 5 files changed, 18 insertions(+), 14 deletions(-)\n create mode 100644 org.spearce.egit.ui/icons/toolbar/fetchd.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/fetche.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/pushd.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/pushe.png\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetchd.png b/org.spearce.egit.ui/icons/toolbar/fetchd.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..4433c543f2a52b586a3ed5e31b138244107bc239\nGIT binary patch\nliteral 359\nzcmV-t0hs=YP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003lNkl<ZIE|%~\nzF{;8q6h+U7BBn4qm_`dxuy6}@!NzsCfLTKp;5yPsN=p|I(rKe&p~M74Bq5ObRRW{%\nzje4sYc=ybGk2gYV%`a+{hvjnl6{!Lo4hNJ{A44jDl#(C_K2BmJ09dV7A3>VW2}+n!\nzO1rKr0DRxqm&=7b&q>piUayDaIKlvw2}+e_&-3(PFkmzq(Q380-|r+zg6Da9KA(#Q\nzPa2QMl^Gz*GK3HmMPby1VQ9_(U^bf>W`H=3+3)uhMZxuY<#al++wJIfyXFi47K?>p\nz2GCj~rNp*vI-L&fb{osGh@!|$@ci;S2_arv_(sil1xb<+1Odb0kjLY}`F!ShJaW6;\nz>Lr*?r);;|7ihoV2SC*MjhoFzuh;A9KAB9aMXCk(Pk$Loi}X0uxcmSB002ovPDHLk\nFV1lxPoI3yj\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetche.png b/org.spearce.egit.ui/icons/toolbar/fetche.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..0ffeb419e6ab302caa5e58661854b33853dc43dc\nGIT binary patch\nliteral 393\nzcmV;40e1e0P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003{Nkl<ZIE|%}\nz%Su8~6o$WjJd|h&)kLg8qatclklHDbhzOh%4SI>*L3{^aqJcvRqCsRQ6~SndH7ExK\nzk=KcyE?#y6(aupYt$(ujUi|ChXYD1Vl>A3Z=W-tL|B2KE=%pm#uoxNA1!yxqxEMW&\nzB>{jQO^yT+ogtn_{8Ep$Aq3h-C?o|y>g-6?-!e46K4}{7I2X6^?w$w$wKqXWo#uE<\nzlN$@u$mIiCW0N$hIYc2#Jf_L5pe_`875HfeP>nhW1zLv1R!iSvNdTZ7`q(*62#YbV\nzQhB;#V#z_Hl;tD;jPm%3!!_Fv=xqj&EpW_lqPo^m>_wFE9KxQ3t1@8v1#@h(gk?2k\nzU%h_@BTD_vVB{6b=^Lij^3<ya#!DI7eU*yg9xg#(&qL<HX{n_QH=dOmU|OU>Dkk>j\nn^=YB|UiI3T3toz$0fY1nZ1068v8@+b00000NkvXXu0mjfWwNMg\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/pushd.png b/org.spearce.egit.ui/icons/toolbar/pushd.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..22c3f7bf17b8b5a931c7527d768af13607b03bce\nGIT binary patch\nliteral 372\nzcmV-)0gL{LP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003yNkl<ZIE|%~\nzF{%PF6h%)&8w)Kgg)~~o6c%=-wG$iH;R0NP3veAG$Sh>A(?&%>K?5S92zkHxGyeyN\nzQSnxRymxZ%OQJ-CZ<LQ0VHnEcaNzNHaJ${8)oOIRUG)l}M1;v?B8^6aVzEe}P~dX8\nzV6A1h+tKg$Ga)&E`~8km3g?`+IiJs8M#ur2PA68Y70x-1$0OVAmgRCusZ@FoAR=h3\nzDVNJsDix~LD)oBZD;$r<sngD7(Utm(zh18y4u?;WOu&C>t%;)O$w?l-T1yl~1VO;{\nzdS$=gv)ODopU<8HfZ1#YAcMg`B@Q~B4vWRYJJDL}%|UCO8Yd6XZnu?)$aFeQidwCf\nz_mE--u|}hjN&o=H7-fukIg4hqnKXNVchu|kh_lCf`xbzwX88RJ-{>O;Y5D>6^@Sy#\nSDlMe|0000<MNUMnLSTZnn4{zX\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/pushe.png b/org.spearce.egit.ui/icons/toolbar/pushe.png\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..1f99f0a702983d674f15eedae5f1218f0a30b5a0\nGIT binary patch\nliteral 404\nzcmV;F0c-w=P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00047Nkl<ZIE|%~\nz%Su8~6o$WjJO~|4C>w|sG%6%VHSk(UL<B+v4SI>*L41dvA&3Z?G>L*BB*n0rWDTl8\nzL8Pb?Jzc!)CSJ}#$rF8}#a?Uu`(JCbg_M&2pmu`H$+oP&=V*R^(bPY1%&ibu+ZV$G\nzgp`tt<A@B;jw3Z6E&C{q>NBF4=c=f%6i@vsq5!CR9fSfc-IT0lZ>^0`E2vbS?r{1v\nz8l^m+g%^~^H#FDePyq!%wm_SSqPmu`yJKk6QAXzdroz+R(7<gg074jZz1Vo3Dy2y#\nzMW2W=)MJ~7I|%3fPE-KBpis_UGqzZuUe(cG%h>L#RCJHY0YK_74TR+C&ZX!&h^>3c\nzJvdA^W^@l;f6eS*z&I*^D|{frVpE>&7273F76LY=;y1$BWF(Q0qALI}5jqkZAq&fh\ny^_oorR)}l`>CE22@+$y+&Cvb}|KU##2Jr)k?t0Dap2#Es0000<MNUMnLSTZgH?cGT\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml\nindex 7c98688..ee8a5a0 100644\n--- a/org.spearce.egit.ui/plugin.xml\n+++ b/org.spearce.egit.ui/plugin.xml\n@@ -272,22 +272,26 @@\n         </separator>\n \t    </menu>\n \t\t<action\n-\t\t       class=\"org.spearce.egit.ui.internal.actions.FetchAction\"\n-\t\t       id=\"org.spearce.egit.ui.actionfetch\"\n-\t\t       label=\"%FetchAction_label\"\n-\t\t       style=\"push\"\n-\t\t       menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n-\t\t       toolbarPath=\"org.spearce.egit.ui\"\n-\t\t       tooltip=\"%FetchAction_tooltip\">\n+        class=\"org.spearce.egit.ui.internal.actions.FetchAction\"\n+        disabledIcon=\"icons/toolbar/fetchd.png\"\n+        icon=\"icons/toolbar/fetche.png\"\n+        id=\"org.spearce.egit.ui.actionfetch\"\n+        label=\"%FetchAction_label\"\n+        menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n+        style=\"push\"\n+        toolbarPath=\"org.spearce.egit.ui\"\n+        tooltip=\"%FetchAction_tooltip\">\n \t\t</action>\n \t\t<action\n-\t\t       class=\"org.spearce.egit.ui.internal.actions.PushAction\"\n-\t\t       id=\"org.spearce.egit.ui.actionpush\"\n-\t\t       label=\"%PushAction_label\"\n-\t\t       style=\"push\"\n-\t\t       menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n-\t\t       toolbarPath=\"org.spearce.egit.ui\"\n-\t\t       tooltip=\"%PushAction_tooltip\">\n+        class=\"org.spearce.egit.ui.internal.actions.PushAction\"\n+        disabledIcon=\"icons/toolbar/pushd.png\"\n+        icon=\"icons/toolbar/pushe.png\"\n+        id=\"org.spearce.egit.ui.actionpush\"\n+        label=\"%PushAction_label\"\n+        menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n+        style=\"push\"\n+        toolbarPath=\"org.spearce.egit.ui\"\n+        tooltip=\"%PushAction_tooltip\">\n \t\t</action>\n \t\t<action\n \t\t       class=\"org.spearce.egit.ui.internal.actions.BranchAction\"\n-- \n1.6.1.rc2.306.ge5d5e\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_NoBinary.patch",
    "content": "From 8363f12135a7d0ff0b5fea7d5a35d294c0479518 Mon Sep 17 00:00:00 2001\nFrom: Robin Rosenberg <robin.rosenberg.lists@dewire.com>\nDate: Tue, 23 Sep 2008 22:19:19 +0200\nSubject: [PATCH] Push and fetch icons for the toolbar\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n org.spearce.egit.ui/icons/toolbar/fetchd.png |  Bin 0 -> 359 bytes\n org.spearce.egit.ui/icons/toolbar/fetche.png |  Bin 0 -> 393 bytes\n org.spearce.egit.ui/icons/toolbar/pushd.png  |  Bin 0 -> 372 bytes\n org.spearce.egit.ui/icons/toolbar/pushe.png  |  Bin 0 -> 404 bytes\n org.spearce.egit.ui/plugin.xml               |   32 ++++++++++++++-----------\n 5 files changed, 18 insertions(+), 14 deletions(-)\n create mode 100644 org.spearce.egit.ui/icons/toolbar/fetchd.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/fetche.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/pushd.png\n create mode 100644 org.spearce.egit.ui/icons/toolbar/pushe.png\n\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetchd.png b/org.spearce.egit.ui/icons/toolbar/fetchd.png\nnew file mode 100644\nindex 0000000..4433c54\nBinary files /dev/null and b/org.spearce.egit.ui/icons/toolbar/fetchd.png differ\ndiff --git a/org.spearce.egit.ui/icons/toolbar/fetche.png b/org.spearce.egit.ui/icons/toolbar/fetche.png\nnew file mode 100644\nindex 0000000..0ffeb41\nBinary files /dev/null and b/org.spearce.egit.ui/icons/toolbar/fetche.png differ\ndiff --git a/org.spearce.egit.ui/icons/toolbar/pushd.png b/org.spearce.egit.ui/icons/toolbar/pushd.png\nnew file mode 100644\nindex 0000000..22c3f7b\nBinary files /dev/null and b/org.spearce.egit.ui/icons/toolbar/pushd.png differ\ndiff --git a/org.spearce.egit.ui/icons/toolbar/pushe.png b/org.spearce.egit.ui/icons/toolbar/pushe.png\nnew file mode 100644\nindex 0000000..1f99f0a\nBinary files /dev/null and b/org.spearce.egit.ui/icons/toolbar/pushe.png differ\ndiff --git a/org.spearce.egit.ui/plugin.xml b/org.spearce.egit.ui/plugin.xml\nindex 7c98688..ee8a5a0 100644\n--- a/org.spearce.egit.ui/plugin.xml\n+++ b/org.spearce.egit.ui/plugin.xml\n@@ -272,22 +272,26 @@\n         </separator>\n \t    </menu>\n \t\t<action\n-\t\t       class=\"org.spearce.egit.ui.internal.actions.FetchAction\"\n-\t\t       id=\"org.spearce.egit.ui.actionfetch\"\n-\t\t       label=\"%FetchAction_label\"\n-\t\t       style=\"push\"\n-\t\t       menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n-\t\t       toolbarPath=\"org.spearce.egit.ui\"\n-\t\t       tooltip=\"%FetchAction_tooltip\">\n+        class=\"org.spearce.egit.ui.internal.actions.FetchAction\"\n+        disabledIcon=\"icons/toolbar/fetchd.png\"\n+        icon=\"icons/toolbar/fetche.png\"\n+        id=\"org.spearce.egit.ui.actionfetch\"\n+        label=\"%FetchAction_label\"\n+        menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n+        style=\"push\"\n+        toolbarPath=\"org.spearce.egit.ui\"\n+        tooltip=\"%FetchAction_tooltip\">\n \t\t</action>\n \t\t<action\n-\t\t       class=\"org.spearce.egit.ui.internal.actions.PushAction\"\n-\t\t       id=\"org.spearce.egit.ui.actionpush\"\n-\t\t       label=\"%PushAction_label\"\n-\t\t       style=\"push\"\n-\t\t       menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n-\t\t       toolbarPath=\"org.spearce.egit.ui\"\n-\t\t       tooltip=\"%PushAction_tooltip\">\n+        class=\"org.spearce.egit.ui.internal.actions.PushAction\"\n+        disabledIcon=\"icons/toolbar/pushd.png\"\n+        icon=\"icons/toolbar/pushe.png\"\n+        id=\"org.spearce.egit.ui.actionpush\"\n+        label=\"%PushAction_label\"\n+        menubarPath=\"org.spearce.egit.ui.gitmenu/repo\"\n+        style=\"push\"\n+        toolbarPath=\"org.spearce.egit.ui\"\n+        tooltip=\"%PushAction_tooltip\">\n \t\t</action>\n \t\t<action\n \t\t       class=\"org.spearce.egit.ui.internal.actions.BranchAction\"\n-- \n1.6.1.rc2.306.ge5d5e\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/Patch/testParse_OneFileCc.patch",
    "content": "commit 1a56639bbea8e8cbfbe5da87746de97f9217ce9b\nDate:   Tue May 13 00:43:56 2008 +0200\n      ...\n\ndiff --cc org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\nindex 169356b,dd8c317..fd85931\nmode 100644,100644..100755\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n@@@ -55,12 -163,13 +163,15 @@@ public class UIText extends NLS \n  \n  \t/** */\n  \tpublic static String ResourceHistory_toggleCommentWrap;\n+ \n  \t/** */\n +\tpublic static String ResourceHistory_toggleCommentFill;\n +\t/** */\n  \tpublic static String ResourceHistory_toggleRevDetail;\n+ \n  \t/** */\n  \tpublic static String ResourceHistory_toggleRevComment;\n+ \n  \t/** */\n  \tpublic static String ResourceHistory_toggleTooltips;\n  \n\ncommit 1a56639bbea8e8cbfbe5da87746de97f9217ce9b\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/COMMIT_EDITMSG",
    "content": "Add Submodule\n\nSigned-off-by: caytchen <caytchen@gmail.com>\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/HEAD",
    "content": "ref: refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/config",
    "content": "[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = false\n\tlogallrefupdates = true\n\tignorecase = true\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/description",
    "content": "Unnamed repository; edit this file 'description' to name the repository.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/applypatch-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message taken by\n# applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.  The hook is\n# allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"applypatch-msg\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/commit-msg\" &&\n\texec \"$GIT_DIR/hooks/commit-msg\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message.\n# Called by git-commit with one argument, the name of the file\n# that has the commit message.  The hook should exit with non-zero\n# status after issuing an appropriate message if it wants to stop the\n# commit.  The hook is allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"commit-msg\".\n\n# Uncomment the below to add a Signed-off-by line to the message.\n# Doing this in a hook is a bad idea in general, but the prepare-commit-msg\n# hook is more suited to it.\n#\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n\n# This example catches duplicate Signed-off-by lines.\n\ntest \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" || {\n\techo >&2 Duplicate Signed-off-by lines.\n\texit 1\n}\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/post-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script that is called after a successful\n# commit is made.\n#\n# To enable this hook, rename this file to \"post-commit\".\n\n: Nothing\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/post-receive.sample",
    "content": "#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  <oldrev> <newrev> <refname>\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n#\n# see contrib/hooks/ for a sample, or uncomment the next line and\n# rename the file to \"post-receive\".\n\n#. /usr/share/doc/git-core/contrib/hooks/post-receive-email\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/post-update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare a packed repository for use over\n# dumb transports.\n#\n# To enable this hook, rename this file to \"post-update\".\n\nexec git-update-server-info\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/pre-applypatch.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed\n# by applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-applypatch\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/pre-commit\" &&\n\texec \"$GIT_DIR/hooks/pre-commit\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/pre-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed.\n# Called by git-commit with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\n# If you want to allow non-ascii filenames set this variable to true.\nallownonascii=$(git config hooks.allownonascii)\n\n# Cross platform projects tend to avoid non-ascii filenames; prevent\n# them from being added to the repository. We exploit the fact that the\n# printable range starts at the space character and ends with tilde.\nif [ \"$allownonascii\" != \"true\" ] &&\n\t# Note that the use of brackets around a tr range is ok here, (it's\n\t# even required, for portability to Solaris 10's /usr/bin/tr), since\n\t# the square bracket bytes happen to fall in the designated range.\n\ttest \"$(git diff --cached --name-only --diff-filter=A -z |\n\t  LC_ALL=C tr -d '[ -~]\\0')\"\nthen\n\techo \"Error: Attempt to add a non-ascii file name.\"\n\techo\n\techo \"This can cause problems if you want to work\"\n\techo \"with people on other platforms.\"\n\techo\n\techo \"To be portable it is advisable to rename the file ...\"\n\techo\n\techo \"If you know what you are doing you can disable this\"\n\techo \"check using:\"\n\techo\n\techo \"  git config hooks.allownonascii true\"\n\techo\n\texit 1\nfi\n\nif git-rev-parse --verify HEAD >/dev/null 2>&1\nthen\n\tagainst=HEAD\nelse\n\t# Initial commit: diff against an empty tree object\n\tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\nexec git diff-index --check --cached $against --\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/pre-rebase.sample",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2006, 2008 Junio C Hamano\n#\n# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n# its job, and can prevent the command from running by exiting with\n# non-zero status.\n#\n# The hook is called with the following parameters:\n#\n# $1 -- the upstream the series was forked from.\n# $2 -- the branch being rebased (or empty when rebasing the current branch).\n#\n# This sample shows how to prevent topic branches that are already\n# merged to 'next' branch from getting rebased, because allowing it\n# would result in rebasing already published history.\n\npublish=next\nbasebranch=\"$1\"\nif test \"$#\" = 2\nthen\n\ttopic=\"refs/heads/$2\"\nelse\n\ttopic=`git symbolic-ref HEAD` ||\n\texit 0 ;# we do not interrupt rebasing detached HEAD\nfi\n\ncase \"$topic\" in\nrefs/heads/??/*)\n\t;;\n*)\n\texit 0 ;# we do not interrupt others.\n\t;;\nesac\n\n# Now we are dealing with a topic branch being rebased\n# on top of master.  Is it OK to rebase it?\n\n# Does the topic really exist?\ngit show-ref -q \"$topic\" || {\n\techo >&2 \"No such branch $topic\"\n\texit 1\n}\n\n# Is topic fully merged to master?\nnot_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\nif test -z \"$not_in_master\"\nthen\n\techo >&2 \"$topic is fully merged to master; better remove it.\"\n\texit 1 ;# we could allow it, but there is no point.\nfi\n\n# Is topic ever merged to next?  If so you should not be rebasing it.\nonly_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\nonly_next_2=`git-rev-list ^master           ${publish} | sort`\nif test \"$only_next_1\" = \"$only_next_2\"\nthen\n\tnot_in_topic=`git-rev-list \"^$topic\" master`\n\tif test -z \"$not_in_topic\"\n\tthen\n\t\techo >&2 \"$topic is already up-to-date with master\"\n\t\texit 1 ;# we could allow it, but there is no point.\n\telse\n\t\texit 0\n\tfi\nelse\n\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n\tperl -e '\n\t\tmy $topic = $ARGV[0];\n\t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n\t\tmy (%not_in_next) = map {\n\t\t\t/^([0-9a-f]+) /;\n\t\t\t($1 => 1);\n\t\t} split(/\\n/, $ARGV[1]);\n\t\tfor my $elem (map {\n\t\t\t\t/^([0-9a-f]+) (.*)$/;\n\t\t\t\t[$1 => $2];\n\t\t\t} split(/\\n/, $ARGV[2])) {\n\t\t\tif (!exists $not_in_next{$elem->[0]}) {\n\t\t\t\tif ($msg) {\n\t\t\t\t\tprint STDERR $msg;\n\t\t\t\t\tundef $msg;\n\t\t\t\t}\n\t\t\t\tprint STDERR \" $elem->[1]\\n\";\n\t\t\t}\n\t\t}\n\t' \"$topic\" \"$not_in_next\" \"$not_in_master\"\n\texit 1\nfi\n\nexit 0\n\n################################################################\n\nThis sample hook safeguards topic branches that have been\npublished from being rewound.\n\nThe workflow assumed here is:\n\n * Once a topic branch forks from \"master\", \"master\" is never\n   merged into it again (either directly or indirectly).\n\n * Once a topic branch is fully cooked and merged into \"master\",\n   it is deleted.  If you need to build on top of it to correct\n   earlier mistakes, a new topic branch is created by forking at\n   the tip of the \"master\".  This is not strictly necessary, but\n   it makes it easier to keep your history simple.\n\n * Whenever you need to test or publish your changes to topic\n   branches, merge them into \"next\" branch.\n\nThe script, being an example, hardcodes the publish branch name\nto be \"next\", but it is trivial to make it configurable via\n$GIT_DIR/config mechanism.\n\nWith this workflow, you would want to know:\n\n(1) ... if a topic branch has ever been merged to \"next\".  Young\n    topic branches can have stupid mistakes you would rather\n    clean up before publishing, and things that have not been\n    merged into other branches can be easily rebased without\n    affecting other people.  But once it is published, you would\n    not want to rewind it.\n\n(2) ... if a topic branch has been fully merged to \"master\".\n    Then you can delete it.  More importantly, you should not\n    build on top of it -- other people may already want to\n    change things related to the topic as patches against your\n    \"master\", so if you need further changes, it is better to\n    fork the topic (perhaps with the same name) afresh from the\n    tip of \"master\".\n\nLet's look at this example:\n\n\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n\t\t  /       /           /           /\n\t\t /   a---a---b A     /           /\n\t\t/   /               /           /\n\t       /   /   c---c---c---c B         /\n\t      /   /   /             \\         /\n\t     /   /   /   b---b C     \\       /\n\t    /   /   /   /             \\     /\n    ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n\n\nA, B and C are topic branches.\n\n * A has one fix since it was merged up to \"next\".\n\n * B has finished.  It has been fully merged up to \"master\" and \"next\",\n   and is ready to be deleted.\n\n * C has not merged to \"next\" at all.\n\nWe would want to allow C to be rebased, refuse A, and encourage\nB to be deleted.\n\nTo compute (1):\n\n\tgit-rev-list ^master ^topic next\n\tgit-rev-list ^master        next\n\n\tif these match, topic has not merged in next at all.\n\nTo compute (2):\n\n\tgit-rev-list master..topic\n\n\tif this is empty, it is fully merged to \"master\".\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/prepare-commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare the commit log message.\n# Called by git-commit with the name of the file that has the\n# commit message, followed by the description of the commit\n# message's source.  The hook's purpose is to edit the commit\n# message file.  If the hook fails with a non-zero status,\n# the commit is aborted.\n#\n# To enable this hook, rename this file to \"prepare-commit-msg\".\n\n# This hook includes three examples.  The first comments out the\n# \"Conflicts:\" part of a merge commit.\n#\n# The second includes the output of \"git diff --name-status -r\"\n# into the message, just before the \"git status\" output.  It is\n# commented because it doesn't cope with --amend or with squashed\n# commits.\n#\n# The third example adds a Signed-off-by line to the message, that can\n# still be edited.  This is rarely a good idea.\n\ncase \"$2,$3\" in\n  merge,)\n    perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' \"$1\" ;;\n\n# ,|template,)\n#   perl -i.bak -pe '\n#      print \"\\n\" . `git diff --cached --name-status -r`\n#\t if /^#/ && $first++ == 0' \"$1\" ;;\n\n  *) ;;\nesac\n\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/hooks/update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to blocks unannotated tags from entering.\n# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowmodifytag\n#   This boolean sets whether a tag may be modified after creation. By default\n#   it won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n# hooks.denycreatebranch\n#   This boolean sets whether remotely creating branches will be denied\n#   in the repository.  By default this is allowed.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" >&2\n\techo \" (if you want, you could supply GIT_DIR then run\" >&2\n\techo \"  $0 <ref> <oldrev> <newrev>)\" >&2\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"Usage: $0 <ref> <oldrev> <newrev>\" >&2\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\ndenycreatebranch=$(git config --bool hooks.denycreatebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\nallowmodifytag=$(git config --bool hooks.allowmodifytag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\ncase \"$projectdesc\" in\n\"Unnamed repository\"* | \"\")\n\techo \"*** Project description file hasn't been set\" >&2\n\texit 1\n\t;;\nesac\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nzero=\"0000000000000000000000000000000000000000\"\nif [ \"$newrev\" = \"$zero\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git-cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" >&2\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\tif [ \"$allowmodifytag\" != \"true\" ] && git rev-parse $refname > /dev/null 2>&1\n\t\tthen\n\t\t\techo \"*** Tag '$refname' already exists.\" >&2\n\t\t\techo \"*** Modifying a tag is not allowed in this repository.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\tif [ \"$oldrev\" = \"$zero\" -a \"$denycreatebranch\" = \"true\" ]; then\n\t\t\techo \"*** Creating a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" >&2\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/info/exclude",
    "content": "# git-ls-files --others --exclude-from=.git/info/exclude\n# Lines that start with '#' are comments.\n# For a project mostly in C, the following would be a good set of\n# exclude patterns (uncomment them if you want to use them):\n# *.[oa]\n# *~\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/logs/HEAD",
    "content": "0000000000000000000000000000000000000000 163678aef05371dc8636cbae9486233fddbede36 caytchen <caytchen@gmail.com> 1261183508 +0100\tcommit (initial): Some data\n163678aef05371dc8636cbae9486233fddbede36 b81197d9c02c98247424be82a7dd55dc419f39e5 caytchen <caytchen@gmail.com> 1261183880 +0100\tcommit: Add Submodule\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/logs/refs/heads/master",
    "content": "0000000000000000000000000000000000000000 163678aef05371dc8636cbae9486233fddbede36 caytchen <caytchen@gmail.com> 1261183508 +0100\tcommit (initial): Some data\n163678aef05371dc8636cbae9486233fddbede36 b81197d9c02c98247424be82a7dd55dc419f39e5 caytchen <caytchen@gmail.com> 1261183880 +0100\tcommit: Add Submodule\n"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/objects/16/3678aef05371dc8636cbae9486233fddbede36",
    "content": "x\u0001K\n0\f\u0005)/)\u0018';\u0004|!ܾt[10̋%\u0002]\u0015:9P\u0004-MmJ2:\\@/v4K!Q\u001bܿ9gY_X\u0003=Q-\u0006\"!f(Y!I\u0015cu45e_0\u001f\u0012E"
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/objects/info/dummy",
    "content": ""
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/objects/pack/dummy",
    "content": ""
  },
  {
    "path": "GitSharp.Tests/Resources/SubmoduleRepository.git/refs/heads/master",
    "content": "b81197d9c02c98247424be82a7dd55dc419f39e5\n"
  },
  {
    "path": "GitSharp.Tests/Resources/all_packed_objects.txt",
    "content": "4b825dc642cb6eb9a060e54bf8d69288fbee4904 tree   0 9 7782\n540a36d136cf413e4b064c2b0e0a4db60f77feab commit 191 131 339\n5b6e7c66c276e7610d4a73c70ec1a1f7c1003259 blob   11 40 516 1 6ff87c4664981e4397625791c8ea3bbb5f2279a3\n6ff87c4664981e4397625791c8ea3bbb5f2279a3 blob   18787 7180 556\n82c6b885ff600be425b4ea96dee75dca255b69e7 commit 245 166 12\n902d5476fa249b7abc9d84c611577a81381f0327 tree   35 46 7736\naabf2ffaec9b497f0950352b3e582d73035c2035 tree   35 46 470\nc59759f143fb1fe21c197981df75a7ee00290799 commit 240 161 178\n02ba32d3649e510002c21651936b7077aa75ffa9 tree   122 127 3806\n0966a434eb1a025db6b71485ab63a3bfbea520b6 commit 287 197 2611\n09efc7e59a839528ac7bda9fa020dc9101278680 tree   68 71 5497\n0a3d7772488b6b106fb62813c4d6d627918d9181 tree   98 95 3367\n1004d0d7ac26fbf63050a234c9b88a46075719d3 tree   68 72 3504\n10da5895682013006950e7da534b705252b03be6 blob   6 15 3591\n1203b03dc816ccbb67773f28b3c19318654b0bc8 commit 222 152 758\n15fae9e651043de0fd1deef588aa3fbf5a7a41c6 blob   6 15 3474\n16f9ec009e5568c435f473ba3a1df732d49ce8c3 blob   3 12 4196\n1fd7d579fb6ae3fe942dc09c2c783443d04cf21e blob   6 15 3678\n20a8ade77639491ea0bd667bf95de8abf3a434c8 tree   66 77 5663\n2675188fd86978d5bc4d7211698b2118ae3bf658 tree   68 72 4124\n2c349335b7f797072cf729c4f3bb0914ecb6dec9 commit 221 154 2457\n2cc3f4155a8eda5c3f1bc85de0988c0155c8cc1c tree   68 72 4717\n30a7b072d441dbfcfe0266b1c5fce94c22c447da tree   38 48 5784\n42e4e7c5e507e113ebbb7801b16b52cf867b7ce1 commit 184 133 1407\n49322bb17d3acc9146f98c97d078513228bbf3c0 commit 338 223 12\n49c5f851406e8004b816b8170f6f18e30ee877b9 tree   68 72 3606\n55a1a760df4b86a02094a904dfa511deb5655905 blob   6 15 3693\n58be4659bb571194ed4562d04b359d26216f526e commit 226 156 2962\n59706a11bde2b9899a278838ef20a97e8f8795d2 commit 222 153 1692\n5f25aaf573e7a094697987a927b833e088134674 tree   66 76 5184\n6020a3b8d5d636e549ccbd0c53e2764684bb3125 tree   122 126 3241\n62b15c9ddac853efbb00f59123f484b05b06d8b3 tree   28 37 4431\n6462e7d8024396b14d7651e2ec11e2bbf07a05c4 commit 221 153 1254\n6c83a9d0a09ce6d12292314ed3d9e1f60e39feb0 tree   66 76 5587\n6c8b137b1c652731597c89668f417b8695f28dd7 commit 172 123 3118\n6db9c2ebf75590eef973081736730a9ea169a0c4 commit 222 152 2153\n6e1475206e57110fcef4b92320436c1e9872a322 commit 282 192 566\n7f822839a2fe9760f386cbbbcb3f92c5fe81def7 commit 222 152 1540\n81e462df7c747d5b8783af18bf83bffbef8dc2bc tree   34 45 5139\n8230f48330e0055d9e0bc5a2a77718f6dd9324b8 blob   10 19 5568\n82b1d08466e9505f8666b778744f9a3471a70c81 blob   20 22 3708\n82fb2e7873759b74c41020a00abaea9c378a7a15 tree   66 76 4801\n835da11381dee94c71a04164cdaa533d0673e4e5 tree   34 45 4468\n83834a7afdaa1a1260568567f6ad90020389f664 commit 282 192 1062\n83d2f0431bcdc9c2fd2c17b828143be6ee4fbe80 commit 221 155 1998\n856ec208ae6cadac25a6d74f19b12bb27a24fe24 tree   66 76 5260\n86265c33b19b2be71bdd7b8cb95823f2743d03a8 tree   94 102 4208\n86cec6b57d80fda40300fb0d667965a5c3c3572f blob   6 15 3576\n8d6a2f2af0b2b96f320dd62fb6d9916fd2497dd9 tree   66 77 5420\n8f50ba15d49353813cc6e20298002c0d17b0a9ee tree   94 102 4961\n9188910f5d18434c2c8a3d78e8bef1a469c5626e tree   68 72 3933\n965361132e2f15897c9fd6c727beb5753057c38a blob   6 15 3489\n968a4b6caa8b55a68098e0495fbd9e75a7d05efa tree   68 72 4310\na288d2cc3ee7d82f482e70ae7b6fedb4a039dd09 tree   28 37 4394\na33a091b7c8de98b3a2ad2f21f88ea86f395d787 tree   94 102 4615\na4e0e50de469ac6e2fdf2ee81808f253d5b78fd3 tree   68 72 5336\nac7e7e44c1885efb472ad54a78327d66bfc4ecef commit 221 154 2808\nacd0220f06f7e4db50ea5ba242f0dfed297b27af tree   94 102 4513\nae9304576a6ec3419b231b2b9c8e33a06f97f9fb blob   3 12 4382\nb9877f83f4c2ba0c3dd8fb2f6b5f04a0aaf18594 tree   66 76 5063\nbab66b48f836ed950c99134ef666436fb07a09a0 commit 222 152 910\nbe9b45333b66013bde1c7314efc50fabd9b39c6d tree   7 18 4005 1 02ba32d3649e510002c21651936b7077aa75ffa9\nc070ad8c08840c8116da865b2d65593a6bb9cd2a commit 282 192 235\nc17b9ee9d0501fecadfac3b60ca485b14f5dbe98 tree   38 49 5832\nc1827f07e114c20547dc6a7296588870a4b5b62c blob   3 12 5408\nc9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 blob   3 12 4949\ncd4bcfc27da62c6b840de700be1c60a7e69952a5 tree   66 76 3730\nd0114ab8ac326bab30e3a657a0397578c5a1af88 commit 84 95 427 1 c070ad8c08840c8116da865b2d65593a6bb9cd2a\nd31f5a60d406e831d056b8ac2538d515100c2df2 commit 221 153 1845\nd4b9b11fc8006af3b05cf2b4611077ed6a9b8c07 tree   68 72 4877\nd86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 commit 222 152 2305\nda0f8ed91a8f2f0f067b3bdf26265d5ca48cf82c blob   3 12 3462\ne4ff0b72cb0994dbf7a9da260aeb461c9d882bb5 tree   34 44 5740\ne6bfff5c1d0f0ecd501552b43a1e13d8008abc31 blob   3 12 4789\nf2aacb9368806d6502a03aa9da0834d4b50b9f0e tree   94 101 4023\nf73b95671f326616d66b2afb3bdfcdbbce110b44 commit 33 44 522 2 d0114ab8ac326bab30e3a657a0397578c5a1af88\n17768080a2318cd89bba4c8b87834401e2095703 tag    140 132 12\n032c063ce34486359e3ee3d4f9e5c225b9e1a4c2 tag    152 138 12\n1170b77a48d3ea2d58b043648b1ec63d606e3efa tag    150 138 971\n214cae792433672d28b3aeb9f75c1ae84fd54628 tag    150 136 1109\n8dfd42699e7b10e568fa1eaebe249e33e98da81e tag    150 138 833\na773cd2d9dbca00d08793dac0d7002a49f0428c0 tag    150 138 422\nbf5123bb77c7b5a379f7de9c1293558e3e24dfb8 tag    150 135 287\nd54e006ebbef94b7d3a5cd56d154f1e6f08efb94 tag    150 137 560\ndd144af286452bfd6a1ea02b0d3745bcdb555e9d tag    150 137 150\nefee904c794b943a06931c76c576dd552212e8bc tag    150 136 697\n8bbde7aacf771a9afb6992434f1ae413e010c6d8 tag    630 436 1187\nfd608fbe625a2b456d9f15c2b1dc41f252057dd7 blob   1512 1175 12\n06b8692d5c4f29a6bc4987e1bec04e9bb2ec54a2 tree   29 40 330\n164bf8c9e69a5c192acd28e95aefd9a5d6f254df blob   7 16 370\n175d5b80bd9768884d8fced02e9bd33488174396 commit 56 68 160 1 47d3697c3747e8184e0dc479ccbd01e359023577\n3d2770618bb1132e59c314dea328b83ac7c83232 tree   29 40 488\n3df983efd6acdf73dfc7b451a2e30f7ed42e7736 blob   5 14 528\n47d3697c3747e8184e0dc479ccbd01e359023577 commit 217 148 12\n5e28f2d1ee99ddf4595a7a1ff31efa1a107c11e7 tree   94 102 386\n737d98fe75742dd9a8f4bce5e176e7f8d99d9de3 tree   94 102 228\n"
  },
  {
    "path": "GitSharp.Tests/Resources/create-second-pack",
    "content": "#!/bin/bash -ex\n\nexport GIT_COMMITTER_NAME=\"A U Thor\"\nexport GIT_AUTHOR_NAME=\"A U Thor\"\nexport GIT_COMMITTER_EMAIL=\"a.u.thor@example.com\"\nexport GIT_AUTHOR_EMAIL=\"a.u.thor@example.com\"\n\ntest_tick () {\n\t# from git/t/test-lib.sh\n\tif test -z \"${test_tick+set}\"\n        then\n                test_tick=1112911993\n        else\n                test_tick=$(($test_tick + 60))\n        fi\n        GIT_COMMITTER_DATE=\"$test_tick -0700\"\n        GIT_AUTHOR_DATE=\"$test_tick -0700\"\n        export GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n}\n\ngit_commit () {\n\ttest_tick\n\tgit commit \"$@\"\n}\n\ngit_merge () {\n\ttest_tick\n\tgit merge \"$@\"\n\n}\n\ntest_tick\nrm -rf .git *.txt ?\ngit init\necho \"On master\" >>master.txt\ngit add master.txt\ngit_commit -a -m \"On master\"\n\necho \"On master\" >>master.txt\ngit_commit -a -m \"On master again\"\n\ngit checkout -b a 6c8b137b1c652731597c89668f417b8695f28dd7\nmkdir a\n\necho a1 >>a/a1.txt\ngit add a/a1.txt\ngit_commit -a -m \"First a/a1\"\n\necho a2 >>a/a2.txt\ngit add a/a2.txt\ngit_commit -a -m \"First a/a2\"\n\ngit merge master\n\necho a1 >>a/a1.txt\ngit add a/a1.txt\ngit_commit -a -m \"Second a/a1\"\ngit branch pa\n\necho a2 >>a/a2.txt\ngit add a/a2.txt\ngit_commit -a -m \"Second a/a2\"\n\ngit checkout -b b 58be4659bb571194ed4562d04b359d26216f526e\n\nmkdir b\necho b1 >>b/b1.txt\ngit add b/b1.txt\ngit_commit -a -m \"First b/b1\"\n\necho b2 >>b/b2.txt\ngit add b/b2.txt\ngit_commit -a -m \"First b/b2\"\n\ngit merge a\n\necho b1 >>b/b1.txt\ngit add b/b1.txt\ngit_commit -a -m \"Second b/b1\"\n\necho b2 >>b/b2.txt\ngit add b/b2.txt\ngit_commit -a -m \"Second b/b2\"\n\nrm -rf a b c master.txt\nmkdir c\nrm -f ./git/index\necho ref: refs/heads/c >.git/HEAD\n\necho c1 >>c/c1.txt\ngit add c/c1.txt\ngit_commit -a -m \"First c/c1, no parent\"\n\necho c2 >>c/c2.txt\ngit add c/c2.txt\ngit_commit -a -m \"First c/c2\"\n\ngit_merge a\n\necho c1 >>c/c1.txt\ngit add c/c2.txt\ngit_commit -a -m \"Second c/c1\"\n\necho c2 >>c/c2.txt\ngit add c/c2.txt\ngit_commit -a -m \"Second c/c2\"\n\ngit_merge b\n\ngit checkout -b d a\n\necho \"a1\" >>a/a1\ngit add a/a1\ngit_commit -a -m \"Third a/a1\"\n\ngit checkout -b e a\n\necho \"a1\" >>a/a1\ngit add a/a1\ngit_commit -a -m \"Fourth a/a1\"\n\ngit checkout master\n\ngit_merge c d e\n\ngit repack -d\n\ngit tag A a\ngit tag -a -m \"An annotated tag\" B a^\n\ngit repack -d\n\nBnth=B\nfor nth in 2nd 3rd 4th 5th 6th 7th 8th 9th 10th; do\n\tgit tag -a -m \"An $nth level annotated tag\" \"B$nth\" \"$Bnth\"\n\tBnth=\"B$nth\"\ndone\n\ngit repack -d\n\ngit checkout -b f a\nmkdir f\necho \"an eff\" >f/f\ngit add f/f\ngit commit -m \"An eff\"\ngit checkout -b g a\nmkdir f\necho \"an F\" >f/f\ngit add f/f\ngit commit -m \"An F\"\n\ngit repack -d\n\ngit checkout -b symlink master\nln -s c/c1.txt symlink.txt\ngit add symlink.txt\ngit_commit -m \"A symlink\"\n\ngit checkout -b gitlink master\ngit submodule add \"$(pwd)/.git\" submodule\ngit_commit -m \"A gitlink\"\n\ngit repack -d\ngit pack-refs --all\n\ngitk --all master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/gitgit.lsfiles",
    "content": "100644 6b9c715d21d5486e59083fb6071566aa6ecd4d42 0\t.gitattributes\n100644 a213e8e25bb2442326e86cbfb9ef56319f482869 0\t.gitignore\n100644 373476bdc03f718b4c01471dd9996ee4497f43a8 0\t.mailmap\n100644 9651afc89d5e789abd9cedaa4f3b92dde7dd1412 0\t.project\n100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0\tCOPYING\n100644 ddb030137d54ef3fb0ee01d973ec5cee4bb2b2b3 0\tDocumentation/.gitattributes\n100644 d8edd904065fbc4bd06365ce378f57d4cd8f9f0d 0\tDocumentation/.gitignore\n100644 f628c1f3b7b706f9d585b96041e5a4b12bc0f62c 0\tDocumentation/CodingGuidelines\n100644 62269e39c4edf95b2cf2e6a60bff2a33b239b07e 0\tDocumentation/Makefile\n100644 fea3f9935b7794ce86f04d22c9d68fb9d537167d 0\tDocumentation/RelNotes-1.5.0.1.txt\n100644 b061e50ff05b5e13211bb315e240974e898de32c 0\tDocumentation/RelNotes-1.5.0.2.txt\n100644 cd500f96bfd73e288577b05cfdfe337d7f2b85bb 0\tDocumentation/RelNotes-1.5.0.3.txt\n100644 feefa5dfd4eee5f493fcf3091ec0de116d414fc1 0\tDocumentation/RelNotes-1.5.0.4.txt\n100644 eeec3d73d01a0e9f61df666bad8a48a4f423438a 0\tDocumentation/RelNotes-1.5.0.5.txt\n100644 c02015ad5fdb1953ad1a8cf5b0edd7ef7c04fbac 0\tDocumentation/RelNotes-1.5.0.6.txt\n100644 670ad32b85678c938709b47c37d6caacbb5ebe29 0\tDocumentation/RelNotes-1.5.0.7.txt\n100644 daf4bdb0d7bb24319810fe0e73aa317663448c93 0\tDocumentation/RelNotes-1.5.0.txt\n100644 91471213bdec8d95209db256f594b0e1b3f3ec2a 0\tDocumentation/RelNotes-1.5.1.1.txt\n100644 d88456306c503d9e604ffbb699fb7cadacb2e733 0\tDocumentation/RelNotes-1.5.1.2.txt\n100644 876408b65a0e0841567a2c9b97c6f6e62cb86b81 0\tDocumentation/RelNotes-1.5.1.3.txt\n100644 df2f66ccb5d2a6a038d1fcf9306e7ed7aae05f39 0\tDocumentation/RelNotes-1.5.1.4.txt\n100644 b0ab8eb371ccb05346781e63c5ec4b71dab8be34 0\tDocumentation/RelNotes-1.5.1.5.txt\n100644 55f3ac13e3c242acc4bb1b873272d7d8ff4ef84d 0\tDocumentation/RelNotes-1.5.1.6.txt\n100644 daed3672709f6b94478fc6ad425897abe3433c9a 0\tDocumentation/RelNotes-1.5.1.txt\n100644 ebf20e22a74284f7085a5027f588ba295fb767d0 0\tDocumentation/RelNotes-1.5.2.1.txt\n100644 f6393f8a94f454f4f7b5cc5bb42881b6662cadff 0\tDocumentation/RelNotes-1.5.2.2.txt\n100644 addb22955b4e4e5344f7f139076a798cb50024ff 0\tDocumentation/RelNotes-1.5.2.3.txt\n100644 75cff475f6546402dc3486c43e0b6e7557ae621e 0\tDocumentation/RelNotes-1.5.2.4.txt\n100644 e8281c72a0b997e90cba2c9a2c4153f8607a7b76 0\tDocumentation/RelNotes-1.5.2.5.txt\n100644 6195715dc78a26ce9ac452bd64852455fb79137c 0\tDocumentation/RelNotes-1.5.2.txt\n100644 7ff546c743b3ac2e75610473e496d93e44a6dbe9 0\tDocumentation/RelNotes-1.5.3.1.txt\n100644 4bbde3cab4dc6dc0815aeae5a0a79f88ab784b23 0\tDocumentation/RelNotes-1.5.3.2.txt\n100644 d2138469511d3dc111d81b9354f100ed344d9524 0\tDocumentation/RelNotes-1.5.3.3.txt\n100644 b04b3a45a5629cf852c970ac995bfb80bde846d2 0\tDocumentation/RelNotes-1.5.3.4.txt\n100644 7ff1d5d0d100fc632208f4cbb67189ecbf58e9a4 0\tDocumentation/RelNotes-1.5.3.5.txt\n100644 069a2b2cf9e9f28a2f9e6dc0817723a38b25f475 0\tDocumentation/RelNotes-1.5.3.6.txt\n100644 2f690616c8327f8c86477998358ee0dd17ee467f 0\tDocumentation/RelNotes-1.5.3.7.txt\n100644 0e3ff58a46f3cc2b987f9c3216e4844bab2317a5 0\tDocumentation/RelNotes-1.5.3.8.txt\n100644 d03894b92645f2dd0d7cb464d3ab1905d8cb62ed 0\tDocumentation/RelNotes-1.5.3.txt\n100644 d4e44b8b09d7176c137d826d5de305bd6822e862 0\tDocumentation/RelNotes-1.5.4.1.txt\n100644 21d0df59fbb08ab148e275e21f0ed182c5aab1a1 0\tDocumentation/RelNotes-1.5.4.2.txt\n100644 b0fc67fb2ade1c7e318d309ee4d55d37964021f3 0\tDocumentation/RelNotes-1.5.4.3.txt\n100644 89fa6d03bc038d6210e94d7fe9fbbffdbc84d883 0\tDocumentation/RelNotes-1.5.4.4.txt\n100644 02823413987d5a10364d936327e3a1cfb38cbac2 0\tDocumentation/RelNotes-1.5.4.5.txt\n100644 3e3c3e55a31fd7f6d51e1aa5a1d57532484dacaf 0\tDocumentation/RelNotes-1.5.4.6.txt\n100644 f1323b61746ee5d7f2a9d2fc3835c2cd75e76434 0\tDocumentation/RelNotes-1.5.4.txt\n100644 7de419708f77fff6f61e749b917b5fcecbe9a292 0\tDocumentation/RelNotes-1.5.5.1.txt\n100644 391a7b02eaf32d930e7c9c274dfd2a2edf081f75 0\tDocumentation/RelNotes-1.5.5.2.txt\n100644 f22f98b734f82101d47a6aa2453d5374d5dd8175 0\tDocumentation/RelNotes-1.5.5.3.txt\n100644 2d0279ecce622aab935e8e25914a5bd132fa95f3 0\tDocumentation/RelNotes-1.5.5.4.txt\n100644 30fa3615c77d6198a5a08ebd8e8c63f4cd21b295 0\tDocumentation/RelNotes-1.5.5.5.txt\n100644 29322124881bf65c3ee6f5d613251b09f4a98d9a 0\tDocumentation/RelNotes-1.5.5.txt\n100644 4864b16445f3ca1854cee608f7c15f5a6e0933d8 0\tDocumentation/RelNotes-1.5.6.1.txt\n100644 5902a85a78610ec38f4cf160ccd3c01267b4f9a1 0\tDocumentation/RelNotes-1.5.6.2.txt\n100644 942611299d59abd4bdd820e1258662067a304d62 0\tDocumentation/RelNotes-1.5.6.3.txt\n100644 d8968f1ecbd930463858870ee872efd8cb672bab 0\tDocumentation/RelNotes-1.5.6.4.txt\n100644 e143d8d61be1bb2fac024b5d5f270b33f4f898d4 0\tDocumentation/RelNotes-1.5.6.txt\n100644 2542cf53d2e40b06afe918fcf1cd35de19126d9e 0\tDocumentation/RelNotes-1.6.0.txt\n100644 841bead9db18a025638570c10cac72bcf4791f68 0\tDocumentation/SubmittingPatches\n100644 40d43b78ee9d6c3827bcf631c1f41f54d0e3dfbc 0\tDocumentation/asciidoc.conf\n100644 5428111d732cb38dbb257ddfa860ebd04088b4e9 0\tDocumentation/blame-options.txt\n100755 ba4205e0302a267a5da6bef504f3e69eb0c4aa6d 0\tDocumentation/build-docdep.perl\n100644 6a361a21367bfed4ae325049556f2e82e7e1dbe4 0\tDocumentation/callouts.xsl\n100755 dbc133cd3c1f19dd507014477e68b8ada78eab5e 0\tDocumentation/cat-texi.perl\n100755 04f99778d81def42e9e129b2f5b2b0551a0c760f 0\tDocumentation/cmd-list.perl\n100644 61c376057c0f2b9510bf6f1b2beb42f9859b7f46 0\tDocumentation/config.txt\n100644 400cbb3b1c120b93278472678ee7bdb87a74f95b 0\tDocumentation/diff-format.txt\n100644 517e1eba3c56907ebcb1d478dceb184e53fceda4 0\tDocumentation/diff-generate-patch.txt\n100644 cba90fd27c6a1baaca884328e96adc8a6da8fc36 0\tDocumentation/diff-options.txt\n100644 b878b385c6967f4c64ba30bdfe8f9bd24bef91e3 0\tDocumentation/docbook-xsl.css\n100644 9a6912c641edf52083b8996fdce3a0be2f4dba45 0\tDocumentation/docbook.xsl\n100644 e598cdda45cf0b953a106d6786765b3316e2cc16 0\tDocumentation/everyday.txt\n100644 d313795fdbc420e3395adc42aebe82fabda037d4 0\tDocumentation/fetch-options.txt\n100755 ff7d78f620a35fb66c47e50c4eceecff00b643b3 0\tDocumentation/fix-texi.perl\n100644 2b6d6c86547b2cec370d34b14ddef25264404892 0\tDocumentation/git-add.txt\n100644 c45c53ec2404725394563a9fba40f31cd314adb2 0\tDocumentation/git-am.txt\n100644 8b6b56a54409dd586047a1a6cdf1138e8bb0e77b 0\tDocumentation/git-annotate.txt\n100644 feb51f124ac8a806e65d41f6274c58de64d2991f 0\tDocumentation/git-apply.txt\n100644 c7a6e3ec050b7ceeec79d468b5ffa123314c8f5d 0\tDocumentation/git-archimport.txt\n100644 41cbf9c0819872a322321455b8a5cb805efcc26b 0\tDocumentation/git-archive.txt\n100644 c7981efcd9b86287bbea9ddcaf187a9bd48c77eb 0\tDocumentation/git-bisect.txt\n100644 fba374d652723161c3683d1be98c08ba573057cc 0\tDocumentation/git-blame.txt\n100644 6103d62fe3dca23c78b16dbdbb5ba231a6b39bf7 0\tDocumentation/git-branch.txt\n100644 1b66ab743c64d980a43a028d57ca2f6505d97845 0\tDocumentation/git-bundle.txt\n100644 d35e8a04fe28b095b5405ae2e0b09e3ab448bf63 0\tDocumentation/git-cat-file.txt\n100644 2b821f2a1d70fa108ce279135fd5028453a04fd9 0\tDocumentation/git-check-attr.txt\n100644 034223cc5ace81dd0b63da44d79db5e83a1d492a 0\tDocumentation/git-check-ref-format.txt\n100644 62d84836b8a0d77c2a6ea534566ff8462b0eb37a 0\tDocumentation/git-checkout-index.txt\n100644 5aa69c0e12a6756fd6f79c117008a373f65ba5f5 0\tDocumentation/git-checkout.txt\n100644 837fb08b7971a8b948dd7d039bab4a3c2e54cac7 0\tDocumentation/git-cherry-pick.txt\n100644 74d14c4e7fc88e702e4781b22eb8ed5ce0480c6f 0\tDocumentation/git-cherry.txt\n100644 670cb02b6cc035e4fbcf1a1016f66b7a85cd4ef7 0\tDocumentation/git-citool.txt\n100644 7dcc1ba58c3879cb14ce243a4af00bca9e850799 0\tDocumentation/git-clean.txt\n100644 26fd1b111798461b9150f1416721aa460f1ea525 0\tDocumentation/git-clone.txt\n100644 feec58400b64c65c8f96f2d1834016455c89829e 0\tDocumentation/git-commit-tree.txt\n100644 0e25bb862704eee4a22fe5349c04823d14ea9cba 0\tDocumentation/git-commit.txt\n100644 28e1861094a1689cdb042df6b1d788620ffdf213 0\tDocumentation/git-config.txt\n100644 75a8da1ca906aee4cc6a7d0c3ff19862b8e0fc2f 0\tDocumentation/git-count-objects.txt\n100644 2da8588f4fd6edb842a9824181165b3f043ec87b 0\tDocumentation/git-cvsexportcommit.txt\n100644 b7a8c10b8709108c1c8a0d14f661c179c2b4f22c 0\tDocumentation/git-cvsimport.txt\n100644 c2d3c90d27084e7de7e0f7c37b40f130f6960244 0\tDocumentation/git-cvsserver.txt\n100644 4ba4b75c1126d87c48935e7697e05f0d5210ad2d 0\tDocumentation/git-daemon.txt\n100644 7fdda04bae34790eb2345427dda746e8bf097c1a 0\tDocumentation/git-describe.txt\n100644 5c8c1d95a89b15e936816f486a8114cbc6788fb9 0\tDocumentation/git-diff-files.txt\n100644 26920d4f63cd213ff17ab28d8dd0dbea94482147 0\tDocumentation/git-diff-index.txt\n100644 8c8f35b7a762d42d3c45ff9f4eee1cb32d3917b6 0\tDocumentation/git-diff-tree.txt\n100644 c53eba557d0a242a0d8553d9569ce8b2eb86331b 0\tDocumentation/git-diff.txt\n100644 b974e2115b01f17f0ac809b691baf2f4e4d32169 0\tDocumentation/git-fast-export.txt\n100644 c2f483a8d2aed8dc017f3172e2d5fff4bed2c450 0\tDocumentation/git-fast-import.txt\n100644 47448da22eeebf51fe5829717df2dc7129a9b17e 0\tDocumentation/git-fetch-pack.txt\n100644 d3164c5c88db6b9e02a4186c398e19c425bc204b 0\tDocumentation/git-fetch.txt\n100644 7ba9dab5e6c0b32f927d24de800e17b71a06b84b 0\tDocumentation/git-filter-branch.txt\n100644 1c24796d66d5aeaeeccfd152c69cddba1953fd6c 0\tDocumentation/git-fmt-merge-msg.txt\n100644 727d84e6735417baa82fe7abff5b6945f6d6cef4 0\tDocumentation/git-for-each-ref.txt\n100644 010d9e432231f41a179023df2e85610583b572cf 0\tDocumentation/git-format-patch.txt\n100644 965a8279c1b17df6fbf82f4fbcadbd254049a7d5 0\tDocumentation/git-fsck-objects.txt\n100644 d5a76472196a5e67bc6e62411d90377ec3b46e3a 0\tDocumentation/git-fsck.txt\n100644 7086eea74a38b036130f61db362bae209a065e47 0\tDocumentation/git-gc.txt\n100644 84f23ee525336fc2bdd289991b97eafecddc14b2 0\tDocumentation/git-get-tar-commit-id.txt\n100644 fa4d133c1bccc088d3c8da65bce4e15cafd394aa 0\tDocumentation/git-grep.txt\n100644 0e650f497bd456e633334a91bd929053a08eb0d3 0\tDocumentation/git-gui.txt\n100644 ac928e198e75595a6fcd4e83b89aaf68987bd420 0\tDocumentation/git-hash-object.txt\n100644 f414583fc48e85e4785fbf5f9431bb81a96ccd9d 0\tDocumentation/git-help.txt\n100644 e7c796155fdd0ad644decf5dc488c6d780a2d164 0\tDocumentation/git-http-fetch.txt\n100644 aef383e0b142bd603b77620cad720c102d70c4b7 0\tDocumentation/git-http-push.txt\n100644 b3d8da33ee64730794821440c287f30c4bb85789 0\tDocumentation/git-imap-send.txt\n100644 4b5c743c1e5f11281e2b9df7508d57e9878ee5d2 0\tDocumentation/git-index-pack.txt\n100644 1fd0ff2610a1375bcf0defe2a234b2dee1a7997a 0\tDocumentation/git-init-db.txt\n100644 71749c09d309f4cae2da9788969359d2620224a9 0\tDocumentation/git-init.txt\n100644 22da21a54f625c434216945889127ec283d3d09f 0\tDocumentation/git-instaweb.txt\n100644 05cbac56aced6ad27f36fe63f8f536e794794f9f 0\tDocumentation/git-log.txt\n100644 602b8d5d4de8f7649cb88e6622108c012f484933 0\tDocumentation/git-lost-found.txt\n100644 9f85d60b5fb6d6ae1b4d8c2e65a6131cbe21450b 0\tDocumentation/git-ls-files.txt\n100644 abe7bf9ff9eb9a3ddb1924938de071291520797a 0\tDocumentation/git-ls-remote.txt\n100644 4c7262f1cd82ca8d9ea6be638d23b18d9bba3738 0\tDocumentation/git-ls-tree.txt\n100644 31eccea5bc0697ee461503734942429c2133ef3f 0\tDocumentation/git-mailinfo.txt\n100644 5cc94ec53daf3057f57c993983d659543962abec 0\tDocumentation/git-mailsplit.txt\n100644 1a7ecbf8f39381b0c7b2da513dfa26eacec15cf6 0\tDocumentation/git-merge-base.txt\n100644 024ec015a3a3e0d3677a82e082e72a36c4572827 0\tDocumentation/git-merge-file.txt\n100644 ff088c5c294527dd97c542012483aafe3ca64314 0\tDocumentation/git-merge-index.txt\n100644 dc8a96adb00c0b674e12e071a4a56f89bfe8583d 0\tDocumentation/git-merge-one-file.txt\n100644 dbb0c18668ff0fb60c31c12b02c27d92b430c24a 0\tDocumentation/git-merge-tree.txt\n100644 2db88809898592c691166427efdd106d844d42d9 0\tDocumentation/git-merge.txt\n100644 31570b1e27af6a603df98868c627da08d91c17cc 0\tDocumentation/git-mergetool.txt\n100644 8bcc11443dce7322ac5b0fa70e07b2465f762615 0\tDocumentation/git-mktag.txt\n100644 af19f06ed738bdecc7ab9a72a5c9a216b816f4c2 0\tDocumentation/git-mktree.txt\n100644 9c5660275b326661bf7dc9a5162e5177b8a62b0f 0\tDocumentation/git-mv.txt\n100644 6e77ab135353aaf713b638a70701717db1706c2c 0\tDocumentation/git-name-rev.txt\n100644 8c354bd47014825de71243d73158b6b080ecb350 0\tDocumentation/git-pack-objects.txt\n100644 5f9435e59b49fec1e37c65f1bfdc38be3704c4e5 0\tDocumentation/git-pack-redundant.txt\n100644 a5244d35f49f10b7954d8fa52164663e3d167d4b 0\tDocumentation/git-pack-refs.txt\n100644 cd43069874d59504627211e011250a3554aeee5a 0\tDocumentation/git-parse-remote.txt\n100644 477785e13418e1971156f5210015da4ab9d77cab 0\tDocumentation/git-patch-id.txt\n100644 8282a5e82b6e897ac501ef05c982d5e69415363f 0\tDocumentation/git-peek-remote.txt\n100644 b5f26cee132622185457d92522fb932302dec97d 0\tDocumentation/git-prune-packed.txt\n100644 54f1dab38de9e01d8452753ac6028875b91d5f6b 0\tDocumentation/git-prune.txt\n100644 7578623edba9e2ddc5232f1a981bcb297182638d 0\tDocumentation/git-pull.txt\n100644 050c3ddae2732fdf4cb9f3b0f798e3d2d190fa4e 0\tDocumentation/git-push.txt\n100644 d4037de5124010e9c90dcc97e8b64e6011dbed21 0\tDocumentation/git-quiltimport.txt\n100644 6f4b9b017f7b504a2b9e909639a61b1ef7750af0 0\tDocumentation/git-read-tree.txt\n100644 59c1b021a6c410e1097df21d6d47365aec6689e2 0\tDocumentation/git-rebase.txt\n100644 6b2f8c4de7c32927f270e561362d4766193986fa 0\tDocumentation/git-receive-pack.txt\n100644 d99236e14d5238c936304029bd48efc6ac9dd024 0\tDocumentation/git-reflog.txt\n100644 25ff8f9dcbe0db52675338f1429e9169052b9cf1 0\tDocumentation/git-relink.txt\n100644 bb99810ec76f93ff1cdc59aacdf592c64419701a 0\tDocumentation/git-remote.txt\n100644 38ac60947bc6c4cbfc8aae70a92f9163fefed442 0\tDocumentation/git-repack.txt\n100644 e5bdb5533e61687874ad36d30534b2ac9e58d7cb 0\tDocumentation/git-repo-config.txt\n100644 19335fddae2b706cd785258a8c02a5595c525667 0\tDocumentation/git-request-pull.txt\n100644 89f321b414212a555f1e0fb0ff0ce6f4c180fd06 0\tDocumentation/git-rerere.txt\n100644 6abaeac28cb70bcff809c803d732f79630c8046f 0\tDocumentation/git-reset.txt\n100644 fd1de92e34b459cdc89928e1561ee6934cd63c19 0\tDocumentation/git-rev-list.txt\n100644 2921da320d2b84df4d15ec2745e6d94093dd6907 0\tDocumentation/git-rev-parse.txt\n100644 98cfa3c0d0f27e0cb603f07c76285f85ef07a771 0\tDocumentation/git-revert.txt\n100644 4d0c495bc3ecb5482165a46956efe73dfdc5ee72 0\tDocumentation/git-rm.txt\n100644 afbb294a7faadc7ff6d4039246dc1c085575cd4f 0\tDocumentation/git-send-email.txt\n100644 399821832c2a5cd6a718a7dc37a87e6b5bc0b213 0\tDocumentation/git-send-pack.txt\n100644 18f14b5be89b4e0240f59b13313308f3c09d012c 0\tDocumentation/git-sh-setup.txt\n100644 ff420f8f8c52eb598976a134916000da9b8f3976 0\tDocumentation/git-shell.txt\n100644 7ccf31ccc401fd35a0ed65667be001805436249b 0\tDocumentation/git-shortlog.txt\n100644 d3f258869f5d441bea16b46d8030eb64ecb7df99 0\tDocumentation/git-show-branch.txt\n100644 e3285aacfd310cc269cdb03aa9243c939c24def7 0\tDocumentation/git-show-index.txt\n100644 9a4389981ca067633d773e28393a1d72ac6552ae 0\tDocumentation/git-show-ref.txt\n100644 1642cfd8236a5b57420f67da580b42066afaa4f6 0\tDocumentation/git-show.txt\n100644 7d50d74cc9a945f0dd82b0c26509bf0392eff837 0\tDocumentation/git-stash.txt\n100644 84f60f3407499c40a8e0caadf9d40ed5e9b8386b 0\tDocumentation/git-status.txt\n100644 7508c0e42d2cd50ac522fc80a3a866411b7b51c5 0\tDocumentation/git-stripspace.txt\n100644 35efeefb3056ac69cf02689dc338956340e9efc9 0\tDocumentation/git-submodule.txt\n100644 f230125a81baab9f13bf84e3543b63fc77a8e827 0\tDocumentation/git-svn.txt\n100644 210fde03a12cd757769f81754e789a2a5934f02c 0\tDocumentation/git-symbolic-ref.txt\n100644 046ab3542bab4048fe07c8a6718d63f9cd9e3791 0\tDocumentation/git-tag.txt\n100644 a5d9558dd1eabd71e838026721d707c5f1ecc369 0\tDocumentation/git-tar-tree.txt\n100644 a96403cb8cb720dbf094b06a0dc0b430147298fc 0\tDocumentation/git-tools.txt\n100644 995db9feadf68df6f22de745d90790a145128e44 0\tDocumentation/git-unpack-file.txt\n100644 36d1038056101a459a33e32b6729d75e03f127ce 0\tDocumentation/git-unpack-objects.txt\n100644 1d9d81a702d26706047ae6ea29b4ca62ebe59460 0\tDocumentation/git-update-index.txt\n100644 9639f705afafab6fcf0cd21ad2693627ab42f66d 0\tDocumentation/git-update-ref.txt\n100644 35d27b0c7f0e4b7a1d0851140958e71fabb0e6bc 0\tDocumentation/git-update-server-info.txt\n100644 bbd7617587084b0c66fd8e0b9f623cac50be2c03 0\tDocumentation/git-upload-archive.txt\n100644 b8e49dce4a19a4d7083459468f27c273c1d91fea 0\tDocumentation/git-upload-pack.txt\n100644 3647dd6c8f9c74a688f7a143119386ba89a8f13d 0\tDocumentation/git-var.txt\n100644 c8611632d1d501d57eb7000de0ec3c3b36810b80 0\tDocumentation/git-verify-pack.txt\n100644 ba837df4bc66e2b828fcd49c94f35957c27322df 0\tDocumentation/git-verify-tag.txt\n100644 36afad8d4e0d67a8d9dd33d3bc590789e9f6604d 0\tDocumentation/git-web--browse.txt\n100644 cadfbd90403766d44598c8d96d89dc5a0e4e2ef8 0\tDocumentation/git-whatchanged.txt\n100644 26d3850e7317c22dcf0999e0c4a6afe9a5ea2e03 0\tDocumentation/git-write-tree.txt\n100644 44ea35e949dbbc0e5785ba2831072059881058f8 0\tDocumentation/git.txt\n100644 d7b41142d2c843bc5460f03c73c609b1c53ff4a6 0\tDocumentation/gitattributes.txt\n100644 29e5929db22257346a2bed16cbd5ca6531698676 0\tDocumentation/gitcli.txt\n100644 49179b0a00fad1ecda1fdf0537ccbce77f5fc494 0\tDocumentation/gitcore-tutorial.txt\n100644 aaa7ef737a4c190c60e37e2849ce42f3bdb5dda7 0\tDocumentation/gitcvs-migration.txt\n100644 2bdbc3d4f6a97c1a1d970f0c5f27222ef9e31274 0\tDocumentation/gitdiffcore.txt\n100644 565719ed5f8516e17229ec11bbec5e1354580397 0\tDocumentation/gitglossary.txt\n100644 046a2a7fe7cf8ec301d3a20f7ebc587a09d210e3 0\tDocumentation/githooks.txt\n100644 59321a2e82b1e141746d94c439452b52b84994ad 0\tDocumentation/gitignore.txt\n100644 e02ecf57444df14d61d82dcf2f9e0c3f6b990b91 0\tDocumentation/gitk.txt\n100644 f8d122a8b90ca7cb4920768ca23fd9a27574ffdf 0\tDocumentation/gitmodules.txt\n100644 a969b3fbc3efc99ce490455b93c8bfb912994e2e 0\tDocumentation/gitrepository-layout.txt\n100644 660904686c656fd00078aa272d0b9a5a198e1833 0\tDocumentation/gittutorial-2.txt\n100644 48d1454a90cf9453e5e3c9fa01b3dbc369a58f1f 0\tDocumentation/gittutorial.txt\n100644 9b4a4f45e900a96c4ddeb214816877f39cca15a5 0\tDocumentation/glossary-content.txt\n100755 34aa30c5b9ffc617e1519878317c2ae83bed6a6a 0\tDocumentation/howto-index.sh\n100644 4357e269131fad960367534ae4161fe078fee30a 0\tDocumentation/howto/maintain-git.txt\n100644 554909fe08de380aa02f2bf37f0f3b43b0233f4b 0\tDocumentation/howto/rebase-and-edit.txt\n100644 d214d4bf9d0e539c6bf58ba24dcd12aabbaea1d8 0\tDocumentation/howto/rebase-from-internal-branch.txt\n100644 48c67568d3418b2d6608f362f4b76e02ec450abc 0\tDocumentation/howto/rebuild-from-update-hook.txt\n100644 323b513ed0e0ce8b749672f589a375073a050b97 0\tDocumentation/howto/recover-corrupted-blob-object.txt\n100644 e70d8a31e7b05e8efc70c6a56f476324065d57a6 0\tDocumentation/howto/revert-branch-rebase.txt\n100644 6d3eb8ed00e1779efce8abe201d37c8cff07ec29 0\tDocumentation/howto/separating-topic-branches.txt\n100644 40327486084ac02874faff70fd100b619af83214 0\tDocumentation/howto/setup-git-server-over-http.txt\n100644 697d9188850e9a685045da5bd37844b02978752d 0\tDocumentation/howto/update-hook-example.txt\n100644 4e2f75cb6167633c97ec1981d2b6659368cc0170 0\tDocumentation/howto/use-git-daemon.txt\n100644 0953a50b693307976977c81a4c0b611fd5dfb490 0\tDocumentation/howto/using-merge-subtree.txt\n100644 fb0d7da56b902217f8f1f4d4bc85186d6bf0dc4c 0\tDocumentation/i18n.txt\n100755 35f440876ed182de319b6d3f0b8296b1a1ede29d 0\tDocumentation/install-doc-quick.sh\n100755 2135a8ee1f4f56a8c799437949ba76d7526164c0 0\tDocumentation/install-webdoc.sh\n100644 4065a3a27a38be73132b9f509e1d63546b3fddef 0\tDocumentation/manpage-1.72.xsl\n100644 48ce747cf4dad592d642735856eb156e93d6cf30 0\tDocumentation/merge-config.txt\n100644 007909a82fe77325e46c54799d00dc78493a47f9 0\tDocumentation/merge-options.txt\n100644 1276f858ade29bec40716d19cf56fe6e3882fc25 0\tDocumentation/merge-strategies.txt\n100644 c11d4957714db202a012209e2437b9e050a28ae0 0\tDocumentation/pretty-formats.txt\n100644 6d66c74cc11e6622892061f8328d04dfe38f87bf 0\tDocumentation/pretty-options.txt\n100644 00a8d210476089257be3d09ac8a16d1f8e1dd8dc 0\tDocumentation/pull-fetch-param.txt\n100644 3aa38097e6350a02c50873d5c670e108003fab22 0\tDocumentation/rev-list-options.txt\n100644 8aa891daee050f03cf265a6ea991ff9ebb60815e 0\tDocumentation/technical/.gitignore\n100644 43dbe09f735525b0a1549ccfb4de2f2ca87252a0 0\tDocumentation/technical/api-allocation-growing.txt\n100644 7ede1e64e5d40ec8f742e900d7273d6f961605e2 0\tDocumentation/technical/api-builtin.txt\n100644 1d52a6ce14416c7308f6c2c5d6a3dd2a43184e91 0\tDocumentation/technical/api-decorate.txt\n100644 20b0241d30026747391fa4b6b38de5cf959cee70 0\tDocumentation/technical/api-diff.txt\n100644 5bbd18f0206604416c3833b7541a5b55b7e63976 0\tDocumentation/technical/api-directory-listing.txt\n100644 9d97eaa9dee99eef7e66072c4c51cfff3000bba3 0\tDocumentation/technical/api-gitattributes.txt\n100644 a69cc8964d585db41b1907a8ce7cb8d0a9511ef2 0\tDocumentation/technical/api-grep.txt\n100644 c784d3edcb2537b84bfb5db3da55faaf45995155 0\tDocumentation/technical/api-hash.txt\n100644 e9559790a32185b1d4ac8ae72881f4f63f082538 0\tDocumentation/technical/api-history-graph.txt\n100644 adbdbf5d75d8e17e38e1ba0e3694b4ff210f5799 0\tDocumentation/technical/api-in-core-index.txt\n100644 af7cc2e395f1399830f9eacc52468376b216fb86 0\tDocumentation/technical/api-index-skel.txt\n100755 9c3f4131b8586408acd81d1e60912b51688575ed 0\tDocumentation/technical/api-index.sh\n100644 dd894043ae8b04269b3aa2108f96cb935217181d 0\tDocumentation/technical/api-lockfile.txt\n100644 03bb0e950dd1616b00f950f83263835c57bfa70a 0\tDocumentation/technical/api-object-access.txt\n100644 539863b1f920f8f34ad9272907cbacbd35a7fcbd 0\tDocumentation/technical/api-parse-options.txt\n100644 e8a1bce94e05f06c5b2aa51d2b610fb9da15d0bb 0\tDocumentation/technical/api-quote.txt\n100644 073b22bd83badb5aada47e061bb29e48d5f95518 0\tDocumentation/technical/api-remote.txt\n100644 996da0503acfa3e3a0ed0f57a951d0fbc1500fb8 0\tDocumentation/technical/api-revision-walking.txt\n100644 75aa5d49234ec36857a7c8d2f3900001af5cbcde 0\tDocumentation/technical/api-run-command.txt\n100644 4f63a04d7db0e7b578c5034c2856ba95a7ef5739 0\tDocumentation/technical/api-setup.txt\n100644 a9668e5f2d2b1a7ffac45e4111ca6d8a4818af2b 0\tDocumentation/technical/api-strbuf.txt\n100644 293bb15d206e71f57e906b33ca27ee05e3429521 0\tDocumentation/technical/api-string-list.txt\n100644 e3ddf912841298d6317a682a29cbaf628e86f156 0\tDocumentation/technical/api-tree-walking.txt\n100644 6296ecad1d65511f943fcd82ded188954a33b052 0\tDocumentation/technical/api-xdiff-interface.txt\n100644 1803e64e465fa4f8f0fe520fc0fd95d0c9def5bd 0\tDocumentation/technical/pack-format.txt\n100644 103eb5d989349c8e7e0147920b2e218caba9daf9 0\tDocumentation/technical/pack-heuristics.txt\n100644 9cd48b48597f9b7e822fc3d81e0bc556d6631b02 0\tDocumentation/technical/pack-protocol.txt\n100644 6bdf034b3af55c8d881fee9153d5cd1824660692 0\tDocumentation/technical/racy-git.txt\n100644 681efe42190fa28f8e6bc8f1eb569bfcf160ed4b 0\tDocumentation/technical/send-pack-pipeline.txt\n100644 559263af485f139d6c33d982bed9342aa4110e50 0\tDocumentation/technical/shallow.txt\n100644 24c84100b0790be22330464e01ea876e5d30fc9a 0\tDocumentation/technical/trivial-merge.txt\n100644 504ae8a53bca42d7c9ec560b65ddfe14699387a4 0\tDocumentation/urls-remotes.txt\n100644 fa34c6747194aaecf9e8124462129b8bbc9ae7d4 0\tDocumentation/urls.txt\n100644 339b30919e6cd9791a5cc30b93395a88fb5e9d96 0\tDocumentation/user-manual.conf\n100644 00256ca57cc7453ef4a0dce90169078ee96e95e3 0\tDocumentation/user-manual.txt\n100755 cb7cd4b53827fa6820e84b1318572d0115b3b17f 0\tGIT-VERSION-GEN\n100644 7d0c2c2f865d6ed969038e7543dbeb8933723ec3 0\tINSTALL\n100644 52c67c1a472455dcce5c19a21bbfd0520ff7dd26 0\tMakefile\n100644 548142c327a6790ff8821d67c2ee1eff7a656b52 0\tREADME\n120000 b9a53c3416991b66e1d35c2bbf663b48340b0041 0\tRelNotes\n100644 0d561246e0a958d9a7284409b1900a82876eebf3 0\tabspath.c\n100644 ccb1108c94436035d0da8b1d6f08f859b68294a3 0\talias.c\n100644 216c23a6f854c614d38c743cd7687a37f304161b 0\talloc.c\n100644 13029619e5ec34bac4ba61a6fc08800ab36f4a1b 0\tarchive-tar.c\n100644 cf285044e3576d0127c3215cb1253443d67517dc 0\tarchive-zip.c\n100644 f834b5f51f4cf5d3b73d21dfd99198caef3b19f8 0\tarchive.c\n100644 0b15b35143fffcc13764e4e668ee452b191cc609 0\tarchive.h\n100644 9e3ae038e818f4e21bc50f864fc5204f6fa44daa 0\tarm/sha1.c\n100644 3952646349cf9d033177e69ba9433652a378c0e9 0\tarm/sha1.h\n100644 8c1cb99fb403875af85e4d1524d21f7eb818f59b 0\tarm/sha1_arm.S\n100644 17f6a4dca521d9690377f2e93a0192d8a874d2ad 0\tattr.c\n100644 f1c2038b0923d3130937eef965667204a8634e6d 0\tattr.h\n100644 b88270f90844095b3d352cc4213cbebd95a7f420 0\tbase85.c\n100644 bd7d078e1ae5fe4ce0a16fda62a2c1743237941b 0\tblob.c\n100644 ea5d9e9f8b63be2c7048d19ee53feb06b0795c80 0\tblob.h\n100644 b1e59f2196b933ab7169a30efc5d1d340f8f9c5c 0\tbranch.c\n100644 9f0c2a2c1fab9a312f436880956da0973c68ead8 0\tbranch.h\n100644 fc3f96eaefff91e4e85adb92162716939f0ecd72 0\tbuiltin-add.c\n100644 fc43eed36b55e4966796490b8c0a02fae790229c 0\tbuiltin-annotate.c\n100644 2216a0bf7cd53adc31346f66a3b9786a1d688bad 0\tbuiltin-apply.c\n100644 22445acbfc5279f391ac6afa855b21064ec54535 0\tbuiltin-archive.c\n100644 8b6b09b10b8f9dcda0b7224f31c860bb803945f0 0\tbuiltin-blame.c\n100644 b1a2ad7a6b3b150cda8d031a87352a4daedc40ea 0\tbuiltin-branch.c\n100644 ac476e7a4b45fc55b6b6d1e4d02be0c35aba2c7b 0\tbuiltin-bundle.c\n100644 7441a56acdbefdd8044a406f4d756ce8a4f06644 0\tbuiltin-cat-file.c\n100644 cb783fc77e75515a02ed2268dfb37ee3bbd03749 0\tbuiltin-check-attr.c\n100644 fe04be77a9312c11fa054897c5982fa6c74b8e5e 0\tbuiltin-check-ref-format.c\n100644 71ebabf9903bd90b7da59c47f1c0819b5f25c538 0\tbuiltin-checkout-index.c\n100644 411cc513c65ba854221ad52dd6aeaaac7d213c9d 0\tbuiltin-checkout.c\n100644 48bf29f40a5e06fd588b34c468535e04abcf206b 0\tbuiltin-clean.c\n100644 e086a40b41810c30a4f5228daa4e38857dae84d5 0\tbuiltin-clone.c\n100644 7a9a309be0543da7d27e7710ef82271f2582e0a9 0\tbuiltin-commit-tree.c\n100644 f7c053a0106c2e42833d0d7c7255b7b636d09a93 0\tbuiltin-commit.c\n100644 91fdc4985d8e64fae12209174dd4aa2d887793e5 0\tbuiltin-config.c\n100644 91b5487478998e39bb8ae4a5cb667360cff82c9a 0\tbuiltin-count-objects.c\n100644 ec404c839b6542deb4e15ca342fd3c0afbbedd2e 0\tbuiltin-describe.c\n100644 9bf10bb37e2f56ec2a10239d7419db8fbb641745 0\tbuiltin-diff-files.c\n100644 17d851b29ee5de33e01745eabcd5cd735c30b352 0\tbuiltin-diff-index.c\n100644 415cb1612f5322da89850874ba81885e41808678 0\tbuiltin-diff-tree.c\n100644 7ffea975059f9e13b07ca680e6707ffc14973f90 0\tbuiltin-diff.c\n100644 070971616dbb12d005c5c9a1f82cc5b0c5391f62 0\tbuiltin-fast-export.c\n100644 7460ab7fce2a4e6a7e014f448819140e2204ccb7 0\tbuiltin-fetch--tool.c\n100644 273239af3be61736ee4ff484d628950c4de7311a 0\tbuiltin-fetch-pack.c\n100644 7eec4a0e43ad5760f1060a7d5bcf2a5083015130 0\tbuiltin-fetch.c\n100644 df02ba7afdd615492361a1897a9dedd6ab233c96 0\tbuiltin-fmt-merge-msg.c\n100644 445039e19c75e4c9321f7ee64289ef8201a25c14 0\tbuiltin-for-each-ref.c\n100644 6eb7da88d3e8591a8c544acc61a42e00babff120 0\tbuiltin-fsck.c\n100644 fac200e0b08360625afc81b02913128c9b87f486 0\tbuiltin-gc.c\n100644 631129ddfd0ffe06f919882d22cfc494d9553f50 0\tbuiltin-grep.c\n100644 3a062487a7eacd01ed824b46a9124dd343cd2e60 0\tbuiltin-http-fetch.c\n100644 baf0d09ac4ea372b4015d399560a133b401b55cc 0\tbuiltin-init-db.c\n100644 f4975cf35f7f1555739f7657ee62ed983d18cb84 0\tbuiltin-log.c\n100644 e8d568eed7ab700bc338af8f589d2f61e81f323c 0\tbuiltin-ls-files.c\n100644 c21b841e7c5e8d27a6e66e7f70786d77aa4653b5 0\tbuiltin-ls-remote.c\n100644 d25767a1f7eb0a8b45bc1eed6b9aa95de0847f18 0\tbuiltin-ls-tree.c\n100644 f974b9df968c74c5d62d58b2a09493e6abb4322e 0\tbuiltin-mailinfo.c\n100644 71f3b3b8741e505fc652e6c74c75972f19211f71 0\tbuiltin-mailsplit.c\n100644 3382b1382a7dcbd525126a35209072da4b4d8041 0\tbuiltin-merge-base.c\n100644 3605960c2d9692514a6df0f344f3c3269cf1de3c 0\tbuiltin-merge-file.c\n100644 8f5bbaf402e020e308e7af9cedb7df1b2ec5a2b7 0\tbuiltin-merge-ours.c\n100644 43e55bf90154c51b94527b2ab7eb7c60fe36e9ec 0\tbuiltin-merge-recursive.c\n100644 dde0c7ed33118ff8d0cc421e8a0366e342c6d011 0\tbuiltin-merge.c\n100644 4f65b5ae9baf66953e79886fd93fe31786b24d36 0\tbuiltin-mv.c\n100644 85612c4dcb719b460623204046e35486e9d9fe97 0\tbuiltin-name-rev.c\n100644 2dadec1630c266bbaf42e84810f7059ed5c43b1e 0\tbuiltin-pack-objects.c\n100644 34246df4ec946273d9f42e6f0848b02d8510beea 0\tbuiltin-pack-refs.c\n100644 10cb8df8457fd5f2ba9be62ecd0f9384e21c3e63 0\tbuiltin-prune-packed.c\n100644 947de8cf258c73d8a327ef3a1daed417ba533f1b 0\tbuiltin-prune.c\n100644 c1ed68d938f67343c6938cfef54d5ff69a522a63 0\tbuiltin-push.c\n100644 72a6de302f88728af17ce5c5c6983c5267afc6f6 0\tbuiltin-read-tree.c\n100644 0c34e378199064e87aa09caf0fa0a2346333ec69 0\tbuiltin-reflog.c\n100644 54d1c3e3d16b2cebcff0c6c57d98756e48472b67 0\tbuiltin-remote.c\n100644 dd4573fe8dcd9dc8edd5a7d41bc8daa83034ee7e 0\tbuiltin-rerere.c\n100644 c24c21909194014b467c86fd3598796e7db576b3 0\tbuiltin-reset.c\n100644 893762c80f4910fadf2d6df414bd835cccb7faaa 0\tbuiltin-rev-list.c\n100644 9aa049ec170b0125fddde29adda3c720c8a7b8ee 0\tbuiltin-rev-parse.c\n100644 e9da870d22c14c32a0e0a6cb71b933c79a2d8b53 0\tbuiltin-revert.c\n100644 ee8247b08cd007f73d5dfffa560a9efe33d327b9 0\tbuiltin-rm.c\n100644 7588d22885d0af24ae80f1d687ccd097fe365021 0\tbuiltin-send-pack.c\n100644 d03f14fdad3d17dde06734d78ddb4aade6ed4f2b 0\tbuiltin-shortlog.c\n100644 233eed499d0b8790781326ff0455bdc7f09fe4d4 0\tbuiltin-show-branch.c\n100644 add16004f11375b1ad2b97f9b1bf1ced5c437f81 0\tbuiltin-show-ref.c\n100644 c0b21301ba4c126a49ed38b6983756b99a25aae0 0\tbuiltin-stripspace.c\n100644 bfc78bb3f6eff2f8e39649b9649ae7263f143ad9 0\tbuiltin-symbolic-ref.c\n100644 325b1b2632e44121c23bc6df556bf3aa4e32ba04 0\tbuiltin-tag.c\n100644 f4bea4a322c26a54734286073c5e67444555c2d9 0\tbuiltin-tar-tree.c\n100644 a8918666655bb91f952ccdac18715bd9ba4a09f2 0\tbuiltin-unpack-objects.c\n100644 38eb53ccba2b97a0fccf50d6ba0b7424fe2d1bcb 0\tbuiltin-update-index.c\n100644 56a0b1b39cf4c4fc51dbbff256240655bc36a038 0\tbuiltin-update-ref.c\n100644 a9b02fa32f372a6810867c10560a20d58b5b2a91 0\tbuiltin-upload-archive.c\n100644 f4ac595695b1fff1317ff7d14ea9427780327aea 0\tbuiltin-verify-pack.c\n100644 729a1593e61d87ad4596f07e7faedac81de64e81 0\tbuiltin-verify-tag.c\n100644 52a3c015ff8e4611522bd41078bdb2934d288d35 0\tbuiltin-write-tree.c\n100644 f3502d305e4f65e9707fe8b738f64be6e49f7f84 0\tbuiltin.h\n100644 00b2aabefca49b634f49143523ee31556baa7777 0\tbundle.c\n100644 e2aedd60d6ad1482bb6da173c853e6ba4805c8d7 0\tbundle.h\n100644 5f8ee87bb1c446341b640c2f978a658d6bfcfcd0 0\tcache-tree.c\n100644 cf8b790874c4a4f5890b360c237ccdd4a5a03de4 0\tcache-tree.h\n100644 2475de9fa837596303284157e08b3080d64351ee 0\tcache.h\n100755 d6fe6cf1749ebcd6189fa36cbb4e14a532d2d17b 0\tcheck-builtins.sh\n100644 00d92a16631a80ff8ec4e995dafcd3e55434fad5 0\tcheck-racy.c\n100755 a1c4c3e8d845e8e791d7df0c1387e1b2262b5ecf 0\tcheck_bindir\n100644 fc0b72ad59b13e4bd86372e5e81b4f400c99d26e 0\tcolor.c\n100644 6cf5c88aaf8d0e38e2853e6fd212e3cdd6c180cb 0\tcolor.h\n100644 9f80a1c5e3a461afd11966625589684d61187911 0\tcombine-diff.c\n100644 3583a33ee90647d8e6ded02643eb75753760d94f 0\tcommand-list.txt\n100644 dc0c5bfdab7296bf7febb6f1b1aad64550838c15 0\tcommit.c\n100644 77de9621d9c926c6fb8a2bf9ca81c6c376a2ad41 0\tcommit.h\n100644 1f4ead5f981688ee9e29ae2ee281e3904c9131f6 0\tcompat/fnmatch.c\n100644 cc3ec379400e9334a37cf3f07a61a77f264da885 0\tcompat/fnmatch.h\n100644 b5ca142fedf2ac0e0cedde1011ab385f65010fdf 0\tcompat/fopen.c\n100644 069c555da47ea168eea937fcc2d788294bf92ef5 0\tcompat/hstrerror.c\n100644 f44498258d4c2a0ebd1379ed818d9d04b56f0761 0\tcompat/inet_ntop.c\n100644 4078fc0877ca99c82152acdd6b7a9eef70a9f8a4 0\tcompat/inet_pton.c\n100644 cd0d8773641f2fdc808d8b246a8dd2bcd0e5814d 0\tcompat/memmem.c\n100644 772cad510d5d260fdf33b4f7d6ff79f9f3367b05 0\tcompat/mingw.c\n100644 290a9e6f822df97984b9f769508aab36419eaf02 0\tcompat/mingw.h\n100644 34d4b49818b0896b9db19b2b1387f142cbbbd42b 0\tcompat/mkdtemp.c\n100644 c9d46d174259f42a3e2a2eb073475aba517044be 0\tcompat/mmap.c\n100644 978cac4ec91e6bb2f81539d85422bb37e4941a51 0\tcompat/pread.c\n100644 d93dce2cf8fa33bd1fbefe131d2e41a6b954da61 0\tcompat/qsort.c\n100644 87b33e46697b9a5dd9a9e8391ca3607f7e2ff569 0\tcompat/regex.c\n100644 6eb64f14020db0a20ba596de5b58b3c552157f16 0\tcompat/regex.h\n100644 3a22ea7b751efb768d72afa2f97fd963e10eec7e 0\tcompat/setenv.c\n100644 580966e56a3455b9970b7eef33143c1e9c57d41c 0\tcompat/snprintf.c\n100644 26896deca64c531f57b4c48ea92134f876b8e537 0\tcompat/strcasestr.c\n100644 4024c360301ebe7d58ac5b84dcbb692341b649ed 0\tcompat/strlcpy.c\n100644 5541353a77a22d48ccebd20ede2f510ae20d1492 0\tcompat/strtoumax.c\n100644 eb29f5e0849370afe90c400271fea12e0f9090aa 0\tcompat/unsetenv.c\n100644 e2d96dfe6f75213de567174261d9aeba3e663d9d 0\tcompat/winansi.c\n100644 53f04a076a7275965090edd4ca2a34652c4f5679 0\tconfig.c\n100644 b776149531025c85f5665d971e6e072f0cc64893 0\tconfig.mak.in\n100644 7c2856efc92ca55e3cf03fcf1c72ffb70318f7c3 0\tconfigure.ac\n100644 574f42fa47ffa69328217eb25afee6f85db9595e 0\tconnect.c\n100644 05f291c1f1d3d1018f390618816f94d0cd58951b 0\tcontrib/README\n100644 fada5ce909876168f68a85c8ca9a8bc269048acb 0\tcontrib/blameview/README\n100755 1dec00137b2dd8a888a962edd62f01aad89e4186 0\tcontrib/blameview/blameview.perl\n100755 30d870187e64e33ed430dc1fab1ea37036a07f58 0\tcontrib/completion/git-completion.bash\n100644 4009a151deceb45030fb26c5bfcf1b75a423a493 0\tcontrib/continuous/cidaemon\n100644 b8f5a609af464f3af8b624246cc69eb335ce81d1 0\tcontrib/continuous/post-receive-cinotify\n100644 90e7900e6d7aff2fadf9ba04f8d982733493411c 0\tcontrib/convert-objects/convert-objects.c\n100644 9718abf86d8cd36ddae1eae8cf2337e35b927959 0\tcontrib/convert-objects/git-convert-objects.txt\n100644 c531d9867f6c223be1daf0f6da7538feb11966d8 0\tcontrib/emacs/.gitignore\n100644 a48540a92b4aa5140a87469b36c1f9b3d8e46e7f 0\tcontrib/emacs/Makefile\n100644 4fa70c5ad47fcd717d9cbdb23a8142f89227f630 0\tcontrib/emacs/git-blame.el\n100644 c1cf1cbcc014e5d6c01a1c33efa2d7bd3b76df88 0\tcontrib/emacs/git.el\n100644 b8f6be5c0af64dfbe7e136f984404f22aea68130 0\tcontrib/emacs/vc-git.el\n100755 1a7689a48f07a6ed2bb156f745bfea19a10e3eb9 0\tcontrib/examples/git-checkout.sh\n100755 01c95e9fe8a19afcf331ed5ffd47eea478886213 0\tcontrib/examples/git-clean.sh\n100755 547228e13ce60e575d0b4a10a322edfff6c0622c 0\tcontrib/examples/git-clone.sh\n100755 2c4a4062a5317c51601fc4c644c96a7f75e1ef2c 0\tcontrib/examples/git-commit.sh\n100755 e44af2c86d8e7e44bc79aafcc8ccef3806804720 0\tcontrib/examples/git-fetch.sh\n100755 1597e9f33f5e001995085639a448f1214010b561 0\tcontrib/examples/git-gc.sh\n100755 fec70bbf88c614a2dadfc40950fdd7abdf7f2c63 0\tcontrib/examples/git-ls-remote.sh\n100755 29dba4ba3a57c15bd430bd23c1cebe78e6dc03be 0\tcontrib/examples/git-merge-ours.sh\n100755 e9588eec33ba5b64d186ff048bb040c18c57e6bc 0\tcontrib/examples/git-merge.sh\n100755 36bd54c985080f8dd5558a3e7a4e19ede9fbab93 0\tcontrib/examples/git-remote.perl\n100755 4f692091e73bf633cf986ba2c9bed38bc2c78538 0\tcontrib/examples/git-rerere.perl\n100755 bafeb52cd113ad8a07ffd1912191f2bc17a7ef7a 0\tcontrib/examples/git-reset.sh\n100755 0ee1bd898ecbb725d13385408b4ed4bcb413f503 0\tcontrib/examples/git-resolve.sh\n100755 49f00321b28833c24ebb78ea2104f34091d43017 0\tcontrib/examples/git-revert.sh\n100755 a13bb6afec2fe5e0b5249523ec8c62d8e517de88 0\tcontrib/examples/git-svnimport.perl\n100644 71aad8b45bd4c5f59c2ce3746cb3299821729c2a 0\tcontrib/examples/git-svnimport.txt\n100755 e9f3a228af472c932f6cec5fa25ae49cd841b239 0\tcontrib/examples/git-tag.sh\n100755 0902a5c21adc4123e36856f73acc1409e17eb0ac 0\tcontrib/examples/git-verify-tag.sh\n100755 f9fef6db28dbba0ef67589f05eeb937760d2facf 0\tcontrib/fast-import/git-import.perl\n100755 0ca7718d0518db2e559ecd17eb6f7f57338b80fd 0\tcontrib/fast-import/git-import.sh\n100755 6ae0429c2dde435f8ae33991ad10f40485aefdc6 0\tcontrib/fast-import/git-p4\n100644 9f97e884f5c3cae9e89164c9590959ba487a89bd 0\tcontrib/fast-import/git-p4.bat\n100644 b16a8384bcfbfe33dc33e1076c64f5d36e75e803 0\tcontrib/fast-import/git-p4.txt\n100755 23aeb257b9557cb146586868084ce1b20d7e7ac8 0\tcontrib/fast-import/import-tars.perl\n100755 c674fa2d1b5c6ab47ebb5e828c427c6d47bb50fc 0\tcontrib/fast-import/import-zips.py\n100755 4c99dfb9038ca034d86b72cbe342373d12ae8cc6 0\tcontrib/gitview/gitview\n100644 77c29de305fabc518edf060b0e6634d9c5c9f71e 0\tcontrib/gitview/gitview.txt\n100755 7b03204ed18500756ba55818f0808b52db68d048 0\tcontrib/hg-to-git/hg-to-git.py\n100644 91f8fe6410c06308b6dce47ca28f4c1b8536c5bb 0\tcontrib/hg-to-git/hg-to-git.txt\n100644 41368950d6b29121089ee9239b8e07ece209a31e 0\tcontrib/hooks/post-receive-email\n100644 0096f57b7e09f33108d7177405d02eec05811c03 0\tcontrib/hooks/pre-auto-gc-battery\n100644 dab7c8e3a1829b31f2b10eafe8becf0f067b5a05 0\tcontrib/hooks/setgitperms.perl\n100644 d18b317b2f018d1d1a5a9677a7bdaf8956d65186 0\tcontrib/hooks/update-paranoid\n100644 b9892b679320d17c1e9812633d892a7e057865aa 0\tcontrib/p4import/README\n100644 0f3d97b67eef3108728265e26f5d79c4526d11ac 0\tcontrib/p4import/git-p4import.py\n100644 9967587fe6bef0cf7cc3e93467bd179f6f58b032 0\tcontrib/p4import/git-p4import.txt\n100644 f2b08b4f4a5ea29ac6125f5717fa661e11b7d5f9 0\tcontrib/patches/docbook-xsl-manpages-charmap.patch\n100755 1cda19f66af96fa828de81cbb21817abca0c06ea 0\tcontrib/remotes2config.sh\n100755 e27fd088be1bd3ecc3da116d5f32ce10d89897ac 0\tcontrib/stats/git-common-hash\n100755 4b852e2455bab324e3bd16e02ec712fbacbf34b0 0\tcontrib/stats/mailmap.pl\n100755 f4a7b62cd9f1a397118b95792c04c2f70f910f9e 0\tcontrib/stats/packinfo.pl\n100644 39f96aa115e0a20024d2f41138db6b2b8c6d5320 0\tcontrib/thunderbird-patch-inline/README\n100755 cc518f3c890158d29e751e008436e0c3790746ee 0\tcontrib/thunderbird-patch-inline/appp.sh\n100644 9e7881fea923e47c3c35028ebbc00bce395d4005 0\tcontrib/vim/README\n100644 332121b40e9c54de9f55362cb57760136039e9fd 0\tcontrib/vim/syntax/gitcommit.vim\n100755 7959eab902d28bb3307c542514ca4c5f49deee0f 0\tcontrib/workdir/git-new-workdir\n100644 78efed800d4d64898d438d9590b01be008cfcd36 0\tconvert.c\n100644 e54d15aced7595ccb11423b0de121db9051ad1f3 0\tcopy.c\n100644 ace64f165e4a01fb99892e9b89e7df791a7f4ca1 0\tcsum-file.c\n100644 72c9487f4fd9fcab5e02fc2dc6afd3cb7f9c036a 0\tcsum-file.h\n100644 ee06eb7f48f1d3e818b3037369b4e056fe7e5be7 0\tctype.c\n100644 4540e8df5ab8bc8ff66549144d7db2928e12199b 0\tdaemon.c\n100644 35a52576c53e5e1406d40ed4402b8834a29b9f0e 0\tdate.c\n100644 d9668d2ef94c73e4a7a5602011ff13a9fd9d8c6a 0\tdecorate.c\n100644 1fa4ad9beb08f23888814b99183487ab85378bfd 0\tdecorate.h\n100644 40ccf5a1e95f62d840a006274f7024fa43208b1c 0\tdelta.h\n100644 a4e28df714b4834e5efe42fa3abb647711913d71 0\tdiff-delta.c\n100644 e7eaff9a68ccbcc692522c9956f0dae9af45f3f1 0\tdiff-lib.c\n100644 7d68b7f1bef1039b4996e662fb17968c4e3e3e79 0\tdiff-no-index.c\n100644 cbf25473c594abfd1fc13473108dc9c15e2f1d15 0\tdiff.c\n100644 50fb5ddb0bec02b0cd5498d6ecc37d44bf874476 0\tdiff.h\n100644 31cdcfe8bcdae7df65b0387071846299a14bb7be 0\tdiffcore-break.c\n100644 e670f8512558c38d9a9d6e754cfc609b042b1195 0\tdiffcore-delta.c\n100644 23e93852d8c701760d56e7e728dba7c08367fbe8 0\tdiffcore-order.c\n100644 af9fffe6e8e145b066157da8791c749257e7c8e9 0\tdiffcore-pickaxe.c\n100644 1b2ebb40014d820fe4fb679509ab694d453be7b4 0\tdiffcore-rename.c\n100644 cc96c20734bf4184970f5381416637cf6e45ea13 0\tdiffcore.h\n100644 29d1d5ba31def46ba8b55905dc60773cc6cc167e 0\tdir.c\n100644 2df15defb6720a742282f24721233c4816deceb6 0\tdir.h\n100644 1f73f1ea7dfa6a14dedf384c99751e86c8121ff4 0\tdump-cache-tree.c\n100644 eebc3e95fe0c7e61f7c29fa5412ea9d4a5900f92 0\teditor.c\n100644 222aaa374b8268828e9d529a8afacb8830acc281 0\tentry.c\n100644 0c6d11f6a0c6fa5dbab2f36c4b4ad4de5aba4ac9 0\tenvironment.c\n100644 ce6741eb682b59ad638c7bee6ca31e2fcd53f281 0\texec_cmd.c\n100644 594f961387240c221020c9ea0bccd8a39ff69595 0\texec_cmd.h\n100644 7089e6f9e6c5fa9142f468e54afe7d33a6d2eec7 0\tfast-import.c\n100644 8bd9c32561e79d194d27fa10cc98a26aa2cb673c 0\tfetch-pack.h\n100755 63dfa4c475ae3632fc5cfd093d949a41683a5458 0\tfixup-builtins\n100644 797e3178ae279f444d2efa7e3758652ad0898dd7 0\tfsck.c\n100644 990ee02335a2e2693e32baa82b259c23843f2aa0 0\tfsck.h\n100755 a2913c2a2cd1ec158157ada3e2deb666892b734b 0\tgenerate-cmdlist.sh\n100755 da768ee7acc22e6480f0a067e109239561d43927 0\tgit-add--interactive.perl\n100755 6aa819280ef99ccbbdeefde037e99fae3e6f0110 0\tgit-am.sh\n100755 98f3ede566a6cb0c902ce84795f7de8f8afbe633 0\tgit-archimport.perl\n100755 3cac20db79e1e408a321b0e9d272501985a3c49b 0\tgit-bisect.sh\n100644 cf89cdf4598b3796724a85aa707f740245155cdc 0\tgit-compat-util.h\n100755 6d9f0ef0f989133422cf8c0302e63dab15a999d5 0\tgit-cvsexportcommit.perl\n100755 e2664ef01308fd0fb65d47b25e0ae73a65aa6262 0\tgit-cvsimport.perl\n100755 b0a805c688f59af29e1f25b514d73f3991285dee 0\tgit-cvsserver.perl\n100755 182822a24e214fe7e93a2df68fdda3dd40b5896d 0\tgit-filter-branch.sh\n100644 6483b21cbfc73601602d628a2c609d3ca84f9e53 0\tgit-gui/.gitignore\n100755 0ab478ef90aba9048a2de785d538da16e1bae431 0\tgit-gui/GIT-VERSION-GEN\n100644 55765c8a3aa6b3702b230e8efe3c2ab47a6e73e5 0\tgit-gui/Makefile\n100755 14b2d9aacd1d28084f195365b434747df2ddc95d 0\tgit-gui/git-gui.sh\n100644 241ab892cd5b731f07571acf7a0ca3150a763f4f 0\tgit-gui/lib/about.tcl\n100644 b6e42cbc8fe0a49c301335f78cc2941bd9d59870 0\tgit-gui/lib/blame.tcl\n100644 777eeb79c1355ec49ce175cc5c33a13df6e41c97 0\tgit-gui/lib/branch.tcl\n100644 6603703ea163d830c7de1478aa2dd737c4d9d499 0\tgit-gui/lib/branch_checkout.tcl\n100644 3817771b944cc363205b86c91f7b4801c1d568f9 0\tgit-gui/lib/branch_create.tcl\n100644 ef1930b4911591566be4561b8c17c24e1cfbfaad 0\tgit-gui/lib/branch_delete.tcl\n100644 166538808f461275075e2b03c56ddc15b5813e1a 0\tgit-gui/lib/branch_rename.tcl\n100644 ab470d12648c1dd3560b411e70ea210cc4381e3e 0\tgit-gui/lib/browser.tcl\n100644 caca88831b7066c573917542d24a52e832dcff34 0\tgit-gui/lib/checkout_op.tcl\n100644 56443b042c62bc10765aaf6484ad1077a843cb30 0\tgit-gui/lib/choose_font.tcl\n100644 318078615862adab052d0d0f637f82176a0a785a 0\tgit-gui/lib/choose_repository.tcl\n100644 c8821c146386f850c0794df70f605cd9f18dcff3 0\tgit-gui/lib/choose_rev.tcl\n100644 dc2141192a21e7416268cc94beda78d6ceb8f86f 0\tgit-gui/lib/class.tcl\n100644 40a710355751836e78b65101592b753266f507ca 0\tgit-gui/lib/commit.tcl\n100644 c112464ec367a2db707a3f28ff6c588aefe7985f 0\tgit-gui/lib/console.tcl\n100644 a18ac8b4308d8263a0688058524282b72bafe77a 0\tgit-gui/lib/database.tcl\n100644 abe82992b6529cf49983029d85348df5d27ceaf5 0\tgit-gui/lib/date.tcl\n100644 52b79e4a1f476c2ee9b65087f66a352a25ed0903 0\tgit-gui/lib/diff.tcl\n100644 7f06b0d47f0fa214c98644757f99f8a036b9689e 0\tgit-gui/lib/encoding.tcl\n100644 75650157e551e34dab650d89f3fa6d25afc91d6a 0\tgit-gui/lib/error.tcl\n100644 334cfa5a1a59c320e86789ccf4ed3320584a0215 0\tgit-gui/lib/git-gui.ico\n100644 3c1fce7475d362d1880d915ff4bdf168fda28593 0\tgit-gui/lib/index.tcl\n100644 5ff76692f5eeeb51bcca0905385f51963d1e6531 0\tgit-gui/lib/logo.tcl\n100644 5c01875b051305b5b40a17ac7a2245f69081f41b 0\tgit-gui/lib/merge.tcl\n100644 ffb3f00ff0a992254804cc047b5a63ce82aa5bd9 0\tgit-gui/lib/option.tcl\n100644 0e86ddac0981fbb575a7dd5294ddaed29f7c3917 0\tgit-gui/lib/remote.tcl\n100644 c7b81486984d46a9dca59867c406a8e247d76313 0\tgit-gui/lib/remote_branch_delete.tcl\n100644 38c3151b05c732d919943e44629bfc0a8c9fb617 0\tgit-gui/lib/shortcut.tcl\n100644 78f344f08f34842c134b6b0e22b6eb8c49b1dbbd 0\tgit-gui/lib/spellcheck.tcl\n100644 51d4177551b911c35cfd8004a36fca4259367d24 0\tgit-gui/lib/status_bar.tcl\n100644 8e6a9d0a6010cf5efee069a2d488124bcbdb54cd 0\tgit-gui/lib/transport.tcl\n100644 d7f93d045d1a2b3a14d2fdb4907697622b5973a8 0\tgit-gui/lib/win32.tcl\n100644 117923f8860bb8f0f04c1664d8cbe38804a59831 0\tgit-gui/lib/win32_shortcut.js\n100644 ddbe6334a258dae46b6c333d53590f3b920a9cab 0\tgit-gui/macosx/AppMain.tcl\n100644 b3bf15fa1c1a41265460664417caf47265553a4f 0\tgit-gui/macosx/Info.plist\n100644 77d88a77a7669667335cf6fd5767c8b40f3ce6e7 0\tgit-gui/macosx/git-gui.icns\n100644 a89cf4496990737117d7558a7465f68aa058e465 0\tgit-gui/po/.gitignore\n100644 5e77a7d7d2d9e82311c1573035fa020c8d08b38c 0\tgit-gui/po/README\n100644 f20955c18520bf2b0cc8826da9e1dc93a5624ac3 0\tgit-gui/po/de.po\n100644 89b6d51ea011d5b0fc8a343ffdda078d659571cb 0\tgit-gui/po/fr.po\n100644 813199f782968cb0949d24119145e8b3e4a174cd 0\tgit-gui/po/git-gui.pot\n100644 749aa2e7ec1b02e6af3427516b1197f77bd48795 0\tgit-gui/po/glossary/Makefile\n100644 35764d1d22da45e90638b2db3e0bfbcb332e8696 0\tgit-gui/po/glossary/de.po\n100644 27c006abb2adca055ebf7e44ce9a4ec351af19c5 0\tgit-gui/po/glossary/fr.po\n100644 40eb3e9c07a4d39091972655d8a99110fd361be5 0\tgit-gui/po/glossary/git-gui-glossary.pot\n100644 9b31f69152025e484ddf467d7884c2bf2140a894 0\tgit-gui/po/glossary/git-gui-glossary.txt\n100644 bb46b48d6b84446a23c14af88c339fda7e417718 0\tgit-gui/po/glossary/it.po\n100755 49bf7c5365130ec290948ee8abba28d757774381 0\tgit-gui/po/glossary/txt-to-pot.sh\n100644 158835b5c1c9364735167e618af62272c8bb7a8d 0\tgit-gui/po/glossary/zh_cn.po\n100644 28760ed97838d39effd035ab4f1159c0085221f8 0\tgit-gui/po/hu.po\n100644 11cc79bb5ec9c8f1a158ceb457157705b04d4adf 0\tgit-gui/po/it.po\n100644 28e6d6246b5a07bc0dfe29dde4727be0cf0ba40c 0\tgit-gui/po/ja.po\n100644 b7c4bf3fdffb3d04b8c01b25e99a706e499de0d1 0\tgit-gui/po/po2msg.sh\n100644 db55b3e0a69813cba16932212ee1b2ce0f5b2b9a 0\tgit-gui/po/ru.po\n100644 4da687bb41f5471eaa6dd49c2ffae1eaa053ec68 0\tgit-gui/po/sv.po\n100644 d2c686667163ec4cd83045efd429e3413564290e 0\tgit-gui/po/zh_cn.po\n100644 53c3a94686813936445efbb055dc4f02885c70e9 0\tgit-gui/windows/git-gui.sh\n100755 0843372b57371b62cd68f2818f634209f55d5395 0\tgit-instaweb.sh\n100755 9cedaf80ceac1d4100adf3cfb152c76c7f945e4d 0\tgit-lost-found.sh\n100755 645e1147dc886f2b1ca6d2020b44db746b082bf0 0\tgit-merge-octopus.sh\n100755 e1eb9632660146396a0b5f3f2a410d8cb027ff9d 0\tgit-merge-one-file.sh\n100755 93bcfc2f5dce418d00f26257788932d5c738785c 0\tgit-merge-resolve.sh\n100755 94187c306ccb05d977f2bb35e81828130ab49a61 0\tgit-mergetool.sh\n100755 695a4094bb4230341618bd6f16d0bea9bff2e826 0\tgit-parse-remote.sh\n100755 75c36100a2f858bcf2663d2b4560654787963175 0\tgit-pull.sh\n100755 cebaee1cc9dfc28d80173583b144a480be2f9bfd 0\tgit-quiltimport.sh\n100755 4e334ba41dad3067394b79c15ebfe610b2d3e178 0\tgit-rebase--interactive.sh\n100755 412e135c3ae88d76b5bdf3f08083b153da220a95 0\tgit-rebase.sh\n100755 937c69a74858a8a3c63bb41a23705b579df1b3a3 0\tgit-relink.perl\n100755 683960b04d6b743e687b2eb640d2b0e00ccfd313 0\tgit-repack.sh\n100755 073a314c8043e0ff30afde65e012e356ff0d186f 0\tgit-request-pull.sh\n100755 d2fd89907688a044ffe0d2520744e00a9b33c942 0\tgit-send-email.perl\n100755 dbdf209ec0e7d6468c199d1905c3e7788a9cd246 0\tgit-sh-setup.sh\n100755 d4609ed66e56dc6021c800d60286bec38615ff39 0\tgit-stash.sh\n100755 b40f876a2ca9fe985cedc622ab28a9f461edc5ab 0\tgit-submodule.sh\n100755 cf6dbbc42773fef394c27cd87109b69c3144753c 0\tgit-svn.perl\n100755 384148a59fc492d8fb1d6ea4fc4532aa1e5ffc22 0\tgit-web--browse.sh\n100644 37b1d76a08ca59f3de54e11890dce962403cf8d3 0\tgit.c\n100644 c6492e5be2763eab81358424ff625a34a5ff2fba 0\tgit.spec.in\n100644 e1b6045605865cbfc4ae0d57039111d5df825649 0\tgitk-git/Makefile\n100644 fddcb45817ed6839ba95965d7e57e9a2e04ae30a 0\tgitk-git/gitk\n100644 e358dd1903352f5cd65ac77e777ae14d6887adc0 0\tgitk-git/po/.gitignore\n100644 b9867bf8e05d06f7effb9919f00879f77690e185 0\tgitk-git/po/de.po\n100644 2cb148624723adf82fd7f4a361133dbc8909db93 0\tgitk-git/po/es.po\n100644 d0f4c2e19ac15b10c01d6df968f823914cdbba4a 0\tgitk-git/po/it.po\n100644 c63248e3752b8b479f75ad2fe772dd40f684be54 0\tgitk-git/po/po2msg.sh\n100644 f6b080df4cf313edaba241eb54c232e9f282a38c 0\tgitk-git/po/sv.po\n100644 26967e201aca8ea1c799e6b21cad468484753779 0\tgitweb/INSTALL\n100644 825162a0b6dce8c354de67a30abfbad94d29fdde 0\tgitweb/README\n100644 de637c0608090162a6ce6b51d5f9bfe512cf8bcf 0\tgitweb/git-favicon.png\n100644 16ae8d5382de5ffe63b54139245143513a87446e 0\tgitweb/git-logo.png\n100644 aa0eeca24786dbd5143354fc3bb5e8cdb3ef831f 0\tgitweb/gitweb.css\n100755 90cd99bf916135e5c0a9e1bd7d5e9ff45555c489 0\tgitweb/gitweb.perl\n100644 e2633f8376eb7b12706dcd4c698e2b3f6be2b433 0\tgraph.c\n100644 eab4e3daba9812293d4e005c3ebe28f9a97744ce 0\tgraph.h\n100644 f67d6716ea5f42c3384a7a4cb2eb973b02785fba 0\tgrep.c\n100644 d252dd25f81526d9b8663b4d3c9585d69a901397 0\tgrep.h\n100644 46c06a9552dac5475afc607c3fe2bf00801eb055 0\thash-object.c\n100644 1cd4c9d5c0945994b84bb25edd6e4685cf76b5c5 0\thash.c\n100644 69e33a47b9861df9ac12c354eae180b4f8fea857 0\thash.h\n100644 3cb19628965685ce59a5377b81bef975851996e8 0\thelp.c\n100644 68052888570af7d09535db8831b8cf3ef2881589 0\thttp-push.c\n100644 9dc6b27b457a2979a95018679a0b885e6fb62d9a 0\thttp-walker.c\n100644 1108ab4a3101fb4768cad420ccfdb52d87890a18 0\thttp.c\n100644 905b4629a47789705c13745fd56ce0c91adea41b 0\thttp.h\n100644 b35504a8d25594a8d243ae7490733eae5a262712 0\tident.c\n100644 1ec131092109aa3fbed3cd20f10b56a864584a94 0\timap-send.c\n100644 52064befdbbbdf671bd08e369a133d4f1fee03c1 0\tindex-pack.c\n100644 7f03bd99c5b66afa6cc7fa11a2430301a3042656 0\tinterpolate.c\n100644 77407e67dca97eb85274c69e2e7469e1d4d40b3b 0\tinterpolate.h\n100644 c8b8375e4983794e601ba69a1c217a3c711835e9 0\tlist-objects.c\n100644 0f41391ecc00eac324ea76de7654781c4fce094e 0\tlist-objects.h\n100644 9837c842a3f215ebee7cbe9690e42e216fb5c76c 0\tll-merge.c\n100644 5388422d091ede134d42406291989c49553f7428 0\tll-merge.h\n100644 4023797b00fe21ecbabe3407ef8a12fca0690607 0\tlockfile.c\n100644 bd8b9e45ab46b8664c8b7016b33bee22f86c9e0d 0\tlog-tree.c\n100644 59ba4c48b7966db34c6345a445ab0b10e235ac83 0\tlog-tree.h\n100644 88fc6f394684436967002ca477eac1e084537348 0\tmailmap.c\n100644 6e48f83cedd13e24d50cddf47f037791ddc5ad4b 0\tmailmap.h\n100644 0fd6df7d6ed839eaed536bc332312c2688a6bbad 0\tmatch-trees.c\n100644 2a939c9dd835a7e7946eb1548e4cf637ae3ca329 0\tmerge-file.c\n100644 7491c56ad25332fb4aae6a075bf0577a1d800c3b 0\tmerge-index.c\n100644 f37630a8ad07709ae106ddde44a34daf6bad8b16 0\tmerge-recursive.h\n100644 02fc10f7e622ba1c53065e7cf4563ff10af0c41f 0\tmerge-tree.c\n100644 0b34341f711a903d4a12fe96dc6ef63e55fb2f5b 0\tmktag.c\n100644 e0da110a98d3a7376dc78df71fabc10fc5664296 0\tmktree.c\n100644 3f06b835675206912777a774d91c3ba611fa5a06 0\tmozilla-sha1/sha1.c\n100644 16f2d3d43ca8bee1eeb306308277bef8c707a972 0\tmozilla-sha1/sha1.h\n100644 0031d78e8c98a32d61cd0dc0f939a033e24ed890 0\tname-hash.c\n100644 50b6528001fe4bafdfe70126dc2078860c3d1969 0\tobject.c\n100644 036bd66fe9b6591e959e6df51160e636ab1a682e 0\tobject.h\n100644 f596bf2db5e0a0065e6856b8caa3ded8a134f74d 0\tpack-check.c\n100644 25b81a445c8fafe0c00ce30082b7d9a7c22ccf1e 0\tpack-redundant.c\n100644 848d311c2b2c651dbb14893c260584f00c639357 0\tpack-refs.c\n100644 518acfb370ad72be18399a3ac5e8ca17880281c9 0\tpack-refs.h\n100644 cd300bdff5b524a4d509ba5276e9ef21f443013d 0\tpack-revindex.c\n100644 36a514a6cf600e7e77794e50998a9d160e30c8e9 0\tpack-revindex.h\n100644 a8f02699366c87de960d7637e9f69c26c2241693 0\tpack-write.c\n100644 76e6aa2aad06545e7c44fc2c1e117ea668356ccf 0\tpack.h\n100644 6b5c9e44b4ded338ddb344ae454d83a685b7569a 0\tpager.c\n100644 71a7acf4e22bd12c0919f277410d6ec52dd5efc8 0\tparse-options.c\n100644 bc317e7512af7a1cc86641a651ae5415d28e71c4 0\tparse-options.h\n100644 ed9db81fa82c812c9ffa07f5a40540dbb15da0d3 0\tpatch-delta.c\n100644 9349bc5580456b378d41da7cc2518e4fa9a7e81a 0\tpatch-id.c\n100644 3be5d3165e0009761a0ca69e15e4a9132c6cfaff 0\tpatch-ids.c\n100644 c8c7ca110ad34def12a3594a1560b3c3052eb701 0\tpatch-ids.h\n100644 9df447bd6dcfaddf7f05fe5f0b624700ff1f40d7 0\tpath.c\n100644 98b24772c7ebe838d513d8e24f3c8acff7839cb9 0\tperl/.gitignore\n100644 d99e7782002e01079b3866003cc8555b7e130e3f 0\tperl/Git.pm\n100644 b8547db2c64ac1242725b5f71fb646b5bca38ef3 0\tperl/Makefile\n100644 320253eb8e91eb1d914aa4e34f7d3af4649b9b39 0\tperl/Makefile.PL\n100644 11e9cd9a02eb3f85a9150c6fb06d1fc76abd9b09 0\tperl/private-Error.pm\n100644 f5d00863a6234c16db33637d19fefd2014780e87 0\tpkt-line.c\n100644 9df653f6f5afe720870658d7093bddbf3e66beaf 0\tpkt-line.h\n100644 738e36c1e81def4822ccc2a66bc2761402a07f26 0\tppc/sha1.c\n100644 c3c51aa4d487f2e85c02b0257c1f0b57d6158d76 0\tppc/sha1.h\n100644 f132696ee72bf4a2e3d608a24322a6839f9a03a8 0\tppc/sha1ppc.S\n100644 33ef34a4119812674726254fee3f391fb5734fdb 0\tpretty.c\n100644 55a8687ad15788f8ea5a5beb463d216908f618b2 0\tprogress.c\n100644 611e4c4d42d8d1164add09f926ad5b2ce088db5e 0\tprogress.h\n100644 6a520855d6c418ecb1384ef9571b122b134af1af 0\tquote.c\n100644 c5eea6f18e2dfabd071b73e6507c34c2b7b5e39f 0\tquote.h\n100644 3b1c18ff9b9060d0dd437ce89aedb8871c66c54c 0\treachable.c\n100644 40751810b64f8bbf9c0a633472a0ef27d23ed1a5 0\treachable.h\n100644 2c03ec3069decb20f7557af4ac7dbe295f2dcf9c 0\tread-cache.c\n100644 d44c19e6b577023dcbaa188a0e67130ff4e5bd9a 0\treceive-pack.c\n100644 f751fdc8d832cae54647c1a70d888e979d324fd8 0\treflog-walk.c\n100644 7ca1438f4d74b652f962c6bdfddd08fe0d75802d 0\treflog-walk.h\n100644 39a3b23804d2da715c564459bf320be23d41c1bf 0\trefs.c\n100644 06ad26055661a9b9e475d0f8a7bd6d1cfb42e792 0\trefs.h\n100644 f61a3ab399aa6960fb8eba050321cea4a3b05344 0\tremote.c\n100644 091b1d041f8a4d255f59bfc001e098e692dbc15c 0\tremote.h\n100644 323e493dafee46c0d3f95e3c4cd9c4c9b463bbef 0\trerere.c\n100644 f9b03862fe78b560ee606637be3b1ce972a2cc14 0\trerere.h\n100644 3897fec53170c50921eb1952bc4bdf9c08480638 0\trevision.c\n100644 f64e8ce7ff999e9fe4a01205ae51775827484ed4 0\trevision.h\n100644 a3b28a64dc2d1b888b0ba2a135be10fe04651201 0\trun-command.c\n100644 5203a9ebb10b14bd06862abafed0ab73d7514a3d 0\trun-command.h\n100644 8ff1dc35390083c3648c4ee5790f35633d956069 0\tsend-pack.h\n100644 c1c073b2f05a48772a45602cdc711eef6e211695 0\tserver-info.c\n100644 6cf909463d4ad3681a2f35269db9dc944f4389c2 0\tsetup.c\n100644 da357479cf19aad4bebc64f874c76fdf8566712b 0\tsha1-lookup.c\n100644 3249a81b3d664afc89c98e6d9dd6b512092a82f9 0\tsha1-lookup.h\n100644 e281c14f01d37ab7623998c2990914aca49a7a3b 0\tsha1_file.c\n100644 4fb77f8863ec075de38b84171d3ef039a00cee4c 0\tsha1_name.c\n100644 4d90eda19efe0a80c1cb39e8897ab3ed5e6fcf56 0\tshallow.c\n100644 6a48de05ff80f86050715ef3dab87a48b0a86ac9 0\tshell.c\n100644 bc02cc29ef0d5f640ab390614def995f30fe4691 0\tshortlog.h\n100644 45bb535773fd9c36f73502df9462f7de800009c8 0\tshow-index.c\n100644 b6777812cb92c1c169ee395164d53a0c2e6eceb2 0\tsideband.c\n100644 a84b6917c7a17b5f8a922540801e98d46aa24431 0\tsideband.h\n100644 720737d856b694bc5239f0c18af372959c99e744 0\tstrbuf.c\n100644 eba7ba423a2d3a383ef93f663c95695438269edf 0\tstrbuf.h\n100644 ddd83c8c76112cecd5d23668aaca467601855a72 0\tstring-list.c\n100644 4d6a7051fe5bccf04a0d0c32a90e5cf9c00dba3c 0\tstring-list.h\n100644 5a5e781a15d7d9cb60797958433eca896b31ec85 0\tsymlinks.c\n100644 1b97c5465b7d9e4404e11668b44c5c507a302d4a 0\tt/.gitattributes\n100644 b27e280083867ac03c4abc188f0f37291eb123a0 0\tt/.gitignore\n100644 0d65cedaa6566a6dd654753cb574c9ee64b1c90b 0\tt/Makefile\n100644 8f12d48fe8b4ffe4a4b37dcd16ce58e50837433f 0\tt/README\n100755 d5bab75d7da49ebb53e368d67f6b867f5417a125 0\tt/aggregate-results.sh\n100644 cacb273afff1fbddf152bb440451fa141589cf33 0\tt/annotate-tests.sh\n100644 4bddeb591ecc17ec532164d0d6cf1ad1a54eb996 0\tt/diff-lib.sh\n100644 a841df2a9e3a9ed64e81ab7b9778e59cfc714cad 0\tt/lib-git-svn.sh\n100644 dc473dfb53d5ffafee72738a55caf21732fa4fb1 0\tt/lib-httpd.sh\n100644 4717c2d33b70af6527f8951ec8a414e8caf87095 0\tt/lib-httpd/apache.conf\n100644 6dab2579cbf9658c3ac2bd55c8a66333d67eda47 0\tt/lib-httpd/ssl.cnf\n100644 168329adbc4edeedc98501575ccc9b9c81f0c061 0\tt/lib-read-tree-m-3way.sh\n100755 70df15cbd8339b552a56a95ca0c0893138550201 0\tt/t0000-basic.sh\n100755 620da5b32041b1ad69bfdcb6d139f2705386a5ff 0\tt/t0001-init.sh\n100755 4db4ac44c9611398db46dfbe2688c95e3b03605b 0\tt/t0002-gitfile.sh\n100755 3d8e06a20fade230136d50736a2f621d3c96002c 0\tt/t0003-attributes.sh\n100755 63e1217e7162435c3da8ec7984b5f6a53b3a10e2 0\tt/t0004-unwritable.sh\n100755 e45a9e40e432524454e94a041599b201a092879a 0\tt/t0010-racy-git.sh\n100755 1be7446d8d9f8a46b463f2474a8c25bdd33044d2 0\tt/t0020-crlf.sh\n100755 8fc39d77cec6168dae930beef785597dace24aa3 0\tt/t0021-conversion.sh\n100755 7d1ce2d0563b3734d754c171d21580075264bbb2 0\tt/t0022-crlf-rename.sh\n100755 6f8a4347d5397b8b396db800c12c6e045a0d2b7c 0\tt/t0023-crlf-am.sh\n100755 ccb0a3cb61be3bb591033564b221726a4cd3968d 0\tt/t0030-stripspace.sh\n100755 03dbe00102626e05c37e45d8a3b1364b99644942 0\tt/t0040-parse-options.sh\n100755 b177174ef53e7689cc8c18b134afdbe90be72744 0\tt/t0050-filesystem.sh\n100755 6e7501f352ee97636280357da54c50d73ceb0138 0\tt/t0060-path-utils.sh\n100755 807fb83af8c65304f1dae2ee35ba0f2909ddf465 0\tt/t1000-read-tree-m-3way.sh\n100755 4b44e131b27df0cc6a73590b045c2eb87b104f59 0\tt/t1001-read-tree-m-2way.sh\n100755 aa9dd580a658ffd980ec9689b01f7964580661f2 0\tt/t1002-read-tree-m-u-2way.sh\n100755 8c6d67edda1468ba0f1c7afc6d13ea3a7bbe0a90 0\tt/t1003-read-tree-prefix.sh\n100755 570d3729bd2312a8d9cf90f3d2e1121a58f43de6 0\tt/t1004-read-tree-m-u-wf.sh\n100755 b0d31f5a9bb8b3474665147327d94ad5067fa206 0\tt/t1005-read-tree-reset.sh\n100755 d8b7f2ffbcc0427b1ae9d48feb4387f580e81d61 0\tt/t1006-cat-file.sh\n100755 1ec0535138c72bbd1e497c35c21bc5ea46b0315f 0\tt/t1007-hash-object.sh\n100755 fc386ba033ac165a5f4a9fca0c6c6f5db49a314e 0\tt/t1020-subdirectory.sh\n100755 7f7fc36734d96de96801c59af41024db97dc614d 0\tt/t1100-commit-tree-options.sh\n100755 09a8199335cbdf96f8aba75d47a321f0cfb828d9 0\tt/t1200-tutorial.sh\n100755 64567fb94d5c3f9587b643333212cdb37a4661ac 0\tt/t1300-repo-config.sh\n100755 dc85e8b60a5c10e57047d1692e383f177e2c478d 0\tt/t1301-shared-repo.sh\n100755 8d305b43725f8cf60e7ee802df1923feb98eeae5 0\tt/t1302-repo-version.sh\n100755 f98f4c51796e6f7a7181568a134e21ecd9dc2c4f 0\tt/t1303-wacky-config.sh\n100755 b31e4b1ac66e56d67ba48ab213c4ef9c32f05ea8 0\tt/t1400-update-ref.sh\n100755 73f830db2374e751fb46e25b345e860979b9dd05 0\tt/t1410-reflog.sh\n100755 dc9e402c55574d981e161d4e38e74617c411f46d 0\tt/t1420-lost-found.sh\n100755 85da4caa7ed1b8bcaca7b21e218f2d1839d2db82 0\tt/t1500-rev-parse.sh\n100755 2ee88d8a069288d0d9f6931231162e04d6b0917a 0\tt/t1501-worktree.sh\n100755 997002d4c40dd8e66e3be5a701e3d99bab1c57c4 0\tt/t1502-rev-parse-parseopt.sh\n100755 95244c9bcf54de8cb3584b4022e53a84051d496f 0\tt/t1503-rev-parse-verify.sh\n100755 91b704a3a4ce6771071d19bd84aa228856fe6875 0\tt/t1504-ceiling-dirs.sh\n100755 f7e1a735ec8699616280a086f59dc50c078bfaa7 0\tt/t2000-checkout-cache-clash.sh\n100755 ef007532b15108d72445f7c95a2906a3039fbbbb 0\tt/t2001-checkout-cache-clash.sh\n100755 70361c806e1baf1b26810983374c53eb49ea2f2d 0\tt/t2002-checkout-cache-u.sh\n100755 71894b37439bd1b9c72194cbbabe37680d2f9743 0\tt/t2003-checkout-cache-mkdir.sh\n100755 39133b8c7a4b56cb7273cec607ea89081a426eff 0\tt/t2004-checkout-cache-temp.sh\n100755 a84c5a6af9e69ffec7689827ce1ba653a658a73f 0\tt/t2005-checkout-index-symlinks.sh\n100755 0526fce163fc13273daf035a0920a6b53a3acefb 0\tt/t2007-checkout-symlink.sh\n100755 3e098ab31e1944abe8e5815c0f219947620b6618 0\tt/t2008-checkout-subdir.sh\n100755 f3c21520877e271506be13b5cabad5e7906f0c91 0\tt/t2009-checkout-statinfo.sh\n100755 7cc0a3582ef1bb1598bc5dfc5334bfbe006c3f5a 0\tt/t2010-checkout-ambiguous.sh\n100755 88f268b9d7a696a06f5ce560c1e8ed0f3d8dc3a3 0\tt/t2050-git-dir-relative.sh\n100755 6ef2dcfd8afece86aaf6345630179af179eb2ed9 0\tt/t2100-update-cache-badpath.sh\n100755 59b560bfdf240e87516aadd6a31a2fe84e85d49a 0\tt/t2101-update-index-reupdate.sh\n100755 19d0894d260787d37a43199d7a3f6c3aa37d32aa 0\tt/t2102-update-index-symlinks.sh\n100755 332694e7d38083fad18b3e53e4def268d54e9423 0\tt/t2103-update-index-ignore-missing.sh\n100755 f57a6e077c3b85dcdedc3f4813150feebc8e647d 0\tt/t2200-add-update.sh\n100755 d24c7d9e5fce0e9c0f8ef5576dab86ffdbc11331 0\tt/t2201-add-update-typechange.sh\n100755 6a8151064c8256bd03a90460eb1bd6970428f2f0 0\tt/t2202-add-addremove.sh\n100755 bc0a3513920cab41e4335b8c1b5163e25e8354d3 0\tt/t3000-ls-files-others.sh\n100755 1caeacafa7ae70506e626498d274dbfa25f1b036 0\tt/t3001-ls-files-others-exclude.sh\n100755 8704b04e1b4150357a7a01c91ac59bb1f22cbb8e 0\tt/t3002-ls-files-dashpath.sh\n100755 ec1404063701eef04667d5ffbbb4bdc8051c773b 0\tt/t3010-ls-files-killed-modified.sh\n100755 af8c4121abfc28b7e289b39936df45bd5b82cf22 0\tt/t3020-ls-files-error-unmatch.sh\n100755 aff360303ae2a304bff4799def6906defdb85843 0\tt/t3030-merge-recursive.sh\n100755 f6973e96a59916c6048222bfa0064aec5dea3746 0\tt/t3040-subprojects-basic.sh\n100755 4261e9641e00fb3b543384b6a8dbbcc1a214b598 0\tt/t3050-subprojects-fetch.sh\n100755 3ce501bb9794900b99fbbf2f2ccfbb330f7947a7 0\tt/t3060-ls-files-with-tree.sh\n100755 6e6a2542a22712006ae23874069c55943a3cba27 0\tt/t3100-ls-tree-restrict.sh\n100755 4dd7d12bac62eae23516686c0ece0edf037f0317 0\tt/t3101-ls-tree-dirname.sh\n100755 7a83fbfe4f6b47dc5dbaa3df59c8633ae5c2c8f8 0\tt/t3200-branch.sh\n100755 f86f4bc5ebcc0e36ddb4071a6aeb855e1039faa6 0\tt/t3201-branch-contains.sh\n100755 7fe4a6ecb05df0fbfb825fbb08207f7672e1775f 0\tt/t3202-show-branch-octopus.sh\n100755 c2dec1c6320a0f9b555e3cd38d164c4e3efcb51e 0\tt/t3210-pack-refs.sh\n100755 0574ef1f101df172a30755726b0ea1b6c2ef5f7d 0\tt/t3300-funny-names.sh\n100755 91bb5e1d9eea0b2f1ff7a1120d97ca2876a8f277 0\tt/t3400-rebase.sh\n100755 166ddb1447db4c33a79f0e9aea21cb00e8a151f2 0\tt/t3401-rebase-partial.sh\n100755 7b7d07269ae35f56dd02a223f350ae0da97bae85 0\tt/t3402-rebase-merge.sh\n100755 0d33c71daa557e68268dfb2279a02fe2afca1ed7 0\tt/t3403-rebase-skip.sh\n100755 ffe3dd97b7b1c056d854e28795e1313ce1633452 0\tt/t3404-rebase-interactive.sh\n100755 e5ad67c643ffee9b79fce813673732faa950714f 0\tt/t3405-rebase-malformed.sh\n100755 539108094345e3e0ba4cf03fc20a5ca6486fa230 0\tt/t3406-rebase-message.sh\n100755 4de550a632e6ead08c9629e80901e4735c53f55c 0\tt/t3407-rebase-abort.sh\n100755 e12cd578e8663ad8717aecde310bb0b6a500c2a2 0\tt/t3408-rebase-multi-line.sh\n100755 4911c48378a137471d2ad56747ceed11d0115be5 0\tt/t3500-cherry.sh\n100755 6da212825a447866364979c2fb10778b6bbc02d5 0\tt/t3501-revert-cherry-pick.sh\n100755 0ab52da902c8d602e9c4d64660aa4a7e8e35544f 0\tt/t3502-cherry-pick-merge.sh\n100755 b0faa299183df5fe06ccaf383bce47cbb9a0cf89 0\tt/t3503-cherry-pick-root.sh\n100755 79c06adf1f035cf727771974b2f9713da9d2fb8c 0\tt/t3600-rm.sh\n100755 7d123d17fc156c61a8e85a399c3762e8075485de 0\tt/t3700-add.sh\n100755 e95663d8e66d5b94e574a6b956625fccfd341a05 0\tt/t3701-add-interactive.sh\n100755 c851db8ca9373a890ede7c230710690d5b4b4165 0\tt/t3800-mktag.sh\n100755 883281dbd6c02ea7b2d90336c2629eafacee0257 0\tt/t3900-i18n-commit.sh\n100644 ee31e1973829739baebbdc1ba0a56391adb2fe2f 0\tt/t3900/1-UTF-8.txt\n100644 63f4f8f121dffe43c1902d1a7357b6303072714d 0\tt/t3900/2-UTF-8.txt\n100644 546f2aac01b67e39d19de601f5586097b34a8325 0\tt/t3900/EUCJP.txt\n100644 74b533042f6d1dfd5cb8fae5a538a43938c2df8d 0\tt/t3900/ISO-2022-JP.txt\n100644 7cbef0ee6f430c611134a06a6dd6c12fbea589d5 0\tt/t3900/ISO-8859-1.txt\n100755 38c21a6a7fa9a643030f68fd6dd1269b9c640608 0\tt/t3901-8859-1.txt\n100755 235f372832cb32aefff0a00c4f2ac0e19de2e55d 0\tt/t3901-i18n-patch.sh\n100755 5f5205cd022ba3a96eb8e5eb73292bd0d4a8ab87 0\tt/t3901-utf8.txt\n100755 fe4fb5116ac4c482c357f0af3f0a34da27cee237 0\tt/t3902-quoted.sh\n100755 8d4804b65818f7fc55f0c0736fde673ac7512a8a 0\tt/t3903-stash.sh\n100755 c44b27aeb24816a346f0aa84d70546a0ffd83b2a 0\tt/t4000-diff-format.sh\n100755 a32692417db73444dbdc143e6908b7371be79d42 0\tt/t4001-diff-rename.sh\n100755 a4cfde6b2927a4655f582d7e92dad4568f7b5f89 0\tt/t4002-diff-basic.sh\n100755 8b1f875286b25b5fc1a527b5b0281f866724a82d 0\tt/t4003-diff-rename-1.sh\n100755 3d25be7a6709cdd23e0d583a8f1a3e19a3927cd8 0\tt/t4004-diff-rename-symlink.sh\n100755 66300173124eee8480e7214322faf8bc493ad940 0\tt/t4005-diff-rename-2.sh\n100755 4e92fce1d00a55cfbc39e55b53f95cc309e96ff2 0\tt/t4006-diff-mode.sh\n100755 104a4e1492b65a64d061e1ce1df0b0a2a49fb20e 0\tt/t4007-rename-3.sh\n100755 26c2e4aa65c539c527ae8e2d71b5abb40c21fbbd 0\tt/t4008-diff-break-rewrite.sh\n100755 d2b45e7b8fb3902cb740e0df582f92195a295f24 0\tt/t4009-diff-rename-4.sh\n100755 ad3d9e48454d2e72afce682df009cdaaee9ba3c5 0\tt/t4010-diff-pathspec.sh\n100755 c6d13693ba45b594704c2ef55d40540ee3f9c25f 0\tt/t4011-diff-symlink.sh\n100755 eced1f30fb8475739aef52230bbb79946a0f76d8 0\tt/t4012-diff-binary.sh\n100755 9337b81064bbdbe4e7f590830b458c48226c4a17 0\tt/t4013-diff-various.sh\n100644 78f8970e2be272114368ee28ca2d55f345a6494a 0\tt/t4013/diff.config_format.subjectprefix_DIFFERENT_PREFIX\n100644 3a9f78a09df1bb12aefbb2b5fb75fd0b9455ed06 0\tt/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master\n100644 a61ad8cb130093ed63bba5335a0b283f9136177e 0\tt/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_side\n100644 49f23b9215c3179d8923915ee2e497ccbc53875a 0\tt/t4013/diff.diff-tree_--cc_--patch-with-stat_master\n100644 cc6eb3b3d50f2d620df7116bf64992a4dd42b736 0\tt/t4013/diff.diff-tree_--cc_--stat_--summary_master\n100644 50362be7bf851759885ad17847f5913e5dfb0b3c 0\tt/t4013/diff.diff-tree_--cc_--stat_--summary_side\n100644 fae7f33255faef186aa7b987c29adfe33d0365f1 0\tt/t4013/diff.diff-tree_--cc_--stat_master\n100644 5ecb4e14ae4718bb26dbe5657abd5660dc45914e 0\tt/t4013/diff.diff-tree_--cc_master\n100644 fc177ab3f24c7eddc71d76b803515f7314d9b136 0\tt/t4013/diff.diff-tree_--patch-with-raw_initial\n100644 bd905b1c573056f92d7f3b11ad4898d19fd0e5f8 0\tt/t4013/diff.diff-tree_--patch-with-stat_initial\n100644 7bb8b45e3eea89b4015cabb70d34483352b40f1a 0\tt/t4013/diff.diff-tree_--pretty=oneline_--patch-with-raw_initial\n100644 cbdde4f400fe96ea565dcf28b6b474c2218b6104 0\tt/t4013/diff.diff-tree_--pretty=oneline_--patch-with-stat_initial\n100644 cd79f1a0ff23a4399416d85737f312e0b8652a38 0\tt/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-raw_initial\n100644 d5c333a378c9407abf179d6cc3f5233ca8b5f116 0\tt/t4013/diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial\n100644 3c5092c6993f454dc7392a3846b93cc3fa47f7e5 0\tt/t4013/diff.diff-tree_--pretty=oneline_--root_-p_initial\n100644 08920ac658b07ed83376bdd492020f7787ad1ad5 0\tt/t4013/diff.diff-tree_--pretty=oneline_--root_initial\n100644 94b76bfef159a0d8e2d7c48194110cb8465545c2 0\tt/t4013/diff.diff-tree_--pretty=oneline_-p_initial\n100644 d50970d5745278a47da683aa20968a912493cb01 0\tt/t4013/diff.diff-tree_--pretty=oneline_initial\n100644 3a85316d8a3416e2f280e01d02e0bf3cfce13cc8 0\tt/t4013/diff.diff-tree_--pretty_--patch-with-raw_initial\n100644 2e08239a46a72e76aad4e38940cdc822ca511793 0\tt/t4013/diff.diff-tree_--pretty_--patch-with-stat_initial\n100644 4d30e7eddc05aa561b43519b031f89de8a30fd98 0\tt/t4013/diff.diff-tree_--pretty_--patch-with-stat_side\n100644 a3203bd19bd74f1308ca75396fd9a3cfa2064ac8 0\tt/t4013/diff.diff-tree_--pretty_--root_--patch-with-raw_initial\n100644 7dfa6af3c97b1ad469135bb9a9f3c1f8d6d4b60d 0\tt/t4013/diff.diff-tree_--pretty_--root_--patch-with-stat_initial\n100644 43bfce253eaf451e2f0a19042c9cbb8879c6fef1 0\tt/t4013/diff.diff-tree_--pretty_--root_--stat_--summary_initial\n100644 9154aa4d4700b4a7c1e4c205f43694c198419ece 0\tt/t4013/diff.diff-tree_--pretty_--root_--stat_initial\n100644 ccdaafb3772e80571441f5e4263f79a7b8bc5bfd 0\tt/t4013/diff.diff-tree_--pretty_--root_--summary_-r_initial\n100644 58e5f74aeae880c69776bfa8e51bc9e5fe2463cf 0\tt/t4013/diff.diff-tree_--pretty_--root_--summary_initial\n100644 d0411f64ec5d104de3169da28453276880984917 0\tt/t4013/diff.diff-tree_--pretty_--root_-p_initial\n100644 94e32eabb1f82eb614f1a92d64d0ada403a4df16 0\tt/t4013/diff.diff-tree_--pretty_--root_initial\n100644 c22983ac4ae05a8c8d9591c91c0a44bc8f42052e 0\tt/t4013/diff.diff-tree_--pretty_--stat_--summary_initial\n100644 8fdcfb4c0ad64bc92ddda2418cb5f7fa1138cc7a 0\tt/t4013/diff.diff-tree_--pretty_--stat_initial\n100644 9bc2c4fbad20e42dd0a007eaa23c5994eb675588 0\tt/t4013/diff.diff-tree_--pretty_--summary_initial\n100644 3c9942faf4b1a1e6d8c3bbbab5627a32ecc96be6 0\tt/t4013/diff.diff-tree_--pretty_-p_initial\n100644 b993aa7b893c9ba6c276045a400fe0a849265fcd 0\tt/t4013/diff.diff-tree_--pretty_-p_side\n100644 14715bf7d08ff7696da2572544092f6be9029e18 0\tt/t4013/diff.diff-tree_--pretty_initial\n100644 e9b6e1c10211c4fb60262a55a28a503c3ed9bb47 0\tt/t4013/diff.diff-tree_--pretty_side\n100644 5aa84b2a866262a4e6b2d496e7da5b6f7b9d4d88 0\tt/t4013/diff.diff-tree_--root_--abbrev_initial\n100644 d295e475ddc626dc18381a5c5e839d3b2c26126e 0\tt/t4013/diff.diff-tree_--root_--patch-with-raw_initial\n100644 1562b627085ff0ad8ffaea61cc42ed39a9d94fc8 0\tt/t4013/diff.diff-tree_--root_--patch-with-stat_initial\n100644 3219c72fcbce5ee5a1c2b4e7bb87e696db9a0b18 0\tt/t4013/diff.diff-tree_--root_-p_initial\n100644 0c5361688c54c2599e240252ce70e4fad457c924 0\tt/t4013/diff.diff-tree_--root_-r_--abbrev=4_initial\n100644 c7b460faf6900e5730a08ab3b90bfda8e1ad48ca 0\tt/t4013/diff.diff-tree_--root_-r_--abbrev_initial\n100644 eed435e175d40a3f6fa8b3a0a534936360e86eea 0\tt/t4013/diff.diff-tree_--root_-r_initial\n100644 ddf6b068abe26f7516c37ceb1dca1d646343a499 0\tt/t4013/diff.diff-tree_--root_initial\n100644 b8e4aa2530717abc7d7b8bea62f12d615dfcd759 0\tt/t4013/diff.diff-tree_-c_--abbrev_master\n100644 ac9f641fb48272f25f3385dfbbd05777564f16bc 0\tt/t4013/diff.diff-tree_-c_--stat_--summary_master\n100644 2afcca11f4d0c4db6e259e85540e4d90f8c76a10 0\tt/t4013/diff.diff-tree_-c_--stat_--summary_side\n100644 c2fe6a98c5f9818f9caf5e0a314aee45831e5329 0\tt/t4013/diff.diff-tree_-c_--stat_master\n100644 e2d2bb26114ac886fbf2467dc7a33ec8cfab5daf 0\tt/t4013/diff.diff-tree_-c_master\n100644 b60bea039d991675e9d1480d5089c416aa68200a 0\tt/t4013/diff.diff-tree_-p_-m_master\n100644 e20ce883702ae0e430350ae849b28c44a081487f 0\tt/t4013/diff.diff-tree_-p_initial\n100644 b182875fb2fb3f0020dbf49fd9fd4c80e016e651 0\tt/t4013/diff.diff-tree_-p_master\n100644 c5a3aa5aa4688cb354bff44cbb6062ef8259a617 0\tt/t4013/diff.diff-tree_-r_--abbrev=4_initial\n100644 0b689b773c67dfef103d95c55ee9958f1b8f32ed 0\tt/t4013/diff.diff-tree_-r_--abbrev_initial\n100644 1765d83ce461d78e59cf7d505ec63331a7c70577 0\tt/t4013/diff.diff-tree_-r_initial\n100644 b49fc5345730346ab50142f55a1b8796545ead89 0\tt/t4013/diff.diff-tree_initial\n100644 fe9226f8a12323c3a36ff2c0c2fd9938852575c8 0\tt/t4013/diff.diff-tree_master\n100644 a88e66f81774579c511b6cd546f5043a9c975c36 0\tt/t4013/diff.diff_--abbrev_initial..side\n100644 d0d96aaa91eec7f5a6cb833e43bbd3ec89efad98 0\tt/t4013/diff.diff_--name-status_dir2_dir\n100644 6a47584777a65cff71e2ebfac8c8f12944de17bb 0\tt/t4013/diff.diff_--no-index_--name-status_dir2_dir\n100644 3590dc79a65af7299c4b56fd632489920b62f0fb 0\tt/t4013/diff.diff_--patch-with-raw_-r_initial..side\n100644 b21d5dc6f391fe977cc7c9b9c6badf9b261c5f72 0\tt/t4013/diff.diff_--patch-with-raw_initial..side\n100644 9ed317a198c71fcec0b44a7b736b61550eed9394 0\tt/t4013/diff.diff_--patch-with-stat_-r_initial..side\n100644 8b50629e668a385179eb9586b472c51237492232 0\tt/t4013/diff.diff_--patch-with-stat_initial..side\n100644 0517b5d63129f44275b16f51819d9c08bf37d430 0\tt/t4013/diff.diff_--stat_initial..side\n100644 245220d3f9b475b4281395639d85122feaa7948d 0\tt/t4013/diff.diff_-r_--stat_initial..side\n100644 5bb2fe2f280d2def45c113b5c0daa7ab789faed0 0\tt/t4013/diff.diff_-r_initial..side\n100644 c8adaf595863e66fb9ae061cd20176c981316372 0\tt/t4013/diff.diff_initial..side\n100644 43346b9ba443fe22b56f0874a7cc885461d2aa81 0\tt/t4013/diff.format-patch_--attach_--stdout_initial..master\n100644 d7490a9fd729890c80a4b8fc3da0783997f81a04 0\tt/t4013/diff.format-patch_--attach_--stdout_initial..master^\n100644 38f790290a41311e490c493bdaf71774853cc861 0\tt/t4013/diff.format-patch_--attach_--stdout_initial..side\n100644 fca5cce373767d96fd68a17a196889c8c9ea172f 0\tt/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master\n100644 6d6fac390849c964e75b56e48808a78dd3428ce1 0\tt/t4013/diff.format-patch_--inline_--stdout_initial..master\n100644 18a1110def4bbe25c0bd7020d35df589ef6f528f 0\tt/t4013/diff.format-patch_--inline_--stdout_initial..master^\n100644 4f258b8858df79ecf475514b69df904e83e29ffa 0\tt/t4013/diff.format-patch_--inline_--stdout_initial..master^^\n100644 e86dce69a3a78d5cfe5cd82067df0381b0f635bd 0\tt/t4013/diff.format-patch_--inline_--stdout_initial..side\n100644 8dab4bf93ebd5f3e5ee6e899890d6e53af9ab967 0\tt/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^\n100644 8b88ca49276695aead0083ad49c53715874e11dc 0\tt/t4013/diff.format-patch_--stdout_initial..master\n100644 47a4b88637d4dc8650f0480278ae67b907eb5080 0\tt/t4013/diff.format-patch_--stdout_initial..master^\n100644 e7650884755b993661ef14fbc812edd7c2710702 0\tt/t4013/diff.format-patch_--stdout_initial..side\n100644 3ceb8e73c5d4e963a2c08eddf41197431ad52178 0\tt/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_\n100644 43d77761f988b7f43f46a5d8fd85d406ef9caa42 0\tt/t4013/diff.log_--patch-with-stat_master\n100644 5187a26816723476b049c44bb3801816e8672cdf 0\tt/t4013/diff.log_--patch-with-stat_master_--_dir_\n100644 c9640976a8f3bd724004f945b00d71f43f00c8ea 0\tt/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master\n100644 ad050af55ffa6983bc08ef5919dd20229584fd59 0\tt/t4013/diff.log_--root_--patch-with-stat_--summary_master\n100644 628c6c03bc6195268c3e7e003478fd042ef36db2 0\tt/t4013/diff.log_--root_--patch-with-stat_master\n100644 5d4e0f13b59652b170c0b2498319f970d071f774 0\tt/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master\n100644 217a2eb203718b91ccd79a04e0369f4c5d2905aa 0\tt/t4013/diff.log_--root_-p_master\n100644 e17ccfc2340eadbb8c393de0aa2793f6f899ba56 0\tt/t4013/diff.log_--root_master\n100644 5e3243897294d1fc4193c1de3fec95ce58ab22af 0\tt/t4013/diff.log_-SF_-p_master\n100644 c1599f2f520090b0717d951a69ade5a9960f8038 0\tt/t4013/diff.log_-SF_master\n100644 f8fefef2c3869337ba048d5cd6d95169dc60cf00 0\tt/t4013/diff.log_-p_master\n100644 e9d9e7b40a08d803901ac001e4bf9f0c37ad8b15 0\tt/t4013/diff.log_master\n100644 221b46a7cc2c174ec605cab02211de97bf84f010 0\tt/t4013/diff.show_--patch-with-raw_side\n100644 377f2b7b7a34a1e83bbcf0f2d72981685a678c24 0\tt/t4013/diff.show_--patch-with-stat_--summary_side\n100644 fb14c530d2dd79730320badff2547ebf755bd350 0\tt/t4013/diff.show_--patch-with-stat_side\n100644 8c89136c4d84091da3f2b9f6eaf582112f90a9ba 0\tt/t4013/diff.show_--root_initial\n100644 5bd597762869443cfd91ba8ebdaeff6e8b515ebf 0\tt/t4013/diff.show_--stat_--summary_side\n100644 3b22327e48122187af12db46027f17526c8e9caf 0\tt/t4013/diff.show_--stat_side\n100644 4c4066ae48e213b6a0f4bf51226c4322ac9348c4 0\tt/t4013/diff.show_initial\n100644 9e6e1f27105ca50262e5eb3f2ff132b46c12fe45 0\tt/t4013/diff.show_master\n100644 530a073b19d75e37aeb241200b6b306e6803ca09 0\tt/t4013/diff.show_side\n100644 6a467cccc190449049b7baed2dde0a2f9027e663 0\tt/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_\n100644 1e1bbe19638eeeffb4e656239545ea91fda3dbf2 0\tt/t4013/diff.whatchanged_--patch-with-stat_master\n100644 13789f169b6803ba71680470197c50b51795e4e4 0\tt/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_\n100644 5facf2543db0135ceb3aafdc5ffe0395b429f44c 0\tt/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master\n100644 02911535870b012720c9ae095499c61e6e242c7e 0\tt/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master\n100644 9b0349cd555eb17836b8c056d7aae8cf1eabe537 0\tt/t4013/diff.whatchanged_--root_--patch-with-stat_master\n100644 10f6767e498b0d5bdadd73067e4ef2dd5f028e89 0\tt/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master\n100644 ebf1f0661e07bd06098d1609a5a22b8e9bbae436 0\tt/t4013/diff.whatchanged_--root_-p_master\n100644 a405cb6138857d3a1bc1b590aa55565c34770e4c 0\tt/t4013/diff.whatchanged_--root_master\n100644 f39da84822845984e0f431cf84e71fc48853a3c8 0\tt/t4013/diff.whatchanged_-SF_-p_master\n100644 0499321d0ebf57fc2d583afd46ce7813a1ba9fde 0\tt/t4013/diff.whatchanged_-SF_master\n100644 f18d43209c0a90d2d6fd474e849690f1b2120cfe 0\tt/t4013/diff.whatchanged_-p_master\n100644 cd3bcc2c7269c17ff25504c8b7ca02b55ba8d8ed 0\tt/t4013/diff.whatchanged_master\n100755 7fe853c20d1111e40371a3796d82bb8485f5ebcf 0\tt/t4014-format-patch.sh\n100755 a27fccc8dce431169ce41f7137fb75f44149719c 0\tt/t4015-diff-whitespace.sh\n100755 f07035ab7ec72557be7a0cba9ea286bcbaa79da9 0\tt/t4016-diff-quote.sh\n100755 60dd2014d5ae5d5e9e168b8b60278d90ef93cc53 0\tt/t4017-diff-retval.sh\n100755 e747e842272df5935f863f78ccfc3b311f64228b 0\tt/t4017-quiet.sh\n100755 833d6cbcfc063f336d97689ae4e547cf5e956b69 0\tt/t4018-diff-funcname.sh\n100755 0d9cbb62615c0d94da784f63907989988b0e8151 0\tt/t4019-diff-wserror.sh\n100755 637b4e19d52e81cf1472a4ed9dcfb0c9ff00da2b 0\tt/t4020-diff-external.sh\n100644 db2f89090c1c4de05e4f82ea39ea118fccfd48dd 0\tt/t4020/diff.NUL\n100755 43d64bbd826049c5a0a8cf365ed5cb3f4489752c 0\tt/t4021-format-patch-numbered.sh\n100755 ba43f185494630c50fc2a168df8dcd45c0b2421b 0\tt/t4021-format-patch-signer-mime.sh\n100755 bf996fc414d3b5ea16488a8b274973a8347b29cb 0\tt/t4022-diff-rewrite.sh\n100755 4dbfc6e8b751a6c93b1f9dfee8ce649235c98c93 0\tt/t4023-diff-rename-typechange.sh\n100755 c4d733f5db6a4d390762505b770954cdbf6cc82f 0\tt/t4024-diff-optimize-common.sh\n100755 7a3dbc1ea22fd19a54da8949abc368c112377b19 0\tt/t4025-hunk-header.sh\n100755 b61e5169f4e9e8d9f87b9ea16e71dfcf1fb9f340 0\tt/t4026-color.sh\n100755 ba6679c6e4032bb12e4206226f95770946ece8cc 0\tt/t4027-diff-submodule.sh\n100755 204ba673cb58f905f2f35ff5b83294b2a2943f48 0\tt/t4028-format-patch-mime-headers.sh\n100755 e0c67740a5ef85aaa3edc9a4514da72c92ce30ec 0\tt/t4100-apply-stat.sh\n100644 540e64db85575e10fe02b3b85af6a353999aab8f 0\tt/t4100/t-apply-1.expect\n100644 90ab54f0f586c87ace077be87fba396c8f2781a0 0\tt/t4100/t-apply-1.patch\n100644 d1e6459749fe3dd4635c9136ccbb148a85405676 0\tt/t4100/t-apply-2.expect\n100644 f5c7d601fc955b15d15012a5b49df83364b6ebf4 0\tt/t4100/t-apply-2.patch\n100644 912a552a7a67be283c963da84bf044fa779fe633 0\tt/t4100/t-apply-3.expect\n100644 90cdbaa5bb62a4adfa0a5eb3f6fe223b9de50e7b 0\tt/t4100/t-apply-3.patch\n100644 1ec028b3d05d79fab29d2ac61027c8ef00bf8401 0\tt/t4100/t-apply-4.expect\n100644 4a56ab5cf416e2144b5dbdbe06d10b51255fabe2 0\tt/t4100/t-apply-4.patch\n100644 b387df15d4fc81574ac18f41174205c86a6ad503 0\tt/t4100/t-apply-5.expect\n100644 5f6ddc105950eac20bcacb7987fabff015320ee3 0\tt/t4100/t-apply-5.patch\n100644 1c343d459eb8fc129f53d3a13f0e0ffa79058139 0\tt/t4100/t-apply-6.expect\n100644 a72729a712038dc64f55d154eb9a94713e3269c9 0\tt/t4100/t-apply-6.patch\n100644 1283164d9909164c2428bc1a08cbff1d819fe71c 0\tt/t4100/t-apply-7.expect\n100644 07c6589e74fa5afbff9bdfd8d7b7b41f873a005b 0\tt/t4100/t-apply-7.patch\n100644 eef7f2e65cc3e2192935b9bde3ea001244b6db18 0\tt/t4100/t-apply-8.expect\n100644 5ca13e65949047b5a1e8170422519cd69418da88 0\tt/t4100/t-apply-8.patch\n100644 eef7f2e65cc3e2192935b9bde3ea001244b6db18 0\tt/t4100/t-apply-9.expect\n100644 875d57d567e2b807587a7e4d2a9bb7771225e28c 0\tt/t4100/t-apply-9.patch\n100755 da8abcf36418dbd2e9d8ec85871c245991f96fda 0\tt/t4101-apply-nonl.sh\n100644 1010a88f4727373c20e7ab46515a79b9d3cd9675 0\tt/t4101/diff.0-1\n100644 36460a243ac10e256df270cec10a7498a0a32009 0\tt/t4101/diff.0-2\n100644 b281c43e5b5f4926e365cbd168e43420e8a4a63a 0\tt/t4101/diff.0-3\n100644 f0a2e92770870d78d32bef7fe2ed63ad4ca105de 0\tt/t4101/diff.1-0\n100644 2a440a5ce2adae53a23363a3cd3b6af5ff915fd0 0\tt/t4101/diff.1-2\n100644 61aff975b69f49430ccb0b6ebd14193fd9f78b4e 0\tt/t4101/diff.1-3\n100644 c2e71ee344d032ee38bf325099ed6386f180f287 0\tt/t4101/diff.2-0\n100644 a66d9fd3a137b22edf5a49cf811970fc85c985d9 0\tt/t4101/diff.2-1\n100644 5633c831de0bb2d5d482acc89c32bb3cb39d02d7 0\tt/t4101/diff.2-3\n100644 10b1a41edf734aef77feb4a5f40cf358a8f48db3 0\tt/t4101/diff.3-0\n100644 c799c60fb9d460ff24160082a9c1346c0751dd4b 0\tt/t4101/diff.3-1\n100644 f8d1ba6dc24669ff19530e0d3ed064db2c8e7077 0\tt/t4101/diff.3-2\n100755 d42abff1ad59343fa1c84bded9a82c3212370da0 0\tt/t4102-apply-rename.sh\n100755 7da0b4bb8bfa96765b9f6eaa1693e2e24e82d335 0\tt/t4103-apply-binary.sh\n100755 e7e2913de745cc9f7639103757933f6238fdd564 0\tt/t4104-apply-boundary.sh\n100755 3266e394003958b62509b7bfe6652abd03fdfcb7 0\tt/t4105-apply-fuzz.sh\n100755 ac58083fe224100987800e9b5ee3e388d9b4d97c 0\tt/t4109-apply-multifrag.sh\n100644 1db5ff10501497459d07e227f02764576a6010e1 0\tt/t4109/expect-1\n100644 bc52924112ba857784169157d3f650eb35a931ba 0\tt/t4109/expect-2\n100644 cd2a475feb2280a24b05870c00f0693dd1de605b 0\tt/t4109/expect-3\n100644 1d411fc3ccebe33ee086cfeaea7cea1beb041a6a 0\tt/t4109/patch1.patch\n100644 8c6b06d536a06d786f0752ec2aa2a7fae22c8926 0\tt/t4109/patch2.patch\n100644 d696c55a752ac61b86691192d46da2566e299830 0\tt/t4109/patch3.patch\n100644 4b085909b160a093e9edb4f91de87f7637f218b5 0\tt/t4109/patch4.patch\n100755 09f58112e0229a41ea2a5d2ea6e8c23d2523298d 0\tt/t4110-apply-scan.sh\n100644 87cc493ec8a0f6f042a5df3c302433c6e45d8dd3 0\tt/t4110/expect\n100644 56139080dc157ab9e58dec01399c40362a9e710e 0\tt/t4110/patch1.patch\n100644 04974247ec927d9b25bf0b30c372e4669321dad0 0\tt/t4110/patch2.patch\n100644 26bd4427f808bb1d0929833f2784e384e35ab961 0\tt/t4110/patch3.patch\n100644 9ffb9c2d7ecd2e87eb3a92ed99be90beba3e16be 0\tt/t4110/patch4.patch\n100644 c5ac6914f987d3a41266dca735d872e4c131d02c 0\tt/t4110/patch5.patch\n100755 f9ad183758c28ff648890d1bd4bbd599562cd795 0\tt/t4112-apply-renames.sh\n100755 66fa51591eb7ee8f102fd86e30e54af2da3ea310 0\tt/t4113-apply-ending.sh\n100755 55334927abb33864a55f8ff49fd0c0c94a3c1769 0\tt/t4114-apply-typechange.sh\n100755 9ace578f17a07aafc050ccaf935aef8a4a3cab4e 0\tt/t4115-apply-symlink.sh\n100755 2298ece8019d79ef718ef658bdac74493d265b92 0\tt/t4116-apply-reverse.sh\n100755 e9ccd161ee96a5bdbb4bf77de406ea51dacfb5de 0\tt/t4117-apply-reject.sh\n100755 f92e259cc6f251ec6f89edee3fc16720f264d82f 0\tt/t4118-apply-empty-context.sh\n100755 3c73a783a7e908070308fb1f972f6b5d152e12a4 0\tt/t4119-apply-config.sh\n100755 83d4ba679850c2ae2548bcfcce3f22227fcde8c7 0\tt/t4120-apply-popt.sh\n100755 aff551a1d787477eb2db34d96217f66ca03c435d 0\tt/t4121-apply-diffs.sh\n100755 841773f75fc085d07836b39b3775f49bde5d8d19 0\tt/t4122-apply-symlink-inside.sh\n100755 984157f03b9744aa491c888fab9e6aef95dfdc6b 0\tt/t4123-apply-shrink.sh\n100755 85f3da2b98a881647837323e3af0378ce59a9db5 0\tt/t4124-apply-ws-rule.sh\n100755 3b471b641ba2d3274dd1ab89948485ff8ce4dfdb 0\tt/t4125-apply-ws-fuzz.sh\n100755 ceb6a79fe0c8ca5b26a9e148215556f2aa344eb9 0\tt/t4126-apply-empty.sh\n100755 1f859dd908cb298bf89a13822e8fc19882060689 0\tt/t4127-apply-same-fn.sh\n100755 2dd0c75f964b690977e40a3a8235cc324dc6826e 0\tt/t4128-apply-root.sh\n100755 6e6aaf59364456e21bb1deda960edb5295a71131 0\tt/t4150-am.sh\n100755 7d86cdff64522f588a3d3e781cf2b272087cfd88 0\tt/t4151-am-abort.sh\n100755 b68ab11f2915789cd04ac6bd43363aeab2079198 0\tt/t4200-rerere.sh\n100755 405b97119175a1c0fa75a9db30c6b1ab076cc44e 0\tt/t4201-shortlog.sh\n100755 4c8af45f834d034529c2a627768a0a3e6f1aac8d 0\tt/t4202-log.sh\n100755 e395ff4e341bacea21cc5cd909304b7bb4fcb044 0\tt/t5000-tar-tree.sh\n100755 e9f3e72c7ee5584d956d46126956c641a7d53905 0\tt/t5100-mailinfo.sh\n100644 f5892c9da73eae30d7629ca5e7f0ba6a4c621c73 0\tt/t5100/0010\n100644 8c052777e0d216e84bb8464b1ceaff1bc7721154 0\tt/t5100/info0001\n100644 49bb0fec85323c8c19182bc2a50ceb64ce8307fb 0\tt/t5100/info0002\n100644 bd0d1221aa34973159390642efc67773a6bfef17 0\tt/t5100/info0003\n100644 616c3092a28223d9aa1b3c68aa0bd49fc394dd85 0\tt/t5100/info0004\n100644 46a46fc77283fe31bd583444f76ae2cb7085a35a 0\tt/t5100/info0005\n100644 8c052777e0d216e84bb8464b1ceaff1bc7721154 0\tt/t5100/info0006\n100644 49bb0fec85323c8c19182bc2a50ceb64ce8307fb 0\tt/t5100/info0007\n100644 e8a295138317864b814b24af63ad3cf9c64cf79a 0\tt/t5100/info0008\n100644 2a66321c8032cc0ee0cba25486e57f790d1f6ce8 0\tt/t5100/info0009\n100644 1791241e46dc44994c58b365e339c093704a6006 0\tt/t5100/info0010\n100644 b275a9a9b21c762814ed09c0d3a6eb103aa59370 0\tt/t5100/msg0001\n100644 e2546ec7332b6b0483f4951906a40436da6383e0 0\tt/t5100/msg0002\n100644 1ac68101b135f4aaf6dacd4bcc0b7586a29d6584 0\tt/t5100/msg0003\n100644 6f8ba3b8e0e504d0aa343e45fffc044a211cc7ca 0\tt/t5100/msg0004\n100644 dd94cd7b9f52247fd33a891e4fdd9b715c7f59b7 0\tt/t5100/msg0005\n100644 b275a9a9b21c762814ed09c0d3a6eb103aa59370 0\tt/t5100/msg0006\n100644 71b23c0236bddbedabfbdb982e4e73c5e266da28 0\tt/t5100/msg0007\n100644 a80ecb97ef9dabb6d25d24d42212dabd5eab6249 0\tt/t5100/msg0008\n100644 9ffe1314891f0998bf90f6c6b1e02c56c405e2f2 0\tt/t5100/msg0009\n100644 a96c230092340037ef1c99ae91f24096eceacf44 0\tt/t5100/msg0010\n100644 d7d680f631b14ea75adf34ba5052043be311e72f 0\tt/t5100/nul-b64.expect\n100644 16540d961f8e6eb791300e085d2d6e82e01bd2c4 0\tt/t5100/nul-b64.in\n100644 3d40691787b855cc0133514a19052492eb853d21 0\tt/t5100/nul-plain\n100644 8ce155167d51de1868fdd2395c312c46b9cc2c63 0\tt/t5100/patch0001\n100644 8ce155167d51de1868fdd2395c312c46b9cc2c63 0\tt/t5100/patch0002\n100644 8ce155167d51de1868fdd2395c312c46b9cc2c63 0\tt/t5100/patch0003\n100644 196458e44e1974188cc1d1523a92c2bbef1ed506 0\tt/t5100/patch0004\n100644 7d24b24af83c861a1dc615c19cbaa392fdd69dec 0\tt/t5100/patch0005\n100644 8ce155167d51de1868fdd2395c312c46b9cc2c63 0\tt/t5100/patch0006\n100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tt/t5100/patch0007\n100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tt/t5100/patch0008\n100644 65615c34af6ea70a53102e6bbef4bd60344cbf1c 0\tt/t5100/patch0009\n100644 f055481d567212b7b43e7ca8251351b3f83b143b 0\tt/t5100/patch0010\n100644 aba57f922b33b6ab708afbbf82c7e56f6e37bb8d 0\tt/t5100/sample.mbox\n100755 645583f9d729cb04ea7bd9638b0c49c48128822e 0\tt/t5300-pack-object.sh\n100755 073ac0c6f9dd3d06474b1b81c8c7b622dcfee663 0\tt/t5301-sliding-window.sh\n100755 0639772ac4e1e2c6563e793b16c2c10faf06758a 0\tt/t5302-pack-index.sh\n100755 31b20b21d23c2066fd124bf6a33dbdc689930170 0\tt/t5303-pack-corruption-resilience.sh\n100755 9fd9d0700033027921c90290cedc0a31d71c7733 0\tt/t5304-prune.sh\n100755 fb471a08c698b431cd2440e9d4f0e77e2fef6b08 0\tt/t5305-include-tag.sh\n100755 68c2ae688c2b7ff96ec927622f92fd512e7beefe 0\tt/t5400-send-pack.sh\n100755 ee769d6695ee91120671c485924d804f14c80424 0\tt/t5401-update-hooks.sh\n100755 1394047a8dc3e87476e223db42936d59845f803b 0\tt/t5402-post-merge-hook.sh\n100755 823239a251f9ba9607649382d595db1b6cc6dcb2 0\tt/t5403-post-checkout-hook.sh\n100755 c24003565d635722f07333bb662c8e102d577c9e 0\tt/t5404-tracking-branches.sh\n100755 86abc6227105e27fdb9ad99e34193efb90a6242f 0\tt/t5405-send-pack-rewind.sh\n100755 59e80a5ea253607bf83ac4eed670744df950eb81 0\tt/t5406-remote-rejects.sh\n100755 362cf7e928090fb3752936317f78a4d128810127 0\tt/t5500-fetch-pack.sh\n100755 16eadd6b68664884836976aafb6dcbb582603c09 0\tt/t5502-quickfetch.sh\n100755 4074e23ffa2c7a93fdbd4a367e273118224b9038 0\tt/t5503-tagfollow.sh\n100755 be9ee9326fc4590dcc875e31b6cf64b800451bc5 0\tt/t5505-remote.sh\n100755 13d1d826c20293c26c739c70c0a36ed48bbb41d1 0\tt/t5510-fetch.sh\n100755 22ba380034775e7584a33ca606294af34f568443 0\tt/t5511-refspec.sh\n100755 1dd8eed5bb3cb0f320a8f0780452e52fa7d8da16 0\tt/t5512-ls-remote.sh\n100755 9e7486274b3f0079cb993acbd03e90afc5638e38 0\tt/t5513-fetch-track.sh\n100755 8becbc3f38fde02371ebbcd9a39a320a1c00c290 0\tt/t5515-fetch-merge-logic.sh\n100644 2e0414f6c3d006ac6f06b884a13397c67f6b7df1 0\tt/t5515/fetch.br-branches-default\n100644 ca2cc1d1b44e3edc8cd42e2e77d0f85658a52195 0\tt/t5515/fetch.br-branches-default-merge\n100644 7d947cd80f9cf656024206f1ea31da0d9f10f493 0\tt/t5515/fetch.br-branches-default-merge_branches-default\n100644 ec39c54b7e242ddbeec76f55b98f555d562aa271 0\tt/t5515/fetch.br-branches-default-octopus\n100644 6bf42e24b67b526bac49e3cdb287e32513f4a6c4 0\tt/t5515/fetch.br-branches-default-octopus_branches-default\n100644 4a2bf3c95ca474417d1dd54d1ac0bcc02bb5f402 0\tt/t5515/fetch.br-branches-default_branches-default\n100644 12ac8d20fba1c8a9402b92aa71e2e6797101a042 0\tt/t5515/fetch.br-branches-one\n100644 b4b3b35ce0e2f46a16b015a74b771eb90ed3ebad 0\tt/t5515/fetch.br-branches-one-merge\n100644 2ecef384eb7d823104581bfe2b4bd240b449e5df 0\tt/t5515/fetch.br-branches-one-merge_branches-one\n100644 96e3029416b46ab4192d3e4aaa285a02489e4054 0\tt/t5515/fetch.br-branches-one-octopus\n100644 55e0bad621cde0c93e6a6fb92dc259c61986aba5 0\tt/t5515/fetch.br-branches-one-octopus_branches-one\n100644 281fa09d481a2d04788d5c1b0a67b8f569203ebc 0\tt/t5515/fetch.br-branches-one_branches-one\n100644 e2fa9c8654647e46baa89d24501b050209aefdc1 0\tt/t5515/fetch.br-config-explicit\n100644 ec1a7231aa7875df2cebd32411bad4861c233dcd 0\tt/t5515/fetch.br-config-explicit-merge\n100644 54f689151ff1006561309f6f7ca5e3523f8626c4 0\tt/t5515/fetch.br-config-explicit-merge_config-explicit\n100644 7011dfc18140aade896592c853bec85567d4ccc8 0\tt/t5515/fetch.br-config-explicit-octopus\n100644 bdad51f87163b51c378aaa1ca9bed8fe4a461af1 0\tt/t5515/fetch.br-config-explicit-octopus_config-explicit\n100644 1b237dde6e03b9bb1f4b9ad0b5ab75ae31127b57 0\tt/t5515/fetch.br-config-explicit_config-explicit\n100644 e75ec2f72b4420cf27bcb959ab83518d93e115b1 0\tt/t5515/fetch.br-config-glob\n100644 ce8f739a0d5f53d24d1408e0e39719c0411e3c0d 0\tt/t5515/fetch.br-config-glob-merge\n100644 5817bed8f88fcc11b9d5e67ce0863249339eeb2c 0\tt/t5515/fetch.br-config-glob-merge_config-glob\n100644 938e532db25e684599b39d1c862680a1caf8ea23 0\tt/t5515/fetch.br-config-glob-octopus\n100644 c9225bf6ff060118ae85b5c666085b3a558db16e 0\tt/t5515/fetch.br-config-glob-octopus_config-glob\n100644 a6c20f92ce6e708f915b285310a94b7080eab1e3 0\tt/t5515/fetch.br-config-glob_config-glob\n100644 83534d2ec85e30dee5c32b8d385dd717cf4930a2 0\tt/t5515/fetch.br-remote-explicit\n100644 a9064dd65a0e569cc3e7ce5ae2368313f6bfa7ec 0\tt/t5515/fetch.br-remote-explicit-merge\n100644 732a37e4d358f0239687770b28c109051c438070 0\tt/t5515/fetch.br-remote-explicit-merge_remote-explicit\n100644 ecf020d9298e7a031833e9986f2deb787712cb89 0\tt/t5515/fetch.br-remote-explicit-octopus\n100644 af7753101140d43e2a592ec37b88d57d53d45bde 0\tt/t5515/fetch.br-remote-explicit-octopus_remote-explicit\n100644 51fae567c8765fc6f447d7ee93a9796e022663a5 0\tt/t5515/fetch.br-remote-explicit_remote-explicit\n100644 94e6ad31e301a87b52160f2287b54051e27b4e18 0\tt/t5515/fetch.br-remote-glob\n100644 09362e25af564342ccb5ed9507caa103676aedf6 0\tt/t5515/fetch.br-remote-glob-merge\n100644 e2eabec62e12b29be2b8cd0c8e6d0cc9ad042f4d 0\tt/t5515/fetch.br-remote-glob-merge_remote-glob\n100644 b08e0461954dcedc90df43c03302e3d4257c6f4b 0\tt/t5515/fetch.br-remote-glob-octopus\n100644 d4d547c84733f0faacc85c88c7b7fa138933e4a6 0\tt/t5515/fetch.br-remote-glob-octopus_remote-glob\n100644 646dbc877008edae3644ceef92fd5bed990eb784 0\tt/t5515/fetch.br-remote-glob_remote-glob\n100644 65ce6d99e2631fd777de10e11b3a58db5859c29a 0\tt/t5515/fetch.br-unconfig\n100644 8258c808689d883b97867b3d07ca89e08146de12 0\tt/t5515/fetch.br-unconfig_--tags_.._.git\n100644 284bb1fb613cafff208741069aea2d4041ec07cd 0\tt/t5515/fetch.br-unconfig_.._.git\n100644 11eb5a6ef22d52b794dd7a0a3e29d2ff515791c2 0\tt/t5515/fetch.br-unconfig_.._.git_one\n100644 f02bab2fb4a1e07c6128fb899bf42183d1f0965e 0\tt/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file\n100644 3f1be224b8b46ba18bb45ffdbc155d9bd312376c 0\tt/t5515/fetch.br-unconfig_.._.git_one_two\n100644 85de41109ecfb6fd4ac3a1b3b15489b83506a63c 0\tt/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file\n100644 0da2337f1b95b2011524b3d047a291747bd80305 0\tt/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three\n100644 fc7041eefc2150417abc504e25f9d82049b3102e 0\tt/t5515/fetch.br-unconfig_branches-default\n100644 e94cde745b58aeb360e2db064466260f2362cf87 0\tt/t5515/fetch.br-unconfig_branches-one\n100644 01a283e70d9d10373c363d1fe15b39949bba8d89 0\tt/t5515/fetch.br-unconfig_config-explicit\n100644 3a556c5e964785046cc43e9c13351818f436b857 0\tt/t5515/fetch.br-unconfig_config-glob\n100644 db216dfa562e894999c565d44d43abb6c6dd562e 0\tt/t5515/fetch.br-unconfig_remote-explicit\n100644 aee65c204d1b1468adaee9d41dc5c0a47a3ae999 0\tt/t5515/fetch.br-unconfig_remote-glob\n100644 950fd078db7ccbe27825183cb0236a0dcc45139a 0\tt/t5515/fetch.master\n100644 0e59950c7b5e18521b59a17d3aaddc3a314a6f9c 0\tt/t5515/fetch.master_--tags_.._.git\n100644 66d1aaddae6cb34d83bbd0e728fbe89fd26227b1 0\tt/t5515/fetch.master_.._.git\n100644 35deddbd2ca6c28c7a50dfc28c3da09b79b7b6a6 0\tt/t5515/fetch.master_.._.git_one\n100644 82868524ca40041b243e146064f4451d6899f3c4 0\tt/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file\n100644 35ec5782c8a6076a76cf314fb5021da8a641e782 0\tt/t5515/fetch.master_.._.git_one_two\n100644 2e133eff296d291045e86fe6a8cba958106b9aae 0\tt/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file\n100644 92b18b40ccc883bede4d2067aa4bf7a529d2f059 0\tt/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three\n100644 603d6d23312b6a58d95a685803d8b19f0e0ac4e2 0\tt/t5515/fetch.master_branches-default\n100644 fe9bb0b7982951ccf85934e42ff7c9620e2312b4 0\tt/t5515/fetch.master_branches-one\n100644 4be97c75752571d46aef0283f164abea025a1be8 0\tt/t5515/fetch.master_config-explicit\n100644 cb0726ff8d7ea9e801497b564b680710c2a273af 0\tt/t5515/fetch.master_config-glob\n100644 44a1ca84296079356eabc3fd37d04529a3492409 0\tt/t5515/fetch.master_remote-explicit\n100644 724e8db0a533248cab6784696c90db02ca1435f3 0\tt/t5515/fetch.master_remote-glob\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default-merge\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default-merge_branches-default\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default-octopus\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default-octopus_branches-default\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-branches-default_branches-default\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one-merge\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one-merge_branches-one\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one-octopus\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one-octopus_branches-one\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-branches-one_branches-one\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit-merge\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit-merge_config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit-octopus\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit-octopus_config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-explicit_config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob-merge\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob-merge_config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob-octopus\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob-octopus_config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-config-glob_config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit-merge\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit-merge_remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit-octopus\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit-octopus_remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-explicit_remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob-merge\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob-merge_remote-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob-octopus\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob-octopus_remote-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-remote-glob_remote-glob\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.br-unconfig\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.br-unconfig_--tags_.._.git\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.br-unconfig_.._.git\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.br-unconfig_.._.git_one\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.br-unconfig_.._.git_one_two\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.br-unconfig_branches-default\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.br-unconfig_branches-one\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-unconfig_config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-unconfig_config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-unconfig_remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.br-unconfig_remote-glob\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.master\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.master_--tags_.._.git\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.master_.._.git\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.master_.._.git_one\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file\n100644 70962eaac152f7063e965da7c6a61abee410e0bc 0\tt/t5515/refs.master_.._.git_one_two\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file\n100644 13e4ad2e4602154808a384fe298497b220ac9d6a 0\tt/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three\n100644 21917c1e5dba7133d451403984f754f445657908 0\tt/t5515/refs.master_branches-default\n100644 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f 0\tt/t5515/refs.master_branches-one\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.master_config-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.master_config-glob\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.master_remote-explicit\n100644 9bbbfd9fc5332911f35826763b821d2eeb758d6f 0\tt/t5515/refs.master_remote-glob\n100755 f0030ad00e4a6478fcb3ccfc503e576bd58003bd 0\tt/t5516-fetch-push.sh\n100755 ea49dedbf8867694d83cd550c8212ff107361920 0\tt/t5517-push-mirror.sh\n100755 c6bc65faa06adeaced0733064fb09eb82add585e 0\tt/t5518-fetch-exit-status.sh\n100755 997b2db827c4f37512c6b5d2f861e12105e2a32d 0\tt/t5520-pull.sh\n100755 1a15817cd5f8e838812723ad14dbec59a108680c 0\tt/t5530-upload-pack-error.sh\n100755 f8c17cd96cc86ca8f2db2ff51467f712d65f8956 0\tt/t5540-http-push.sh\n100755 3c013e2b6aa5c659c80134baf43c99e0d89e2e38 0\tt/t5600-clone-fail-cleanup.sh\n100755 d785b3df78e8507d81ffa03ff694846791edfc87 0\tt/t5601-clone.sh\n100755 8367a6845f6ea3cdbc2f4f0e096144975fa3aef2 0\tt/t5602-clone-remote-exec.sh\n100755 1c109160690d273451f7a089be42e45f36a3b5bb 0\tt/t5700-clone-reference.sh\n100755 8dfaaa456e115e85e36c438bb998d8053534104e 0\tt/t5701-clone-local.sh\n100755 328e4d9a339101d04bb22e441a8955f6c2e1f260 0\tt/t5702-clone-options.sh\n100755 ef7127c1b3943a494692ac8027ec321608a31b9c 0\tt/t5710-info-alternate.sh\n100755 f55627b641682e72d58a2282639ca589b38fa744 0\tt/t6000lib.sh\n100755 b2131cdacd93e0b62f4ef8fdc62b6a81c6aef6fc 0\tt/t6001-rev-list-graft.sh\n100755 8f5de097ecd703ae5f6f889ecb735f7277f361be 0\tt/t6002-rev-list-bisect.sh\n100755 5daa0be8cc856bff513905bc6583854e0b5ae53a 0\tt/t6003-rev-list-topo-order.sh\n100755 5dabf1c5e354c28cc593bd0ea8e4b0d5f0d56d67 0\tt/t6004-rev-list-path-optim.sh\n100755 0b64822bf621dee5c9544f76013c0342412eaee6 0\tt/t6005-rev-list-count.sh\n100755 9176484db2f78122f71c0f11889e01382effcfb9 0\tt/t6006-rev-list-format.sh\n100755 4b8611ce2092f9062aeaeb62ce19a9121d5be537 0\tt/t6007-rev-list-cherry-pick-file.sh\n100755 c4af9ca0a7edf6230dc6ca8ec10848545971fce7 0\tt/t6008-rev-list-submodule.sh\n100755 c8a96a9a994badde602c8bf7a7decda048a00525 0\tt/t6009-rev-list-parent.sh\n100755 b6e57b2426728cce308a57315247cd2a66cabf4a 0\tt/t6010-merge-base.sh\n100755 e51eb41f4b9575d2b51d8d4d255ff5ab7a0889ad 0\tt/t6011-rev-list-with-bad-commit.sh\n100755 a19d49de28c457d1a5726400d25c1f731506a05f 0\tt/t6020-merge-df.sh\n100755 331b9b07d4eedb07377de605ebb87691427b7bb4 0\tt/t6021-merge-criss-cross.sh\n100755 e3f7ae8120aa2a46b25dd3830597cb863a5f5e20 0\tt/t6022-merge-rename.sh\n100755 f674c48cab3e80d63b5a5831c667b8e08b542905 0\tt/t6023-merge-file.sh\n100755 65be95fbaaef4861189a7fc6b3a25bb6d7feb0a7 0\tt/t6023-merge-rename-nocruft.sh\n100755 802d0d06ebddec9db6e3a109e689b3974f1e0ff1 0\tt/t6024-recursive-merge.sh\n100755 fc58456a11eef7ecb4cf60d37a9e9d5cbe13f970 0\tt/t6025-merge-symlinks.sh\n100755 56fc34176859b81137b4d88af90398b9a74a18f7 0\tt/t6026-merge-attr.sh\n100755 92ca1f0f8ccabe6f01159ea3e4a73683387ec4a3 0\tt/t6027-merge-binary.sh\n100755 f8f3e3ff2c00df468f5703a4e0ac31f52e42e06d 0\tt/t6028-merge-up-to-date.sh\n100755 5bbfa44e8d9ee3eebb18eb07e93380c802741a18 0\tt/t6029-merge-subtree.sh\n100755 244fda62a5cd34d778cf0789961654eaa37fe589 0\tt/t6030-bisect-porcelain.sh\n100755 8073e0c3efb2ac01e4a81e722fc357bcab13f5d4 0\tt/t6031-merge-recursive.sh\n100755 eac5ebac24a0174fa20625a19835861573147a26 0\tt/t6032-merge-large-rename.sh\n100755 75d9602de4d4238b4182956127540525f711d33f 0\tt/t6033-merge-crlf.sh\n100755 aac212e936331db9a596fda0c4a9c0382e123797 0\tt/t6040-tracking-info.sh\n100755 919552a2fc5544c130268befca322a6e6a8081c3 0\tt/t6101-rev-parse-parents.sh\n100755 2fb672c3b43a9efe4cb9c85465f6b33f23724e48 0\tt/t6120-describe.sh\n100755 bc74349416d858834c43f6c648daa95c8b9f3a7a 0\tt/t6200-fmt-merge-msg.sh\n100755 a3c8941c726d77fd993a3cfcd7fde4e9aa43da74 0\tt/t6300-for-each-ref.sh\n100755 910a28c7e29b6dd8bd30d1ccb156681b44e51bca 0\tt/t7001-mv.sh\n100755 c8b4f65f380f3941c75bd6ed52975777d2b28d67 0\tt/t7002-grep.sh\n100755 a0ab096c8fdee153a89a1428f85c9bf107badada 0\tt/t7003-filter-branch.sh\n100755 bc7ce2cbbb712f890245688da03be96146a1d9ed 0\tt/t7004-tag.sh\n100644 83855fa4e1c6c37afe550c17afa1e7971042ded5 0\tt/t7004/pubring.gpg\n100644 8fed1339ed0a744e5663f4a5e6b6ac9bae3d8524 0\tt/t7004/random_seed\n100644 d831cd9eb3eee613d3c0e1a71093ae01ea7347e3 0\tt/t7004/secring.gpg\n100644 abace962b8bf84be688a6f27e4ebd0ee7052f210 0\tt/t7004/trustdb.gpg\n100755 2d919d69ef110408b820c76185d6b8da63ea183e 0\tt/t7005-editor.sh\n100755 d8a7c798525728ddc8fc5fa9bd8335d8d1f0a710 0\tt/t7010-setup.sh\n100755 0d9874bfd7082f9ef16c1f6b3ff8a848a19d8937 0\tt/t7101-reset.sh\n100755 29f5678b4c93485ad492fa865a5da58a3cc05b7c 0\tt/t7102-reset.sh\n100755 cdecebe456c7a9cf30465b112a24ce7bcf76f344 0\tt/t7103-reset-bare.sh\n100755 f136ee7bb5300966c0c3c9d2250dc81763db9feb 0\tt/t7104-reset.sh\n100755 9ad5d635a2881c920fff8e524aea0ed931f68e6c 0\tt/t7201-co.sh\n100755 2b51c0d7d8ab727a5fb0be8338938f1d3b2eb6a3 0\tt/t7300-clean.sh\n100755 cbc0c34ce2487959ef0e8f89f7c2a5d4a68be826 0\tt/t7400-submodule-basic.sh\n100755 bf12dbdeef6e307850a91eb6be5ebe537b2de0c8 0\tt/t7401-submodule-summary.sh\n100755 f919c8d34de41b2ec3fe08c217dd2c6276cf8472 0\tt/t7402-submodule-rebase.sh\n100755 d89f91a6fb7fa12d41cc4a346829bff7cbd3e76b 0\tt/t7500-commit.sh\n100755 a72e65c8910f71b8ea562ef5ed641c54fbd89a8e 0\tt/t7500/add-comments\n100755 2fa3d86a108d1fc410d82173809066db0b32b062 0\tt/t7500/add-content\n100755 e1d856af6d8b59fed20e3beb272006612ba4e8a5 0\tt/t7500/add-signed-off\n100755 0edd9ddf73b7053c21595ce1ac1dd157c77d1bca 0\tt/t7501-commit.sh\n100755 f1112639b698faca38b2c8fc743e422d14dc15f6 0\tt/t7502-commit.sh\n100755 38a48b57c70a888838cfa114be843e1d4aea00d8 0\tt/t7502-status.sh\n100755 b06909599564a1c8afa027b0f9c71ef6bb61d6e4 0\tt/t7503-pre-commit-hook.sh\n100755 47680e6df41c2bc14f23514b010a8aefb3fedcd7 0\tt/t7504-commit-msg-hook.sh\n100755 cd6c7c834218fd4c46c49396b79da1ddeef42772 0\tt/t7505-prepare-commit-msg-hook.sh\n100755 a75130cdbb55be157c915f4fc1397227a78441ec 0\tt/t7506-status-submodule.sh\n100755 5eeb6c2b2708d582a6e86cd2e06e2b00b7b7b391 0\tt/t7600-merge.sh\n100755 55aa6b5f2716255b2b5aa74f1cac9d285de6d6a8 0\tt/t7601-merge-pull-config.sh\n100755 fcb8285746420ed721713d9c8e527d23cafb05cf 0\tt/t7602-merge-octopus-many.sh\n100755 17b19dc11f2b1a5d26a16f447733880f3cf30d26 0\tt/t7603-merge-reduce-heads.sh\n100755 6081677d234f1fcb88b6b9160f707ebf0274f38a 0\tt/t7604-merge-custom-message.sh\n100755 ee21a107fd99e35b9d6325a040b7549b7a6c2502 0\tt/t7605-merge-resolve.sh\n100755 9285071c473dcfe7d37845d01ba20226b5ab585d 0\tt/t7610-mergetool.sh\n100755 31c340fd389ed2688bb94a29acbf892be6f0c564 0\tt/t7701-repack-unpack-unreachable.sh\n100755 eabec2e06e2f97fc1790cd4ce30a80e402d4a205 0\tt/t8001-annotate.sh\n100755 92ece30fa94784bdad8ae50fc370487e60bbcb5c 0\tt/t8002-blame.sh\n100755 966bb0a61a89ed63dec085338d3c45f766a7f777 0\tt/t8003-blame.sh\n100755 ba19ac127e630c01e009fa6eda1fac0086d7184d 0\tt/t8004-blame.sh\n100755 1c857cf4ab6e359d7009d2c6b5018bb61c916e93 0\tt/t9001-send-email.sh\n100755 843a5013b96c675a629bd7f738eca220861e6ff8 0\tt/t9100-git-svn-basic.sh\n100755 f420796c31db2746b71ba9d7090f37363eba214a 0\tt/t9101-git-svn-props.sh\n100755 0e7ce34b9b1e254873a2700cf58095318b49b15c 0\tt/t9102-git-svn-deep-rmdir.sh\n100755 9ffd8458ef9d58fa5d3c42fd61f4629219b4d80a 0\tt/t9103-git-svn-tracked-directory-removed.sh\n100755 4d964e2db7cc3c96fc64911bd58c4f2f9679a6cd 0\tt/t9104-git-svn-follow-parent.sh\n100755 63230367bb1566384e66e1b5ddd6a68e1ae98c8f 0\tt/t9105-git-svn-commit-diff.sh\n100755 83896e96876d8cca24496c7cb278732a308e3d92 0\tt/t9106-git-svn-commit-diff-clobber.sh\n100755 bc37db9d62071ba92463276524675964c3e91593 0\tt/t9106-git-svn-dcommit-clobber-series.sh\n100755 d9b553ad55b1f7024af0689a450a9c6c65dcb034 0\tt/t9107-git-svn-migrate.sh\n100755 f6f71d0545c869a7216eb0e81f260085f6ffdec1 0\tt/t9108-git-svn-glob.sh\n100755 04d2a65c087de78fa8126b68774673532497276e 0\tt/t9110-git-svn-use-svm-props.sh\n100644 cc799c238de91a2b466735d678a0bc7415ebefc2 0\tt/t9110/svm.dump\n100755 a8d74dcd3aba7c462d46ea33c722d4307d24bded 0\tt/t9111-git-svn-use-svnsync-props.sh\n100644 499fa9594fafe5d45a32005c189634b6a3048777 0\tt/t9111/svnsync.dump\n100755 d470a920e4864ab0c494da1261fe835ff80474eb 0\tt/t9112-git-svn-md5less-file.sh\n100755 8da8ce58eb1b29210a6ac95fdd3a3fcb547ca36f 0\tt/t9113-git-svn-dcommit-new-file.sh\n100755 61d7781616eed4374c014cabd75a297c2baa348d 0\tt/t9114-git-svn-dcommit-merge.sh\n100755 f0fbd3aff7e63f64f8ba388db805013c43b4b22c 0\tt/t9115-git-svn-dcommit-funky-renames.sh\n100644 42422f791ea4240495e0b9cb5173bb7a27989958 0\tt/t9115/funky-names.dump\n100755 4b2cc878f685e65b2ccd5d8153efb533320d6ee9 0\tt/t9116-git-svn-log.sh\n100755 7a689bb1cd1d9daa1f17c0dcaaafa4d68ebd78fa 0\tt/t9117-git-svn-init-clone.sh\n100755 3281cbd3472a8da58c4f6f0f3965b5810705b0e9 0\tt/t9118-git-svn-funky-branch-names.sh\n100755 cc619115931cb74a85a171ade915ca2c47639c9b 0\tt/t9119-git-svn-info.sh\n100755 5979e133b9d5b9d85ddca31a40763ed4fb6feba3 0\tt/t9120-git-svn-clone-with-percent-escapes.sh\n100755 99230b08107102836f752c14e1b0a67804b35ea3 0\tt/t9121-git-svn-fetch-renamed-dir.sh\n100644 5f9127be92616ea8fb8ace1cff80a37037cb15ec 0\tt/t9121/renamed-dir.dump\n100755 1190576a658d08a680e177b748cfc5e69caa3ddb 0\tt/t9122-git-svn-author.sh\n100755 c18878fad16a6565fe846cc958417fea73289dce 0\tt/t9123-git-svn-rebuild-with-rewriteroot.sh\n100755 8223c5909e6ff6936cb0ccf4d0badfe43491af46 0\tt/t9124-git-svn-dcommit-auto-props.sh\n100755 3e32e84e6cd32413f98b5189f869bfb8f0a7f354 0\tt/t9200-git-cvsexportcommit.sh\n100755 1fc06c5a23b50d54c33755a9fce4ddd9ed3b9c79 0\tt/t9300-fast-import.sh\n100755 c19b4a2bab586b21da43c7a838ba85626f913568 0\tt/t9301-fast-export.sh\n100755 4b91f8d4c45dad075d69028c9c70aa9cb1959e2b 0\tt/t9400-git-cvsserver-server.sh\n100755 e27a1c5f85bbecac652ce8d224f8fc5e99b02a4e 0\tt/t9401-git-cvsserver-crlf.sh\n100755 ae7082be1d903e1f4d5758610d5166152f2847cc 0\tt/t9500-gitweb-standalone-no-errors.sh\n100755 0d7786a8c730d17fa194346f1da2978d23256da9 0\tt/t9600-cvsimport.sh\n100755 9706ee5773692bd8fcfbc9015ef062947c0a2da5 0\tt/t9700-perl-git.sh\n100755 4d2312548a81762918ac05b9a0014195b08ea532 0\tt/t9700/test.pl\n100644 11c027571b44c429b4f6fdca88bff9c3360c7545 0\tt/test-lib.sh\n100644 7b181d15cebb4c86a6ad7fed3dbf30ce2223b4c5 0\tt/test4012.png\n100644 7b181d15cebb4c86a6ad7fed3dbf30ce2223b4c5 0\tt/test9200a.png\n100644 ac22ccbd3ee9f03a3b38249ac8efdbe96b5da2cd 0\tt/test9200b.png\n100644 4470d2bf78e1fbb00d00e487f41daa4373cf48e1 0\ttag.c\n100644 7a0cb0070d46ba8c49d71029dc0704188805ea62 0\ttag.h\n100644 3467705e9b0e14a0230473186079e83a582e4345 0\ttar.h\n100644 6759ecbf98f8a90d96b4918c130babdd87889f69 0\ttemplates/.gitignore\n100644 9f3f1fc352dea624bd36e55802de190ead0ad9dd 0\ttemplates/Makefile\n100644 fae88709a636f3a06cc813dd64b28bfee7fa2073 0\ttemplates/branches--\n100755 8b2a2fe84feaeaba56953d6d4d0d649b3cf755eb 0\ttemplates/hooks--applypatch-msg.sample\n100755 6ef1d29d09a10a5b6c3cbec0ac481931cd0d85fc 0\ttemplates/hooks--commit-msg.sample\n100755 22668216a3cec5a00d804dc5e9a904a10fd0fd09 0\ttemplates/hooks--post-commit.sample\n100755 18d2e0f72768c103d593cc2cf6d2b7a4bc8a9a01 0\ttemplates/hooks--post-receive.sample\n100755 5323b56b81b9dd3d7f9fb86d8892241becbb5e7e 0\ttemplates/hooks--post-update.sample\n100755 b1f187c2e9acaba942639bca90a63c5b4f058967 0\ttemplates/hooks--pre-applypatch.sample\n100755 0e49279c7f7b805c78f1bc4760a0d1c70a84a0d9 0\ttemplates/hooks--pre-commit.sample\n100755 be1b06e25043146f22261b55548229e6ab524b7c 0\ttemplates/hooks--pre-rebase.sample\n100755 365242499dcf0ee35c26ccb2917724d6e559be69 0\ttemplates/hooks--prepare-commit-msg.sample\n100755 93c605594fc06683088b934273873165215ccbb5 0\ttemplates/hooks--update.sample\n100644 2c87b72dff61f8394b3f1f32e21c1d936314ec2e 0\ttemplates/info--exclude\n100644 c6f25e80b8bcf0a21db2bea368b9e444c19bc0bf 0\ttemplates/this--description\n100644 90da448ebec3e5375b7725ba7f297c1c74199b87 0\ttest-chmtime.c\n100644 62e8f2387a1cab97ec1c71d1993d082274e17bf5 0\ttest-date.c\n100644 3d885ff37ee7fc43dec05dd827679d68cee5516b 0\ttest-delta.c\n100644 8cefe6cfed87c8fe0c11d1263dae01639d2bd0f0 0\ttest-genrandom.c\n100644 a3c4688778d9db28c83c9149c9cff1609b69b93f 0\ttest-match-trees.c\n100644 2a79e729a4018ddb2da9ff633f4bf3b102fa8f88 0\ttest-parse-options.c\n100644 a0bcb0e210523124fa977c8bf46667cf25d0335f 0\ttest-path-utils.c\n100644 78d7e983a7a05ba0652132425a66477ef5773304 0\ttest-sha1.c\n100755 0f0bc5d02f4dcbd67c6d405350e5aaeb39f44bfb 0\ttest-sha1.sh\n100644 55e7e2904eb5f95cedaec2520ddd1d158ee93c7a 0\tthread-utils.c\n100644 cce4b77bd6452e2ec589d8c0dc0e8156352dd67b 0\tthread-utils.h\n100644 4713f9165c54405d51e81c3e90847120ee907e5d 0\ttrace.c\n100644 6eb65b873afc9dfd457e974b63d88350bb8dc913 0\ttransport.c\n100644 d0b52053fff9bc463438674232bffb6024f3b1fc 0\ttransport.h\n100644 bbb126fc46cfb28a0bc92cc0842c0dc72017751d 0\ttree-diff.c\n100644 02e2aed7737207225f1b96eed774a1b75dd6d8d9 0\ttree-walk.c\n100644 42110a465f9a8c91d1bc643dfae7a9b9c32e3719 0\ttree-walk.h\n100644 03e782a9cabc0a12ed5baec0ef59c99f19dbc843 0\ttree.c\n100644 2ff01a4f839ecc2206fcc1c13fee9d5d202b1128 0\ttree.h\n100644 bcdc8bbb3b44a43aa43db6035a31478158e070af 0\tunpack-file.c\n100644 cba0aca062f201c5cd5f8799f2190d4a6f06e7c7 0\tunpack-trees.c\n100644 94e567265af9a69a30dd5c578439b6444e50004d 0\tunpack-trees.h\n100644 7e8209ea4b43995737b36bc58db47e7dd6eadb19 0\tupdate-server-info.c\n100644 c911e70c9aa47b70dac41b7f4de2f0b4b6c1f948 0\tupload-pack.c\n100644 a5fc4ec5fae66823266862fa0254474696c220e6 0\tusage.c\n100644 dc3735364f85273c2a119b994ddb405c09dc395c 0\tutf8.c\n100644 98cce1b038a908bec51ccd2f7e1c1f648cb429a1 0\tutf8.h\n100644 724ba87a7c9ccb16bc506fc3f25710a4b78e3006 0\tvar.c\n100644 0e68ee6d2e2fb1b866ecec00c5f6446af366a62e 0\twalker.c\n100644 8a149e11084eeec4501b5b2c5d22e5266f4852e7 0\twalker.h\n100644 93562f03eef21b26945d2d9bbdc96818f4de6567 0\twrapper.c\n100644 4c29255df1b637f93ab3d59e0dcab1fa3b40e10b 0\twrite_or_die.c\n100644 7a7ff130a34942506e6068105ac5946c9404bf18 0\tws.c\n100644 889e50f89fc24984f700d14f7033600fa9fdf642 0\twt-status.c\n100644 78add09bd67c727babb61cd1eaa773bcd0c6e55e 0\twt-status.h\n100644 61dc5c547019776b971dc89d009f628bbac134fd 0\txdiff-interface.c\n100644 f7f791d96b9a34ef0f08db4b007c5309b9adc3d6 0\txdiff-interface.h\n100644 413082e1fdf537d230a0f58940cee7466b965d0e 0\txdiff/xdiff.h\n100644 1bad8462fb32cffdc9ff20a278d513e7a444b257 0\txdiff/xdiffi.c\n100644 3e099dc445d6130f6a0ce2c6270a3b06d6ee119f 0\txdiff/xdiffi.h\n100644 d3d9c845c6420e4881636d779c7029f900a0b067 0\txdiff/xemit.c\n100644 440a7390fa4abb0411c336cfba616e3229484e86 0\txdiff/xemit.h\n100644 526ccb344d231fb978f53b80deb17ec6c8fed368 0\txdiff/xinclude.h\n100644 8ef232cfad12d706aaafe705bf16c546f3597182 0\txdiff/xmacros.h\n100644 82b3573e7ada8c6df13ac24a78650b80af91ea73 0\txdiff/xmerge.c\n100644 e87ab57c652b56b1a684e2a0a56885c1d1b27ef7 0\txdiff/xprepare.c\n100644 8fb06a537451cbf3335ab4bdacb0f992e9744338 0\txdiff/xprepare.h\n100644 2511aef8d89ab52be5ec6a5e46236b4b6bcd07ea 0\txdiff/xtypes.h\n100644 d7974d1a3e612a235b0c8adfde08ba802e782b5a 0\txdiff/xutils.c\n100644 d5de8292e05e7c36c4b68857c1cf9855e3d2f70a 0\txdiff/xutils.h\n"
  },
  {
    "path": "GitSharp.Tests/Resources/gitgit.lstree",
    "content": "100644 blob 6b9c715d21d5486e59083fb6071566aa6ecd4d42\t.gitattributes\n100644 blob a213e8e25bb2442326e86cbfb9ef56319f482869\t.gitignore\n100644 blob 373476bdc03f718b4c01471dd9996ee4497f43a8\t.mailmap\n100644 blob 9651afc89d5e789abd9cedaa4f3b92dde7dd1412\t.project\n100644 blob 6ff87c4664981e4397625791c8ea3bbb5f2279a3\tCOPYING\n040000 tree fe83e22f0c04b81c62a335ef09d59c23ff93d6ca\tDocumentation\n100755 blob cb7cd4b53827fa6820e84b1318572d0115b3b17f\tGIT-VERSION-GEN\n100644 blob 7d0c2c2f865d6ed969038e7543dbeb8933723ec3\tINSTALL\n100644 blob 52c67c1a472455dcce5c19a21bbfd0520ff7dd26\tMakefile\n100644 blob 548142c327a6790ff8821d67c2ee1eff7a656b52\tREADME\n120000 blob b9a53c3416991b66e1d35c2bbf663b48340b0041\tRelNotes\n100644 blob 0d561246e0a958d9a7284409b1900a82876eebf3\tabspath.c\n100644 blob ccb1108c94436035d0da8b1d6f08f859b68294a3\talias.c\n100644 blob 216c23a6f854c614d38c743cd7687a37f304161b\talloc.c\n100644 blob 13029619e5ec34bac4ba61a6fc08800ab36f4a1b\tarchive-tar.c\n100644 blob cf285044e3576d0127c3215cb1253443d67517dc\tarchive-zip.c\n100644 blob f834b5f51f4cf5d3b73d21dfd99198caef3b19f8\tarchive.c\n100644 blob 0b15b35143fffcc13764e4e668ee452b191cc609\tarchive.h\n040000 tree 36753f6455e2308e746447cde2c2113285bc9b02\tarm\n100644 blob 17f6a4dca521d9690377f2e93a0192d8a874d2ad\tattr.c\n100644 blob f1c2038b0923d3130937eef965667204a8634e6d\tattr.h\n100644 blob b88270f90844095b3d352cc4213cbebd95a7f420\tbase85.c\n100644 blob bd7d078e1ae5fe4ce0a16fda62a2c1743237941b\tblob.c\n100644 blob ea5d9e9f8b63be2c7048d19ee53feb06b0795c80\tblob.h\n100644 blob b1e59f2196b933ab7169a30efc5d1d340f8f9c5c\tbranch.c\n100644 blob 9f0c2a2c1fab9a312f436880956da0973c68ead8\tbranch.h\n100644 blob fc3f96eaefff91e4e85adb92162716939f0ecd72\tbuiltin-add.c\n100644 blob fc43eed36b55e4966796490b8c0a02fae790229c\tbuiltin-annotate.c\n100644 blob 2216a0bf7cd53adc31346f66a3b9786a1d688bad\tbuiltin-apply.c\n100644 blob 22445acbfc5279f391ac6afa855b21064ec54535\tbuiltin-archive.c\n100644 blob 8b6b09b10b8f9dcda0b7224f31c860bb803945f0\tbuiltin-blame.c\n100644 blob b1a2ad7a6b3b150cda8d031a87352a4daedc40ea\tbuiltin-branch.c\n100644 blob ac476e7a4b45fc55b6b6d1e4d02be0c35aba2c7b\tbuiltin-bundle.c\n100644 blob 7441a56acdbefdd8044a406f4d756ce8a4f06644\tbuiltin-cat-file.c\n100644 blob cb783fc77e75515a02ed2268dfb37ee3bbd03749\tbuiltin-check-attr.c\n100644 blob fe04be77a9312c11fa054897c5982fa6c74b8e5e\tbuiltin-check-ref-format.c\n100644 blob 71ebabf9903bd90b7da59c47f1c0819b5f25c538\tbuiltin-checkout-index.c\n100644 blob 411cc513c65ba854221ad52dd6aeaaac7d213c9d\tbuiltin-checkout.c\n100644 blob 48bf29f40a5e06fd588b34c468535e04abcf206b\tbuiltin-clean.c\n100644 blob e086a40b41810c30a4f5228daa4e38857dae84d5\tbuiltin-clone.c\n100644 blob 7a9a309be0543da7d27e7710ef82271f2582e0a9\tbuiltin-commit-tree.c\n100644 blob f7c053a0106c2e42833d0d7c7255b7b636d09a93\tbuiltin-commit.c\n100644 blob 91fdc4985d8e64fae12209174dd4aa2d887793e5\tbuiltin-config.c\n100644 blob 91b5487478998e39bb8ae4a5cb667360cff82c9a\tbuiltin-count-objects.c\n100644 blob ec404c839b6542deb4e15ca342fd3c0afbbedd2e\tbuiltin-describe.c\n100644 blob 9bf10bb37e2f56ec2a10239d7419db8fbb641745\tbuiltin-diff-files.c\n100644 blob 17d851b29ee5de33e01745eabcd5cd735c30b352\tbuiltin-diff-index.c\n100644 blob 415cb1612f5322da89850874ba81885e41808678\tbuiltin-diff-tree.c\n100644 blob 7ffea975059f9e13b07ca680e6707ffc14973f90\tbuiltin-diff.c\n100644 blob 070971616dbb12d005c5c9a1f82cc5b0c5391f62\tbuiltin-fast-export.c\n100644 blob 7460ab7fce2a4e6a7e014f448819140e2204ccb7\tbuiltin-fetch--tool.c\n100644 blob 273239af3be61736ee4ff484d628950c4de7311a\tbuiltin-fetch-pack.c\n100644 blob 7eec4a0e43ad5760f1060a7d5bcf2a5083015130\tbuiltin-fetch.c\n100644 blob df02ba7afdd615492361a1897a9dedd6ab233c96\tbuiltin-fmt-merge-msg.c\n100644 blob 445039e19c75e4c9321f7ee64289ef8201a25c14\tbuiltin-for-each-ref.c\n100644 blob 6eb7da88d3e8591a8c544acc61a42e00babff120\tbuiltin-fsck.c\n100644 blob fac200e0b08360625afc81b02913128c9b87f486\tbuiltin-gc.c\n100644 blob 631129ddfd0ffe06f919882d22cfc494d9553f50\tbuiltin-grep.c\n100644 blob 3a062487a7eacd01ed824b46a9124dd343cd2e60\tbuiltin-http-fetch.c\n100644 blob baf0d09ac4ea372b4015d399560a133b401b55cc\tbuiltin-init-db.c\n100644 blob f4975cf35f7f1555739f7657ee62ed983d18cb84\tbuiltin-log.c\n100644 blob e8d568eed7ab700bc338af8f589d2f61e81f323c\tbuiltin-ls-files.c\n100644 blob c21b841e7c5e8d27a6e66e7f70786d77aa4653b5\tbuiltin-ls-remote.c\n100644 blob d25767a1f7eb0a8b45bc1eed6b9aa95de0847f18\tbuiltin-ls-tree.c\n100644 blob f974b9df968c74c5d62d58b2a09493e6abb4322e\tbuiltin-mailinfo.c\n100644 blob 71f3b3b8741e505fc652e6c74c75972f19211f71\tbuiltin-mailsplit.c\n100644 blob 3382b1382a7dcbd525126a35209072da4b4d8041\tbuiltin-merge-base.c\n100644 blob 3605960c2d9692514a6df0f344f3c3269cf1de3c\tbuiltin-merge-file.c\n100644 blob 8f5bbaf402e020e308e7af9cedb7df1b2ec5a2b7\tbuiltin-merge-ours.c\n100644 blob 43e55bf90154c51b94527b2ab7eb7c60fe36e9ec\tbuiltin-merge-recursive.c\n100644 blob dde0c7ed33118ff8d0cc421e8a0366e342c6d011\tbuiltin-merge.c\n100644 blob 4f65b5ae9baf66953e79886fd93fe31786b24d36\tbuiltin-mv.c\n100644 blob 85612c4dcb719b460623204046e35486e9d9fe97\tbuiltin-name-rev.c\n100644 blob 2dadec1630c266bbaf42e84810f7059ed5c43b1e\tbuiltin-pack-objects.c\n100644 blob 34246df4ec946273d9f42e6f0848b02d8510beea\tbuiltin-pack-refs.c\n100644 blob 10cb8df8457fd5f2ba9be62ecd0f9384e21c3e63\tbuiltin-prune-packed.c\n100644 blob 947de8cf258c73d8a327ef3a1daed417ba533f1b\tbuiltin-prune.c\n100644 blob c1ed68d938f67343c6938cfef54d5ff69a522a63\tbuiltin-push.c\n100644 blob 72a6de302f88728af17ce5c5c6983c5267afc6f6\tbuiltin-read-tree.c\n100644 blob 0c34e378199064e87aa09caf0fa0a2346333ec69\tbuiltin-reflog.c\n100644 blob 54d1c3e3d16b2cebcff0c6c57d98756e48472b67\tbuiltin-remote.c\n100644 blob dd4573fe8dcd9dc8edd5a7d41bc8daa83034ee7e\tbuiltin-rerere.c\n100644 blob c24c21909194014b467c86fd3598796e7db576b3\tbuiltin-reset.c\n100644 blob 893762c80f4910fadf2d6df414bd835cccb7faaa\tbuiltin-rev-list.c\n100644 blob 9aa049ec170b0125fddde29adda3c720c8a7b8ee\tbuiltin-rev-parse.c\n100644 blob e9da870d22c14c32a0e0a6cb71b933c79a2d8b53\tbuiltin-revert.c\n100644 blob ee8247b08cd007f73d5dfffa560a9efe33d327b9\tbuiltin-rm.c\n100644 blob 7588d22885d0af24ae80f1d687ccd097fe365021\tbuiltin-send-pack.c\n100644 blob d03f14fdad3d17dde06734d78ddb4aade6ed4f2b\tbuiltin-shortlog.c\n100644 blob 233eed499d0b8790781326ff0455bdc7f09fe4d4\tbuiltin-show-branch.c\n100644 blob add16004f11375b1ad2b97f9b1bf1ced5c437f81\tbuiltin-show-ref.c\n100644 blob c0b21301ba4c126a49ed38b6983756b99a25aae0\tbuiltin-stripspace.c\n100644 blob bfc78bb3f6eff2f8e39649b9649ae7263f143ad9\tbuiltin-symbolic-ref.c\n100644 blob 325b1b2632e44121c23bc6df556bf3aa4e32ba04\tbuiltin-tag.c\n100644 blob f4bea4a322c26a54734286073c5e67444555c2d9\tbuiltin-tar-tree.c\n100644 blob a8918666655bb91f952ccdac18715bd9ba4a09f2\tbuiltin-unpack-objects.c\n100644 blob 38eb53ccba2b97a0fccf50d6ba0b7424fe2d1bcb\tbuiltin-update-index.c\n100644 blob 56a0b1b39cf4c4fc51dbbff256240655bc36a038\tbuiltin-update-ref.c\n100644 blob a9b02fa32f372a6810867c10560a20d58b5b2a91\tbuiltin-upload-archive.c\n100644 blob f4ac595695b1fff1317ff7d14ea9427780327aea\tbuiltin-verify-pack.c\n100644 blob 729a1593e61d87ad4596f07e7faedac81de64e81\tbuiltin-verify-tag.c\n100644 blob 52a3c015ff8e4611522bd41078bdb2934d288d35\tbuiltin-write-tree.c\n100644 blob f3502d305e4f65e9707fe8b738f64be6e49f7f84\tbuiltin.h\n100644 blob 00b2aabefca49b634f49143523ee31556baa7777\tbundle.c\n100644 blob e2aedd60d6ad1482bb6da173c853e6ba4805c8d7\tbundle.h\n100644 blob 5f8ee87bb1c446341b640c2f978a658d6bfcfcd0\tcache-tree.c\n100644 blob cf8b790874c4a4f5890b360c237ccdd4a5a03de4\tcache-tree.h\n100644 blob 2475de9fa837596303284157e08b3080d64351ee\tcache.h\n100755 blob d6fe6cf1749ebcd6189fa36cbb4e14a532d2d17b\tcheck-builtins.sh\n100644 blob 00d92a16631a80ff8ec4e995dafcd3e55434fad5\tcheck-racy.c\n100755 blob a1c4c3e8d845e8e791d7df0c1387e1b2262b5ecf\tcheck_bindir\n100644 blob fc0b72ad59b13e4bd86372e5e81b4f400c99d26e\tcolor.c\n100644 blob 6cf5c88aaf8d0e38e2853e6fd212e3cdd6c180cb\tcolor.h\n100644 blob 9f80a1c5e3a461afd11966625589684d61187911\tcombine-diff.c\n100644 blob 3583a33ee90647d8e6ded02643eb75753760d94f\tcommand-list.txt\n100644 blob dc0c5bfdab7296bf7febb6f1b1aad64550838c15\tcommit.c\n100644 blob 77de9621d9c926c6fb8a2bf9ca81c6c376a2ad41\tcommit.h\n040000 tree 3612b1a756de51eb5beb16e0c3b958e74f8bc53d\tcompat\n100644 blob 53f04a076a7275965090edd4ca2a34652c4f5679\tconfig.c\n100644 blob b776149531025c85f5665d971e6e072f0cc64893\tconfig.mak.in\n100644 blob 7c2856efc92ca55e3cf03fcf1c72ffb70318f7c3\tconfigure.ac\n100644 blob 574f42fa47ffa69328217eb25afee6f85db9595e\tconnect.c\n040000 tree ed65cee05eb473aca9cfae781f109d464dcbd711\tcontrib\n100644 blob 78efed800d4d64898d438d9590b01be008cfcd36\tconvert.c\n100644 blob e54d15aced7595ccb11423b0de121db9051ad1f3\tcopy.c\n100644 blob ace64f165e4a01fb99892e9b89e7df791a7f4ca1\tcsum-file.c\n100644 blob 72c9487f4fd9fcab5e02fc2dc6afd3cb7f9c036a\tcsum-file.h\n100644 blob ee06eb7f48f1d3e818b3037369b4e056fe7e5be7\tctype.c\n100644 blob 4540e8df5ab8bc8ff66549144d7db2928e12199b\tdaemon.c\n100644 blob 35a52576c53e5e1406d40ed4402b8834a29b9f0e\tdate.c\n100644 blob d9668d2ef94c73e4a7a5602011ff13a9fd9d8c6a\tdecorate.c\n100644 blob 1fa4ad9beb08f23888814b99183487ab85378bfd\tdecorate.h\n100644 blob 40ccf5a1e95f62d840a006274f7024fa43208b1c\tdelta.h\n100644 blob a4e28df714b4834e5efe42fa3abb647711913d71\tdiff-delta.c\n100644 blob e7eaff9a68ccbcc692522c9956f0dae9af45f3f1\tdiff-lib.c\n100644 blob 7d68b7f1bef1039b4996e662fb17968c4e3e3e79\tdiff-no-index.c\n100644 blob cbf25473c594abfd1fc13473108dc9c15e2f1d15\tdiff.c\n100644 blob 50fb5ddb0bec02b0cd5498d6ecc37d44bf874476\tdiff.h\n100644 blob 31cdcfe8bcdae7df65b0387071846299a14bb7be\tdiffcore-break.c\n100644 blob e670f8512558c38d9a9d6e754cfc609b042b1195\tdiffcore-delta.c\n100644 blob 23e93852d8c701760d56e7e728dba7c08367fbe8\tdiffcore-order.c\n100644 blob af9fffe6e8e145b066157da8791c749257e7c8e9\tdiffcore-pickaxe.c\n100644 blob 1b2ebb40014d820fe4fb679509ab694d453be7b4\tdiffcore-rename.c\n100644 blob cc96c20734bf4184970f5381416637cf6e45ea13\tdiffcore.h\n100644 blob 29d1d5ba31def46ba8b55905dc60773cc6cc167e\tdir.c\n100644 blob 2df15defb6720a742282f24721233c4816deceb6\tdir.h\n100644 blob 1f73f1ea7dfa6a14dedf384c99751e86c8121ff4\tdump-cache-tree.c\n100644 blob eebc3e95fe0c7e61f7c29fa5412ea9d4a5900f92\teditor.c\n100644 blob 222aaa374b8268828e9d529a8afacb8830acc281\tentry.c\n100644 blob 0c6d11f6a0c6fa5dbab2f36c4b4ad4de5aba4ac9\tenvironment.c\n100644 blob ce6741eb682b59ad638c7bee6ca31e2fcd53f281\texec_cmd.c\n100644 blob 594f961387240c221020c9ea0bccd8a39ff69595\texec_cmd.h\n100644 blob 7089e6f9e6c5fa9142f468e54afe7d33a6d2eec7\tfast-import.c\n100644 blob 8bd9c32561e79d194d27fa10cc98a26aa2cb673c\tfetch-pack.h\n100755 blob 63dfa4c475ae3632fc5cfd093d949a41683a5458\tfixup-builtins\n100644 blob 797e3178ae279f444d2efa7e3758652ad0898dd7\tfsck.c\n100644 blob 990ee02335a2e2693e32baa82b259c23843f2aa0\tfsck.h\n100755 blob a2913c2a2cd1ec158157ada3e2deb666892b734b\tgenerate-cmdlist.sh\n100755 blob da768ee7acc22e6480f0a067e109239561d43927\tgit-add--interactive.perl\n100755 blob 6aa819280ef99ccbbdeefde037e99fae3e6f0110\tgit-am.sh\n100755 blob 98f3ede566a6cb0c902ce84795f7de8f8afbe633\tgit-archimport.perl\n100755 blob 3cac20db79e1e408a321b0e9d272501985a3c49b\tgit-bisect.sh\n100644 blob cf89cdf4598b3796724a85aa707f740245155cdc\tgit-compat-util.h\n100755 blob 6d9f0ef0f989133422cf8c0302e63dab15a999d5\tgit-cvsexportcommit.perl\n100755 blob e2664ef01308fd0fb65d47b25e0ae73a65aa6262\tgit-cvsimport.perl\n100755 blob b0a805c688f59af29e1f25b514d73f3991285dee\tgit-cvsserver.perl\n100755 blob 182822a24e214fe7e93a2df68fdda3dd40b5896d\tgit-filter-branch.sh\n040000 tree 320e89a01513e3630eb681d9524ff835d56f6690\tgit-gui\n100755 blob 0843372b57371b62cd68f2818f634209f55d5395\tgit-instaweb.sh\n100755 blob 9cedaf80ceac1d4100adf3cfb152c76c7f945e4d\tgit-lost-found.sh\n100755 blob 645e1147dc886f2b1ca6d2020b44db746b082bf0\tgit-merge-octopus.sh\n100755 blob e1eb9632660146396a0b5f3f2a410d8cb027ff9d\tgit-merge-one-file.sh\n100755 blob 93bcfc2f5dce418d00f26257788932d5c738785c\tgit-merge-resolve.sh\n100755 blob 94187c306ccb05d977f2bb35e81828130ab49a61\tgit-mergetool.sh\n100755 blob 695a4094bb4230341618bd6f16d0bea9bff2e826\tgit-parse-remote.sh\n100755 blob 75c36100a2f858bcf2663d2b4560654787963175\tgit-pull.sh\n100755 blob cebaee1cc9dfc28d80173583b144a480be2f9bfd\tgit-quiltimport.sh\n100755 blob 4e334ba41dad3067394b79c15ebfe610b2d3e178\tgit-rebase--interactive.sh\n100755 blob 412e135c3ae88d76b5bdf3f08083b153da220a95\tgit-rebase.sh\n100755 blob 937c69a74858a8a3c63bb41a23705b579df1b3a3\tgit-relink.perl\n100755 blob 683960b04d6b743e687b2eb640d2b0e00ccfd313\tgit-repack.sh\n100755 blob 073a314c8043e0ff30afde65e012e356ff0d186f\tgit-request-pull.sh\n100755 blob d2fd89907688a044ffe0d2520744e00a9b33c942\tgit-send-email.perl\n100755 blob dbdf209ec0e7d6468c199d1905c3e7788a9cd246\tgit-sh-setup.sh\n100755 blob d4609ed66e56dc6021c800d60286bec38615ff39\tgit-stash.sh\n100755 blob b40f876a2ca9fe985cedc622ab28a9f461edc5ab\tgit-submodule.sh\n100755 blob cf6dbbc42773fef394c27cd87109b69c3144753c\tgit-svn.perl\n100755 blob 384148a59fc492d8fb1d6ea4fc4532aa1e5ffc22\tgit-web--browse.sh\n100644 blob 37b1d76a08ca59f3de54e11890dce962403cf8d3\tgit.c\n100644 blob c6492e5be2763eab81358424ff625a34a5ff2fba\tgit.spec.in\n040000 tree 615732133b5e3dcd80f5477f3ca94574e4430957\tgitk-git\n040000 tree e3fbfd0f5bfe5e8927abb7fe37a59585aef9a405\tgitweb\n100644 blob e2633f8376eb7b12706dcd4c698e2b3f6be2b433\tgraph.c\n100644 blob eab4e3daba9812293d4e005c3ebe28f9a97744ce\tgraph.h\n100644 blob f67d6716ea5f42c3384a7a4cb2eb973b02785fba\tgrep.c\n100644 blob d252dd25f81526d9b8663b4d3c9585d69a901397\tgrep.h\n100644 blob 46c06a9552dac5475afc607c3fe2bf00801eb055\thash-object.c\n100644 blob 1cd4c9d5c0945994b84bb25edd6e4685cf76b5c5\thash.c\n100644 blob 69e33a47b9861df9ac12c354eae180b4f8fea857\thash.h\n100644 blob 3cb19628965685ce59a5377b81bef975851996e8\thelp.c\n100644 blob 68052888570af7d09535db8831b8cf3ef2881589\thttp-push.c\n100644 blob 9dc6b27b457a2979a95018679a0b885e6fb62d9a\thttp-walker.c\n100644 blob 1108ab4a3101fb4768cad420ccfdb52d87890a18\thttp.c\n100644 blob 905b4629a47789705c13745fd56ce0c91adea41b\thttp.h\n100644 blob b35504a8d25594a8d243ae7490733eae5a262712\tident.c\n100644 blob 1ec131092109aa3fbed3cd20f10b56a864584a94\timap-send.c\n100644 blob 52064befdbbbdf671bd08e369a133d4f1fee03c1\tindex-pack.c\n100644 blob 7f03bd99c5b66afa6cc7fa11a2430301a3042656\tinterpolate.c\n100644 blob 77407e67dca97eb85274c69e2e7469e1d4d40b3b\tinterpolate.h\n100644 blob c8b8375e4983794e601ba69a1c217a3c711835e9\tlist-objects.c\n100644 blob 0f41391ecc00eac324ea76de7654781c4fce094e\tlist-objects.h\n100644 blob 9837c842a3f215ebee7cbe9690e42e216fb5c76c\tll-merge.c\n100644 blob 5388422d091ede134d42406291989c49553f7428\tll-merge.h\n100644 blob 4023797b00fe21ecbabe3407ef8a12fca0690607\tlockfile.c\n100644 blob bd8b9e45ab46b8664c8b7016b33bee22f86c9e0d\tlog-tree.c\n100644 blob 59ba4c48b7966db34c6345a445ab0b10e235ac83\tlog-tree.h\n100644 blob 88fc6f394684436967002ca477eac1e084537348\tmailmap.c\n100644 blob 6e48f83cedd13e24d50cddf47f037791ddc5ad4b\tmailmap.h\n100644 blob 0fd6df7d6ed839eaed536bc332312c2688a6bbad\tmatch-trees.c\n100644 blob 2a939c9dd835a7e7946eb1548e4cf637ae3ca329\tmerge-file.c\n100644 blob 7491c56ad25332fb4aae6a075bf0577a1d800c3b\tmerge-index.c\n100644 blob f37630a8ad07709ae106ddde44a34daf6bad8b16\tmerge-recursive.h\n100644 blob 02fc10f7e622ba1c53065e7cf4563ff10af0c41f\tmerge-tree.c\n100644 blob 0b34341f711a903d4a12fe96dc6ef63e55fb2f5b\tmktag.c\n100644 blob e0da110a98d3a7376dc78df71fabc10fc5664296\tmktree.c\n040000 tree 930c4b2743737c3dd8a58309fd66f019f08ab12f\tmozilla-sha1\n100644 blob 0031d78e8c98a32d61cd0dc0f939a033e24ed890\tname-hash.c\n100644 blob 50b6528001fe4bafdfe70126dc2078860c3d1969\tobject.c\n100644 blob 036bd66fe9b6591e959e6df51160e636ab1a682e\tobject.h\n100644 blob f596bf2db5e0a0065e6856b8caa3ded8a134f74d\tpack-check.c\n100644 blob 25b81a445c8fafe0c00ce30082b7d9a7c22ccf1e\tpack-redundant.c\n100644 blob 848d311c2b2c651dbb14893c260584f00c639357\tpack-refs.c\n100644 blob 518acfb370ad72be18399a3ac5e8ca17880281c9\tpack-refs.h\n100644 blob cd300bdff5b524a4d509ba5276e9ef21f443013d\tpack-revindex.c\n100644 blob 36a514a6cf600e7e77794e50998a9d160e30c8e9\tpack-revindex.h\n100644 blob a8f02699366c87de960d7637e9f69c26c2241693\tpack-write.c\n100644 blob 76e6aa2aad06545e7c44fc2c1e117ea668356ccf\tpack.h\n100644 blob 6b5c9e44b4ded338ddb344ae454d83a685b7569a\tpager.c\n100644 blob 71a7acf4e22bd12c0919f277410d6ec52dd5efc8\tparse-options.c\n100644 blob bc317e7512af7a1cc86641a651ae5415d28e71c4\tparse-options.h\n100644 blob ed9db81fa82c812c9ffa07f5a40540dbb15da0d3\tpatch-delta.c\n100644 blob 9349bc5580456b378d41da7cc2518e4fa9a7e81a\tpatch-id.c\n100644 blob 3be5d3165e0009761a0ca69e15e4a9132c6cfaff\tpatch-ids.c\n100644 blob c8c7ca110ad34def12a3594a1560b3c3052eb701\tpatch-ids.h\n100644 blob 9df447bd6dcfaddf7f05fe5f0b624700ff1f40d7\tpath.c\n040000 tree 7f5daf8444afe10cabcfff7b46dcf101777301cb\tperl\n100644 blob f5d00863a6234c16db33637d19fefd2014780e87\tpkt-line.c\n100644 blob 9df653f6f5afe720870658d7093bddbf3e66beaf\tpkt-line.h\n040000 tree 6f6159f0245784352414ff38ffb68bae80f30bd6\tppc\n100644 blob 33ef34a4119812674726254fee3f391fb5734fdb\tpretty.c\n100644 blob 55a8687ad15788f8ea5a5beb463d216908f618b2\tprogress.c\n100644 blob 611e4c4d42d8d1164add09f926ad5b2ce088db5e\tprogress.h\n100644 blob 6a520855d6c418ecb1384ef9571b122b134af1af\tquote.c\n100644 blob c5eea6f18e2dfabd071b73e6507c34c2b7b5e39f\tquote.h\n100644 blob 3b1c18ff9b9060d0dd437ce89aedb8871c66c54c\treachable.c\n100644 blob 40751810b64f8bbf9c0a633472a0ef27d23ed1a5\treachable.h\n100644 blob 2c03ec3069decb20f7557af4ac7dbe295f2dcf9c\tread-cache.c\n100644 blob d44c19e6b577023dcbaa188a0e67130ff4e5bd9a\treceive-pack.c\n100644 blob f751fdc8d832cae54647c1a70d888e979d324fd8\treflog-walk.c\n100644 blob 7ca1438f4d74b652f962c6bdfddd08fe0d75802d\treflog-walk.h\n100644 blob 39a3b23804d2da715c564459bf320be23d41c1bf\trefs.c\n100644 blob 06ad26055661a9b9e475d0f8a7bd6d1cfb42e792\trefs.h\n100644 blob f61a3ab399aa6960fb8eba050321cea4a3b05344\tremote.c\n100644 blob 091b1d041f8a4d255f59bfc001e098e692dbc15c\tremote.h\n100644 blob 323e493dafee46c0d3f95e3c4cd9c4c9b463bbef\trerere.c\n100644 blob f9b03862fe78b560ee606637be3b1ce972a2cc14\trerere.h\n100644 blob 3897fec53170c50921eb1952bc4bdf9c08480638\trevision.c\n100644 blob f64e8ce7ff999e9fe4a01205ae51775827484ed4\trevision.h\n100644 blob a3b28a64dc2d1b888b0ba2a135be10fe04651201\trun-command.c\n100644 blob 5203a9ebb10b14bd06862abafed0ab73d7514a3d\trun-command.h\n100644 blob 8ff1dc35390083c3648c4ee5790f35633d956069\tsend-pack.h\n100644 blob c1c073b2f05a48772a45602cdc711eef6e211695\tserver-info.c\n100644 blob 6cf909463d4ad3681a2f35269db9dc944f4389c2\tsetup.c\n100644 blob da357479cf19aad4bebc64f874c76fdf8566712b\tsha1-lookup.c\n100644 blob 3249a81b3d664afc89c98e6d9dd6b512092a82f9\tsha1-lookup.h\n100644 blob e281c14f01d37ab7623998c2990914aca49a7a3b\tsha1_file.c\n100644 blob 4fb77f8863ec075de38b84171d3ef039a00cee4c\tsha1_name.c\n100644 blob 4d90eda19efe0a80c1cb39e8897ab3ed5e6fcf56\tshallow.c\n100644 blob 6a48de05ff80f86050715ef3dab87a48b0a86ac9\tshell.c\n100644 blob bc02cc29ef0d5f640ab390614def995f30fe4691\tshortlog.h\n100644 blob 45bb535773fd9c36f73502df9462f7de800009c8\tshow-index.c\n100644 blob b6777812cb92c1c169ee395164d53a0c2e6eceb2\tsideband.c\n100644 blob a84b6917c7a17b5f8a922540801e98d46aa24431\tsideband.h\n100644 blob 720737d856b694bc5239f0c18af372959c99e744\tstrbuf.c\n100644 blob eba7ba423a2d3a383ef93f663c95695438269edf\tstrbuf.h\n100644 blob ddd83c8c76112cecd5d23668aaca467601855a72\tstring-list.c\n100644 blob 4d6a7051fe5bccf04a0d0c32a90e5cf9c00dba3c\tstring-list.h\n100644 blob 5a5e781a15d7d9cb60797958433eca896b31ec85\tsymlinks.c\n040000 tree 40b1d0c852cbaf154abff6e8f5e94537c1184548\tt\n100644 blob 4470d2bf78e1fbb00d00e487f41daa4373cf48e1\ttag.c\n100644 blob 7a0cb0070d46ba8c49d71029dc0704188805ea62\ttag.h\n100644 blob 3467705e9b0e14a0230473186079e83a582e4345\ttar.h\n040000 tree b9afb0508810e32cc63b582eb84bc72c8d2225cd\ttemplates\n100644 blob 90da448ebec3e5375b7725ba7f297c1c74199b87\ttest-chmtime.c\n100644 blob 62e8f2387a1cab97ec1c71d1993d082274e17bf5\ttest-date.c\n100644 blob 3d885ff37ee7fc43dec05dd827679d68cee5516b\ttest-delta.c\n100644 blob 8cefe6cfed87c8fe0c11d1263dae01639d2bd0f0\ttest-genrandom.c\n100644 blob a3c4688778d9db28c83c9149c9cff1609b69b93f\ttest-match-trees.c\n100644 blob 2a79e729a4018ddb2da9ff633f4bf3b102fa8f88\ttest-parse-options.c\n100644 blob a0bcb0e210523124fa977c8bf46667cf25d0335f\ttest-path-utils.c\n100644 blob 78d7e983a7a05ba0652132425a66477ef5773304\ttest-sha1.c\n100755 blob 0f0bc5d02f4dcbd67c6d405350e5aaeb39f44bfb\ttest-sha1.sh\n100644 blob 55e7e2904eb5f95cedaec2520ddd1d158ee93c7a\tthread-utils.c\n100644 blob cce4b77bd6452e2ec589d8c0dc0e8156352dd67b\tthread-utils.h\n100644 blob 4713f9165c54405d51e81c3e90847120ee907e5d\ttrace.c\n100644 blob 6eb65b873afc9dfd457e974b63d88350bb8dc913\ttransport.c\n100644 blob d0b52053fff9bc463438674232bffb6024f3b1fc\ttransport.h\n100644 blob bbb126fc46cfb28a0bc92cc0842c0dc72017751d\ttree-diff.c\n100644 blob 02e2aed7737207225f1b96eed774a1b75dd6d8d9\ttree-walk.c\n100644 blob 42110a465f9a8c91d1bc643dfae7a9b9c32e3719\ttree-walk.h\n100644 blob 03e782a9cabc0a12ed5baec0ef59c99f19dbc843\ttree.c\n100644 blob 2ff01a4f839ecc2206fcc1c13fee9d5d202b1128\ttree.h\n100644 blob bcdc8bbb3b44a43aa43db6035a31478158e070af\tunpack-file.c\n100644 blob cba0aca062f201c5cd5f8799f2190d4a6f06e7c7\tunpack-trees.c\n100644 blob 94e567265af9a69a30dd5c578439b6444e50004d\tunpack-trees.h\n100644 blob 7e8209ea4b43995737b36bc58db47e7dd6eadb19\tupdate-server-info.c\n100644 blob c911e70c9aa47b70dac41b7f4de2f0b4b6c1f948\tupload-pack.c\n100644 blob a5fc4ec5fae66823266862fa0254474696c220e6\tusage.c\n100644 blob dc3735364f85273c2a119b994ddb405c09dc395c\tutf8.c\n100644 blob 98cce1b038a908bec51ccd2f7e1c1f648cb429a1\tutf8.h\n100644 blob 724ba87a7c9ccb16bc506fc3f25710a4b78e3006\tvar.c\n100644 blob 0e68ee6d2e2fb1b866ecec00c5f6446af366a62e\twalker.c\n100644 blob 8a149e11084eeec4501b5b2c5d22e5266f4852e7\twalker.h\n100644 blob 93562f03eef21b26945d2d9bbdc96818f4de6567\twrapper.c\n100644 blob 4c29255df1b637f93ab3d59e0dcab1fa3b40e10b\twrite_or_die.c\n100644 blob 7a7ff130a34942506e6068105ac5946c9404bf18\tws.c\n100644 blob 889e50f89fc24984f700d14f7033600fa9fdf642\twt-status.c\n100644 blob 78add09bd67c727babb61cd1eaa773bcd0c6e55e\twt-status.h\n100644 blob 61dc5c547019776b971dc89d009f628bbac134fd\txdiff-interface.c\n100644 blob f7f791d96b9a34ef0f08db4b007c5309b9adc3d6\txdiff-interface.h\n040000 tree 88b6f65753131f1f2c0dbceb1f37950e3494833a\txdiff\n"
  },
  {
    "path": "GitSharp.Tests/Resources/packed-refs",
    "content": "# pack-refs with: peeled \n6db9c2ebf75590eef973081736730a9ea169a0c4 refs/heads/a\n7f822839a2fe9760f386cbbbcb3f92c5fe81def7 refs/heads/b\n6e1475206e57110fcef4b92320436c1e9872a322 refs/heads/c\nf73b95671f326616d66b2afb3bdfcdbbce110b44 refs/heads/d\nd0114ab8ac326bab30e3a657a0397578c5a1af88 refs/heads/e\n47d3697c3747e8184e0dc479ccbd01e359023577 refs/heads/f\n175d5b80bd9768884d8fced02e9bd33488174396 refs/heads/g\n175d5b80bd9768884d8fced02e9bd33488174396 refs/heads/prefix/a\n68cb1f232964f3cd698afc1dafe583937203c587 refs/heads/gitlink\n49322bb17d3acc9146f98c97d078513228bbf3c0 refs/heads/master\nd86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/heads/pa\n5ce00008cf3fb8f194f52742020bd40d78f3f1b3 refs/heads/symlink\n6db9c2ebf75590eef973081736730a9ea169a0c4 refs/tags/A\n17768080a2318cd89bba4c8b87834401e2095703 refs/tags/B\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\n032c063ce34486359e3ee3d4f9e5c225b9e1a4c2 refs/tags/B10th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\n214cae792433672d28b3aeb9f75c1ae84fd54628 refs/tags/B2nd\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\n1170b77a48d3ea2d58b043648b1ec63d606e3efa refs/tags/B3rd\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\n8dfd42699e7b10e568fa1eaebe249e33e98da81e refs/tags/B4th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\nefee904c794b943a06931c76c576dd552212e8bc refs/tags/B5th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\nd54e006ebbef94b7d3a5cd56d154f1e6f08efb94 refs/tags/B6th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\na773cd2d9dbca00d08793dac0d7002a49f0428c0 refs/tags/B7th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\nbf5123bb77c7b5a379f7de9c1293558e3e24dfb8 refs/tags/B8th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\ndd144af286452bfd6a1ea02b0d3745bcdb555e9d refs/tags/B9th\n^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864\n8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub\n^fd608fbe625a2b456d9f15c2b1dc41f252057dd7\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/COMMIT_EDITMSG",
    "content": "this is a commit of an unpacked object\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/HEAD",
    "content": "ref: refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/ORIG_HEAD",
    "content": "a13973bc29346193c4a023fc83cc5b0645784262\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/config",
    "content": "[core]\n\trepositoryformatversion = 0\n\tfilemode = true\n\tbare = false\n\tlogallrefupdates = true\n\tignorecase = true\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/description",
    "content": "Unnamed repository; edit this file to name it for gitweb.\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/gitk.cache",
    "content": "1 1\na13973bc29346193c4a023fc83cc5b0645784262 e41517d564000311f3d7a54f1390ee82f5f1a55b {a48b402f61eb8ed445dacaa3af80a2e9796dcb3b e41517d564000311f3d7a54f1390ee82f5f1a55b}\n1\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/applypatch-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message taken by\n# applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.  The hook is\n# allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"applypatch-msg\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/commit-msg\" &&\n\texec \"$GIT_DIR/hooks/commit-msg\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to check the commit log message.\n# Called by git-commit with one argument, the name of the file\n# that has the commit message.  The hook should exit with non-zero\n# status after issuing an appropriate message if it wants to stop the\n# commit.  The hook is allowed to edit the commit message file.\n#\n# To enable this hook, rename this file to \"commit-msg\".\n\n# Uncomment the below to add a Signed-off-by line to the message.\n# Doing this in a hook is a bad idea in general, but the prepare-commit-msg\n# hook is more suited to it.\n#\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n\n# This example catches duplicate Signed-off-by lines.\n\ntest \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" || {\n\techo >&2 Duplicate Signed-off-by lines.\n\texit 1\n}\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/post-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script that is called after a successful\n# commit is made.\n#\n# To enable this hook, rename this file to \"post-commit\".\n\n: Nothing\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/post-receive.sample",
    "content": "#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  <oldrev> <newrev> <refname>\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n#\n# see contrib/hooks/ for an sample, or uncomment the next line and\n# rename the file to \"post-receive\".\n\n#. /usr/share/doc/git-core/contrib/hooks/post-receive-email\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/post-update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare a packed repository for use over\n# dumb transports.\n#\n# To enable this hook, rename this file to \"post-update\".\n\nexec git-update-server-info\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/pre-applypatch.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed\n# by applypatch from an e-mail message.\n#\n# The hook should exit with non-zero status after issuing an\n# appropriate message if it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-applypatch\".\n\n. git-sh-setup\ntest -x \"$GIT_DIR/hooks/pre-commit\" &&\n\texec \"$GIT_DIR/hooks/pre-commit\" ${1+\"$@\"}\n:\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/pre-commit.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to verify what is about to be committed.\n# Called by git-commit with no arguments.  The hook should\n# exit with non-zero status after issuing an appropriate message if\n# it wants to stop the commit.\n#\n# To enable this hook, rename this file to \"pre-commit\".\n\nif git-rev-parse --verify HEAD 2>/dev/null\nthen\n\tagainst=HEAD\nelse\n\t# Initial commit: diff against an empty tree object\n\tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\nfi\n\nexec git diff-index --check --cached $against --\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/pre-rebase.sample",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2006, 2008 Junio C Hamano\n#\n# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n# its job, and can prevent the command from running by exiting with\n# non-zero status.\n#\n# The hook is called with the following parameters:\n#\n# $1 -- the upstream the series was forked from.\n# $2 -- the branch being rebased (or empty when rebasing the current branch).\n#\n# This sample shows how to prevent topic branches that are already\n# merged to 'next' branch from getting rebased, because allowing it\n# would result in rebasing already published history.\n\npublish=next\nbasebranch=\"$1\"\nif test \"$#\" = 2\nthen\n\ttopic=\"refs/heads/$2\"\nelse\n\ttopic=`git symbolic-ref HEAD` ||\n\texit 0 ;# we do not interrupt rebasing detached HEAD\nfi\n\ncase \"$topic\" in\nrefs/heads/??/*)\n\t;;\n*)\n\texit 0 ;# we do not interrupt others.\n\t;;\nesac\n\n# Now we are dealing with a topic branch being rebased\n# on top of master.  Is it OK to rebase it?\n\n# Does the topic really exist?\ngit show-ref -q \"$topic\" || {\n\techo >&2 \"No such branch $topic\"\n\texit 1\n}\n\n# Is topic fully merged to master?\nnot_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\nif test -z \"$not_in_master\"\nthen\n\techo >&2 \"$topic is fully merged to master; better remove it.\"\n\texit 1 ;# we could allow it, but there is no point.\nfi\n\n# Is topic ever merged to next?  If so you should not be rebasing it.\nonly_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\nonly_next_2=`git-rev-list ^master           ${publish} | sort`\nif test \"$only_next_1\" = \"$only_next_2\"\nthen\n\tnot_in_topic=`git-rev-list \"^$topic\" master`\n\tif test -z \"$not_in_topic\"\n\tthen\n\t\techo >&2 \"$topic is already up-to-date with master\"\n\t\texit 1 ;# we could allow it, but there is no point.\n\telse\n\t\texit 0\n\tfi\nelse\n\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n\tperl -e '\n\t\tmy $topic = $ARGV[0];\n\t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n\t\tmy (%not_in_next) = map {\n\t\t\t/^([0-9a-f]+) /;\n\t\t\t($1 => 1);\n\t\t} split(/\\n/, $ARGV[1]);\n\t\tfor my $elem (map {\n\t\t\t\t/^([0-9a-f]+) (.*)$/;\n\t\t\t\t[$1 => $2];\n\t\t\t} split(/\\n/, $ARGV[2])) {\n\t\t\tif (!exists $not_in_next{$elem->[0]}) {\n\t\t\t\tif ($msg) {\n\t\t\t\t\tprint STDERR $msg;\n\t\t\t\t\tundef $msg;\n\t\t\t\t}\n\t\t\t\tprint STDERR \" $elem->[1]\\n\";\n\t\t\t}\n\t\t}\n\t' \"$topic\" \"$not_in_next\" \"$not_in_master\"\n\texit 1\nfi\n\nexit 0\n\n################################################################\n\nThis sample hook safeguards topic branches that have been\npublished from being rewound.\n\nThe workflow assumed here is:\n\n * Once a topic branch forks from \"master\", \"master\" is never\n   merged into it again (either directly or indirectly).\n\n * Once a topic branch is fully cooked and merged into \"master\",\n   it is deleted.  If you need to build on top of it to correct\n   earlier mistakes, a new topic branch is created by forking at\n   the tip of the \"master\".  This is not strictly necessary, but\n   it makes it easier to keep your history simple.\n\n * Whenever you need to test or publish your changes to topic\n   branches, merge them into \"next\" branch.\n\nThe script, being an example, hardcodes the publish branch name\nto be \"next\", but it is trivial to make it configurable via\n$GIT_DIR/config mechanism.\n\nWith this workflow, you would want to know:\n\n(1) ... if a topic branch has ever been merged to \"next\".  Young\n    topic branches can have stupid mistakes you would rather\n    clean up before publishing, and things that have not been\n    merged into other branches can be easily rebased without\n    affecting other people.  But once it is published, you would\n    not want to rewind it.\n\n(2) ... if a topic branch has been fully merged to \"master\".\n    Then you can delete it.  More importantly, you should not\n    build on top of it -- other people may already want to\n    change things related to the topic as patches against your\n    \"master\", so if you need further changes, it is better to\n    fork the topic (perhaps with the same name) afresh from the\n    tip of \"master\".\n\nLet's look at this example:\n\n\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n\t\t  /       /           /           /\n\t\t /   a---a---b A     /           /\n\t\t/   /               /           /\n\t       /   /   c---c---c---c B         /\n\t      /   /   /             \\         /\n\t     /   /   /   b---b C     \\       /\n\t    /   /   /   /             \\     /\n    ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n\n\nA, B and C are topic branches.\n\n * A has one fix since it was merged up to \"next\".\n\n * B has finished.  It has been fully merged up to \"master\" and \"next\",\n   and is ready to be deleted.\n\n * C has not merged to \"next\" at all.\n\nWe would want to allow C to be rebased, refuse A, and encourage\nB to be deleted.\n\nTo compute (1):\n\n\tgit-rev-list ^master ^topic next\n\tgit-rev-list ^master        next\n\n\tif these match, topic has not merged in next at all.\n\nTo compute (2):\n\n\tgit-rev-list master..topic\n\n\tif this is empty, it is fully merged to \"master\".\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/prepare-commit-msg.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to prepare the commit log message.\n# Called by git-commit with the name of the file that has the\n# commit message, followed by the description of the commit\n# message's source.  The hook's purpose is to edit the commit\n# message file.  If the hook fails with a non-zero status,\n# the commit is aborted.\n#\n# To enable this hook, rename this file to \"prepare-commit-msg\".\n\n# This hook includes three examples.  The first comments out the\n# \"Conflicts:\" part of a merge commit.\n#\n# The second includes the output of \"git diff --name-status -r\"\n# into the message, just before the \"git status\" output.  It is\n# commented because it doesn't cope with --amend or with squashed\n# commits.\n#\n# The third example adds a Signed-off-by line to the message, that can\n# still be edited.  This is rarely a good idea.\n\ncase \"$2,$3\" in\n  merge,)\n    perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' \"$1\" ;;\n\n# ,|template,)\n#   perl -i.bak -pe '\n#      print \"\\n\" . `git diff --cached --name-status -r`\n#\t if /^#/ && $first++ == 0' \"$1\" ;;\n\n  *) ;;\nesac\n\n# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\\(.*>\\).*$/Signed-off-by: \\1/p')\n# grep -qs \"^$SOB\" \"$1\" || echo \"$SOB\" >> \"$1\"\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/hooks/update.sample",
    "content": "#!/bin/sh\n#\n# An example hook script to blocks unannotated tags from entering.\n# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" >&2\n\techo \" (if you want, you could supply GIT_DIR then run\" >&2\n\techo \"  $0 <ref> <oldrev> <newrev>)\" >&2\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"Usage: $0 <ref> <oldrev> <newrev>\" >&2\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\nif [ -z \"$projectdesc\" -o \"$projectdesc\" = \"Unnamed repository; edit this file to name it for gitweb.\" ]; then\n\techo \"*** Project description file hasn't been set\" >&2\n\texit 1\nfi\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nif [ \"$newrev\" = \"0000000000000000000000000000000000000000\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git-cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" >&2\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" >&2\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" >&2\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/info/exclude",
    "content": "# git-ls-files --others --exclude-from=.git/info/exclude\n# Lines that start with '#' are comments.\n# For a project mostly in C, the following would be a good set of\n# exclude patterns (uncomment them if you want to use them):\n# *.[oa]\n# *~\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/info/refs",
    "content": "e41517d564000311f3d7a54f1390ee82f5f1a55b\trefs/heads/first\na48b402f61eb8ed445dacaa3af80a2e9796dcb3b\trefs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/logs/HEAD",
    "content": "0000000000000000000000000000000000000000 e41517d564000311f3d7a54f1390ee82f5f1a55b Kevin Thompson <kthompson@pelco.com> 1239405799 -0700\tcommit (initial): Initial Commit\ne41517d564000311f3d7a54f1390ee82f5f1a55b a48b402f61eb8ed445dacaa3af80a2e9796dcb3b Kevin Thompson <kthompson@pelco.com> 1239405850 -0700\tcommit: Updated README\na48b402f61eb8ed445dacaa3af80a2e9796dcb3b a13973bc29346193c4a023fc83cc5b0645784262 Kevin Thompson <kthompson@pelco.com> 1239405984 -0700\tcommit: this is a commit of an unpacked object\na13973bc29346193c4a023fc83cc5b0645784262 a48b402f61eb8ed445dacaa3af80a2e9796dcb3b Kevin Thompson <kthompson@pelco.com> 1239748622 -0700\tcheckout: moving from master to a48b402f61e\na48b402f61eb8ed445dacaa3af80a2e9796dcb3b a13973bc29346193c4a023fc83cc5b0645784262 Kevin Thompson <kthompson@pelco.com> 1239748647 -0700\tcheckout: moving from a48b402f61eb8ed445dacaa3af80a2e9796dcb3b to master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/logs/refs/heads/first",
    "content": "0000000000000000000000000000000000000000 e41517d564000311f3d7a54f1390ee82f5f1a55b Kevin Thompson <kthompson@pelco.com> 1239405819 -0700\tbranch: Created from master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/logs/refs/heads/master",
    "content": "0000000000000000000000000000000000000000 e41517d564000311f3d7a54f1390ee82f5f1a55b Kevin Thompson <kthompson@pelco.com> 1239405799 -0700\tcommit (initial): Initial Commit\ne41517d564000311f3d7a54f1390ee82f5f1a55b a48b402f61eb8ed445dacaa3af80a2e9796dcb3b Kevin Thompson <kthompson@pelco.com> 1239405850 -0700\tcommit: Updated README\na48b402f61eb8ed445dacaa3af80a2e9796dcb3b a13973bc29346193c4a023fc83cc5b0645784262 Kevin Thompson <kthompson@pelco.com> 1239405984 -0700\tcommit: this is a commit of an unpacked object\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/objects/76/e984096c69db581a6d48eb444e5490d727ebac",
    "content": "x\u0001-A\n0\u0010E]\u0014s\u0001%M6\u0005\u0011nI:M)f\u0010z{#\b\u000f\u0018i!\u0007y\u00064\u0019!gi2#jDEC?tw\t7\u0002SZXpm^私pϲ\u0018sJ^^7z|\u000b4J\u000f6pBq)PH\u0014\f$A\u00193r"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/objects/a1/3973bc29346193c4a023fc83cc5b0645784262",
    "content": "x\u0001]j0\u0010S\u0005RkK\u0010J\u000bM,\u0019[+\u001b\u0014a\u0019.\rlHгIzD8p\b\u0013\u0019\u001bH\u001bä6ܥ4@\u001fk;\rF(J>ddDSh%iL\u0014m;g)\u001d~mu\u0004c]:GUeU\u0003\u0010N\u0005β!?%Co~\u0001T"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/objects/info/packs",
    "content": "P pack-845b2ba3349cc201321e752b01c5ada8102a9a08.pack\n\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/packed-refs",
    "content": "# pack-refs with: peeled \ne41517d564000311f3d7a54f1390ee82f5f1a55b refs/heads/first\na48b402f61eb8ed445dacaa3af80a2e9796dcb3b refs/heads/master\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/refs/heads/first",
    "content": "e41517d564000311f3d7a54f1390ee82f5f1a55b\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/refs/heads/master",
    "content": "a13973bc29346193c4a023fc83cc5b0645784262\n"
  },
  {
    "path": "GitSharp.Tests/Resources/sample.git/refs/tags/my_tag",
    "content": "76e984096c69db581a6d48eb444e5490d727ebac\n"
  },
  {
    "path": "GitSharp.Tests/Resources/single_file_commit/.gitattributes",
    "content": "i-am-a-file -crlf"
  },
  {
    "path": "GitSharp.Tests/Resources/single_file_commit/16c0beaf7523eb3ef5df45bd42dd4fc6343de864",
    "content": "x\u0001\n\u0002!\u0010@}\u000fQu'glT0{\u001e\u0003\u001f'Z\u0004ii\u000efpF1$ބRƨKQ\u0006Ԅr[{M[op\\i\u0019\u001cw.۳ZbWՒ3*Dqc9/,y\u0005&8"
  },
  {
    "path": "GitSharp.Tests/Resources/single_file_commit/i-am-a-file",
    "content": "and this is the data in me\r\n\r\n"
  },
  {
    "path": "GitSharp.build",
    "content": "﻿<?xml version=\"1.0\"?>\n<project name=\"GitSharp\" default=\"run-tests\">\n\n  <property name=\"build.config\" value=\"debug\" overwrite=\"false\" />\n  <property name=\"build.platform\" value=\"${nant.settings.currentframework}\" />\n  <property name=\"build.defines\" value=\"TRACE;LINQ;DEBUG\" />\n\n  <property name=\"build.runs.on.mono\" value=\"${(framework::get-family(framework::get-runtime-framework()) == 'mono')}\" />\n  \n  <property name=\"path.base\" value=\"${project::get-base-directory()}\"/>\n  <property name=\"path.build\" value=\"${path.base}/build\"/>\n  <property name=\"path.lib\" value=\"${path.base}/lib\"/>\n  <property name=\"path.dist\" value=\"${path.base}/dist\"/>\n  <property name=\"path.tools\" value=\"${path.base}/tools\"/>\n  <property name=\"path.tools.nunit\" value=\"${path.tools}/nunit\"/>\n\n  <!-- Revision version detection. If build.vcs.number hasn't been passed through command line argument, version revision is set to 'local-build' -->\n  <property name=\"build.vcs.number.1\" value=\"\" overwrite=\"false\"/>\n  <property name=\"version.revision\" value=\"local-build\" />\n\n  <if test=\"${(string::get-length(build.vcs.number.1) != 0)}\">\n    <property name=\"version.revision\" value=\"${build.vcs.number.1}\" />\n  </if>\n\n  <property name=\"version.major\" value=\"${version::get-major(version::parse(version))}\" dynamic=\"true\"/>\n  <property name=\"version.minor\" value=\"${version::get-minor(version::parse(version))}\" dynamic=\"true\"/>\n  <property name=\"version.build\" value=\"${version::get-build(version::parse(version))}\" dynamic=\"true\"/>\n  <property name=\"build.version\" value=\"${version.major}.${version.minor}.${version.build}.${version.revision}\" dynamic=\"true\"/>\n\n  <target name=\"rebuild\" depends=\"clean, run-tests\"/>\n\n  <target name=\"clean\">\n    <delete dir=\"${path.build}\" if=\"${directory::exists(path.build)}\"/>\n    <delete dir=\"${path.dist}\" if=\"${directory::exists(path.dist)}\"/>\n  </target>\n\n  <target name=\"dist\" depends=\"run-tests, package\"/>\n\n  <!-- ********************************************** -->\n  <!-- GitSharp.Core.dll -->\n  <!-- ********************************************** -->\n  <target name=\"compile-core\" depends=\"init\">\n    <property name=\"assembly.name\" value=\"GitSharp.Core\" />\n    <property name=\"assembly.type\" value=\"library\" />\n    <property name=\"project.directory\" value=\"${assembly.name}\" />\n\n    <property name=\"assembly.namespace\" value=\"${assembly.name}\" />\n    \n    <fileset id=\"project.references\" >\n      <include name=\"System.dll\" />\n      <include name=\"System.Core.dll\" />\n      <include name=\"System.Xml.dll\" />\n      <include name=\"${path.lib}/ICSharpCode.SharpZipLib.dll\" />\n      <include name=\"${path.lib}/Winterdom.IO.FileMap.dll\" />\n      <include name=\"${path.lib}/Tamir.SharpSSH.dll\" />\n    </fileset>\n\n    <call target=\"compile-dll\" />\n  </target>\n\n  <!-- ********************************************** -->\n  <!-- git.exe -->\n  <!-- ********************************************** -->\n  <target name=\"compile-cli\" depends=\"compile-gitsharp\">\n    <property name=\"assembly.name\" value=\"GitSharp.Git\" />\n    <property name=\"assembly.type\" value=\"exe\" />\n    <property name=\"project.directory\" value=\"Git\" />\n\n    <property name=\"assembly.namespace\" value=\"GitSharp.CLI\" />\n    \n    <fileset id=\"project.references\" basedir=\"${path.build.output}\" >\n      <include name=\"GitSharp.dll\" />\n      <include name=\"GitSharp.Core.dll\" />\n    </fileset>\n\n    <copy todir=\"${path.build.output}\">\n      <fileset basedir=\"${path.base}/Git\">\n        <include name=\"Commands.xml\" />\n      </fileset>\n    </copy>\n\n    <call target=\"compile-dll\" />\n  </target>\n\n  <!-- ********************************************** -->\n  <!-- GitSharp.dll -->\n  <!-- ********************************************** -->\n  <target name=\"compile-gitsharp\" depends=\"compile-core\">\n    <property name=\"assembly.name\" value=\"GitSharp\" />\n    <property name=\"assembly.type\" value=\"library\" />\n    <property name=\"project.directory\" value=\"${assembly.name}\" />\n\n    <property name=\"assembly.namespace\" value=\"${assembly.name}\" />\n\n    <fileset id=\"project.references\" basedir=\"${path.build.output}\" >\n      <include name=\"System.dll\" />\n      <include name=\"System.Core.dll\" />\n      <include name=\"GitSharp.Core.dll\" />\n      <include name=\"${path.lib}/Tamir.SharpSSH.dll\" />\n    </fileset>\n\n    <call target=\"compile-dll\" />\n  </target>\n\n  <!-- ********************************************** -->\n  <!-- GitSharp.Tests.dll -->\n  <!-- ********************************************** -->\n  <target name=\"compile-tests\" depends=\"compile-cli\">\n    <property name=\"assembly.name\" value=\"GitSharp.Tests\" />\n    <property name=\"assembly.type\" value=\"library\" />\n    <property name=\"project.directory\" value=\"${assembly.name}\" />\n\n    <property name=\"assembly.namespace\" value=\"${assembly.name}\" />\n\n    <fileset id=\"project.references\" >\n      <include name=\"${path.build.output}/GitSharp.dll\" />\n      <include name=\"${path.build.output}/GitSharp.Core.dll\" />\n      <include name=\"${path.build.output}/GitSharp.Git.exe\" />\n      <include name=\"${path.tools.nunit}/nunit.framework.dll\" />\n    </fileset>\n\n    <call target=\"compile-dll\" />\n  </target>\n\n  <!-- ********************************************** -->\n  <!-- run tests -->\n  <!-- ********************************************** -->\n  <target name=\"run-tests\"  depends=\"compile-tests\">\n    <property name=\"path.testresults\" value=\"${path.build}/${build.platform}-${build.config}/test-results\" />\n\n    <mkdir dir=\"${path.testresults}\" if=\"${not(directory::exists(path.testresults))}\"/>\n    <echo message=\"path.testresults = ${path.testresults}\"/>\n\n    <copy todir=\"${path.testresults}\">\n      <fileset basedir=\"${path.base}/GitSharp.Tests/Resources\">\n        <include name=\"${path.build.output}/*.dll\" />\n        <include name=\"${path.build.output}/GitSharp.Git.exe\" />\n      </fileset>\n    </copy>\n\n    <copy todir=\"${path.testresults}/Resources\">\n      <fileset basedir=\"${path.base}/GitSharp.Tests/Resources\">\n        <include name=\"**\" />\n      </fileset>\n    </copy>\n\n    <property name=\"nunit.consolerunner\" value=\"${path.tools.nunit}/nunit-console.exe\" />\n    <property name=\"nunit.commandline\" value=\"GitSharp.Tests.dll /xml:GitSharp.Tests.dll-results.xml /noshadow \" />\n    <if test=\"${build.runs.on.mono}\">\n      <property name=\"nunit.consolerunner\" value=\"nunit-console2\" />\n      <property name=\"nunit.commandline\" value=\"GitSharp.Tests.dll -xml:GitSharp.Tests.dll-results.xml -noshadow \" />\n    </if>\n\n    <exec verbose=\"true\"\n      program=\"${nunit.consolerunner}\"\n      workingdir=\"${path.testresults}\"\n      commandline=\"${nunit.commandline}\"\n      failonerror=\"true\"\n\t\t\t/>\n\n\n    <property name=\"debugger.file.path.before\" value=\"${path.build.output}/GitSharp.Git.pdb\" />\n    <property name=\"debugger.file.path.after\" value=\"${path.build.output}/Git.pdb\"  />\n\n    <property name=\"debugger.file.path.before\" value=\"${path.build.output}/GitSharp.Git.exe.mdb\" if=\"${build.runs.on.mono}\" />\n    <property name=\"debugger.file.path.after\" value=\"${path.build.output}/Git.exe.mdb\" if=\"${build.runs.on.mono}\" />\n\n\n    <move file=\"${path.build.output}/GitSharp.Git.exe\" tofile=\"${path.build.output}/Git.exe\" />\n    <move file=\"${debugger.file.path.before}\" tofile=\"${debugger.file.path.after}\" />\n    <move file=\"${path.build.output}/GitSharp.Git.xml\" tofile=\"${path.build.output}/Git.xml\" />\n  </target>\n\n  <target name=\"init\">\n    <loadfile file=\"version.txt\" property=\"version\" />\n\n    <mkdir dir=\"${path.build}\" if=\"${not(directory::exists(path.build))}\"/>\n\n    <property name=\"path.build.output\" value=\"${path.build}/${build.platform}-${build.config}/bin\"/>\n\n    <echo message=\"build.version = ${build.version}\"/>\n    <echo message=\"path.build.output = ${path.build.output}\"/>\n\n    <mkdir dir=\"${path.build.output}\" if=\"${not(directory::exists(path.build.output))}\"/>\n\n    <call target=\"set-${build.config}-project-configuration\" />\n  </target>\n\n  <target name=\"package\">\n    <mkdir dir=\"${path.dist}\" if=\"${not(directory::exists(path.dist))}\"/>\n\n    <copy todir=\"${path.build.output}\">\n      <fileset>\n        <include name=\"${path.base}/*.txt\" />\n        <exclude name=\"${path.base}/version.txt\" />\n      </fileset>\n    </copy>\n    \n    <zip zipfile=\"${path.dist}/GitSharp-${build.version}-${build.config}-${build.platform}.zip\" ziplevel=\"9\">\n      <fileset basedir=\"${path.build.output}\">\n        <include name=\"*.*\"/>\n      </fileset>\n    </zip>\n  </target>\n\n  <target name=\"set-debug-project-configuration\" >\n    <property name=\"build.optimize\"\tvalue=\"false\" />\n  </target>\n\n  <target name=\"set-release-project-configuration\" >\n    <property name=\"build.optimize\"\tvalue=\"true\" />\n    <property name=\"build.defines\" value=\"LINQ;TRACE\" />\n  </target>\n\n  <target name=\"compile-dll\">\n    <call target=\"copy-references\"/>\n\n    <property name=\"project.sources.path\" value=\"${path.base}/${project.directory}\"/>\n\n    <call target=\"create-assembly-info\"/>\n\n    <fileset id=\"project.sources\" failonempty=\"true\">\n      <include name=\"${project.sources.path}/**/*.cs\" />\n    </fileset>\n\n    <property name=\"assembly.extension\" value=\"dll\" />\n    <property name=\"assembly.extension\" value=\"exe\" if=\"${assembly.type == 'exe'}\" />\n\n    <csc target=\"${assembly.type}\"\n         debug=\"Full\"\n         define=\"${build.defines}\"\n         optimize=\"${build.optimize}\"\n         output=\"${path.build.output}/${assembly.name}.${assembly.extension}\"\n         doc=\"${path.build.output}/${assembly.name}.xml\" >\n      <sources refid=\"project.sources\" />\n      <references refid=\"project.references\" />\n      <resources prefix=\"${assembly.namespace}.Resources.\">\n        <include name=\"${project.sources.path}/Resources/*.*\"/>\n      </resources>\n      <nowarn>\n        <!-- No warning when public members lack XML comments -->\n        <warning number=\"1591\" />\n      </nowarn>\n    </csc>\n\n    <call target=\"cleanup-assembly-info\"/>\n  </target>\n\n  <target name=\"cleanup-assembly-info\">\n    <delete file=\"${project.sources.path}/SharedAssemblyInfo.cs\" />\n    <delete file=\"${project.sources.path}/VersionAssemblyInfo.cs\" />\n  </target>\n\n  <target name=\"create-assembly-info\">\n    <copy todir=\"${project.sources.path}\">\n      <fileset>\n        <include name=\"${path.base}/SharedAssemblyInfo.cs\" />\n      </fileset>\n    </copy>\n\n    <asminfo output=\"${project.sources.path}/VersionAssemblyInfo.cs\" language=\"CSharp\">\n      <imports>\n        <import namespace=\"System\"/>\n        <import namespace=\"System.Reflection\"/>\n        <import namespace=\"System.Runtime.InteropServices\"/>\n      </imports>\n      <attributes>\n        <attribute type=\"AssemblyVersionAttribute\" value=\"${version}\"/>\n        <attribute type=\"AssemblyProductAttribute\" value=\"GitSharp [${version.revision}]\"/>\n      </attributes>\n    </asminfo>\n  </target>\n\n  <target name=\"copy-references\">\n    <foreach item=\"File\" property=\"reference\">\n      <in>\n        <items refid=\"project.references\" />\n      </in>\n      <do>\n        <echo message=\"reference = ${reference}\"/>\n        <copy file=\"${reference}\" todir=\"${path.build.output}\" />\n      </do>\n    </foreach>\n  </target>\n\n</project>\n"
  },
  {
    "path": "GitSharp.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{A2CD2048-48D8-4641-ACBF-5199613EE281}\"\n\tProjectSection(SolutionItems) = preProject\n\t\tGitSharp licence.txt = GitSharp licence.txt\n\t\tIndentation.txt = Indentation.txt\n\t\tIndentation.vssettings = Indentation.vssettings\n\t\tJGit licence.txt = JGit licence.txt\n\t\tMiscUtil licence.txt = MiscUtil licence.txt\n\t\tREADME.txt = README.txt\n\t\tSharedAssemblyInfo.cs = SharedAssemblyInfo.cs\n\t\tWinterdom.IO.FileMap License.txt = Winterdom.IO.FileMap License.txt\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"GitSharp.Tests\", \"GitSharp.Tests\\GitSharp.Tests.csproj\", \"{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{C46EDD61-C202-465A-93F1-ADE20A83BB59} = {C46EDD61-C202-465A-93F1-ADE20A83BB59}\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"GitSharp.Core\", \"GitSharp.Core\\GitSharp.Core.csproj\", \"{C46EDD61-C202-465A-93F1-ADE20A83BB59}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Git\", \"Git\\Git.csproj\", \"{2A467118-E885-44FC-B7AF-DFAD937F6012}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"GitSharp\", \"GitSharp\\GitSharp.csproj\", \"{7311850F-619A-4241-B09F-157792C75FBA}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{37052DA4-F6A9-47D0-94AA-96F4A7E0462C}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C46EDD61-C202-465A-93F1-ADE20A83BB59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C46EDD61-C202-465A-93F1-ADE20A83BB59}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C46EDD61-C202-465A-93F1-ADE20A83BB59}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C46EDD61-C202-465A-93F1-ADE20A83BB59}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2A467118-E885-44FC-B7AF-DFAD937F6012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2A467118-E885-44FC-B7AF-DFAD937F6012}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2A467118-E885-44FC-B7AF-DFAD937F6012}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2A467118-E885-44FC-B7AF-DFAD937F6012}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{7311850F-619A-4241-B09F-157792C75FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{7311850F-619A-4241-B09F-157792C75FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{7311850F-619A-4241-B09F-157792C75FBA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{7311850F-619A-4241-B09F-157792C75FBA}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Indentation.txt",
    "content": "This how to adresses the problem of changing the indentation white space settings \non a per solution basis. The community choice for GitSharp was TABS so if you need\nspaces in other solutions then check this out.\n\nShort Summary:\n==========\n\n1) Your solutions need to have a solution item called Indentation.vssettings (see GitSharp \n\tsolution's which sets *only* the indentation whitespace to tabs)\n2) You need to paste the following script at the end of your EnvironmentEvents makro that \n\tautomatically loads Indentation.vssettings if it exists:\n\n    '''''''''''''\n    Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened\n        Dim item As ProjectItem = DTE.Solution.FindProjectItem(\"Indentation.vssettings\")\n        If Not item Is Nothing Then\n            Dim name = item.FileNames(1)\n            DTE.ExecuteCommand(\"Tools.ImportandExportSettings\", \"/import:\"\"\" & name & \"\"\"\")\n        End If\n    End Sub\n    ''''''''''''' \n\nLong Explanantion:\n============\n\n   (partially copied from http://geekswithblogs.net/sdorman/archive/2007/04/25/111981.aspx)\n   \n1) If you have multiple solutions with different white space settings you'll want to set the \n\tregarding setting (i.e. UseTabs) automatically. Add Indentation.vssettings to every of your \n\tsolutions that is having conflicting settings and edit it to your needs. For example: GitSharp's \n\tIndentation.vssettings is only touching \"InsertTabs\" and nothing else.\n\t\n\tNote: As long as you don't add the following makro it won't affect your settings in any way. \n\t\n2) However, if you want to load the correct settings automatically when a new solution is loaded \n\tthen follow the receipe:\n\n    1. Launch the Macros IDE (Alt+F11)\n    2. In the \"Project Explorer\" toolwindow, double-click on \"MyMacros\" to expand it\n    3. Double-click on \"EnvironmentEvents\" to show the source code\n    4. Add this code just above the \"End Module\" statement at the end of the file:\n\n    '''''''''''''\n        Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened\n            Dim item As ProjectItem = DTE.Solution.FindProjectItem(\"VsEditorFormatting.vssettings\")\n            If Not item Is Nothing Then\n                Dim name = item.FileNames(1)\n                DTE.ExecuteCommand(\"Tools.ImportandExportSettings\", \"/import:\"\"\" & name & \"\"\"\")\n            End If\n        End Sub\n    '''''''''''''\n\n    What this does is hook up a handler for the \"Solution.Opened\" event. When it fires, the code looks for \n    your \"VsEditorFormatting.vssettings\" file in the solution and, if it's found, it imports that file.\n\n    5. Close the Macros IDE\n    6. Close Visual Studio (you will get prompted to save \"MyMacros\")\n\n    Now, every time you open a solution containing a \"VsEditorFormatting.vssettings\" file, it will be automatically \n    imported for you. You will can need to share this macro with your co-workers so that they can take \n    advantage of it.\n"
  },
  {
    "path": "Indentation.vssettings",
    "content": "<UserSettings>\n\t<ApplicationIdentity version=\"9.0\"/>\n\t<ToolsOptions>\n\t\t<ToolsOptionsCategory name=\"TextEditor\" RegisteredName=\"TextEditor\">\n\t\t\t<ToolsOptionsSubCategory name=\"CSharp\" RegisteredName=\"CSharp\" PackageName=\"Text Management Package\">\n\t\t\t\t<!--<PropertyValue name=\"TabSize\">4</PropertyValue>\n\t\t\t\t<PropertyValue name=\"AutoListMembers\">false</PropertyValue>\n\t\t\t\t<PropertyValue name=\"IndentStyle\">2</PropertyValue>\n\t\t\t\t<PropertyValue name=\"HideAdvancedMembers\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"ShowNavigationBar\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"VirtualSpace\">false</PropertyValue>-->\n\t\t\t\t<PropertyValue name=\"InsertTabs\">true</PropertyValue>\n\t\t\t\t<!--<PropertyValue name=\"WordWrapGlyphs\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"EnableLeftClickForURLs\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"ShowLineNumbers\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"WordWrap\">false</PropertyValue>\n\t\t\t\t<PropertyValue name=\"IndentSize\">4</PropertyValue>\n\t\t\t\t<PropertyValue name=\"CutCopyBlankLines\">true</PropertyValue>\n\t\t\t\t<PropertyValue name=\"AutoListParams\">false</PropertyValue>-->\n\t\t\t</ToolsOptionsSubCategory>\n\t\t</ToolsOptionsCategory>\n\t</ToolsOptions>\n</UserSettings>\n"
  },
  {
    "path": "JGit licence.txt",
    "content": "/*\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that the following\n * conditions are met:\n *\n * - Redistributions of source code must retain the above copyright\n *   notice, this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above\n *   copyright notice, this list of conditions and the following\n *   disclaimer in the documentation and/or other materials provided\n *   with the distribution.\n *\n * - Neither the name of the Eclipse Foundation, Inc. nor the\n *   names of its contributors may be used to endorse or promote\n *   products derived from this software without specific prior\n *   written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n"
  },
  {
    "path": "MiscUtil licence.txt",
    "content": "\"Miscellaneous Utility Library\" Software Licence\n\nVersion 1.0\n\nCopyright (c) 2004-2008 Jon Skeet and Marc Gravell.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. The end-user documentation included with the redistribution, if\nany, must include the following acknowledgment:\n\n\"This product includes software developed by Jon Skeet\nand Marc Gravell. Contact skeet@pobox.com, or see \nhttp://www.pobox.com/~skeet/).\"\n\nAlternately, this acknowledgment may appear in the software itself,\nif and wherever such third-party acknowledgments normally appear.\n\n4. The name \"Miscellaneous Utility Library\" must not be used to endorse \nor promote products derived from this software without prior written \npermission. For written permission, please contact skeet@pobox.com.\n\n5. Products derived from this software may not be called \n\"Miscellaneous Utility Library\", nor may \"Miscellaneous Utility Library\"\nappear in their name, without prior written permission of Jon Skeet.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL JON SKEET BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE. \n"
  },
  {
    "path": "README.txt",
    "content": "# GitSharp\n\nIt was a fun project but was never fully completed. If you are seeking for a good\nC# git library please go to: https://github.com/libgit2/libgit2sharp\n\n"
  },
  {
    "path": "Winterdom.IO.FileMap License.txt",
    "content": "\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n\t\t       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n\t\t\t    Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\f\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\f\n\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n  \n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n\t\t\t    NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n"
  },
  {
    "path": "generate-Docs.bat",
    "content": "rem ==========================\nrem Generates the documentation\nrem ==========================\nrem\n\ntools\\nant\\nant.exe -buildfile:GitSharp.build %1 -t:net-3.5 -D:build.config=release -D:build.vcs.number.1=%BUILD_VCS_NUMBER% compile-gitsharp\ncd tools\\docu\ndocu ..\\..\\build\\net-3.5-release\\bin\\GitSharp.dll\n\nrem The docs are generated into tools\\docu\\output"
  },
  {
    "path": "lib/ICSharpCode.SharpZipLib.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>ICSharpCode.SharpZipLib</name>\n    </assembly>\n    <members>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.FastZipEvents\">\n            <summary>\n            FastZipEvents supports all events applicable to <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FastZip\">FastZip</see> operations.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.ProcessDirectory\">\n            <summary>\n            Delegate to invoke when processing directories.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.ProcessFile\">\n            <summary>\n            Delegate to invoke when processing files.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.Progress\">\n            <summary>\n            Delegate to invoke during processing of files.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.CompletedFile\">\n            <summary>\n            Delegate to invoke when processing for a file has been completed.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.DirectoryFailure\">\n            <summary>\n            Delegate to invoke when processing directory failures.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.FileFailure\">\n            <summary>\n            Delegate to invoke when processing file failures.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnDirectoryFailure(System.String,System.Exception)\">\n            <summary>\n            Raise the <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.DirectoryFailure\">directory failure</see> event.\n            </summary>\n            <param name=\"directory\">The directory causing the failure.</param>\n            <param name=\"e\">The exception for this event.</param>\n            <returns>A boolean indicating if execution should continue or not.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnFileFailure(System.String,System.Exception)\">\n            <summary>\n            Raises the <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.FileFailure\">file failure delegate</see>.\n            </summary>\n            <param name=\"file\">The file causing the failure.</param>\n            <param name=\"e\">The exception for this failure.</param>\n            <returns>A boolean indicating if execution should continue or not.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnProcessFile(System.String)\">\n            <summary>\n            Fires the <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.ProcessFile\">Process File delegate</see>.\n            </summary>\n            <param name=\"file\">The file being processed.</param>\n            <returns>A boolean indicating if execution should continue or not.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnCompletedFile(System.String)\">\n            <summary>\n            Fires the CompletedFile delegate\n            </summary>\n            <param name=\"file\">The file whose processing has been completed.</param>\n            <returns>A boolean indicating if execution should continue or not.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnProcessDirectory(System.String,System.Boolean)\">\n            <summary>\n            Fires the <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.ProcessDirectory\">process directory</see> delegate.\n            </summary>\n            <param name=\"directory\">The directory being processed.</param>\n            <param name=\"hasMatchingFiles\">Flag indicating if the directory has matching files as determined by the current filter.</param>\n            <returns>A <see cref=\"T:System.Boolean\"/> of true if the operation should continue; false otherwise.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZipEvents.ProgressInterval\">\n            <summary>\n            The minimum timespan between <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.Progress\"/> events.\n            </summary>\n            <value>The minimum period of time between <see cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.Progress\"/> events.</value>\n            <seealso cref=\"F:ICSharpCode.SharpZipLib.Zip.FastZipEvents.Progress\"/>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.FastZip\">\n            <summary>\n            FastZip provides facilities for creating and extracting zip files.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.#ctor\">\n            <summary>\n            Initialise a default instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FastZip\"/>.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.#ctor(ICSharpCode.SharpZipLib.Zip.FastZipEvents)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FastZip\"/>\n            </summary>\n            <param name=\"events\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FastZipEvents\">events</see> to use during operations.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip(System.String,System.String,System.Boolean,System.String,System.String)\">\n            <summary>\n            Create a zip file.\n            </summary>\n            <param name=\"zipFileName\">The name of the zip file to create.</param>\n            <param name=\"sourceDirectory\">The directory to source files from.</param>\n            <param name=\"recurse\">True to recurse directories, false for no recursion.</param>\n            <param name=\"fileFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">file filter</see> to apply.</param>\n            <param name=\"directoryFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">directory filter</see> to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip(System.String,System.String,System.Boolean,System.String)\">\n            <summary>\n            Create a zip file/archive.\n            </summary>\n            <param name=\"zipFileName\">The name of the zip file to create.</param>\n            <param name=\"sourceDirectory\">The directory to obtain files and directories from.</param>\n            <param name=\"recurse\">True to recurse directories, false for no recursion.</param>\n            <param name=\"fileFilter\">The file filter to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip(System.IO.Stream,System.String,System.Boolean,System.String,System.String)\">\n            <summary>\n            Create a zip archive sending output to the <paramref name=\"outputStream\"/> passed.\n            </summary>\n            <param name=\"outputStream\">The stream to write archive data to.</param>\n            <param name=\"sourceDirectory\">The directory to source files from.</param>\n            <param name=\"recurse\">True to recurse directories, false for no recursion.</param>\n            <param name=\"fileFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">file filter</see> to apply.</param>\n            <param name=\"directoryFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">directory filter</see> to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(System.String,System.String,System.String)\">\n            <summary>\n            Extract the contents of a zip file.\n            </summary>\n            <param name=\"zipFileName\">The zip file to extract from.</param>\n            <param name=\"targetDirectory\">The directory to save extracted information in.</param>\n            <param name=\"fileFilter\">A filter to apply to files.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(System.String,System.String,ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite,ICSharpCode.SharpZipLib.Zip.FastZip.ConfirmOverwriteDelegate,System.String,System.String,System.Boolean)\">\n            <summary>\n            Extract the contents of a zip file.\n            </summary>\n            <param name=\"zipFileName\">The zip file to extract from.</param>\n            <param name=\"targetDirectory\">The directory to save extracted information in.</param>\n            <param name=\"overwrite\">The style of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite\">overwriting</see> to apply.</param>\n            <param name=\"confirmDelegate\">A delegate to invoke when confirming overwriting.</param>\n            <param name=\"fileFilter\">A filter to apply to files.</param>\n            <param name=\"directoryFilter\">A filter to apply to directories.</param>\n            <param name=\"restoreDateTime\">Flag indicating wether to restore the date and time for extracted files.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.CreateEmptyDirectories\">\n            <summary>\n            Get/set a value indicating wether empty directories should be created.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.Password\">\n            <summary>\n            Get / set the password value.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.NameTransform\">\n            <summary>\n            Get or set the <see cref=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\"></see> active when creating Zip files.\n            </summary>\n            <seealso cref=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.EntryFactory\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.EntryFactory\">\n            <summary>\n            Get or set the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IEntryFactory\"></see> active when creating Zip files.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.RestoreDateTimeOnExtract\">\n            <summary>\n            Get/set a value indicating wether file dates and times should \n            be restored when extracting files from an archive.\n            </summary>\n            <remarks>The default value is false.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.FastZip.RestoreAttributesOnExtract\">\n            <summary>\n            Get/set a value indicating wether file attributes should\n            be restored during extract operations\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite\">\n            <summary>\n            Defines the desired handling when overwriting files during extraction.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite.Prompt\">\n            <summary>\n            Prompt the user to confirm overwriting\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite.Never\">\n            <summary>\n            Never overwrite files.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FastZip.Overwrite.Always\">\n            <summary>\n            Always overwrite files.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.FastZip.ConfirmOverwriteDelegate\">\n            <summary>\n            Delegate called when confirming overwriting of files.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.NameFilter\">\n            <summary>\n            NameFilter is a string matching class which allows for both positive and negative\n            matching.\n            A filter is a sequence of independant <see cref=\"T:System.Text.RegularExpressions.Regex\">regular expressions</see> separated by semi-colons ';'\n            Each expression can be prefixed by a plus '+' sign or a minus '-' sign to denote the expression\n            is intended to include or exclude names.  If neither a plus or minus sign is found include is the default\n            A given name is tested for inclusion before checking exclusions.  Only names matching an include spec \n            and not matching an exclude spec are deemed to match the filter.\n            An empty filter matches any name.\n            </summary>\n            <example>The following expression includes all name ending in '.dat' with the exception of 'dummy.dat'\n            \"+\\.dat$;-^dummy\\.dat$\"\n            </example>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.IScanFilter\">\n            <summary>\n            Scanning filters support filtering of names.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.IScanFilter.IsMatch(System.String)\">\n            <summary>\n            Test a name to see if it 'matches' the filter.\n            </summary>\n            <param name=\"name\">The name to test.</param>\n            <returns>Returns true if the name matches the filter, false if it does not match.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.#ctor(System.String)\">\n            <summary>\n            Construct an instance based on the filter expression passed\n            </summary>\n            <param name=\"filter\">The filter expression.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.IsValidExpression(System.String)\">\n            <summary>\n            Test a string to see if it is a valid regular expression.\n            </summary>\n            <param name=\"expression\">The expression to test.</param>\n            <returns>True if expression is a valid <see cref=\"T:System.Text.RegularExpressions.Regex\"/> false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.IsValidFilterExpression(System.String)\">\n            <summary>\n            Test an expression to see if it is valid as a filter.\n            </summary>\n            <param name=\"toTest\">The filter expression to test.</param>\n            <returns>True if the expression is valid, false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.ToString\">\n            <summary>\n            Convert this filter to its string equivalent.\n            </summary>\n            <returns>The string equivalent for this filter.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.IsIncluded(System.String)\">\n            <summary>\n            Test a value to see if it is included by the filter.\n            </summary>\n            <param name=\"name\">The value to test.</param>\n            <returns>True if the value is included, false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.IsExcluded(System.String)\">\n            <summary>\n            Test a value to see if it is excluded by the filter.\n            </summary>\n            <param name=\"name\">The value to test.</param>\n            <returns>True if the value is excluded, false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.IsMatch(System.String)\">\n            <summary>\n            Test a value to see if it matches the filter.\n            </summary>\n            <param name=\"name\">The value to test.</param>\n            <returns>True if the value matches, false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameFilter.Compile\">\n            <summary>\n            Compile this filter.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.InflaterHuffmanTree\">\n            <summary>\n            Huffman tree used for inflation\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.InflaterHuffmanTree.defLitLenTree\">\n            <summary>\n            Literal length tree\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.InflaterHuffmanTree.defDistTree\">\n            <summary>\n            Distance tree\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.InflaterHuffmanTree.#ctor(System.Byte[])\">\n            <summary>\n            Constructs a Huffman tree from the array of code lengths.\n            </summary>\n            <param name = \"codeLengths\">\n            the array of code lengths\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.InflaterHuffmanTree.GetSymbol(ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator)\">\n            <summary>\n            Reads the next symbol from input.  The symbol is encoded using the\n            huffman tree.\n            </summary>\n            <param name=\"input\">\n            input the input source.\n            </param>\n            <returns>\n            the next symbol, or -1 if not enough input is available.\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer\">\n            <summary>\n            This class is general purpose class for writing data to a buffer.\n            \n            It allows you to write bits as well as bytes\n            Based on DeflaterPending.java\n            \n            author of the original java version : Jochen Hoenicke\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.buffer_\">\n            <summary>\n            Internal work buffer\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.#ctor\">\n            <summary>\n            construct instance using default buffer size of 4096\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.#ctor(System.Int32)\">\n            <summary>\n            construct instance using specified buffer size\n            </summary>\n            <param name=\"bufferSize\">\n            size to use for internal buffer\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.Reset\">\n            <summary>\n            Clear internal state/buffers\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteByte(System.Int32)\">\n            <summary>\n            Write a byte to buffer\n            </summary>\n            <param name=\"value\">\n            The value to write\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteShort(System.Int32)\">\n            <summary>\n            Write a short value to buffer LSB first\n            </summary>\n            <param name=\"value\">\n            The value to write.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteInt(System.Int32)\">\n            <summary>\n            write an integer LSB first\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteBlock(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Write a block of data to buffer\n            </summary>\n            <param name=\"block\">data to write</param>\n            <param name=\"offset\">offset of first byte to write</param>\n            <param name=\"length\">number of bytes to write</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.AlignToByte\">\n            <summary>\n            Align internal buffer on a byte boundary\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteBits(System.Int32,System.Int32)\">\n            <summary>\n            Write bits to internal buffer\n            </summary>\n            <param name=\"b\">source of bits</param>\n            <param name=\"count\">number of bits to write</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.WriteShortMSB(System.Int32)\">\n            <summary>\n            Write a short value to internal buffer most significant byte first\n            </summary>\n            <param name=\"s\">value to write</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.Flush(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Flushes the pending buffer into the given output array.  If the\n            output array is to small, only a partial flush is done.\n            </summary>\n            <param name=\"output\">The output array.</param>\n            <param name=\"offset\">The offset into output array.</param>\n            <param name=\"length\">The maximum number of bytes to store.</param>\n            <returns>The number of bytes flushed.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.ToByteArray\">\n            <summary>\n            Convert internal buffer to byte array.\n            Buffer is empty on completion\n            </summary>\n            <returns>\n            The internal buffer contents converted to a byte array.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.BitCount\">\n            <summary>\n            The number of bits written to the buffer\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer.IsFlushed\">\n            <summary>\n            Indicates if buffer has been flushed\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.ProgressMessageHandler\">\n            <summary>\n            Used to advise clients of 'events' while processing archives\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\">\n            <summary>\n            The TarArchive class implements the concept of a\n            'Tape Archive'. A tar archive is a series of entries, each of\n            which represents a file system object. Each entry in\n            the archive consists of a header block followed by 0 or more data blocks.\n            Directory entries consist only of the header block, and are followed by entries\n            for the directory's contents. File entries consist of a\n            header followed by the number of blocks needed to\n            contain the file's contents. All entries are written on\n            block boundaries. Blocks are 512 bytes long.\n            \n            TarArchives are instantiated in either read or write mode,\n            based upon whether they are instantiated with an InputStream\n            or an OutputStream. Once instantiated TarArchives read/write\n            mode can not be changed.\n            \n            There is currently no support for random access to tar archives.\n            However, it seems that subclassing TarArchive, and using the\n            TarBuffer.CurrentRecord and TarBuffer.CurrentBlock\n            properties, this would be rather trivial.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.OnProgressMessageEvent(ICSharpCode.SharpZipLib.Tar.TarEntry,System.String)\">\n            <summary>\n            Raises the ProgressMessage event\n            </summary>\n            <param name=\"entry\">The <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\">TarEntry</see> for this event</param>\n            <param name=\"message\">message for this event.  Null is no message</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.#ctor\">\n            <summary>\n            Constructor for a default <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/>.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.#ctor(ICSharpCode.SharpZipLib.Tar.TarInputStream)\">\n            <summary>\n            Initalise a TarArchive for input.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarInputStream\"/> to use for input.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.#ctor(ICSharpCode.SharpZipLib.Tar.TarOutputStream)\">\n            <summary>\n            Initialise a TarArchive for output.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarOutputStream\"/> to use for output.</param> \n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.CreateInputTarArchive(System.IO.Stream)\">\n            <summary>\n            The InputStream based constructors create a TarArchive for the\n            purposes of extracting or listing a tar archive. Thus, use\n            these constructors when you wish to extract files from or list\n            the contents of an existing tar archive.\n            </summary>\n            <param name=\"inputStream\">The stream to retrieve archive data from.</param>\n            <returns>Returns a new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/> suitable for reading from.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.CreateInputTarArchive(System.IO.Stream,System.Int32)\">\n            <summary>\n            Create TarArchive for reading setting block factor\n            </summary>\n            <param name=\"inputStream\">Stream for tar archive contents</param>\n            <param name=\"blockFactor\">The blocking factor to apply</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/> suitable for reading.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.CreateOutputTarArchive(System.IO.Stream)\">\n            <summary>\n            Create a TarArchive for writing to, using the default blocking factor\n            </summary>\n            <param name=\"outputStream\">The <see cref=\"T:System.IO.Stream\"/> to write to</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/> suitable for writing.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.CreateOutputTarArchive(System.IO.Stream,System.Int32)\">\n            <summary>\n            Create a TarArchive for writing to\n            </summary>\n            <param name=\"outputStream\">The stream to write to</param>\n            <param name=\"blockFactor\">The blocking factor to use for buffering.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/> suitable for writing.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.SetKeepOldFiles(System.Boolean)\">\n            <summary>\n            Set the flag that determines whether existing files are\n            kept, or overwritten during extraction.\n            </summary>\n            <param name=\"keepOldFiles\">\n            If true, do not overwrite existing files.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.SetAsciiTranslation(System.Boolean)\">\n            <summary>\n            Set the ascii file translation flag.\n            </summary>\n            <param name= \"asciiTranslate\">\n            If true, translate ascii text files.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.SetUserInfo(System.Int32,System.String,System.Int32,System.String)\">\n            <summary>\n            Set user and group information that will be used to fill in the\n            tar archive's entry headers. This information based on that available \n            for the linux operating system, which is not always available on other\n            operating systems.  TarArchive allows the programmer to specify values\n            to be used in their place.\n            <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\"/> is set to true by this call.\n            </summary>\n            <param name=\"userId\">\n            The user id to use in the headers.\n            </param>\n            <param name=\"userName\">\n            The user name to use in the headers.\n            </param>\n            <param name=\"groupId\">\n            The group id to use in the headers.\n            </param>\n            <param name=\"groupName\">\n            The group name to use in the headers.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.CloseArchive\">\n            <summary>\n            Close the archive.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.ListContents\">\n            <summary>\n            Perform the \"list\" command for the archive contents.\n            \n            NOTE That this method uses the <see cref=\"E:ICSharpCode.SharpZipLib.Tar.TarArchive.ProgressMessageEvent\"> progress event</see> to actually list\n            the contents. If the progress display event is not set, nothing will be listed!\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.ExtractContents(System.String)\">\n            <summary>\n            Perform the \"extract\" command and extract the contents of the archive.\n            </summary>\n            <param name=\"destinationDirectory\">\n            The destination directory into which to extract.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.ExtractEntry(System.String,ICSharpCode.SharpZipLib.Tar.TarEntry)\">\n            <summary>\n            Extract an entry from the archive. This method assumes that the\n            tarIn stream has been properly set with a call to GetNextEntry().\n            </summary>\n            <param name=\"destDir\">\n            The destination directory into which to extract.\n            </param>\n            <param name=\"entry\">\n            The TarEntry returned by tarIn.GetNextEntry().\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.WriteEntry(ICSharpCode.SharpZipLib.Tar.TarEntry,System.Boolean)\">\n            <summary>\n            Write an entry to the archive. This method will call the putNextEntry\n            and then write the contents of the entry, and finally call closeEntry()\n            for entries that are files. For directories, it will call putNextEntry(),\n            and then, if the recurse flag is true, process each entry that is a\n            child of the directory.\n            </summary>\n            <param name=\"sourceEntry\">\n            The TarEntry representing the entry to write to the archive.\n            </param>\n            <param name=\"recurse\">\n            If true, process the children of directory entries.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.InternalWriteEntry(ICSharpCode.SharpZipLib.Tar.TarEntry,System.Boolean)\">\n            <summary>\n            Write an entry to the archive. This method will call the putNextEntry\n            and then write the contents of the entry, and finally call closeEntry()\n            for entries that are files. For directories, it will call putNextEntry(),\n            and then, if the recurse flag is true, process each entry that is a\n            child of the directory.\n            </summary>\n            <param name=\"sourceEntry\">\n            The TarEntry representing the entry to write to the archive.\n            </param>\n            <param name=\"recurse\">\n            If true, process the children of directory entries.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.Dispose(System.Boolean)\">\n            <summary>\n            Releases the unmanaged resources used by the FileStream and optionally releases the managed resources.\n            </summary>\n            <param name=\"disposing\">true to release both managed and unmanaged resources;\n            false to release only unmanaged resources.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.Close\">\n            <summary>\n            Closes the archive and releases any associated resources.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.Finalize\">\n            <summary>\n            Ensures that resources are freed and other cleanup operations are performed\n            when the garbage collector reclaims the <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarArchive\"/>.\n            </summary>\n        </member>\n        <member name=\"E:ICSharpCode.SharpZipLib.Tar.TarArchive.ProgressMessageEvent\">\n            <summary>\n            Client hook allowing detailed information to be reported during processing\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.AsciiTranslate\">\n            <summary>\n            Get/set the ascii file translation flag. If ascii file translation\n            is true, then the file is checked to see if it a binary file or not. \n            If the flag is true and the test indicates it is ascii text \n            file, it will be translated. The translation converts the local\n            operating system's concept of line ends into the UNIX line end,\n            '\\n', which is the defacto standard for a TAR archive. This makes\n            text files compatible with UNIX.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.PathPrefix\">\n            <summary>\n            PathPrefix is added to entry names as they are written if the value is not null.\n            A slash character is appended after PathPrefix \n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.RootPath\">\n            <summary>\n            RootPath is removed from entry names if it is found at the\n            beginning of the name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\">\n            <summary>\n            Get or set a value indicating if overrides defined by <see cref=\"M:ICSharpCode.SharpZipLib.Tar.TarArchive.SetUserInfo(System.Int32,System.String,System.Int32,System.String)\">SetUserInfo</see> should be applied.\n            </summary>\n            <remarks>If overrides are not applied then the values as set in each header will be used.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.UserId\">\n            <summary>\n            Get the archive user id.\n            See <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\">ApplyUserInfoOverrides</see> for detail\n            on how to allow setting values on a per entry basis.\n            </summary>\n            <returns>\n            The current user id.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.UserName\">\n            <summary>\n            Get the archive user name.\n            See <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\">ApplyUserInfoOverrides</see> for detail\n            on how to allow setting values on a per entry basis.\n            </summary>\n            <returns>\n            The current user name.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.GroupId\">\n            <summary>\n            Get the archive group id.\n            See <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\">ApplyUserInfoOverrides</see> for detail\n            on how to allow setting values on a per entry basis.\n            </summary>\n            <returns>\n            The current group id.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.GroupName\">\n            <summary>\n            Get the archive group name.\n            See <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.ApplyUserInfoOverrides\">ApplyUserInfoOverrides</see> for detail\n            on how to allow setting values on a per entry basis.\n            </summary>\n            <returns>\n            The current group name.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarArchive.RecordSize\">\n            <summary>\n            Get the archive's record size. Tar archives are composed of\n            a series of RECORDS each containing a number of BLOCKS.\n            This allowed tar archives to match the IO characteristics of\n            the physical device being used. Archives are expected\n            to be properly \"blocked\".\n            </summary>\n            <returns>\n            The record size this archive is using.\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream\">\n            <summary>\n            An output stream that compresses into the BZip2 format \n            including file header chars into another stream.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Construct a default output stream with maximum block size\n            </summary>\n            <param name=\"stream\">The stream to write BZip data onto.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Initialise a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream\"></see> \n            for the specified stream, using the given blocksize.\n            </summary>\n            <param name=\"stream\">The stream to write compressed data to.</param>\n            <param name=\"blockSize\">The block size to use.</param>\n            <remarks>\n            Valid block sizes are in the range 1..9, with 1 giving \n            the lowest compression and 9 the highest.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Finalize\">\n            <summary>\n            Ensures that resources are freed and other cleanup operations \n            are performed when the garbage collector reclaims the BZip2OutputStream.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            Sets the current position of this stream to the given value.\n            </summary>\n            <param name=\"offset\">The point relative to the offset from which to being seeking.</param>\n            <param name=\"origin\">The reference point from which to begin seeking.</param>\n            <returns>The new position in the stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SetLength(System.Int64)\">\n            <summary>\n            Sets the length of this stream to the given value.\n            </summary>\n            <param name=\"value\">The new stream length.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.ReadByte\">\n            <summary>\n            Read a byte from the stream advancing the position.\n            </summary>\n            <returns>The byte read cast to an int; -1 if end of stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read a block of bytes\n            </summary>\n            <param name=\"buffer\">The buffer to read into.</param>\n            <param name=\"offset\">The offset in the buffer to start storing data at.</param>\n            <param name=\"count\">The maximum number of bytes to read.</param>\n            <returns>The total number of bytes read. This might be less than the number of bytes\n            requested if that number of bytes are not currently available, or zero \n            if the end of the stream is reached.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Write a block of bytes to the stream\n            </summary>\n            <param name=\"buffer\">The buffer containing data to write.</param>\n            <param name=\"offset\">The offset of the first byte to write.</param>\n            <param name=\"count\">The number of bytes to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.WriteByte(System.Byte)\">\n            <summary>\n            Write a byte to the stream.\n            </summary>\n            <param name=\"value\">The byte to write to the stream.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Close\">\n            <summary>\n            End the current block and end compression.\n            Close the stream and free any resources\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.WriteRun\">\n            <summary>\n            Get the number of bytes written to output.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Dispose(System.Boolean)\">\n            <summary>\n            Releases the unmanaged resources used by the <see cref=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream\"/> and optionally releases the managed resources.\n            </summary>\n            <param name=\"disposing\">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Flush\">\n            <summary>\n            Flush output buffers\n            </summary>\t\t\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.IsStreamOwner\">\n            <summary>\n            Get/set flag indicating ownership of underlying stream.\n            When the flag is true <see cref=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Close\"></see> will close the underlying stream also.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanRead\">\n            <summary>\n            Gets a value indicating whether the current stream supports reading\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanSeek\">\n            <summary>\n            Gets a value indicating whether the current stream supports seeking\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanWrite\">\n            <summary>\n            Gets a value indicating whether the current stream supports writing\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Length\">\n            <summary>\n            Gets the length in bytes of the stream\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Position\">\n            <summary>\n            Gets or sets the current position of this stream.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BytesWritten\">\n            <summary>\n            Get the number of bytes written to the output.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            <summary>\n            Represents exception conditions specific to Zip archive handling\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            <summary>\n            SharpZipBaseException is the base exception class for the SharpZipLibrary.\n            All library exceptions are derived from this.\n            </summary>\n            <remarks>NOTE: Not all exceptions thrown will be derived from this class.\n            A variety of other exceptions are possible for example <see cref=\"T:System.ArgumentNullException\"></see></remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.SharpZipBaseException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"info\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.SharpZipBaseException.#ctor\">\n            <summary>\n            Initializes a new instance of the SharpZipBaseException class.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.SharpZipBaseException.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the SharpZipBaseException class with a specified error message.\n            </summary>\n            <param name=\"message\">A message describing the exception.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.SharpZipBaseException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initializes a new instance of the SharpZipBaseException class with a specified\n            error message and a reference to the inner exception that is the cause of this exception.\n            </summary>\n            <param name=\"message\">A message describing the exception.</param>\n            <param name=\"innerException\">The inner exception</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"info\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipException.#ctor\">\n            <summary>\n            Initializes a new instance of the ZipException class.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipException.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the ZipException class with a specified error message.\n            </summary>\n            <param name=\"message\">The error message that explains the reason for the exception.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initialise a new instance of ZipException.\n            </summary>\n            <param name=\"message\">A message describing the error.</param>\n            <param name=\"exception\">The exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2\">\n            <summary>\n            A helper class to simplify compressing and decompressing streams.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2.Decompress(System.IO.Stream,System.IO.Stream)\">\n            <summary>\n            Decompress <paramref name=\"inStream\">input</paramref> writing \n            decompressed data to the <paramref name=\"outStream\">output stream</paramref>\n            </summary>\n            <param name=\"inStream\">The stream containing data to decompress.</param>\n            <param name=\"outStream\">The stream to write decompressed data to.</param>\n            <remarks>Both streams are closed on completion</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2.Compress(System.IO.Stream,System.IO.Stream,System.Int32)\">\n            <summary>\n            Compress <paramref name=\"inStream\">input stream</paramref> sending \n            result to <paramref name=\"outStream\">output stream</paramref>\n            </summary>\n            <param name=\"inStream\">The stream to compress.</param>\n            <param name=\"outStream\">The stream to write compressed data to.</param>\n            <param name=\"blockSize\">The block size to use.</param>\n            <remarks>Both streams are closed on completion</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2.#ctor\">\n            <summary>\n            Initialise a default instance of this class.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.UseZip64\">\n            <summary>\n            Determines how entries are tested to see if they should use Zip64 extensions or not.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.UseZip64.Off\">\n            <summary>\n            Zip64 will not be forced on entries during processing.\n            </summary>\n            <remarks>An entry can have this overridden if required <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.ForceZip64\"></see></remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.UseZip64.On\">\n            <summary>\n            Zip64 should always be used.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic\">\n            <summary>\n            #ZipLib will determine use based on entry values when added to archive.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.CompressionMethod\">\n            <summary>\n            The kind of compression used for an entry in an archive\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.Stored\">\n            <summary>\n            A direct copy of the file contents is held in the archive\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.Deflated\">\n            <summary>\n            Common Zip compression method using a sliding dictionary \n            of up to 32KB and secondary compression from Huffman/Shannon-Fano trees\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.Deflate64\">\n            <summary>\n            An extension to deflate with a 64KB window. Not supported by #Zip currently\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.BZip2\">\n            <summary>\n            Not supported by #Zip currently\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.WinZipAES\">\n            <summary>\n            WinZip special for AES encryption, Not supported by #Zip\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm\">\n            <summary>\n            Identifies the encryption algorithm used for an entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.None\">\n            <summary>\n            No encryption has been used.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.PkzipClassic\">\n            <summary>\n            Encrypted using PKZIP 2.0 or 'classic' encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Des\">\n            <summary>\n            DES encryption has been used.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.RC2\">\n            <summary>\n            RCS encryption has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.TripleDes168\">\n            <summary>\n            Triple DES encryption with 168 bit keys has been used for this entry.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.TripleDes112\">\n            <summary>\n            Triple DES with 112 bit keys has been used for this entry.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Aes128\">\n            <summary>\n            AES 128 has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Aes192\">\n            <summary>\n            AES 192 has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Aes256\">\n            <summary>\n            AES 256 has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.RC2Corrected\">\n            <summary>\n            RC2 corrected has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Blowfish\">\n            <summary>\n            Blowfish has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Twofish\">\n            <summary>\n            Twofish has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.RC4\">\n            <summary>\n            RCS has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.EncryptionAlgorithm.Unknown\">\n            <summary>\n            An unknown algorithm has been used for encryption.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags\">\n            <summary>\n            Defines the contents of the general bit flags field for an archive entry.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Encrypted\">\n            <summary>\n            Bit 0 if set indicates that the file is encrypted\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Method\">\n            <summary>\n            Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Descriptor\">\n            <summary>\n            Bit 3 if set indicates a trailing data desciptor is appended to the entry data\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.ReservedPKware4\">\n            <summary>\n            Bit 4 is reserved for use with method 8 for enhanced deflation\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Patched\">\n            <summary>\n            Bit 5 if set indicates the file contains Pkzip compressed patched data.\n            Requires version 2.7 or greater.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.StrongEncryption\">\n            <summary>\n            Bit 6 if set strong encryption has been used for this entry.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Unused7\">\n            <summary>\n            Bit 7 is currently unused\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Unused8\">\n            <summary>\n            Bit 8 is currently unused\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Unused9\">\n            <summary>\n            Bit 9 is currently unused\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.Unused10\">\n            <summary>\n            Bit 10 is currently unused\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.UnicodeText\">\n            <summary>\n            Bit 11 if set indicates the filename and \n            comment fields for this file must be encoded using UTF-8.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.EnhancedCompress\">\n            <summary>\n            Bit 12 is documented as being reserved by PKware for enhanced compression.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.HeaderMasked\">\n            <summary>\n            Bit 13 if set indicates that values in the local header are masked to hide\n            their actual values, and the central directory is encrypted.\n            </summary>\n            <remarks>\n            Used when encrypting the central directory contents.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.ReservedPkware14\">\n            <summary>\n            Bit 14 is documented as being reserved for use by PKware\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.GeneralBitFlags.ReservedPkware15\">\n            <summary>\n            Bit 15 is documented as being reserved for use by PKware\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipConstants\">\n            <summary>\n            This class contains constants used for Zip format files\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.VersionMadeBy\">\n            <summary>\n            The version made by field for entries in the central header when created by this library\n            </summary>\n            <remarks>\n            This is also the Zip version for the library when comparing against the version required to extract\n            for an entry.  See <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CanDecompress\"/>.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.VERSION_MADE_BY\">\n            <summary>\n            The version made by field for entries in the central header when created by this library\n            </summary>\n            <remarks>\n            This is also the Zip version for the library when comparing against the version required to extract\n            for an entry.  See <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipInputStream.CanDecompressEntry\">ZipInputStream.CanDecompressEntry</see>.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.VersionStrongEncryption\">\n            <summary>\n            The minimum version required to support strong encryption\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.VERSION_STRONG_ENCRYPTION\">\n            <summary>\n            The minimum version required to support strong encryption\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.VersionZip64\">\n            <summary>\n            The version required for Zip64 extensions\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.LocalHeaderBaseSize\">\n            <summary>\n            Size of local entry header (excluding variable length fields at end)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.LOCHDR\">\n            <summary>\n            Size of local entry header (excluding variable length fields at end)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.Zip64DataDescriptorSize\">\n            <summary>\n            Size of Zip64 data descriptor\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.DataDescriptorSize\">\n            <summary>\n            Size of data descriptor\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.EXTHDR\">\n            <summary>\n            Size of data descriptor\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CentralHeaderBaseSize\">\n            <summary>\n            Size of central header entry (excluding variable fields)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CENHDR\">\n            <summary>\n            Size of central header entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.EndOfCentralRecordBaseSize\">\n            <summary>\n            Size of end of central record (excluding variable fields)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.ENDHDR\">\n            <summary>\n            Size of end of central record (excluding variable fields)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CryptoHeaderSize\">\n            <summary>\n            Size of 'classic' cryptographic header stored before any entry data\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CRYPTO_HEADER_SIZE\">\n            <summary>\n            Size of cryptographic header stored before entry data\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.LocalHeaderSignature\">\n            <summary>\n            Signature for local entry header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.LOCSIG\">\n            <summary>\n            Signature for local entry header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.SpanningSignature\">\n            <summary>\n            Signature for spanning entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.SPANNINGSIG\">\n            <summary>\n            Signature for spanning entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.SpanningTempSignature\">\n            <summary>\n            Signature for temporary spanning entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.SPANTEMPSIG\">\n            <summary>\n            Signature for temporary spanning entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.DataDescriptorSignature\">\n            <summary>\n            Signature for data descriptor\n            </summary>\n            <remarks>\n            This is only used where the length, Crc, or compressed size isnt known when the\n            entry is created and the output stream doesnt support seeking.\n            The local entry cannot be 'patched' with the correct values in this case\n            so the values are recorded after the data prefixed by this header, as well as in the central directory.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.EXTSIG\">\n            <summary>\n            Signature for data descriptor\n            </summary>\n            <remarks>\n            This is only used where the length, Crc, or compressed size isnt known when the\n            entry is created and the output stream doesnt support seeking.\n            The local entry cannot be 'patched' with the correct values in this case\n            so the values are recorded after the data prefixed by this header, as well as in the central directory.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CENSIG\">\n            <summary>\n            Signature for central header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CentralHeaderSignature\">\n            <summary>\n            Signature for central header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.Zip64CentralFileHeaderSignature\">\n            <summary>\n            Signature for Zip64 central file header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CENSIG64\">\n            <summary>\n            Signature for Zip64 central file header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.Zip64CentralDirLocatorSignature\">\n            <summary>\n            Signature for Zip64 central directory locator\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.ArchiveExtraDataSignature\">\n            <summary>\n            Signature for archive extra data signature (were headers are encrypted).\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CentralHeaderDigitalSignature\">\n            <summary>\n            Central header digitial signature\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.CENDIGITALSIG\">\n            <summary>\n            Central header digitial signature\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.EndOfCentralDirectorySignature\">\n            <summary>\n            End of central directory record signature\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipConstants.ENDSIG\">\n            <summary>\n            End of central directory record signature\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToString(System.Byte[],System.Int32)\">\n            <summary>\n            Convert a portion of a byte array to a string.\n            </summary>\t\t\n            <param name=\"data\">\n            Data to convert to string\n            </param>\n            <param name=\"count\">\n            Number of bytes to convert starting from index 0\n            </param>\n            <returns>\n            data[0]..data[length - 1] converted to a string\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToString(System.Byte[])\">\n            <summary>\n            Convert a byte array to string\n            </summary>\n            <param name=\"data\">\n            Byte array to convert\n            </param>\n            <returns>\n            <paramref name=\"data\">data</paramref>converted to a string\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToStringExt(System.Int32,System.Byte[],System.Int32)\">\n            <summary>\n            Convert a byte array to string\n            </summary>\n            <param name=\"flags\">The applicable general purpose bits flags</param>\n            <param name=\"data\">\n            Byte array to convert\n            </param>\n            <param name=\"count\">The number of bytes to convert.</param>\n            <returns>\n            <paramref name=\"data\">data</paramref>converted to a string\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToStringExt(System.Int32,System.Byte[])\">\n            <summary>\n            Convert a byte array to string\n            </summary>\n            <param name=\"data\">\n            Byte array to convert\n            </param>\n            <param name=\"flags\">The applicable general purpose bits flags</param>\n            <returns>\n            <paramref name=\"data\">data</paramref>converted to a string\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToArray(System.String)\">\n            <summary>\n            Convert a string to a byte array\n            </summary>\n            <param name=\"str\">\n            String to convert to an array\n            </param>\n            <returns>Converted array</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToArray(System.Int32,System.String)\">\n            <summary>\n            Convert a string to a byte array\n            </summary>\n            <param name=\"flags\">The applicable general purpose bits flags</param>\n            <param name=\"str\">\n            String to convert to an array\n            </param>\n            <returns>Converted array</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipConstants.#ctor\">\n            <summary>\n            Initialise default instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipConstants\">ZipConstants</see>\n            </summary>\n            <remarks>\n            Private to prevent instances being created.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipConstants.DefaultCodePage\">\n            <summary>\n            Default encoding used for string conversion.  0 gives the default system OEM code page.\n            Dont use unicode encodings if you want to be Zip compatible!\n            Using the default code page isnt the full solution neccessarily\n            there are many variable factors, codepage 850 is often a good choice for\n            European users, however be careful about compatability.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipOutputStream\">\n             <summary>\n             This is a DeflaterOutputStream that writes the files into a zip\n             archive one after another.  It has a special method to start a new\n             zip entry.  The zip entries contains information about the file name\n             size, compressed size, CRC, etc.\n             \n             It includes support for Stored and Deflated entries.\n             This class is not thread safe.\n             <br/>\n             <br/>Author of the original java version : Jochen Hoenicke\n             </summary>\n             <example> This sample shows how to create a zip file\n             <code>\n             using System;\n             using System.IO;\n             \n             using ICSharpCode.SharpZipLib.Core;\n             using ICSharpCode.SharpZipLib.Zip;\n             \n             class MainClass\n             {\n             \tpublic static void Main(string[] args)\n             \t{\n             \t\tstring[] filenames = Directory.GetFiles(args[0]);\n             \t\tbyte[] buffer = new byte[4096];\n             \t\t\n             \t\tusing ( ZipOutputStream s = new ZipOutputStream(File.Create(args[1])) ) {\n             \t\t\n             \t\t\ts.SetLevel(9); // 0 - store only to 9 - means best compression\n             \t\t\n             \t\t\tforeach (string file in filenames) {\n             \t\t\t\tZipEntry entry = new ZipEntry(file);\n             \t\t\t\ts.PutNextEntry(entry);\n            \n             \t\t\t\tusing (FileStream fs = File.OpenRead(file)) {\n            \t\t\t\t\t\tStreamUtils.Copy(fs, s, buffer);\n             \t\t\t\t}\n             \t\t\t}\n             \t\t}\n             \t}\n             }\t\n             </code>\n             </example>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream\">\n            <summary>\n            A special stream deflating or compressing the bytes that are\n            written to it.  It uses a Deflater to perform actual deflating.<br/>\n            Authors of the original java version : Tom Tromey, Jochen Hoenicke \n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Creates a new DeflaterOutputStream with a default Deflater and default buffer size.\n            </summary>\n            <param name=\"baseOutputStream\">\n            the output stream where deflated output should be written.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.#ctor(System.IO.Stream,ICSharpCode.SharpZipLib.Zip.Compression.Deflater)\">\n            <summary>\n            Creates a new DeflaterOutputStream with the given Deflater and\n            default buffer size.\n            </summary>\n            <param name=\"baseOutputStream\">\n            the output stream where deflated output should be written.\n            </param>\n            <param name=\"deflater\">\n            the underlying deflater.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.#ctor(System.IO.Stream,ICSharpCode.SharpZipLib.Zip.Compression.Deflater,System.Int32)\">\n            <summary>\n            Creates a new DeflaterOutputStream with the given Deflater and\n            buffer size.\n            </summary>\n            <param name=\"baseOutputStream\">\n            The output stream where deflated output is written.\n            </param>\n            <param name=\"deflater\">\n            The underlying deflater to use\n            </param>\n            <param name=\"bufferSize\">\n            The buffer size to use when deflating\n            </param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            bufsize is less than or equal to zero.\n            </exception>\n            <exception cref=\"T:System.ArgumentException\">\n            baseOutputStream does not support writing\n            </exception>\n            <exception cref=\"T:System.ArgumentNullException\">\n            deflater instance is null\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Finish\">\n            <summary>\n            Finishes the stream by calling finish() on the deflater. \n            </summary>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            Not all input is deflated\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.EncryptBlock(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Encrypt a block of data\n            </summary>\n            <param name=\"buffer\">\n            Data to encrypt.  NOTE the original contents of the buffer are lost\n            </param>\n            <param name=\"offset\">\n            Offset of first byte in buffer to encrypt\n            </param>\n            <param name=\"length\">\n            Number of bytes in buffer to encrypt\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.InitializePassword(System.String)\">\n            <summary>\n            Initializes encryption keys based on given password\n            </summary>\n            <param name=\"password\">The password.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Deflate\">\n            <summary>\n            Deflates everything in the input buffers.  This will call\n            <code>def.deflate()</code> until all bytes from the input buffers\n            are processed.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            Sets the current position of this stream to the given value. Not supported by this class!\n            </summary>\n            <param name=\"offset\">The offset relative to the <paramref name=\"origin\"/> to seek.</param>\n            <param name=\"origin\">The <see cref=\"T:System.IO.SeekOrigin\"/> to seek from.</param>\n            <returns>The new position in the stream.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.SetLength(System.Int64)\">\n            <summary>\n            Sets the length of this stream to the given value. Not supported by this class!\n            </summary>\n            <param name=\"value\">The new stream length.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.ReadByte\">\n            <summary>\n            Read a byte from stream advancing position by one\n            </summary>\n            <returns>The byte read cast to an int.  THe value is -1 if at the end of the stream.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read a block of bytes from stream\n            </summary>\n            <param name=\"buffer\">The buffer to store read data in.</param>\n            <param name=\"offset\">The offset to start storing at.</param>\n            <param name=\"count\">The maximum number of bytes to read.</param>\n            <returns>The actual number of bytes read.  Zero if end of stream is detected.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)\">\n            <summary>\n            Asynchronous reads are not supported a NotSupportedException is always thrown\n            </summary>\n            <param name=\"buffer\">The buffer to read into.</param>\n            <param name=\"offset\">The offset to start storing data at.</param>\n            <param name=\"count\">The number of bytes to read</param>\n            <param name=\"callback\">The async callback to use.</param>\n            <param name=\"state\">The state to use.</param>\n            <returns>Returns an <see cref=\"T:System.IAsyncResult\"/></returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)\">\n            <summary>\n            Asynchronous writes arent supported, a NotSupportedException is always thrown\n            </summary>\n            <param name=\"buffer\">The buffer to write.</param>\n            <param name=\"offset\">The offset to begin writing at.</param>\n            <param name=\"count\">The number of bytes to write.</param>\n            <param name=\"callback\">The <see cref=\"T:System.AsyncCallback\"/> to use.</param>\n            <param name=\"state\">The state object.</param>\n            <returns>Returns an IAsyncResult.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Flush\">\n            <summary>\n            Flushes the stream by calling <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Flush\">Flush</see> on the deflater and then\n            on the underlying stream.  This ensures that all bytes are flushed.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Close\">\n            <summary>\n            Calls <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Finish\"/> and closes the underlying\n            stream when <see cref=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.IsStreamOwner\"></see> is true.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.WriteByte(System.Byte)\">\n            <summary>\n            Writes a single byte to the compressed output stream.\n            </summary>\n            <param name=\"value\">\n            The byte value.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes bytes from an array to the compressed stream.\n            </summary>\n            <param name=\"buffer\">\n            The byte array\n            </param>\n            <param name=\"offset\">\n            The offset into the byte array where to start.\n            </param>\n            <param name=\"count\">\n            The number of bytes to write.\n            </param>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.buffer_\">\n            <summary>\n            This buffer is used temporarily to retrieve the bytes from the\n            deflater and write them to the underlying output stream.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.deflater_\">\n            <summary>\n            The deflater which is used to deflate the stream.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.baseOutputStream_\">\n            <summary>\n            Base stream the deflater depends on.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.IsStreamOwner\">\n            <summary>\n            Get/set flag indicating ownership of the underlying stream.\n            When the flag is true <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Close\"></see> will close the underlying stream also.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanPatchEntries\">\n            <summary>\n            Allows client to determine if an entry can be patched after its added\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Password\">\n            <summary>\n            Get/set the password used for encryption.\n            </summary>\n            <remarks>When set to null or if the password is empty no encryption is performed</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanRead\">\n            <summary>\n            Gets value indicating stream can be read from\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanSeek\">\n            <summary>\n            Gets a value indicating if seeking is supported for this stream\n            This property always returns false\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanWrite\">\n            <summary>\n            Get value indicating if this stream supports writing\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Length\">\n            <summary>\n            Get current length of stream\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Position\">\n            <summary>\n            Gets the current position within the stream.\n            </summary>\n            <exception cref=\"T:System.NotSupportedException\">Any attempt to set position</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Creates a new Zip output stream, writing a zip archive.\n            </summary>\n            <param name=\"baseOutputStream\">\n            The output stream to which the archive contents are written.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.SetComment(System.String)\">\n            <summary>\n            Set the zip file comment.\n            </summary>\n            <param name=\"comment\">\n            The comment text for the entire archive.\n            </param>\n            <exception name =\"ArgumentOutOfRangeException\">\n            The converted comment is longer than 0xffff bytes.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.SetLevel(System.Int32)\">\n            <summary>\n            Sets the compression level.  The new level will be activated\n            immediately.\n            </summary>\n            <param name=\"level\">The new compression level (1 to 9).</param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Level specified is not supported.\n            </exception>\n            <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Deflater\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.GetLevel\">\n            <summary>\n            Get the current deflater compression level\n            </summary>\n            <returns>The current compression level</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.WriteLeShort(System.Int32)\">\n            <summary>\n            Write an unsigned short in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.WriteLeInt(System.Int32)\">\n            <summary>\n            Write an int in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.WriteLeLong(System.Int64)\">\n            <summary>\n            Write an int in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.PutNextEntry(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Starts a new Zip entry. It automatically closes the previous\n            entry if present.\n            All entry elements bar name are optional, but must be correct if present.\n            If the compression method is stored and the output is not patchable\n            the compression for that entry is automatically changed to deflate level 0\n            </summary>\n            <param name=\"entry\">\n            the entry.\n            </param>\n            <exception cref=\"T:System.ArgumentNullException\">\n            if entry passed is null.\n            </exception>\n            <exception cref=\"T:System.IO.IOException\">\n            if an I/O error occured.\n            </exception>\n            <exception cref=\"T:System.InvalidOperationException\">\n            if stream was finished\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            Too many entries in the Zip file<br/>\n            Entry name is too long<br/>\n            Finish has already been called<br/>\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.CloseEntry\">\n            <summary>\n            Closes the current entry, updating header and footer information as required\n            </summary>\n            <exception cref=\"T:System.IO.IOException\">\n            An I/O error occurs.\n            </exception>\n            <exception cref=\"T:System.InvalidOperationException\">\n            No entry is active.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes the given buffer to the current entry.\n            </summary>\n            <param name=\"buffer\">The buffer containing data to write.</param>\n            <param name=\"offset\">The offset of the first byte to write.</param>\n            <param name=\"count\">The number of bytes to write.</param>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">Archive size is invalid</exception>\n            <exception cref=\"T:System.InvalidOperationException\">No entry is active.</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.Finish\">\n            <summary>\n            Finishes the stream.  This will write the central directory at the\n            end of the zip file and flush the stream.\n            </summary>\n            <remarks>\n            This is automatically called when the stream is closed.\n            </remarks>\n            <exception cref=\"T:System.IO.IOException\">\n            An I/O error occurs.\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            Comment exceeds the maximum length<br/>\n            Entry name exceeds the maximum length\n            </exception>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.entries\">\n            <summary>\n            The entries for the archive.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.crc\">\n            <summary>\n            Used to track the crc of data added to entries.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.curEntry\">\n            <summary>\n            The current entry being added.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.size\">\n            <summary>\n            Used to track the size of data for an entry during writing.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.offset\">\n            <summary>\n            Offset to be recorded for each entry in the central header.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.zipComment\">\n            <summary>\n            Comment for the entire archive recorded in central header.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.patchEntryHeader\">\n            <summary>\n            Flag indicating that header patching is required for the current entry.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.crcPatchPos\">\n            <summary>\n            Position to patch crc\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.sizePatchPos\">\n            <summary>\n            Position to patch size.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.IsFinished\">\n            <summary>\n            Gets a flag value of true if the central header has been added for this archive; false if it has not been added.\n            </summary>\n            <remarks>No further entries can be added once this has been done.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipOutputStream.UseZip64\">\n            <summary>\n            Get / set a value indicating how Zip64 Extension usage is determined when adding entries.\n            </summary>\n            <remarks>Older archivers may not understand Zip64 extensions.\n            If backwards compatability is an issue be careful when adding <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Size\">entries</see> to an archive.\n            Setting this property to off is workable but less desirable as in those circumstances adding a file\n            larger then 4GB will fail.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\">\n            <summary>\n            INameTransform defines how file system names are transformed for use with archives.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.INameTransform.TransformFile(System.String)\">\n            <summary>\n            Given a file name determine the transformed value.\n            </summary>\n            <param name=\"name\">The name to transform.</param>\n            <returns>The transformed file name.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.INameTransform.TransformDirectory(System.String)\">\n            <summary>\n            Given a directory name determine the transformed value.\n            </summary>\n            <param name=\"name\">The name to transform.</param>\n            <returns>The transformed directory name</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants\">\n            <summary>\n            This class contains constants used for deflation.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DEBUGGING\">\n            <summary>\n            Set to true to enable debugging\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.STORED_BLOCK\">\n            <summary>\n            Written to Zip file to identify a stored block\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.STATIC_TREES\">\n            <summary>\n            Identifies static tree in Zip file\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DYN_TREES\">\n            <summary>\n            Identifies dynamic tree in Zip file\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.PRESET_DICT\">\n            <summary>\n            Header flag indicating a preset dictionary for deflation\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DEFAULT_MEM_LEVEL\">\n            <summary>\n            Sets internal buffer sizes for Huffman encoding\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_MATCH\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MIN_MATCH\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_WBITS\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.WSIZE\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.WMASK\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.HASH_BITS\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.HASH_SIZE\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.HASH_MASK\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.HASH_SHIFT\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MIN_LOOKAHEAD\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_DIST\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.PENDING_BUF_SIZE\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DEFLATE_STORED\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DEFLATE_FAST\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.DEFLATE_SLOW\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_BLOCK_SIZE\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.GOOD_LENGTH\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_LAZY\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.NICE_LENGTH\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.MAX_CHAIN\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterConstants.COMPR_FUNC\">\n            <summary>\n            Internal compression engine constant\n            </summary>\t\t\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterPending\">\n            <summary>\n            This class stores the pending output of the Deflater.\n            \n            author of the original java version : Jochen Hoenicke\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterPending.#ctor\">\n            <summary>\n            Construct instance with default buffer size\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">\n            <summary>\n            PathFilter filters directories and files using a form of <see cref=\"T:System.Text.RegularExpressions.Regex\">regular expressions</see>\n            by full path name.\n            See <see cref=\"T:ICSharpCode.SharpZipLib.Core.NameFilter\">NameFilter</see> for more detail on filtering.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.PathFilter.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\"></see>.\n            </summary>\n            <param name=\"filter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.NameFilter\">filter</see> expression to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.PathFilter.IsMatch(System.String)\">\n            <summary>\n            Test a name to see if it matches the filter.\n            </summary>\n            <param name=\"name\">The name to test.</param>\n            <returns>True if the name matches, false otherwise.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter\">\n            <summary>\n            ExtendedPathFilter filters based on name, file size, and the last write time of the file.\n            </summary>\n            <remarks>Provides an example of how to customise filtering.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.#ctor(System.String,System.Int64,System.Int64)\">\n            <summary>\n            Initialise a new instance of ExtendedPathFilter.\n            </summary>\n            <param name=\"filter\">The filter to apply.</param>\n            <param name=\"minSize\">The minimum file size to include.</param>\n            <param name=\"maxSize\">The maximum file size to include.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.#ctor(System.String,System.DateTime,System.DateTime)\">\n            <summary>\n            Initialise a new instance of ExtendedPathFilter.\n            </summary>\n            <param name=\"filter\">The filter to apply.</param>\n            <param name=\"minDate\">The minimum <see cref=\"T:System.DateTime\"/> to include.</param>\n            <param name=\"maxDate\">The maximum <see cref=\"T:System.DateTime\"/> to include.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.#ctor(System.String,System.Int64,System.Int64,System.DateTime,System.DateTime)\">\n            <summary>\n            Initialise a new instance of ExtendedPathFilter.\n            </summary>\n            <param name=\"filter\">The filter to apply.</param>\n            <param name=\"minSize\">The minimum file size to include.</param>\n            <param name=\"maxSize\">The maximum file size to include.</param>\n            <param name=\"minDate\">The minimum <see cref=\"T:System.DateTime\"/> to include.</param>\n            <param name=\"maxDate\">The maximum <see cref=\"T:System.DateTime\"/> to include.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.IsMatch(System.String)\">\n            <summary>\n            Test a filename to see if it matches the filter.\n            </summary>\n            <param name=\"name\">The filename to test.</param>\n            <returns>True if the filter matches, false otherwise.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.MinSize\">\n            <summary>\n            Get/set the minimum size for a file that will match this filter.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.MaxSize\">\n            <summary>\n            Get/set the maximum size for a file that will match this filter.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.MinDate\">\n            <summary>\n            Get/set the minimum <see cref=\"T:System.DateTime\"/> value that will match for this filter.\n            </summary>\n            <remarks>Files with a LastWrite time less than this value are excluded by the filter.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ExtendedPathFilter.MaxDate\">\n            <summary>\n            Get/set the maximum <see cref=\"T:System.DateTime\"/> value that will match for this filter.\n            </summary>\n            <remarks>Files with a LastWrite time greater than this value are excluded by the filter.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.NameAndSizeFilter\">\n            <summary>\n            NameAndSizeFilter filters based on name and file size.\n            </summary>\n            <remarks>A sample showing how filters might be extended.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameAndSizeFilter.#ctor(System.String,System.Int64,System.Int64)\">\n            <summary>\n            Initialise a new instance of NameAndSizeFilter.\n            </summary>\n            <param name=\"filter\">The filter to apply.</param>\n            <param name=\"minSize\">The minimum file size to include.</param>\n            <param name=\"maxSize\">The maximum file size to include.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.NameAndSizeFilter.IsMatch(System.String)\">\n            <summary>\n            Test a filename to see if it matches the filter.\n            </summary>\n            <param name=\"name\">The filename to test.</param>\n            <returns>True if the filter matches, false otherwise.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.NameAndSizeFilter.MinSize\">\n            <summary>\n            Get/set the minimum size for a file that will match this filter.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.NameAndSizeFilter.MaxSize\">\n            <summary>\n            Get/set the maximum size for a file that will match this filter.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2Exception\">\n            <summary>\n            BZip2Exception represents exceptions specific to Bzip2 algorithm\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2Exception.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"info\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2Exception.#ctor\">\n            <summary>\n            Initialise a new instance of BZip2Exception.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2Exception.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of BZip2Exception with its message set to message.\n            </summary>\n            <param name=\"message\">The message describing the error.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2Exception.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initialise an instance of BZip2Exception\n            </summary>\n            <param name=\"message\">A message describing the error.</param>\n            <param name=\"exception\">The exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.GZip.GZipException\">\n            <summary>\n            GZipException represents a Gzip specific exception\t\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"info\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipException.#ctor\">\n            <summary>\n            Initialise a new instance of GZipException\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipException.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of GZipException with its message string.\n            </summary>\n            <param name=\"message\">A <see cref=\"T:System.String\"/> that describes the error.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.GZip.GZipException\"></see>.\n            </summary>\n            <param name=\"message\">A <see cref=\"T:System.String\"/> that describes the error.</param>\n            <param name=\"innerException\">The <see cref=\"T:System.Exception\"/> that caused this exception.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow\">\n            <summary>\n            Contains the output from the Inflation process.\n            We need to have a window so that we can refer backwards into the output stream\n            to repeat stuff.<br/>\n            Author of the original java version : John Leuner\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.Write(System.Int32)\">\n            <summary>\n            Write a byte to this output window\n            </summary>\n            <param name=\"value\">value to write</param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            if window is full\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.Repeat(System.Int32,System.Int32)\">\n            <summary>\n            Append a byte pattern already in the window itself\n            </summary>\n            <param name=\"length\">length of pattern to copy</param>\n            <param name=\"distance\">distance from end of window pattern occurs</param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            If the repeated data overflows the window\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.CopyStored(ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator,System.Int32)\">\n            <summary>\n            Copy from input manipulator to internal window\n            </summary>\n            <param name=\"input\">source of data</param>\n            <param name=\"length\">length of data to copy</param>\n            <returns>the number of bytes copied</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.CopyDict(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Copy dictionary to window\n            </summary>\n            <param name=\"dictionary\">source dictionary</param>\n            <param name=\"offset\">offset of start in source dictionary</param>\n            <param name=\"length\">length of dictionary</param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            If window isnt empty\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.GetFreeSpace\">\n            <summary>\n            Get remaining unfilled space in window\n            </summary>\n            <returns>Number of bytes left in window</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.GetAvailable\">\n            <summary>\n            Get bytes available for output in window\n            </summary>\n            <returns>Number of bytes filled</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.CopyOutput(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Copy contents of window to output\n            </summary>\n            <param name=\"output\">buffer to copy to</param>\n            <param name=\"offset\">offset to start at</param>\n            <param name=\"len\">number of bytes to count</param>\n            <returns>The number of bytes copied</returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            If a window underflow occurs\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.Reset\">\n            <summary>\n            Reset by clearing window so <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.OutputWindow.GetAvailable\">GetAvailable</see> returns 0\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2Constants\">\n            <summary>\n            Defines internal values for both compression and decompression\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.baseBlockSize\">\n            <summary>\n            When multiplied by compression parameter (1-9) gives the block size for compression\n            9 gives the best compresssion but uses the most memory.\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.MAX_ALPHA_SIZE\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.MAX_CODE_LEN\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.RUNA\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.RUNB\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.N_GROUPS\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.G_SIZE\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.N_ITERS\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.MAX_SELECTORS\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.NUM_OVERSHOOT_BYTES\">\n            <summary>\n            Backend constant\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.BZip2.BZip2Constants.rNums\">\n            <summary>\n            Random numbers used to randomise repetitive blocks\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.GZip.GZipOutputStream\">\n             <summary>\n             This filter stream is used to compress a stream into a \"GZIP\" stream.\n             The \"GZIP\" format is described in RFC 1952.\n            \n             author of the original java version : John Leuner\n             </summary>\n             <example> This sample shows how to gzip a file\n             <code>\n             using System;\n             using System.IO;\n             \n             using ICSharpCode.SharpZipLib.GZip;\n             using ICSharpCode.SharpZipLib.Core;\n             \n             class MainClass\n             {\n             \tpublic static void Main(string[] args)\n             \t{\n             \t\t\tusing (Stream s = new GZipOutputStream(File.Create(args[0] + \".gz\")))\n             \t\t\tusing (FileStream fs = File.OpenRead(args[0])) {\n             \t\t\t\tbyte[] writeData = new byte[4096];\n             \t\t\t\tStreamutils.Copy(s, fs, writeData);\n             \t\t\t}\n             \t\t}\n             \t}\n             }\t\n             </code>\n             </example>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.crc\">\n            <summary>\n            CRC-32 value for uncompressed data\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Creates a GzipOutputStream with the default buffer size\n            </summary>\n            <param name=\"baseOutputStream\">\n            The stream to read data (to be compressed) from\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Creates a GZipOutputStream with the specified buffer size\n            </summary>\n            <param name=\"baseOutputStream\">\n            The stream to read data (to be compressed) from\n            </param>\n            <param name=\"size\">\n            Size of the buffer to use\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.SetLevel(System.Int32)\">\n            <summary>\n            Sets the active compression level (1-9).  The new level will be activated\n            immediately.\n            </summary>\n            <param name=\"level\">The compression level to set.</param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Level specified is not supported.\n            </exception>\n            <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Deflater\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.GetLevel\">\n            <summary>\n            Get the current compression level.\n            </summary>\n            <returns>The current compression level.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Write given buffer to output updating crc\n            </summary>\n            <param name=\"buffer\">Buffer to write</param>\n            <param name=\"offset\">Offset of first byte in buf to write</param>\n            <param name=\"count\">Number of bytes to write</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.Close\">\n            <summary>\n            Writes remaining compressed output data to the output stream\n            and closes it.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipOutputStream.Finish\">\n            <summary>\n            Finish compression and write any footer information required to stream\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs\">\n            <summary>\n            Arguments used with KeysRequiredEvent\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs\"></see>\n            </summary>\n            <param name=\"name\">The name of the file for which keys are required.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs.#ctor(System.String,System.Byte[])\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs\"></see>\n            </summary>\n            <param name=\"name\">The name of the file for which keys are required.</param>\n            <param name=\"keyValue\">The current key value.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs.FileName\">\n            <summary>\n            Get the name of the file for which keys are required.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.KeysRequiredEventArgs.Key\">\n            <summary>\n            Get/set the key value\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.TestStrategy\">\n            <summary>\n            The strategy to apply to testing.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestStrategy.FindFirstError\">\n            <summary>\n            Find the first error only.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestStrategy.FindAllErrors\">\n            <summary>\n            Find all possible errors.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.TestOperation\">\n            <summary>\n            The operation in progress reported by a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler\"/> during testing.\n            </summary>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive(System.Boolean)\">TestArchive</seealso>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.Initialising\">\n            <summary>\n            Setting up testing.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.EntryHeader\">\n            <summary>\n            Testing an individual entries header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.EntryData\">\n            <summary>\n            Testing an individual entries data\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.EntryComplete\">\n            <summary>\n            Testing an individual entry has completed.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.MiscellaneousTests\">\n            <summary>\n            Running miscellaneous tests\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.TestOperation.Complete\">\n            <summary>\n            Testing is complete\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.TestStatus\">\n            <summary>\n            Status returned returned by <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler\"/> during testing.\n            </summary>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive(System.Boolean)\">TestArchive</seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.TestStatus.#ctor(ICSharpCode.SharpZipLib.Zip.ZipFile)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.TestStatus\"/>\n            </summary>\n            <param name=\"file\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> this status applies to.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.Operation\">\n            <summary>\n            Get the current <see cref=\"T:ICSharpCode.SharpZipLib.Zip.TestOperation\"/> in progress.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.File\">\n            <summary>\n            Get the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> this status is applicable to.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.Entry\">\n            <summary>\n            Get the current/last entry tested.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.ErrorCount\">\n            <summary>\n            Get the number of errors detected so far.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.BytesTested\">\n            <summary>\n            Get the number of bytes tested so far for the current entry.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.TestStatus.EntryValid\">\n            <summary>\n            Get a value indicating wether the last entry test was valid.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler\">\n            <summary>\n            Delegate invoked during <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive(System.Boolean,ICSharpCode.SharpZipLib.Zip.TestStrategy,ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler)\">testing</see> if supplied indicating current progress and status.\n            </summary>\n            <remarks>If the message is non-null an error has occured.  If the message is null\n            the operation as found in <see cref=\"T:ICSharpCode.SharpZipLib.Zip.TestStatus\">status</see> has started.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.FileUpdateMode\">\n            <summary>\n            The possible ways of <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate\">applying updates</see> to an archive.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FileUpdateMode.Safe\">\n            <summary>\n            Perform all updates on temporary files ensuring that the original file is saved.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.FileUpdateMode.Direct\">\n            <summary>\n            Update the archive directly, which is faster but less safe.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\">\n            <summary>\n            This class represents a Zip archive.  You can ask for the contained\n            entries, or get an input stream for a file entry.  The entry is\n            automatically decompressed.\n            \n            You can also update the archive adding or deleting entries.\n            \n            This class is thread safe for input:  You can open input streams for arbitrary\n            entries in different threads.\n            <br/>\n            <br/>Author of the original java version : Jochen Hoenicke\n            </summary>\n            <example>\n            <code>\n            using System;\n            using System.Text;\n            using System.Collections;\n            using System.IO;\n            \n            using ICSharpCode.SharpZipLib.Zip;\n            \n            class MainClass\n            {\n            \tstatic public void Main(string[] args)\n            \t{\n            \t\tusing (ZipFile zFile = new ZipFile(args[0])) {\n            \t\t\tConsole.WriteLine(\"Listing of : \" + zFile.Name);\n            \t\t\tConsole.WriteLine(\"\");\n            \t\t\tConsole.WriteLine(\"Raw Size    Size      Date     Time     Name\");\n            \t\t\tConsole.WriteLine(\"--------  --------  --------  ------  ---------\");\n            \t\t\tforeach (ZipEntry e in zFile) {\n            \t\t\t\tif ( e.IsFile ) {\n            \t\t\t\t\tDateTime d = e.DateTime;\n            \t\t\t\t\tConsole.WriteLine(\"{0, -10}{1, -10}{2}  {3}   {4}\", e.Size, e.CompressedSize,\n            \t\t\t\t\t\td.ToString(\"dd-MM-yy\"), d.ToString(\"HH:mm\"),\n            \t\t\t\t\t\te.Name);\n            \t\t\t\t}\n            \t\t\t}\n            \t\t}\n            \t}\n            }\n            </code>\n            </example>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipFile.KeysRequired\">\n            <summary>\n            Event handler for handling encryption keys.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.OnKeysRequired(System.String)\">\n            <summary>\n            Handles getting of encryption keys when required.\n            </summary>\n            <param name=\"fileName\">The file for which encryption keys are required.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.#ctor(System.String)\">\n            <summary>\n            Opens a Zip file with the given name for reading.\n            </summary>\n            <param name=\"name\">The name of the file to open.</param>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The file doesn't contain a valid zip archive.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.#ctor(System.IO.FileStream)\">\n            <summary>\n            Opens a Zip file reading the given <see cref=\"T:System.IO.FileStream\"/>.\n            </summary>\n            <param name=\"file\">The <see cref=\"T:System.IO.FileStream\"/> to read archive data from.</param>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The file doesn't contain a valid zip archive.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.#ctor(System.IO.Stream)\">\n            <summary>\n            Opens a Zip file reading the given <see cref=\"T:System.IO.Stream\"/>.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to read archive data from.</param>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The file doesn't contain a valid zip archive.<br/>\n            The stream provided cannot seek\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.#ctor\">\n            <summary>\n            Initialises a default <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> instance with no entries and no file storage.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Finalize\">\n            <summary>\n            Finalize this instance.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Close\">\n            <summary>\n            Closes the ZipFile.  If the stream is <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.IsStreamOwner\">owned</see> then this also closes the underlying input stream.\n            Once closed, no further instance methods should be called.\n            </summary>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Create(System.String)\">\n            <summary>\n            Create a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> whose data will be stored in a file.\n            </summary>\n            <param name=\"fileName\">The name of the archive to create.</param>\n            <returns>Returns the newly created <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Create(System.IO.Stream)\">\n            <summary>\n            Create a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> whose data will be stored on a stream.\n            </summary>\n            <param name=\"outStream\">The stream providing data storage.</param>\n            <returns>Returns the newly created <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetEnumerator\">\n            <summary>\n            Gets an enumerator for the Zip entries in this Zip file.\n            </summary>\n            <returns>Returns an <see cref=\"T:System.Collections.IEnumerator\"/> for this archive.</returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The Zip file has been closed.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.FindEntry(System.String,System.Boolean)\">\n            <summary>\n            Return the index of the entry with a matching name\n            </summary>\n            <param name=\"name\">Entry name to find</param>\n            <param name=\"ignoreCase\">If true the comparison is case insensitive</param>\n            <returns>The index position of the matching entry or -1 if not found</returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The Zip file has been closed.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetEntry(System.String)\">\n            <summary>\n            Searches for a zip entry in this archive with the given name.\n            String comparisons are case insensitive\n            </summary>\n            <param name=\"name\">\n            The name to find. May contain directory components separated by slashes ('/').\n            </param>\n            <returns>\n            A clone of the zip entry, or null if no entry with that name exists.\n            </returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The Zip file has been closed.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Gets an input stream for reading the given zip entry data in an uncompressed form.\n            Normally the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> should be an entry returned by GetEntry().\n            </summary>\n            <param name=\"entry\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> to obtain a data <see cref=\"T:System.IO.Stream\"/> for</param>\n            <returns>An input <see cref=\"T:System.IO.Stream\"/> containing data for this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/></returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The ZipFile has already been closed\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The compression method for the entry is unknown\n            </exception>\n            <exception cref=\"T:System.IndexOutOfRangeException\">\n            The entry is not found in the ZipFile\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream(System.Int64)\">\n            <summary>\n            Creates an input stream reading a zip entry\n            </summary>\n            <param name=\"entryIndex\">The index of the entry to obtain an input stream for.</param>\n            <returns>\n            An input <see cref=\"T:System.IO.Stream\"/> containing data for this <paramref name=\"entryIndex\"/>\n            </returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The ZipFile has already been closed\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The compression method for the entry is unknown\n            </exception>\n            <exception cref=\"T:System.IndexOutOfRangeException\">\n            The entry is not found in the ZipFile\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive(System.Boolean)\">\n            <summary>\n            Test an archive for integrity/validity\n            </summary>\n            <param name=\"testData\">Perform low level data Crc check</param>\n            <returns>true if all tests pass, false otherwise</returns>\n            <remarks>Testing will terminate on the first error found.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive(System.Boolean,ICSharpCode.SharpZipLib.Zip.TestStrategy,ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler)\">\n            <summary>\n            Test an archive for integrity/validity\n            </summary>\n            <param name=\"testData\">Perform low level data Crc check</param>\n            <param name=\"strategy\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.TestStrategy\"></see> to apply.</param>\n            <param name=\"resultHandler\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipTestResultHandler\"></see> handler to call during testing.</param>\n            <returns>true if all tests pass, false otherwise</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.TestLocalHeader(ICSharpCode.SharpZipLib.Zip.ZipEntry,ICSharpCode.SharpZipLib.Zip.ZipFile.HeaderTest)\">\n            <summary>\n            Test a local header against that provided from the central directory\n            </summary>\n            <param name=\"entry\">\n            The entry to test against\n            </param>\n            <param name=\"tests\">The type of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.HeaderTest\">tests</see> to carry out.</param>\n            <returns>The offset of the entries data in the file</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate(ICSharpCode.SharpZipLib.Zip.IArchiveStorage,ICSharpCode.SharpZipLib.Zip.IDynamicDataSource)\">\n            <summary>\n            Begin updating this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> archive.\n            </summary>\n            <param name=\"archiveStorage\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IArchiveStorage\">archive storage</see> for use during the update.</param>\n            <param name=\"dataSource\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IDynamicDataSource\">data source</see> to utilise during updating.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate(ICSharpCode.SharpZipLib.Zip.IArchiveStorage)\">\n            <summary>\n            Begin updating to this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> archive.\n            </summary>\n            <param name=\"archiveStorage\">The storage to use during the update.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate\">\n            <summary>\n            Begin updating this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> archive.\n            </summary>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate(ICSharpCode.SharpZipLib.Zip.IArchiveStorage)\"/>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate\"></seealso>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.AbortUpdate\"></seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate\">\n            <summary>\n            Commit current updates, updating this archive.\n            </summary>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate\"></seealso>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.AbortUpdate\"></seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.AbortUpdate\">\n            <summary>\n            Abort updating leaving the archive unchanged.\n            </summary>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate\"></seealso>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate\"></seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.SetComment(System.String)\">\n            <summary>\n            Set the file comment to be recorded when the current update is <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate\">commited</see>.\n            </summary>\n            <param name=\"comment\">The comment to record.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(System.String,ICSharpCode.SharpZipLib.Zip.CompressionMethod,System.Boolean)\">\n            <summary>\n            Add a new entry to the archive.\n            </summary>\n            <param name=\"fileName\">The name of the file to add.</param>\n            <param name=\"compressionMethod\">The compression method to use.</param>\n            <param name=\"useUnicodeText\">Ensure Unicode text is used for name and comment for this entry.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(System.String,ICSharpCode.SharpZipLib.Zip.CompressionMethod)\">\n            <summary>\n            Add a new entry to the archive.\n            </summary>\n            <param name=\"fileName\">The name of the file to add.</param>\n            <param name=\"compressionMethod\">The compression method to use.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(System.String)\">\n            <summary>\n            Add a file to the archive.\n            </summary>\n            <param name=\"fileName\">The name of the file to add.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(ICSharpCode.SharpZipLib.Zip.IStaticDataSource,System.String)\">\n            <summary>\n            Add a file entry with data.\n            </summary>\n            <param name=\"dataSource\">The source of the data for this entry.</param>\n            <param name=\"entryName\">The name to give to the entry.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(ICSharpCode.SharpZipLib.Zip.IStaticDataSource,System.String,ICSharpCode.SharpZipLib.Zip.CompressionMethod)\">\n            <summary>\n            Add a file entry with data.\n            </summary>\n            <param name=\"dataSource\">The source of the data for this entry.</param>\n            <param name=\"entryName\">The name to give to the entry.</param>\n            <param name=\"compressionMethod\">The compression method to use.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(ICSharpCode.SharpZipLib.Zip.IStaticDataSource,System.String,ICSharpCode.SharpZipLib.Zip.CompressionMethod,System.Boolean)\">\n            <summary>\n            Add a file entry with data.\n            </summary>\n            <param name=\"dataSource\">The source of the data for this entry.</param>\n            <param name=\"entryName\">The name to give to the entry.</param>\n            <param name=\"compressionMethod\">The compression method to use.</param>\n            <param name=\"useUnicodeText\">Ensure Unicode text is used for name and comments for this entry.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Add(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Add a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> that contains no data.\n            </summary>\n            <param name=\"entry\">The entry to add.</param>\n            <remarks>This can be used to add directories, volume labels, or empty file entries.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.AddDirectory(System.String)\">\n            <summary>\n            Add a directory entry to the archive.\n            </summary>\n            <param name=\"directoryName\">The directory to add.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Delete(System.String)\">\n            <summary>\n            Delete an entry by name\n            </summary>\n            <param name=\"fileName\">The filename to delete</param>\n            <returns>True if the entry was found and deleted; false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Delete(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Delete a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> from the archive.\n            </summary>\n            <param name=\"entry\">The entry to delete.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.WriteLEUshort(System.UInt16)\">\n            <summary>\n            Write an unsigned short in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.WriteLEInt(System.Int32)\">\n            <summary>\n            Write an int in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.WriteLEUint(System.UInt32)\">\n            <summary>\n            Write an unsigned int in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.WriteLeLong(System.Int64)\">\n            <summary>\n            Write a long in little endian byte order.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetBuffer\">\n            <summary>\n            Get a raw memory buffer.\n            </summary>\n            <returns>Returns a raw memory buffer.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetDescriptorSize(ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate)\">\n            <summary>\n            Get the size of the source descriptor for a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate\"/>.\n            </summary>\n            <param name=\"update\">The update to get the size for.</param>\n            <returns>The descriptor size, zero if there isnt one.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.GetOutputStream(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Get an output stream for the specified <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/>\n            </summary>\n            <param name=\"entry\">The entry to get an output stream for.</param>\n            <returns>The output stream obtained for the entry.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Dispose(System.Boolean)\">\n            <summary>\n            Releases the unmanaged resources used by the this instance and optionally releases the managed resources.\n            </summary>\n            <param name=\"disposing\">true to release both managed and unmanaged resources;\n            false to release only unmanaged resources.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ReadLEUshort\">\n            <summary>\n            Read an unsigned short in little endian byte order.\n            </summary>\n            <returns>Returns the value read.</returns>\n            <exception cref=\"T:System.IO.EndOfStreamException\">\n            The stream ends prematurely\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ReadLEUint\">\n            <summary>\n            Read a uint in little endian byte order.\n            </summary>\n            <returns>Returns the value read.</returns>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n            <exception cref=\"T:System.IO.EndOfStreamException\">\n            The file ends prematurely\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries\">\n            <summary>\n            Search for and read the central directory of a zip file filling the entries array.\n            </summary>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The central directory is malformed or cannot be found\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.LocateEntry(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Locate the data for a given entry.\n            </summary>\n            <returns>\n            The start offset of the data.\n            </returns>\n            <exception cref=\"T:System.IO.EndOfStreamException\">\n            The stream ends prematurely\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The local header signature is invalid, the entry and central header file name lengths are different\n            or the local and entry compression methods dont match\n            </exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.Key\">\n            <summary>\n            Get/set the encryption key value.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.Password\">\n            <summary>\n            Password to be used for encrypting/decrypting files.\n            </summary>\n            <remarks>Set to null if no password is required.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.HaveKeys\">\n            <summary>\n            Get a value indicating wether encryption keys are currently available.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.IsStreamOwner\">\n            <summary>\n            Get/set a flag indicating if the underlying stream is owned by the ZipFile instance.\n            If the flag is true then the stream will be closed when <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.Close\">Close</see> is called.\n            </summary>\n            <remarks>\n            The default value is true in all cases.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.IsEmbeddedArchive\">\n            <summary>\n            Get a value indicating wether\n            this archive is embedded in another file or not.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.IsNewArchive\">\n            <summary>\n            Get a value indicating that this archive is a new one.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipFileComment\">\n            <summary>\n            Gets the comment for the zip file.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.Name\">\n            <summary>\n            Gets the name of this zip file.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.Size\">\n            <summary>\n            Gets the number of entries in this zip file.\n            </summary>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The Zip file has been closed.\n            </exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.Count\">\n            <summary>\n            Get the number of entries contained in this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/>.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.EntryByIndex(System.Int32)\">\n            <summary>\n            Indexer property for ZipEntries\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.NameTransform\">\n            <summary>\n            Get / set the <see cref=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\"/> to apply to names when updating.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.EntryFactory\">\n            <summary>\n            Get/set the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IEntryFactory\"/> used to generate <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> values\n            during updates.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.BufferSize\">\n            <summary>\n            Get /set the buffer size to be used when updating this zip file.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.IsUpdating\">\n            <summary>\n            Get a value indicating an update has <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate\">been started</see>.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UseZip64\">\n            <summary>\n            Get / set a value indicating how Zip64 Extension usage is determined when adding entries.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.KeysRequiredEventHandler\">\n            <summary>\n            Delegate for handling keys/password setting during compresion/decompression.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.UpdateCommand\">\n            <summary>\n            The kind of update to apply.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.UpdateComparer\">\n            <summary>\n            Class used to sort updates.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.UpdateComparer.Compare(System.Object,System.Object)\">\n            <summary>\n            Compares two objects and returns a value indicating whether one is \n            less than, equal to or greater than the other.\n            </summary>\n            <param name=\"x\">First object to compare</param>\n            <param name=\"y\">Second object to compare.</param>\n            <returns>Compare result.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate\">\n            <summary>\n            Represents a pending update to a Zip file.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.#ctor(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Copy an existing entry.\n            </summary>\n            <param name=\"entry\">The existing entry to copy.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.Entry\">\n            <summary>\n            Get the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for this update.\n            </summary>\n            <remarks>This is the source or original entry.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.OutEntry\">\n            <summary>\n            Get the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> that will be written to the updated/new file.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.Command\">\n            <summary>\n            Get the command for this update.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.Filename\">\n            <summary>\n            Get the filename if any for this update.  Null if none exists.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.SizePatchOffset\">\n            <summary>\n            Get/set the location of the size patch for this update.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipUpdate.CrcPatchOffset\">\n            <summary>\n            Get /set the location of the crc patch for this update.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString\">\n            <summary>\n            Represents a string from a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> which is stored as an array of bytes.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.#ctor(System.String)\">\n            <summary>\n            Initialise a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString\"/> with a string.\n            </summary>\n            <param name=\"comment\">The textual string form.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.#ctor(System.Byte[])\">\n            <summary>\n            Initialise a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString\"/> using a string in its binary 'raw' form.\n            </summary>\n            <param name=\"rawString\"></param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.Reset\">\n            <summary>\n            Reset the comment to its initial state.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.op_Implicit(ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString)~System.String\">\n            <summary>\n            Implicit conversion of comment to a string.\n            </summary>\n            <param name=\"zipString\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString\"/> to convert to a string.</param>\n            <returns>The textual equivalent for the input value.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.IsSourceString\">\n            <summary>\n            Get a value indicating the original source of data for this instance.\n            True if the source was a string; false if the source was binary data.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.RawLength\">\n            <summary>\n            Get the length of the comment when represented as raw bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipString.RawComment\">\n            <summary>\n            Get the comment in its 'raw' form as plain bytes.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.ZipEntryEnumerator\">\n            <summary>\n            An <see cref=\"T:System.Collections.IEnumerator\">enumerator</see> for <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">Zip entries</see>\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream\">\n            <summary>\n            An <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream\"/> is a stream that you can write uncompressed data\n            to and flush, but cannot read, seek or do anything else to.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.Close\">\n            <summary>\n            Close this stream instance.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.Flush\">\n            <summary>\n            Write any buffered data to underlying storage.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.CanRead\">\n            <summary>\n            Gets a value indicating whether the current stream supports reading.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.CanWrite\">\n            <summary>\n            Gets a value indicating whether the current stream supports writing.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.CanSeek\">\n            <summary>\n            Gets a value indicating whether the current stream supports seeking.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.Length\">\n            <summary>\n            Get the length in bytes of the stream.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipFile.UncompressedStream.Position\">\n            <summary>\n            Gets or sets the position within the current stream.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream\">\n            <summary>\n            A <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream\"/> is an <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream\"/>\n            whose data is only a part or subsection of a file.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream\">\n             <summary>\n             This filter stream is used to decompress data compressed using the \"deflate\"\n             format. The \"deflate\" format is described in RFC 1951.\n            \n             This stream may form the basis for other decompression filters, such\n             as the <see cref=\"T:ICSharpCode.SharpZipLib.GZip.GZipInputStream\">GZipInputStream</see>.\n            \n             Author of the original java version : John Leuner.\n             </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Create an InflaterInputStream with the default decompressor\n            and a default buffer size of 4KB.\n            </summary>\n            <param name = \"baseInputStream\">\n            The InputStream to read bytes from\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.#ctor(System.IO.Stream,ICSharpCode.SharpZipLib.Zip.Compression.Inflater)\">\n            <summary>\n            Create an InflaterInputStream with the specified decompressor\n            and a default buffer size of 4KB.\n            </summary>\n            <param name = \"baseInputStream\">\n            The source of input data\n            </param>\n            <param name = \"inf\">\n            The decompressor used to decompress data read from baseInputStream\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.#ctor(System.IO.Stream,ICSharpCode.SharpZipLib.Zip.Compression.Inflater,System.Int32)\">\n            <summary>\n            Create an InflaterInputStream with the specified decompressor\n            and the specified buffer size.\n            </summary>\n            <param name = \"baseInputStream\">\n            The InputStream to read bytes from\n            </param>\n            <param name = \"inflater\">\n            The decompressor to use\n            </param>\n            <param name = \"bufferSize\">\n            Size of the buffer to use\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Skip(System.Int64)\">\n            <summary>\n            Skip specified number of bytes of uncompressed data\n            </summary>\n            <param name=\"count\">\n            Number of bytes to skip\n            </param>\n            <returns>\n            The number of bytes skipped, zero if the end of \n            stream has been reached\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Number of bytes to skip is less than zero\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.StopDecrypting\">\n            <summary>\n            Clear any cryptographic state.\n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Fill\">\n            <summary>\n            Fills the buffer with more data to decompress.\n            </summary>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            Stream ends early\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Flush\">\n            <summary>\n            Flushes the baseInputStream\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            Sets the position within the current stream\n            Always throws a NotSupportedException\n            </summary>\n            <param name=\"offset\">The relative offset to seek to.</param>\n            <param name=\"origin\">The <see cref=\"T:System.IO.SeekOrigin\"/> defining where to seek from.</param>\n            <returns>The new position in the stream.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.SetLength(System.Int64)\">\n            <summary>\n            Set the length of the current stream\n            Always throws a NotSupportedException\n            </summary>\n            <param name=\"value\">The new length value for the stream.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes a sequence of bytes to stream and advances the current position\n            This method always throws a NotSupportedException\n            </summary>\n            <param name=\"buffer\">Thew buffer containing data to write.</param>\n            <param name=\"offset\">The offset of the first byte to write.</param>\n            <param name=\"count\">The number of bytes to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.WriteByte(System.Byte)\">\n            <summary>\n            Writes one byte to the current stream and advances the current position\n            Always throws a NotSupportedException\n            </summary>\n            <param name=\"value\">The byte to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)\">\n            <summary>\n            Entry point to begin an asynchronous write.  Always throws a NotSupportedException.\n            </summary>\n            <param name=\"buffer\">The buffer to write data from</param>\n            <param name=\"offset\">Offset of first byte to write</param>\n            <param name=\"count\">The maximum number of bytes to write</param>\n            <param name=\"callback\">The method to be called when the asynchronous write operation is completed</param>\n            <param name=\"state\">A user-provided object that distinguishes this particular asynchronous write request from other requests</param>\n            <returns>An <see cref=\"T:System.IAsyncResult\">IAsyncResult</see> that references the asynchronous write</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Close\">\n            <summary>\n            Closes the input stream.  When <see cref=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.IsStreamOwner\"></see>\n            is true the underlying stream is also closed.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Reads decompressed data into the provided buffer byte array\n            </summary>\n            <param name=\"buffer\">\n            The array to read and decompress data into\n            </param>\n            <param name=\"offset\">\n            The offset indicating where the data should be placed\n            </param>\n            <param name=\"count\">\n            The number of bytes to decompress\n            </param>\n            <returns>The number of bytes read.  Zero signals the end of stream</returns>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            Inflater needs a dictionary\n            </exception>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.inf\">\n            <summary>\n            Decompressor for this stream\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.inputBuffer\">\n            <summary>\n            <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer\">Input buffer</see> for this stream.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.baseInputStream\">\n            <summary>\n            Base stream the inflater reads from.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.csize\">\n            <summary>\n            The compressed size\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.isClosed\">\n            <summary>\n            Flag indicating wether this instance has been closed or not.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.isStreamOwner\">\n            <summary>\n            Flag indicating wether this instance is designated the stream owner.\n            When closing if this flag is true the underlying stream is closed.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.IsStreamOwner\">\n            <summary>\n            Get/set flag indicating ownership of underlying stream.\n            When the flag is true <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Close\"/> will close the underlying stream also.\n            </summary>\n            <remarks>\n            The default value is true.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Available\">\n            <summary>\n            Returns 0 once the end of the stream (EOF) has been reached.\n            Otherwise returns 1.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.CanRead\">\n            <summary>\n            Gets a value indicating whether the current stream supports reading\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.CanSeek\">\n            <summary>\n            Gets a value of false indicating seeking is not supported for this stream.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.CanWrite\">\n            <summary>\n            Gets a value of false indicating that this stream is not writeable.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Length\">\n            <summary>\n            A value representing the length of the stream in bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Position\">\n            <summary>\n            The current position within the stream.\n            Throws a NotSupportedException when attempting to set the position\n            </summary>\n            <exception cref=\"T:System.NotSupportedException\">Attempting to set the position</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream.#ctor(System.IO.Stream,System.Int64,System.Int64)\">\n            <summary>\n            Initialise a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream\"/> class.\n            </summary>\n            <param name=\"baseStream\">The underlying stream to use for IO.</param>\n            <param name=\"start\">The start of the partial data.</param>\n            <param name=\"length\">The length of the partial data.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream.SkipBytes(System.Int64)\">\n            <summary>\n            Skip the specified number of input bytes.\n            </summary>\n            <param name=\"count\">The maximum number of input bytes to skip.</param>\n            <returns>The actuial number of input bytes skipped.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream.ReadByte\">\n            <summary>\n            Read a byte from this stream.\n            </summary>\n            <returns>Returns the byte read or -1 on end of stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream.Close\">\n            <summary>\n            Close this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile.PartialInputStream\">partial input stream</see>.\n            </summary>\n            <remarks>\n            The underlying stream is not closed.  Close the parent ZipFile class to do that.\n            </remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.IStaticDataSource\">\n            <summary>\n            Provides a static way to obtain a source of data for an entry.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IStaticDataSource.GetSource\">\n            <summary>\n            Get a source of data by creating a new stream.\n            </summary>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> to use for compression input.</returns>\n            <remarks>Ideally a new stream is created and opened to achieve this, to avoid locking problems.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.IDynamicDataSource\">\n            <summary>\n            Represents a source of data that can dynamically provide\n            multiple <see cref=\"T:System.IO.Stream\">data sources</see> based on the parameters passed.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IDynamicDataSource.GetSource(ICSharpCode.SharpZipLib.Zip.ZipEntry,System.String)\">\n            <summary>\n            Get a data source.\n            </summary>\n            <param name=\"entry\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> to get a source for.</param>\n            <param name=\"name\">The name for data if known.</param>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> to use for compression input.</returns>\n            <remarks>Ideally a new stream is created and opened to achieve this, to avoid locking problems.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.StaticDiskDataSource\">\n            <summary>\n            Default implementation of a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IStaticDataSource\"/> for use with files stored on disk.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.StaticDiskDataSource.#ctor(System.String)\">\n            <summary>\n            Initialise a new instnace of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.StaticDiskDataSource\"/>\n            </summary>\n            <param name=\"fileName\">The name of the file to obtain data from.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.StaticDiskDataSource.GetSource\">\n            <summary>\n            Get a <see cref=\"T:System.IO.Stream\"/> providing data.\n            </summary>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> provising data.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.DynamicDiskDataSource\">\n            <summary>\n            Default implementation of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IDynamicDataSource\"/> for files stored on disk.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DynamicDiskDataSource.#ctor\">\n            <summary>\n            Initialise a default instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.DynamicDiskDataSource\"/>.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DynamicDiskDataSource.GetSource(ICSharpCode.SharpZipLib.Zip.ZipEntry,System.String)\">\n            <summary>\n            Get a <see cref=\"T:System.IO.Stream\"/> providing data for an entry.\n            </summary>\n            <param name=\"entry\">The entry to provide data for.</param>\n            <param name=\"name\">The file name for data if known.</param>\n            <returns>Returns a stream providing data; or null if not available</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.IArchiveStorage\">\n            <summary>\n            Defines facilities for data storage when updating Zip Archives.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.GetTemporaryOutput\">\n            <summary>\n            Get an empty <see cref=\"T:System.IO.Stream\"/> that can be used for temporary output.\n            </summary>\n            <returns>Returns a temporary output <see cref=\"T:System.IO.Stream\"/></returns>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.ConvertTemporaryToFinal\"></seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.ConvertTemporaryToFinal\">\n            <summary>\n            Convert a temporary output stream to a final stream.\n            </summary>\n            <returns>The resulting final <see cref=\"T:System.IO.Stream\"/></returns>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.GetTemporaryOutput\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.MakeTemporaryCopy(System.IO.Stream)\">\n            <summary>\n            Make a temporary copy of the original stream.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to copy.</param>\n            <returns>Returns a temporary output <see cref=\"T:System.IO.Stream\"/> that is a copy of the input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.OpenForDirectUpdate(System.IO.Stream)\">\n            <summary>\n            Return a stream suitable for performing direct updates on the original source.\n            </summary>\n            <param name=\"stream\">The current stream.</param>\n            <returns>Returns a stream suitable for direct updating.</returns>\n            <remarks>This may be the current stream passed.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.Dispose\">\n            <summary>\n            Dispose of this instance.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.IArchiveStorage.UpdateMode\">\n            <summary>\n            Get the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FileUpdateMode\"/> to apply during updates.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage\">\n            <summary>\n            An abstract <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IArchiveStorage\"/> suitable for extension by inheritance.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.#ctor(ICSharpCode.SharpZipLib.Zip.FileUpdateMode)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage\"/> class.\n            </summary>\n            <param name=\"updateMode\">The update mode.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.GetTemporaryOutput\">\n            <summary>\n            Gets a temporary output <see cref=\"T:System.IO.Stream\"/>\n            </summary>\n            <returns>Returns the temporary output stream.</returns>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.ConvertTemporaryToFinal\"></seealso>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.ConvertTemporaryToFinal\">\n            <summary>\n            Converts the temporary <see cref=\"T:System.IO.Stream\"/> to its final form.\n            </summary>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> that can be used to read\n            the final storage for the archive.</returns>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.GetTemporaryOutput\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.MakeTemporaryCopy(System.IO.Stream)\">\n            <summary>\n            Make a temporary copy of a <see cref=\"T:System.IO.Stream\"/>.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to make a copy of.</param>\n            <returns>Returns a temporary output <see cref=\"T:System.IO.Stream\"/> that is a copy of the input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.OpenForDirectUpdate(System.IO.Stream)\">\n            <summary>\n            Return a stream suitable for performing direct updates on the original source.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to open for direct update.</param>\n            <returns>Returns a stream suitable for direct updating.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.Dispose\">\n            <summary>\n            Disposes this instance.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.BaseArchiveStorage.UpdateMode\">\n            <summary>\n            Gets the update mode applicable.\n            </summary>\n            <value>The update mode.</value>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage\">\n            <summary>\n            An <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IArchiveStorage\"/> implementation suitable for hard disks.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.#ctor(ICSharpCode.SharpZipLib.Zip.ZipFile,ICSharpCode.SharpZipLib.Zip.FileUpdateMode)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage\"/> class.\n            </summary>\n            <param name=\"file\">The file.</param>\n            <param name=\"updateMode\">The update mode.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.#ctor(ICSharpCode.SharpZipLib.Zip.ZipFile)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage\"/> class.\n            </summary>\n            <param name=\"file\">The file.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.GetTemporaryOutput\">\n            <summary>\n            Gets a temporary output <see cref=\"T:System.IO.Stream\"/> for performing updates on.\n            </summary>\n            <returns>Returns the temporary output stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.ConvertTemporaryToFinal\">\n            <summary>\n            Converts a temporary <see cref=\"T:System.IO.Stream\"/> to its final form.\n            </summary>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> that can be used to read\n            the final storage for the archive.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.MakeTemporaryCopy(System.IO.Stream)\">\n            <summary>\n            Make a temporary copy of a stream.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to copy.</param>\n            <returns>Returns a temporary output <see cref=\"T:System.IO.Stream\"/> that is a copy of the input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.OpenForDirectUpdate(System.IO.Stream)\">\n            <summary>\n            Return a stream suitable for performing direct updates on the original source.\n            </summary>\n            <param name=\"current\">The current stream.</param>\n            <returns>Returns a stream suitable for direct updating.</returns>\n            <remarks>If the <paramref name=\"current\"/> stream is not null this is used as is.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.Dispose\">\n            <summary>\n            Disposes this instance.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage\">\n            <summary>\n            An <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IArchiveStorage\"/> implementation suitable for in memory streams.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.#ctor(ICSharpCode.SharpZipLib.Zip.FileUpdateMode)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage\"/> class.\n            </summary>\n            <param name=\"updateMode\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.FileUpdateMode\"/> to use</param>\n            <remarks>This constructor is for testing as memory streams dont really require safe mode.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.GetTemporaryOutput\">\n            <summary>\n            Gets the temporary output <see cref=\"T:System.IO.Stream\"/>\n            </summary>\n            <returns>Returns the temporary output stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.ConvertTemporaryToFinal\">\n            <summary>\n            Converts the temporary <see cref=\"T:System.IO.Stream\"/> to its final form.\n            </summary>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> that can be used to read\n            the final storage for the archive.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.MakeTemporaryCopy(System.IO.Stream)\">\n            <summary>\n            Make a temporary copy of the original stream.\n            </summary>\n            <param name=\"stream\">The <see cref=\"T:System.IO.Stream\"/> to copy.</param>\n            <returns>Returns a temporary output <see cref=\"T:System.IO.Stream\"/> that is a copy of the input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.OpenForDirectUpdate(System.IO.Stream)\">\n            <summary>\n            Return a stream suitable for performing direct updates on the original source.\n            </summary>\n            <param name=\"stream\">The original source stream</param>\n            <returns>Returns a stream suitable for direct updating.</returns>\n            <remarks>If the <paramref name=\"stream\"/> passed is not null this is used;\n            otherwise a new <see cref=\"T:System.IO.MemoryStream\"/> is returned.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.Dispose\">\n            <summary>\n            Disposes this instance.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.FinalStream\">\n            <summary>\n            Get the stream returned by <see cref=\"M:ICSharpCode.SharpZipLib.Zip.MemoryArchiveStorage.ConvertTemporaryToFinal\"/> if this was in fact called.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Checksums.Crc32\">\n             <summary>\n             Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:\n             x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.\n            \n             Polynomials over GF(2) are represented in binary, one bit per coefficient,\n             with the lowest powers in the most significant bit.  Then adding polynomials\n             is just exclusive-or, and multiplying a polynomial by x is a right shift by\n             one.  If we call the above polynomial p, and represent a byte as the\n             polynomial q, also with the lowest power in the most significant bit (so the\n             byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,\n             where a mod b means the remainder after dividing a by b.\n            \n             This calculation is done using the shift-register method of multiplying and\n             taking the remainder.  The register is initialized to zero, and for each\n             incoming bit, x^32 is added mod p to the register if the bit is a one (where\n             x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by\n             x (which is shifting right by one and adding x^32 mod p if the bit shifted\n             out is a one).  We start with the highest power (least significant bit) of\n             q and repeat for all eight bits of q.\n            \n             The table is simply the CRC of all possible eight bit values.  This is all\n             the information needed to generate CRC's on data a byte at a time for all\n             combinations of CRC register values and incoming bytes.\n             </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Checksums.IChecksum\">\n            <summary>\n            Interface to compute a data checksum used by checked input/output streams.\n            A data checksum can be updated by one byte or with a byte array. After each\n            update the value of the current checksum can be returned by calling\n            <code>getValue</code>. The complete checksum object can also be reset\n            so it can be used again with new data.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.IChecksum.Reset\">\n            <summary>\n            Resets the data checksum as if no update was ever called.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.IChecksum.Update(System.Int32)\">\n            <summary>\n            Adds one byte to the data checksum.\n            </summary>\n            <param name = \"value\">\n            the data value to add. The high byte of the int is ignored.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.IChecksum.Update(System.Byte[])\">\n            <summary>\n            Updates the data checksum with the bytes taken from the array.\n            </summary>\n            <param name=\"buffer\">\n            buffer an array of bytes\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.IChecksum.Update(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Adds the byte array to the data checksum.\n            </summary>\n            <param name = \"buffer\">\n            The buffer which contains the data\n            </param>\n            <param name = \"offset\">\n            The offset in the buffer where the data starts\n            </param>\n            <param name = \"count\">\n            the number of data bytes to add.\n            </param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Checksums.IChecksum.Value\">\n            <summary>\n            Returns the data checksum computed so far.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Checksums.Crc32.crc\">\n            <summary>\n            The crc data checksum so far.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Crc32.Reset\">\n            <summary>\n            Resets the CRC32 data checksum as if no update was ever called.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Crc32.Update(System.Int32)\">\n            <summary>\n            Updates the checksum with the int bval.\n            </summary>\n            <param name = \"value\">\n            the byte is taken as the lower 8 bits of value\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Crc32.Update(System.Byte[])\">\n            <summary>\n            Updates the checksum with the bytes taken from the array.\n            </summary>\n            <param name=\"buffer\">\n            buffer an array of bytes\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Crc32.Update(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Adds the byte array to the data checksum.\n            </summary>\n            <param name = \"buffer\">\n            The buffer which contains the data\n            </param>\n            <param name = \"offset\">\n            The offset in the buffer where the data starts\n            </param>\n            <param name = \"count\">\n            The number of data bytes to update the CRC with.\n            </param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Checksums.Crc32.Value\">\n            <summary>\n            Returns the CRC32 data checksum computed so far.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory\">\n            <summary>\n            Basic implementation of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.IEntryFactory\"></see>\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.IEntryFactory\">\n            <summary>\n            Defines factory methods for creating new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"></see> values.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IEntryFactory.MakeFileEntry(System.String)\">\n            <summary>\n            Create a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for a file given its name\n            </summary>\n            <param name=\"fileName\">The name of the file to create an entry for.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">file entry</see> based on the <paramref name=\"fileName\"/> passed.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IEntryFactory.MakeFileEntry(System.String,System.Boolean)\">\n            <summary>\n            Create a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for a file given its name\n            </summary>\n            <param name=\"fileName\">The name of the file to create an entry for.</param>\n            <param name=\"useFileSystem\">If true get details from the file system if the file exists.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">file entry</see> based on the <paramref name=\"fileName\"/> passed.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IEntryFactory.MakeDirectoryEntry(System.String)\">\n            <summary>\n            Create a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for a directory given its name\n            </summary>\n            <param name=\"directoryName\">The name of the directory to create an entry for.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">directory entry</see> based on the <paramref name=\"directoryName\"/> passed.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.IEntryFactory.MakeDirectoryEntry(System.String,System.Boolean)\">\n            <summary>\n            Create a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for a directory given its name\n            </summary>\n            <param name=\"directoryName\">The name of the directory to create an entry for.</param>\n            <param name=\"useFileSystem\">If true get details from the file system for this directory if it exists.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">directory entry</see> based on the <paramref name=\"directoryName\"/> passed.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.IEntryFactory.NameTransform\">\n            <summary>\n            Get/set the <see cref=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\"></see> applicable.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.#ctor\">\n            <summary>\n            Initialise a new instance of the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory\"/> class.\n            </summary>\n            <remarks>A default <see cref=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\"/>, and the LastWriteTime for files is used.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.#ctor(ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory\"/> using the specified <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting\"/>\n            </summary>\n            <param name=\"timeSetting\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting\">time setting</see> to use when creating <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">Zip entries</see>.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.#ctor(System.DateTime)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory\"/> using the specified <see cref=\"T:System.DateTime\"/>\n            </summary>\n            <param name=\"time\">The time to set all <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.DateTime\"/> values to.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.MakeFileEntry(System.String)\">\n            <summary>\n            Make a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> for a file.\n            </summary>\n            <param name=\"fileName\">The name of the file to create a new entry for.</param>\n            <returns>Returns a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> based on the <paramref name=\"fileName\"/>.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.MakeFileEntry(System.String,System.Boolean)\">\n            <summary>\n            Make a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> from a name.\n            </summary>\n            <param name=\"fileName\">The name of the file to create a new entry for.</param>\n            <param name=\"useFileSystem\">If true entry detail is retrieved from the file system if the file exists.</param>\n            <returns>Returns a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> based on the <paramref name=\"fileName\"/>.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.MakeDirectoryEntry(System.String)\">\n            <summary>\n            Make a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"></see> for a directory.\n            </summary>\n            <param name=\"directoryName\">The raw untransformed name for the new directory</param>\n            <returns>Returns a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"></see> representing a directory.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.MakeDirectoryEntry(System.String,System.Boolean)\">\n            <summary>\n            Make a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"></see> for a directory.\n            </summary>\n            <param name=\"directoryName\">The raw untransformed name for the new directory</param>\n            <param name=\"useFileSystem\">If true entry detail is retrieved from the file system if the file exists.</param>\n            <returns>Returns a new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"></see> representing a directory.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.NameTransform\">\n            <summary>\n            Get / set the <see cref=\"T:ICSharpCode.SharpZipLib.Core.INameTransform\"/> to be used when creating new <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> values.\n            </summary>\n            <remarks>\n            Setting this property to null will cause a default <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\">name transform</see> to be used.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.Setting\">\n            <summary>\n            Get / set the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting\"/> in use.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.FixedDateTime\">\n            <summary>\n            Get / set the <see cref=\"T:System.DateTime\"/> value to use when <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.Setting\"/> is set to <see cref=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.Fixed\"/>\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.GetAttributes\">\n            <summary>\n            A bitmask defining the attributes to be retrieved from the actual file.\n            </summary>\n            <remarks>The default is to get all possible attributes from the actual file.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.SetAttributes\">\n            <summary>\n            A bitmask defining which attributes are to be set on.\n            </summary>\n            <remarks>By default no attributes are set on.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.IsUnicodeText\">\n            <summary>\n            Get set a value indicating wether unidoce text should be set on.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting\">\n            <summary>\n            Defines the possible values to be used for the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.DateTime\"/>.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.LastWriteTime\">\n            <summary>\n            Use the recorded LastWriteTime value for the file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.LastWriteTimeUtc\">\n            <summary>\n            Use the recorded LastWriteTimeUtc value for the file\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.CreateTime\">\n            <summary>\n            Use the recorded CreateTime value for the file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.CreateTimeUtc\">\n            <summary>\n            Use the recorded CreateTimeUtc value for the file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.LastAccessTime\">\n            <summary>\n            Use the recorded LastAccessTime value for the file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.LastAccessTimeUtc\">\n            <summary>\n            Use the recorded LastAccessTimeUtc value for the file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.Fixed\">\n            <summary>\n            Use a fixed value.\n            </summary>\n            <remarks>The actual <see cref=\"T:System.DateTime\"/> value used can be\n            specified via the <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.#ctor(System.DateTime)\"/> constructor or \n            using the <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.#ctor(ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting)\"/> with the setting set\n            to <see cref=\"F:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.TimeSetting.Fixed\"/> which will use the <see cref=\"T:System.DateTime\"/> when this class was constructed.\n            The <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntryFactory.FixedDateTime\"/> property can also be used to set this value.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassic\">\n            <summary>\n            PkzipClassic embodies the classic or original encryption facilities used in Pkzip archives.\n            While it has been superceded by more recent and more powerful algorithms, its still in use and \n            is viable for preventing casual snooping\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassic.GenerateKeys(System.Byte[])\">\n            <summary>\n            Generates new encryption keys based on given seed\n            </summary>\n            <param name=\"seed\">The seed value to initialise keys with.</param>\n            <returns>A new key value.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicCryptoBase\">\n            <summary>\n            PkzipClassicCryptoBase provides the low level facilities for encryption\n            and decryption using the PkzipClassic algorithm.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicCryptoBase.TransformByte\">\n            <summary>\n            Transform a single byte \n            </summary>\n            <returns>\n            The transformed value\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicCryptoBase.SetKeys(System.Byte[])\">\n            <summary>\n            Set the key schedule for encryption/decryption.\n            </summary>\n            <param name=\"keyData\">The data use to set the keys from.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicCryptoBase.UpdateKeys(System.Byte)\">\n            <summary>\n            Update encryption keys \n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicCryptoBase.Reset\">\n            <summary>\n            Reset the internal state.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform\">\n            <summary>\n            PkzipClassic CryptoTransform for encryption.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.#ctor(System.Byte[])\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform\"></see>\n            </summary>\n            <param name=\"keyBlock\">The key block to use.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.TransformFinalBlock(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Transforms the specified region of the specified byte array.\n            </summary>\n            <param name=\"inputBuffer\">The input for which to compute the transform.</param>\n            <param name=\"inputOffset\">The offset into the byte array from which to begin using data.</param>\n            <param name=\"inputCount\">The number of bytes in the byte array to use as data.</param>\n            <returns>The computed transform.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.TransformBlock(System.Byte[],System.Int32,System.Int32,System.Byte[],System.Int32)\">\n            <summary>\n            Transforms the specified region of the input byte array and copies \n            the resulting transform to the specified region of the output byte array.\n            </summary>\n            <param name=\"inputBuffer\">The input for which to compute the transform.</param>\n            <param name=\"inputOffset\">The offset into the input byte array from which to begin using data.</param>\n            <param name=\"inputCount\">The number of bytes in the input byte array to use as data.</param>\n            <param name=\"outputBuffer\">The output to which to write the transform.</param>\n            <param name=\"outputOffset\">The offset into the output byte array from which to begin writing data.</param>\n            <returns>The number of bytes written.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.Dispose\">\n            <summary>\n            Cleanup internal state.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.CanReuseTransform\">\n            <summary>\n            Gets a value indicating whether the current transform can be reused.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.InputBlockSize\">\n            <summary>\n            Gets the size of the input data blocks in bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.OutputBlockSize\">\n            <summary>\n            Gets the size of the output data blocks in bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicEncryptCryptoTransform.CanTransformMultipleBlocks\">\n            <summary>\n            Gets a value indicating whether multiple blocks can be transformed.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform\">\n            <summary>\n            PkzipClassic CryptoTransform for decryption.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.#ctor(System.Byte[])\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform\"></see>.\n            </summary>\n            <param name=\"keyBlock\">The key block to decrypt with.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.TransformFinalBlock(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Transforms the specified region of the specified byte array.\n            </summary>\n            <param name=\"inputBuffer\">The input for which to compute the transform.</param>\n            <param name=\"inputOffset\">The offset into the byte array from which to begin using data.</param>\n            <param name=\"inputCount\">The number of bytes in the byte array to use as data.</param>\n            <returns>The computed transform.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.TransformBlock(System.Byte[],System.Int32,System.Int32,System.Byte[],System.Int32)\">\n            <summary>\n            Transforms the specified region of the input byte array and copies \n            the resulting transform to the specified region of the output byte array.\n            </summary>\n            <param name=\"inputBuffer\">The input for which to compute the transform.</param>\n            <param name=\"inputOffset\">The offset into the input byte array from which to begin using data.</param>\n            <param name=\"inputCount\">The number of bytes in the input byte array to use as data.</param>\n            <param name=\"outputBuffer\">The output to which to write the transform.</param>\n            <param name=\"outputOffset\">The offset into the output byte array from which to begin writing data.</param>\n            <returns>The number of bytes written.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.Dispose\">\n            <summary>\n            Cleanup internal state.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.CanReuseTransform\">\n            <summary>\n            Gets a value indicating whether the current transform can be reused.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.InputBlockSize\">\n            <summary>\n            Gets the size of the input data blocks in bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.OutputBlockSize\">\n            <summary>\n            Gets the size of the output data blocks in bytes.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicDecryptCryptoTransform.CanTransformMultipleBlocks\">\n            <summary>\n            Gets a value indicating whether multiple blocks can be transformed.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged\">\n            <summary>\n            Defines a wrapper object to access the Pkzip algorithm. \n            This class cannot be inherited.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.GenerateIV\">\n            <summary>\n            Generate an initial vector.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.GenerateKey\">\n            <summary>\n            Generate a new random key.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.CreateEncryptor(System.Byte[],System.Byte[])\">\n            <summary>\n            Create an encryptor.\n            </summary>\n            <param name=\"rgbKey\">The key to use for this encryptor.</param>\n            <param name=\"rgbIV\">Initialisation vector for the new encryptor.</param>\n            <returns>Returns a new PkzipClassic encryptor</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.CreateDecryptor(System.Byte[],System.Byte[])\">\n            <summary>\n            Create a decryptor.\n            </summary>\n            <param name=\"rgbKey\">Keys to use for this new decryptor.</param>\n            <param name=\"rgbIV\">Initialisation vector for the new decryptor.</param>\n            <returns>Returns a new decryptor.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.BlockSize\">\n            <summary>\n            Get / set the applicable block size in bits.\n            </summary>\n            <remarks>The only valid block size is 8.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.LegalKeySizes\">\n            <summary>\n            Get an array of legal <see cref=\"T:System.Security.Cryptography.KeySizes\">key sizes.</see>\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.LegalBlockSizes\">\n            <summary>\n            Get an array of legal <see cref=\"T:System.Security.Cryptography.KeySizes\">block sizes</see>.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Encryption.PkzipClassicManaged.Key\">\n            <summary>\n            Get / set the key value applicable.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\">\n            <summary>\n            This class represents an entry in a Tar archive. It consists\n            of the entry's header, as well as the entry's File. Entries\n            can be instantiated in one of three ways, depending on how\n            they are to be used.\n            <p>\n            TarEntries that are created from the header bytes read from\n            an archive are instantiated with the TarEntry( byte[] )\n            constructor. These entries will be used when extracting from\n            or listing the contents of an archive. These entries have their\n            header filled in using the header bytes. They also set the File\n            to null, since they reference an archive entry not a file.</p>\n            <p>\n            TarEntries that are created from files that are to be written\n            into an archive are instantiated with the CreateEntryFromFile(string)\n            pseudo constructor. These entries have their header filled in using\n            the File's information. They also keep a reference to the File\n            for convenience when writing entries.</p>\n            <p>\n            Finally, TarEntries can be constructed from nothing but a name.\n            This allows the programmer to construct the entry by hand, for\n            instance when only an InputStream is available for writing to\n            the archive, and the header information is constructed from\n            other information. In this case the header fields are set to\n            defaults and the File is set to null.</p>\n            <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.TarHeader\"/>\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.#ctor\">\n            <summary>\n            Initialise a default instance of <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/>.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.#ctor(System.Byte[])\">\n            <summary>\n            Construct an entry from an archive's header bytes. File is set\n            to null.\n            </summary>\n            <param name = \"headerBuffer\">\n            The header bytes from a tar archive entry.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.#ctor(ICSharpCode.SharpZipLib.Tar.TarHeader)\">\n            <summary>\n            Construct a TarEntry using the <paramref name=\"header\">header</paramref> provided\n            </summary>\n            <param name=\"header\">Header details for entry</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.Clone\">\n            <summary>\n            Clone this tar entry.\n            </summary>\n            <returns>Returns a clone of this entry.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.CreateTarEntry(System.String)\">\n            <summary>\n            Construct an entry with only a <paramref name=\"name\">name</paramref>.\n            This allows the programmer to construct the entry's header \"by hand\". \n            </summary>\n            <param name=\"name\">The name to use for the entry</param>\n            <returns>Returns the newly created <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.CreateEntryFromFile(System.String)\">\n            <summary>\n            Construct an entry for a file. File is set to file, and the\n            header is constructed from information from the file.\n            </summary>\n            <param name=\"fileName\">The file name that the entry represents.</param>\n            <returns>Returns the newly created <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.Equals(System.Object)\">\n            <summary>\n            Determine if the two entries are equal. Equality is determined\n            by the header names being equal.\n            </summary>\n            <param name=\"obj\">The <see cref=\"T:System.Object\"/> to compare with the current Object.</param>\n            <returns>\n            True if the entries are equal; false if not.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.GetHashCode\">\n            <summary>\n            Derive a Hash value for the current <see cref=\"T:System.Object\"/>\n            </summary>\n            <returns>A Hash code for the current <see cref=\"T:System.Object\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.IsDescendent(ICSharpCode.SharpZipLib.Tar.TarEntry)\">\n            <summary>\n            Determine if the given entry is a descendant of this entry.\n            Descendancy is determined by the name of the descendant\n            starting with this entry's name.\n            </summary>\n            <param name = \"toTest\">\n            Entry to be checked as a descendent of this.\n            </param>\n            <returns>\n            True if entry is a descendant of this.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.SetIds(System.Int32,System.Int32)\">\n            <summary>\n            Convenience method to set this entry's group and user ids.\n            </summary>\n            <param name=\"userId\">\n            This entry's new user id.\n            </param>\n            <param name=\"groupId\">\n            This entry's new group id.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.SetNames(System.String,System.String)\">\n            <summary>\n            Convenience method to set this entry's group and user names.\n            </summary>\n            <param name=\"userName\">\n            This entry's new user name.\n            </param>\n            <param name=\"groupName\">\n            This entry's new group name.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.GetFileTarHeader(ICSharpCode.SharpZipLib.Tar.TarHeader,System.String)\">\n            <summary>\n            Fill in a TarHeader with information from a File.\n            </summary>\n            <param name=\"header\">\n            The TarHeader to fill in.\n            </param>\n            <param name=\"file\">\n            The file from which to get the header information.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.GetDirectoryEntries\">\n            <summary>\n            Get entries for all files present in this entries directory.\n            If this entry doesnt represent a directory zero entries are returned.\n            </summary>\n            <returns>\n            An array of TarEntry's for this entry's children.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.WriteEntryHeader(System.Byte[])\">\n            <summary>\n            Write an entry's header information to a header buffer.\n            </summary>\n            <param name = \"outBuffer\">\n            The tar entry header buffer to fill in.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.AdjustEntryName(System.Byte[],System.String)\">\n            <summary>\n            Convenience method that will modify an entry's name directly\n            in place in an entry header buffer byte array.\n            </summary>\n            <param name=\"buffer\">\n            The buffer containing the entry header to modify.\n            </param>\n            <param name=\"newName\">\n            The new name to place into the header buffer.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarEntry.NameTarHeader(ICSharpCode.SharpZipLib.Tar.TarHeader,System.String)\">\n            <summary>\n            Fill in a TarHeader given only the entry's name.\n            </summary>\n            <param name=\"header\">\n            The TarHeader to fill in.\n            </param>\n            <param name=\"name\">\n            The tar entry name.\n            </param>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarEntry.file\">\n            <summary>\n            The name of the file this entry represents or null if the entry is not based on a file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarEntry.header\">\n            <summary>\n            The entry's header information.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.TarHeader\">\n            <summary>\n            Get this entry's header.\n            </summary>\n            <returns>\n            This entry's TarHeader.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.Name\">\n            <summary>\n            Get/Set this entry's name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.UserId\">\n            <summary>\n            Get/set this entry's user id.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.GroupId\">\n            <summary>\n            Get/set this entry's group id.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.UserName\">\n            <summary>\n            Get/set this entry's user name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.GroupName\">\n            <summary>\n            Get/set this entry's group name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.ModTime\">\n            <summary>\n            Get/Set the modification time for this entry\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.File\">\n            <summary>\n            Get this entry's file.\n            </summary>\n            <returns>\n            This entry's file.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.Size\">\n            <summary>\n            Get/set this entry's recorded file size.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarEntry.IsDirectory\">\n            <summary>\n            Return true if this entry represents a directory, false otherwise\n            </summary>\n            <returns>\n            True if this entry is a directory.\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.GZip.GZipInputStream\">\n            <summary>\n            This filter stream is used to decompress a \"GZIP\" format stream.\n            The \"GZIP\" format is described baseInputStream RFC 1952.\n            \n            author of the original java version : John Leuner\n            </summary>\n            <example> This sample shows how to unzip a gzipped file\n            <code>\n            using System;\n            using System.IO;\n            \n            using ICSharpCode.SharpZipLib.Core;\n            using ICSharpCode.SharpZipLib.GZip;\n            \n            class MainClass\n            {\n            \tpublic static void Main(string[] args)\n            \t{\n            \t\tusing (Stream inStream = new GZipInputStream(File.OpenRead(args[0])))\n            \t\tusing (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) {\n            \t\t\tbyte[] buffer = new byte[4096];\n            \t\t\tStreamUtils.Copy(inStream, outStream, buffer);\n            \t\t}\n            \t}\n            }\t\n            </code>\n            </example>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipInputStream.crc\">\n            <summary>\n            CRC-32 value for uncompressed data\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipInputStream.eos\">\n            <summary>\n            Indicates end of stream\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipInputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Creates a GZipInputStream with the default buffer size\n            </summary>\n            <param name=\"baseInputStream\">\n            The stream to read compressed data from (baseInputStream GZIP format)\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipInputStream.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Creates a GZIPInputStream with the specified buffer size\n            </summary>\n            <param name=\"baseInputStream\">\n            The stream to read compressed data from (baseInputStream GZIP format)\n            </param>\n            <param name=\"size\">\n            Size of the buffer to use\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipInputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Reads uncompressed data into an array of bytes\n            </summary>\n            <param name=\"buffer\">\n            The buffer to read uncompressed data into\n            </param>\n            <param name=\"offset\">\n            The offset indicating where the data should be placed\n            </param>\n            <param name=\"count\">\n            The number of uncompressed bytes to be read\n            </param>\n            <returns>Returns the number of bytes actually read.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.StreamUtils\">\n            <summary>\n            Provides simple <see cref=\"T:System.IO.Stream\"/>\" utilities.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.StreamUtils.ReadFully(System.IO.Stream,System.Byte[])\">\n            <summary>\n            Read from a <see cref=\"T:System.IO.Stream\"/> ensuring all the required data is read.\n            </summary>\n            <param name=\"stream\">The stream to read.</param>\n            <param name=\"buffer\">The buffer to fill.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.StreamUtils.ReadFully(System.IO.Stream,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read from a <see cref=\"T:System.IO.Stream\"/>\" ensuring all the required data is read.\n            </summary>\n            <param name=\"stream\">The stream to read data from.</param>\n            <param name=\"buffer\">The buffer to store data in.</param>\n            <param name=\"offset\">The offset at which to begin storing data.</param>\n            <param name=\"count\">The number of bytes of data to store.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.StreamUtils.Copy(System.IO.Stream,System.IO.Stream,System.Byte[],ICSharpCode.SharpZipLib.Core.ProgressHandler,System.TimeSpan,System.Object,System.String)\">\n            <summary>\n            Copy the contents of one <see cref=\"T:System.IO.Stream\"/> to another.\n            </summary>\n            <param name=\"source\">The stream to source data from.</param>\n            <param name=\"destination\">The stream to write data to.</param>\n            <param name=\"buffer\">The buffer to use during copying.</param>\n            <param name=\"progressHandler\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.ProgressHandler\">progress handler delegate</see> to use.</param>\n            <param name=\"updateInterval\">The minimum <see cref=\"T:System.TimeSpan\"/> between progress updates.</param>\n            <param name=\"sender\">The source for this event.</param>\n            <param name=\"name\">The name to use with the event.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.StreamUtils.Copy(System.IO.Stream,System.IO.Stream,System.Byte[])\">\n            <summary>\n            Copy the contents of one <see cref=\"T:System.IO.Stream\"/> to another.\n            </summary>\n            <param name=\"source\">The stream to source data from.</param>\n            <param name=\"destination\">The stream to write data to.</param>\n            <param name=\"buffer\">The buffer to use during copying.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.StreamUtils.#ctor\">\n            <summary>\n            Initialise an instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.StreamUtils\"></see>\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman\">\n            <summary>\n            This is the DeflaterHuffman class.\n            \n            This class is <i>not</i> thread safe.  This is inherent in the API, due\n            to the split of Deflate and SetInput.\n            \n            author of the original java version : Jochen Hoenicke\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.pending\">\n            <summary>\n            Pending buffer to use\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.#ctor(ICSharpCode.SharpZipLib.Zip.Compression.DeflaterPending)\">\n            <summary>\n            Construct instance with pending buffer\n            </summary>\n            <param name=\"pending\">Pending buffer to use</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Reset\">\n            <summary>\n            Reset internal state\n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.SendAllTrees(System.Int32)\">\n            <summary>\n            Write all trees to pending buffer\n            </summary>\n            <param name=\"blTreeCodes\">The number/rank of treecodes to send.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.CompressBlock\">\n            <summary>\n            Compress current buffer writing data to pending buffer\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.FlushStoredBlock(System.Byte[],System.Int32,System.Int32,System.Boolean)\">\n            <summary>\n            Flush block to output with no compression\n            </summary>\n            <param name=\"stored\">Data to write</param>\n            <param name=\"storedOffset\">Index of first byte to write</param>\n            <param name=\"storedLength\">Count of bytes to write</param>\n            <param name=\"lastBlock\">True if this is the last block</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.FlushBlock(System.Byte[],System.Int32,System.Int32,System.Boolean)\">\n            <summary>\n            Flush block to output with compression\n            </summary>\t\t\n            <param name=\"stored\">Data to flush</param>\n            <param name=\"storedOffset\">Index of first byte to flush</param>\n            <param name=\"storedLength\">Count of bytes to flush</param>\n            <param name=\"lastBlock\">True if this is the last block</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.IsFull\">\n            <summary>\n            Get value indicating if internal buffer is full\n            </summary>\n            <returns>true if buffer is full</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.TallyLit(System.Int32)\">\n            <summary>\n            Add literal to buffer\n            </summary>\n            <param name=\"literal\">Literal value to add to buffer.</param>\n            <returns>Value indicating internal buffer is full</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.TallyDist(System.Int32,System.Int32)\">\n            <summary>\n            Add distance code and length to literal and distance trees\n            </summary>\n            <param name=\"distance\">Distance code</param>\n            <param name=\"length\">Length</param>\n            <returns>Value indicating if internal buffer is full</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.BitReverse(System.Int32)\">\n            <summary>\n            Reverse the bits of a 16 bit value.\n            </summary>\n            <param name=\"toReverse\">Value to reverse bits</param>\n            <returns>Value with bits reversed</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.Reset\">\n            <summary>\n            Resets the internal state of the tree\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.CheckEmpty\">\n            <summary>\n            Check that all frequencies are zero\n            </summary>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            At least one frequency is non-zero\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.SetStaticCodes(System.Int16[],System.Byte[])\">\n            <summary>\n            Set static codes and length\n            </summary>\n            <param name=\"staticCodes\">new codes</param>\n            <param name=\"staticLengths\">length for new codes</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.BuildCodes\">\n            <summary>\n            Build dynamic codes and lengths\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.GetEncodedLength\">\n            <summary>\n            Get encoded length\n            </summary>\n            <returns>Encoded length, the sum of frequencies * lengths</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.CalcBLFreq(ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree)\">\n            <summary>\n            Scan a literal or distance tree to determine the frequencies of the codes\n            in the bit length tree.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree.WriteTree(ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Tree)\">\n            <summary>\n            Write tree values\n            </summary>\n            <param name=\"blTree\">Tree to write</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.GZip.GZipConstants\">\n            <summary>\n            This class contains constants used for gzip.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.GZIP_MAGIC\">\n            <summary>\n            Magic number found at start of GZIP header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.FTEXT\">\n            <summary>\n            Flag bit mask for text\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.FHCRC\">\n            <summary>\n            Flag bitmask for Crc\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.FEXTRA\">\n            <summary>\n            Flag bit mask for extra\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.FNAME\">\n            <summary>\n            flag bitmask for name\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.GZip.GZipConstants.FCOMMENT\">\n            <summary>\n            flag bit mask indicating comment is present\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.GZip.GZipConstants.#ctor\">\n            <summary>\n            Initialise default instance.\n            </summary>\n            <remarks>Constructor is private to prevent instances being created.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarException\">\n            <summary>\n            TarExceptions are used for exceptions specific to tar classes and code.\t\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"info\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarException.#ctor\">\n            <summary>\n            Initialises a new instance of the TarException class.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarException.#ctor(System.String)\">\n            <summary>\n            Initialises a new instance of the TarException class with a specified message.\n            </summary>\n            <param name=\"message\">The message that describes the error.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarException.#ctor(System.String,System.Exception)\">\n            <summary>\n            \n            </summary>\n            <param name=\"message\">A message describing the error.</param>\n            <param name=\"exception\">The exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Checksums.StrangeCRC\">\n            <summary>\n            Bzip2 checksum algorithm\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.#ctor\">\n            <summary>\n            Initialise a default instance of <see cref=\"T:ICSharpCode.SharpZipLib.Checksums.StrangeCRC\"></see>\n            </summary>\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.Reset\">\n            <summary>\n            Reset the state of Crc.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.Update(System.Int32)\">\n            <summary>\n            Update the Crc value.\n            </summary>\n            <param name=\"value\">data update is based on</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.Update(System.Byte[])\">\n            <summary>\n            Update Crc based on a block of data\n            </summary>\n            <param name=\"buffer\">The buffer containing data to update the crc with.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.Update(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Update Crc based on a portion of a block of data\n            </summary>\n            <param name=\"buffer\">block of data</param>\n            <param name=\"offset\">index of first byte to use</param>\n            <param name=\"count\">number of bytes to use</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Checksums.StrangeCRC.Value\">\n            <summary>\n            Get the current Crc value.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipInputStream\">\n             <summary>\n             This is an InflaterInputStream that reads the files baseInputStream an zip archive\n             one after another.  It has a special method to get the zip entry of\n             the next file.  The zip entry contains information about the file name\n             size, compressed size, Crc, etc.\n             It includes support for Stored and Deflated entries.\n             <br/>\n             <br/>Author of the original java version : Jochen Hoenicke\n             </summary>\n             \n             <example> This sample shows how to read a zip file\n             <code lang=\"C#\">\n             using System;\n             using System.Text;\n             using System.IO;\n             \n             using ICSharpCode.SharpZipLib.Zip;\n             \n             class MainClass\n             {\n             \tpublic static void Main(string[] args)\n             \t{\n             \t\tusing ( ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) {\n            \n             \t\t\tZipEntry theEntry;\n             \t\t\twhile ((theEntry = s.GetNextEntry()) != null) {\n             \t\t\t\tint size = 2048;\n             \t\t\t\tbyte[] data = new byte[2048];\n            \n             \t\t\t\tConsole.Write(\"Show contents (y/n) ?\");\n             \t\t\t\tif (Console.ReadLine() == \"y\") {\n             \t\t\t\t\twhile (true) {\n             \t\t\t\t\t\tsize = s.Read(data, 0, data.Length);\n             \t\t\t\t\t\tif (size > 0) {\n             \t\t\t\t\t\t\tConsole.Write(new ASCIIEncoding().GetString(data, 0, size));\n             \t\t\t\t\t\t} else {\n             \t\t\t\t\t\t\tbreak;\n             \t\t\t\t\t\t}\n             \t\t\t\t\t}\n             \t\t\t\t}\n             \t\t\t}\n             \t\t}\n             \t}\n             }\n             </code>\n             </example>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ZipInputStream.internalReader\">\n            <summary>\n            The current reader this instance.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Creates a new Zip input stream, for reading a zip archive.\n            </summary>\n            <param name=\"baseInputStream\">The underlying <see cref=\"T:System.IO.Stream\"/> providing data.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry\">\n            <summary>\n            Advances to the next entry in the archive\n            </summary>\n            <returns>\n            The next <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">entry</see> in the archive or null if there are no more entries.\n            </returns>\n            <remarks>\n            If the previous entry is still open <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.CloseEntry\">CloseEntry</see> is called.\n            </remarks>\n            <exception cref=\"T:System.InvalidOperationException\">\n            Input stream is closed\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            Password is not set, password is invalid, compression method is invalid,\n            version required to extract is not supported\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.ReadDataDescriptor\">\n            <summary>\n            Read data descriptor at the end of compressed data. \n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.CompleteCloseEntry(System.Boolean)\">\n            <summary>\n            Complete cleanup as the final part of closing.\n            </summary>\n            <param name=\"testCrc\">True if the crc value should be tested</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.CloseEntry\">\n            <summary>\n            Closes the current zip entry and moves to the next one.\n            </summary>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The stream is closed\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The Zip stream ends early\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.ReadByte\">\n            <summary>\n            Reads a byte from the current zip entry.\n            </summary>\n            <returns>\n            The byte or -1 if end of stream is reached.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.ReadingNotAvailable(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Handle attempts to read by throwing an <see cref=\"T:System.InvalidOperationException\"/>.\n            </summary>\n            <param name=\"destination\">The destination array to store data in.</param>\n            <param name=\"offset\">The offset at which data read should be stored.</param>\n            <param name=\"count\">The maximum number of bytes to read.</param>\n            <returns>Returns the number of bytes actually read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.ReadingNotSupported(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Handle attempts to read from this entry by throwing an exception\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.InitialRead(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Perform the initial read on an entry which may include \n            reading encryption headers and setting up inflation.\n            </summary>\n            <param name=\"destination\">The destination to fill with data read.</param>\n            <param name=\"offset\">The offset to start reading at.</param>\n            <param name=\"count\">The maximum number of bytes to read.</param>\n            <returns>The actual number of bytes read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read a block of bytes from the stream.\n            </summary>\n            <param name=\"buffer\">The destination for the bytes.</param>\n            <param name=\"offset\">The index to start storing data.</param>\n            <param name=\"count\">The number of bytes to attempt to read.</param>\n            <returns>Returns the number of bytes read.</returns>\n            <remarks>Zero bytes read means end of stream.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Reads a block of bytes from the current zip entry.\n            </summary>\n            <returns>\n            The number of bytes read (this may be less than the length requested, even before the end of stream), or 0 on end of stream.\n            </returns>\n            <exception name=\"IOException\">\n            An i/o error occured.\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">\n            The deflated stream is corrupted.\n            </exception>\n            <exception cref=\"T:System.InvalidOperationException\">\n            The stream is not open.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipInputStream.Close\">\n            <summary>\n            Closes the zip input stream\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipInputStream.Password\">\n            <summary>\n            Optional password used for encryption when non-null\n            </summary>\n            <value>A password for all encrypted <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">entries </see> in this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipInputStream\"/></value>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipInputStream.CanDecompressEntry\">\n            <summary>\n            Gets a value indicating if there is a current entry and it can be decompressed\n            </summary>\n            <remarks>\n            The entry can only be decompressed if the library supports the zip features required to extract it.\n            See the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Version\">ZipEntry Version</see> property for more details.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipInputStream.Available\">\n            <summary>\n            Returns 1 if there is an entry available\n            Otherwise returns 0.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipInputStream.Length\">\n            <summary>\n            Returns the current size that can be read from the current entry if available\n            </summary>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipException\">Thrown if the entry size is not known.</exception>\n            <exception cref=\"T:System.InvalidOperationException\">Thrown if no entry is currently available.</exception>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\">\n            <summary>\n            ZipNameTransform transforms names as per the Zip file naming convention.\n            </summary>\n            <remarks>The use of absolute names is supported although its use is not valid \n            according to Zip naming conventions, and should not be used if maximum compatability is desired.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.#ctor\">\n            <summary>\n            Initialize a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\"></see>\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.#ctor(System.String)\">\n            <summary>\n            Initialize a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\"></see>\n            </summary>\n            <param name=\"trimPrefix\">The string to trim from front of paths if found.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.#cctor\">\n            <summary>\n            Static constructor.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformDirectory(System.String)\">\n            <summary>\n            Transform a directory name according to the Zip file naming conventions.\n            </summary>\n            <param name=\"name\">The directory name to transform.</param>\n            <returns>The transformed name.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformFile(System.String)\">\n            <summary>\n            Transform a windows file name according to the Zip file naming conventions.\n            </summary>\n            <param name=\"name\">The file name to transform.</param>\n            <returns>The transformed name.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.MakeValidName(System.String,System.Char)\">\n            <summary>\n            Force a name to be valid by replacing invalid characters with a fixed value\n            </summary>\n            <param name=\"name\">The name to force valid</param>\n            <param name=\"replacement\">The replacement character to use.</param>\n            <returns>Returns a valid name</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.IsValidName(System.String,System.Boolean)\">\n            <summary>\n            Test a name to see if it is a valid name for a zip entry.\n            </summary>\n            <param name=\"name\">The name to test.</param>\n            <param name=\"relaxed\">If true checking is relaxed about windows file names and absolute paths.</param>\n            <returns>Returns true if the name is a valid zip name; false otherwise.</returns>\n            <remarks>Zip path names are actually in Unix format, and should only contain relative paths.\n            This means that any path stored should not contain a drive or\n            device letter, or a leading slash.  All slashes should forward slashes '/'.\n            An empty name is valid for a file where the input comes from standard input.\n            A null name is not considered valid.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.IsValidName(System.String)\">\n            <summary>\n            Test a name to see if it is a valid name for a zip entry.\n            </summary>\n            <param name=\"name\">The name to test.</param>\n            <returns>Returns true if the name is a valid zip name; false otherwise.</returns>\n            <remarks>Zip path names are actually in unix format,\n            and should only contain relative paths if a path is present.\n            This means that the path stored should not contain a drive or\n            device letter, or a leading slash.  All slashes should forward slashes '/'.\n            An empty name is valid where the input comes from standard input.\n            A null name is not considered valid.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TrimPrefix\">\n            <summary>\n            Get/set the path prefix to be trimmed from paths if present.\n            </summary>\n            <remarks>The prefix is trimmed before any conversion from\n            a windows path is done.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.InvalidHeaderException\">\n            <summary>\n            This exception is used to indicate that there is a problem\n            with a TAR archive header.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.InvalidHeaderException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Deserialization constructor \n            </summary>\n            <param name=\"information\"><see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> for this constructor</param>\n            <param name=\"context\"><see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> for this constructor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.InvalidHeaderException.#ctor\">\n            <summary>\n            Initialise a new instance of the InvalidHeaderException class.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.InvalidHeaderException.#ctor(System.String)\">\n            <summary>\n            Initialises a new instance of the InvalidHeaderException class with a specified message.\n            </summary>\n            <param name=\"message\">Message describing the exception cause.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.InvalidHeaderException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initialise a new instance of InvalidHeaderException\n            </summary>\n            <param name=\"message\">Message describing the problem.</param>\n            <param name=\"exception\">The exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator\">\n             <summary>\n             This class allows us to retrieve a specified number of bits from\n             the input buffer, as well as copy big byte blocks.\n            \n             It uses an int buffer to store up to 31 bits for direct\n             manipulation.  This guarantees that we can get at least 16 bits,\n             but we only need at most 15, so this is all safe.\n            \n             There are some optimizations in this class, for example, you must\n             never peek more than 8 bits more than needed, and you must first\n             peek bits before you may drop them.  This is not a general purpose\n             class but optimized for the behaviour of the Inflater.\n            \n             authors of the original java version : John Leuner, Jochen Hoenicke\n             </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.#ctor\">\n            <summary>\n            Constructs a default StreamManipulator with all buffers empty\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.PeekBits(System.Int32)\">\n            <summary>\n            Get the next sequence of bits but don't increase input pointer.  bitCount must be\n            less or equal 16 and if this call succeeds, you must drop\n            at least n - 8 bits in the next call.\n            </summary>\n            <param name=\"bitCount\">The number of bits to peek.</param>\n            <returns>\n            the value of the bits, or -1 if not enough bits available.  */\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.DropBits(System.Int32)\">\n            <summary>\n            Drops the next n bits from the input.  You should have called PeekBits\n            with a bigger or equal n before, to make sure that enough bits are in\n            the bit buffer.\n            </summary>\n            <param name=\"bitCount\">The number of bits to drop.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.GetBits(System.Int32)\">\n            <summary>\n            Gets the next n bits and increases input pointer.  This is equivalent\n            to <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.PeekBits(System.Int32)\"/> followed by <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.DropBits(System.Int32)\"/>, except for correct error handling.\n            </summary>\n            <param name=\"bitCount\">The number of bits to retrieve.</param>\n            <returns>\n            the value of the bits, or -1 if not enough bits available.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.SkipToByteBoundary\">\n            <summary>\n            Skips to the next byte boundary.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.CopyBytes(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Copies bytes from input buffer to output buffer starting\n            at output[offset].  You have to make sure, that the buffer is\n            byte aligned.  If not enough bytes are available, copies fewer\n            bytes.\n            </summary>\n            <param name=\"output\">\n            The buffer to copy bytes to.\n            </param>\n            <param name=\"offset\">\n            The offset in the buffer at which copying starts\n            </param>\n            <param name=\"length\">\n            The length to copy, 0 is allowed.\n            </param>\n            <returns>\n            The number of bytes copied, 0 if no bytes were available.\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Length is less than zero\n            </exception>\n            <exception cref=\"T:System.InvalidOperationException\">\n            Bit buffer isnt byte aligned\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.Reset\">\n            <summary>\n            Resets state and empties internal buffers\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.SetInput(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add more input for consumption.\n            Only call when IsNeedingInput returns true\n            </summary>\n            <param name=\"buffer\">data to be input</param>\n            <param name=\"offset\">offset of first byte of input</param>\n            <param name=\"count\">number of bytes of input to add.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.AvailableBits\">\n            <summary>\n            Gets the number of bits available in the bit buffer.  This must be\n            only called when a previous PeekBits() returned -1.\n            </summary>\n            <returns>\n            the number of bits available.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.AvailableBytes\">\n            <summary>\n            Gets the number of bytes available.\n            </summary>\n            <returns>\n            The number of bytes available.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.IsNeedingInput\">\n            <summary>\n            Returns true when SetInput can be called\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy\">\n            <summary>\n            Strategies for deflater\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy.Default\">\n            <summary>\n            The default strategy\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy.Filtered\">\n            <summary>\n            This strategy will only allow longer string repetitions.  It is\n            useful for random data with a small character set.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy.HuffmanOnly\">\n            <summary>\n            This strategy will not look for string repetitions at all.  It\n            only encodes with Huffman trees (which means, that more common\n            characters get a smaller encoding.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine\">\n            <summary>\n            Low level compression engine for deflate algorithm which uses a 32K sliding window\n            with secondary compression from Huffman/Shannon-Fano codes.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.#ctor(ICSharpCode.SharpZipLib.Zip.Compression.DeflaterPending)\">\n            <summary>\n            Construct instance with pending buffer\n            </summary>\n            <param name=\"pending\">\n            Pending buffer to use\n            </param>>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Deflate(System.Boolean,System.Boolean)\">\n            <summary>\n            Deflate drives actual compression of data\n            </summary>\n            <param name=\"flush\">True to flush input buffers</param>\n            <param name=\"finish\">Finish deflation with the current input.</param>\n            <returns>Returns true if progress has been made.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetInput(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Sets input data to be deflated.  Should only be called when <code>NeedsInput()</code>\n            returns true\n            </summary>\n            <param name=\"buffer\">The buffer containing input data.</param>\n            <param name=\"offset\">The offset of the first byte of data.</param>\n            <param name=\"count\">The number of bytes of data to use as input.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.NeedsInput\">\n            <summary>\n            Determines if more <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetInput(System.Byte[],System.Int32,System.Int32)\">input</see> is needed.\n            </summary>\t\t\n            <returns>Return true if input is needed via <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetInput(System.Byte[],System.Int32,System.Int32)\">SetInput</see></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetDictionary(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Set compression dictionary\n            </summary>\n            <param name=\"buffer\">The buffer containing the dictionary data</param>\n            <param name=\"offset\">The offset in the buffer for the first byte of data</param>\n            <param name=\"length\">The length of the dictionary data.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Reset\">\n            <summary>\n            Reset internal state\n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.ResetAdler\">\n            <summary>\n            Reset Adler checksum\n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.SetLevel(System.Int32)\">\n            <summary>\n            Set the deflate level (0-9)\n            </summary>\n            <param name=\"level\">The value to set the level to.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.FillWindow\">\n            <summary>\n            Fill the window\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.InsertString\">\n            <summary>\n            Inserts the current string in the head hash and returns the previous\n            value for this hash.\n            </summary>\n            <returns>The previous hash value</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.FindLongestMatch(System.Int32)\">\n             <summary>\n             Find the best (longest) string in the window matching the \n             string starting at strstart.\n            \n             Preconditions:\n             <code>\n             strstart + MAX_MATCH &lt;= window.length.</code>\n             </summary>\n             <param name=\"curMatch\"></param>\n             <returns>True if a match greater than the minimum length is found</returns>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.head\">\n            <summary>\n            Hashtable, hashing three characters to an index for window, so\n            that window[index]..window[index+2] have this hash code.  \n            Note that the array should really be unsigned short, so you need\n            to and the values with 0xffff.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.prev\">\n            <summary>\n            <code>prev[index &amp; WMASK]</code> points to the previous index that has the\n            same hash code as the string starting at index.  This way \n            entries with the same hash code are in a linked list.\n            Note that the array should really be unsigned short, so you need\n            to and the values with 0xffff.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.strstart\">\n            <summary>\n            Points to the current character in the window.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.lookahead\">\n            <summary>\n            lookahead is the number of characters starting at strstart in\n            window that are valid.\n            So window[strstart] until window[strstart+lookahead-1] are valid\n            characters.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.window\">\n            <summary>\n            This array contains the part of the uncompressed stream that \n            is of relevance.  The current character is indexed by strstart.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.compressionFunction\">\n            <summary>\n            The current compression function.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.inputBuf\">\n            <summary>\n            The input data for compression.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.totalIn\">\n            <summary>\n            The total bytes of input read.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.inputOff\">\n            <summary>\n            The offset into inputBuf, where input data starts.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.inputEnd\">\n            <summary>\n            The end offset of the input data.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.adler\">\n            <summary>\n            The adler checksum\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Adler\">\n            <summary>\n            Get current value of Adler checksum\n            </summary>\t\t\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.TotalIn\">\n            <summary>\n            Total data processed\n            </summary>\t\t\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.Strategy\">\n            <summary>\n            Get/set the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy\">deflate strategy</see>\n            </summary>\t\t\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarBuffer\">\n            <summary>\n            The TarBuffer class implements the tar archive concept\n            of a buffered input stream. This concept goes back to the\n            days of blocked tape drives and special io devices. In the\n            C# universe, the only real function that this class\n            performs is to ensure that files have the correct \"record\"\n            size, or other tars will complain.\n            <p>\n            You should never have a need to access this class directly.\n            TarBuffers are created by Tar IO Streams.\n            </p>\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockSize\">\n            <summary>\n            The size of a block in a tar archive in bytes.\n            </summary>\n            <remarks>This is 512 bytes.</remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarBuffer.DefaultBlockFactor\">\n            <summary>\n            The number of blocks in a default record.\n            </summary>\n            <remarks>\n            The default value is 20 blocks per record.\n            </remarks>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarBuffer.DefaultRecordSize\">\n            <summary>\n            The size in bytes of a default record.\n            </summary>\n            <remarks>\n            The default size is 10KB.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetRecordSize\">\n            <summary>\n            Get the TAR Buffer's record size.\n            </summary>\n            <returns>The record size in bytes.\n            This is equal to the <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockFactor\"/> multiplied by the <see cref=\"F:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockSize\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetBlockFactor\">\n            <summary>\n            Get the TAR Buffer's block factor\n            </summary>\n            <returns>The block factor; the number of blocks per record.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.#ctor\">\n            <summary>\n            Construct a default TarBuffer\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.CreateInputTarBuffer(System.IO.Stream)\">\n            <summary>\n            Create TarBuffer for reading with default BlockFactor\n            </summary>\n            <param name=\"inputStream\">Stream to buffer</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarBuffer\"/> suitable for input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.CreateInputTarBuffer(System.IO.Stream,System.Int32)\">\n            <summary>\n            Construct TarBuffer for reading inputStream setting BlockFactor\n            </summary>\n            <param name=\"inputStream\">Stream to buffer</param>\n            <param name=\"blockFactor\">Blocking factor to apply</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarBuffer\"/> suitable for input.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.CreateOutputTarBuffer(System.IO.Stream)\">\n            <summary>\n            Construct TarBuffer for writing with default BlockFactor\n            </summary>\n            <param name=\"outputStream\">output stream for buffer</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarBuffer\"/> suitable for output.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.CreateOutputTarBuffer(System.IO.Stream,System.Int32)\">\n            <summary>\n            Construct TarBuffer for writing Tar output to streams.\n            </summary>\n            <param name=\"outputStream\">Output stream to write to.</param>\n            <param name=\"blockFactor\">Blocking factor to apply</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarBuffer\"/> suitable for output.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.Initialize(System.Int32)\">\n            <summary>\n            Initialization common to all constructors.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.IsEOFBlock(System.Byte[])\">\n            <summary>\n            Determine if an archive block indicates End of Archive. End of\n            archive is indicated by a block that consists entirely of null bytes.\n            All remaining blocks for the record should also be null's\n            However some older tars only do a couple of null blocks (Old GNU tar for one)\n            and also partial records\n            </summary>\n            <param name = \"block\">The data block to check.</param>\n            <returns>Returns true if the block is an EOF block; false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.SkipBlock\">\n            <summary>\n            Skip over a block on the input stream.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.ReadBlock\">\n            <summary>\n            Read a block from the input stream.\n            </summary>\n            <returns>\n            The block of data read.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.ReadRecord\">\n            <summary>\n            Read a record from data stream.\n            </summary>\n            <returns>\n            false if End-Of-File, else true.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetCurrentBlockNum\">\n            <summary>\n            Get the current block number, within the current record, zero based.\n            </summary>\n            <returns>\n            The current zero based block number.\n            </returns>\n            <remarks>\n            The absolute block number = (<see cref=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetCurrentRecordNum\">record number</see> * <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockFactor\">block factor</see>) + <see cref=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetCurrentBlockNum\">block number</see>.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.GetCurrentRecordNum\">\n            <summary>\n            Get the current record number.\n            </summary>\n            <returns>\n            The current zero based record number.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.WriteBlock(System.Byte[])\">\n            <summary>\n            Write a block of data to the archive.\n            </summary>\n            <param name=\"block\">\n            The data to write to the archive.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.WriteBlock(System.Byte[],System.Int32)\">\n            <summary>\n            Write an archive record to the archive, where the record may be\n            inside of a larger array buffer. The buffer must be \"offset plus\n            record size\" long.\n            </summary>\n            <param name=\"buffer\">\n            The buffer containing the record data to write.\n            </param>\n            <param name=\"offset\">\n            The offset of the record data within buffer.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.WriteRecord\">\n            <summary>\n            Write a TarBuffer record to the archive.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.Flush\">\n            <summary>\n            Flush the current record if it has any data in it.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarBuffer.Close\">\n            <summary>\n            Close the TarBuffer. If this is an output buffer, also flush the\n            current block before closing.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.RecordSize\">\n            <summary>\n            Get the record size for this buffer\n            </summary>\n            <value>The record size in bytes.\n            This is equal to the <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockFactor\"/> multiplied by the <see cref=\"F:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockSize\"/></value>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.BlockFactor\">\n            <summary>\n            Get the Blocking factor for the buffer\n            </summary>\n            <value>This is the number of block in each record.</value>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.CurrentBlock\">\n            <summary>\n            Get the current block number, within the current record, zero based.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarBuffer.CurrentRecord\">\n            <summary>\n            Get the current record number.\n            </summary>\n            <returns>\n            The current zero based record number.\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarHeader\">\n            <summary>\n            This class encapsulates the Tar Entry Header used in Tar Archives.\n            The class also holds a number of tar constants, used mostly in headers.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.NAMELEN\">\n            <summary>\n            The length of the name field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.MODELEN\">\n            <summary>\n            The length of the mode field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.UIDLEN\">\n            <summary>\n            The length of the user id field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.GIDLEN\">\n            <summary>\n            The length of the group id field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.CHKSUMLEN\">\n            <summary>\n            The length of the checksum field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.CHKSUMOFS\">\n            <summary>\n            Offset of checksum in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.SIZELEN\">\n            <summary>\n            The length of the size field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.MAGICLEN\">\n            <summary>\n            The length of the magic field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.VERSIONLEN\">\n            <summary>\n            The length of the version field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.MODTIMELEN\">\n            <summary>\n            The length of the modification time field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.UNAMELEN\">\n            <summary>\n            The length of the user name field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.GNAMELEN\">\n            <summary>\n            The length of the group name field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.DEVLEN\">\n            <summary>\n            The length of the devices field in a header buffer.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_OLDNORM\">\n            <summary>\n             The \"old way\" of indicating a normal file.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_NORMAL\">\n            <summary>\n            Normal file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_LINK\">\n            <summary>\n            Link file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_SYMLINK\">\n            <summary>\n            Symbolic link file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_CHR\">\n            <summary>\n            Character device file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_BLK\">\n            <summary>\n            Block device file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_DIR\">\n            <summary>\n            Directory file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_FIFO\">\n            <summary>\n            FIFO (pipe) file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_CONTIG\">\n            <summary>\n            Contiguous file type.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GHDR\">\n            <summary>\n            Posix.1 2001 global extended header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_XHDR\">\n            <summary>\n            Posix.1 2001 extended header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_ACL\">\n            <summary>\n            Solaris access control list file type\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_DUMPDIR\">\n            <summary>\n            GNU dir dump file type\n            This is a dir entry that contains the names of files that were in the\n            dir at the time the dump was made\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_EXTATTR\">\n            <summary>\n            Solaris Extended Attribute File\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_META\">\n            <summary>\n            Inode (metadata only) no file content\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_LONGLINK\">\n            <summary>\n            Identifies the next file on the tape as having a long link name\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_LONGNAME\">\n            <summary>\n            Identifies the next file on the tape as having a long name\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_MULTIVOL\">\n            <summary>\n            Continuation of a file that began on another volume\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_NAMES\">\n            <summary>\n            For storing filenames that dont fit in the main header (old GNU)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_SPARSE\">\n            <summary>\n            GNU Sparse file\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.LF_GNU_VOLHDR\">\n            <summary>\n            GNU Tape/volume header ignore on extraction\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.TMAGIC\">\n            <summary>\n            The magic tag representing a POSIX tar archive.  (includes trailing NULL)\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarHeader.GNU_TMAGIC\">\n            <summary>\n            The magic tag representing an old GNU tar archive where version is included in magic and overwrites it\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.#ctor\">\n            <summary>\n            Initialise a default TarHeader instance\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetName\">\n            <summary>\n            Get the name of this entry.\n            </summary>\n            <returns>The entry's name.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.Clone\">\n            <summary>\n            Create a new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarHeader\"/> that is a copy of the current instance.\n            </summary>\n            <returns>A new <see cref=\"T:System.Object\"/> that is a copy of the current instance.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.ParseBuffer(System.Byte[])\">\n            <summary>\n            Parse TarHeader information from a header buffer.\n            </summary>\n            <param name = \"header\">\n            The tar entry header buffer to get information from.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.WriteHeader(System.Byte[])\">\n            <summary>\n            'Write' header information to buffer provided, updating the <see cref=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Checksum\">check sum</see>.\n            </summary>\n            <param name=\"outBuffer\">output buffer for header information</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetHashCode\">\n            <summary>\n            Get a hash code for the current object.\n            </summary>\n            <returns>A hash code for the current object.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.Equals(System.Object)\">\n            <summary>\n            Determines if this instance is equal to the specified object.\n            </summary>\n            <param name=\"obj\">The object to compare with.</param>\n            <returns>true if the objects are equal, false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.SetValueDefaults(System.Int32,System.String,System.Int32,System.String)\">\n            <summary>\n            Set defaults for values used when constructing a TarHeader instance.\n            </summary>\n            <param name=\"userId\">Value to apply as a default for userId.</param>\n            <param name=\"userName\">Value to apply as a default for userName.</param>\n            <param name=\"groupId\">Value to apply as a default for groupId.</param>\n            <param name=\"groupName\">Value to apply as a default for groupName.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.ParseOctal(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Parse an octal string from a header buffer.\n            </summary>\n            <param name = \"header\">The header buffer from which to parse.</param>\n            <param name = \"offset\">The offset into the buffer from which to parse.</param>\n            <param name = \"length\">The number of header bytes to parse.</param>\n            <returns>The long equivalent of the octal string.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.ParseName(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Parse a name from a header buffer.\n            </summary>\n            <param name=\"header\">\n            The header buffer from which to parse.\n            </param>\n            <param name=\"offset\">\n            The offset into the buffer from which to parse.\n            </param>\n            <param name=\"length\">\n            The number of header bytes to parse.\n            </param>\n            <returns>\n            The name parsed.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetNameBytes(System.Text.StringBuilder,System.Int32,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add <paramref name=\"name\">name</paramref> to the buffer as a collection of bytes\n            </summary>\n            <param name=\"name\">The name to add</param>\n            <param name=\"nameOffset\">The offset of the first character</param>\n            <param name=\"buffer\">The buffer to add to</param>\n            <param name=\"bufferOffset\">The index of the first byte to add</param>\n            <param name=\"length\">The number of characters/bytes to add</param>\n            <returns>The next free index in the <paramref name=\"buf\">buffer</paramref></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetNameBytes(System.String,System.Int32,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add <paramref name=\"name\">name</paramref> to the buffer as a collection of bytes\n            </summary>\n            <param name=\"name\">The name to add</param>\n            <param name=\"nameOffset\">The offset of the first character</param>\n            <param name=\"buffer\">The buffer to add to</param>\n            <param name=\"bufferOffset\">The index of the first byte to add</param>\n            <param name=\"length\">The number of characters/bytes to add</param>\n            <returns>The next free index in the <paramref name=\"buf\">buffer</paramref></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetNameBytes(System.Text.StringBuilder,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add an entry name to the buffer\n            </summary>\n            <param name=\"name\">\n            The name to add\n            </param>\n            <param name=\"buffer\">\n            The buffer to add to\n            </param>\n            <param name=\"offset\">\n            The offset into the buffer from which to start adding\n            </param>\n            <param name=\"length\">\n            The number of header bytes to add\n            </param>\n            <returns>\n            The index of the next free byte in the buffer\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetNameBytes(System.String,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add an entry name to the buffer\n            </summary>\n            <param name=\"name\">The name to add</param>\n            <param name=\"buffer\">The buffer to add to</param>\n            <param name=\"offset\">The offset into the buffer from which to start adding</param>\n            <param name=\"length\">The number of header bytes to add</param>\n            <returns>The index of the next free byte in the buffer</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetAsciiBytes(System.String,System.Int32,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add a string to a buffer as a collection of ascii bytes.\n            </summary>\n            <param name=\"toAdd\">The string to add</param>\n            <param name=\"nameOffset\">The offset of the first character to add.</param>\n            <param name=\"buffer\">The buffer to add to.</param>\n            <param name=\"bufferOffset\">The offset to start adding at.</param>\n            <param name=\"length\">The number of ascii characters to add.</param>\n            <returns>The next free index in the buffer.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetOctalBytes(System.Int64,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Put an octal representation of a value into a buffer\n            </summary>\n            <param name = \"value\">\n            the value to be converted to octal\n            </param>\n            <param name = \"buffer\">\n            buffer to store the octal string\n            </param>\n            <param name = \"offset\">\n            The offset into the buffer where the value starts\n            </param>\n            <param name = \"length\">\n            The length of the octal string to create\n            </param>\n            <returns>\n            The offset of the character next byte after the octal string\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetLongOctalBytes(System.Int64,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Put an octal representation of a value into a buffer\n            </summary>\n            <param name = \"value\">Value to be convert to octal</param>\n            <param name = \"buffer\">The buffer to update</param>\n            <param name = \"offset\">The offset into the buffer to store the value</param>\n            <param name = \"length\">The length of the octal string</param>\n            <returns>Index of next byte</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.GetCheckSumOctalBytes(System.Int64,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Add the checksum integer to header buffer.\n            </summary>\n            <param name = \"value\"></param>\n            <param name = \"buffer\">The header buffer to set the checksum for</param>\n            <param name = \"offset\">The offset into the buffer for the checksum</param>\n            <param name = \"length\">The number of header bytes to update.\n            It's formatted differently from the other fields: it has 6 digits, a\n            null, then a space -- rather than digits, a space, then a null.\n            The final space is already there, from checksumming\n            </param>\n            <returns>The modified buffer offset</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.ComputeCheckSum(System.Byte[])\">\n            <summary>\n            Compute the checksum for a tar entry header.  \n            The checksum field must be all spaces prior to this happening\n            </summary>\n            <param name = \"buffer\">The tar entry's header buffer.</param>\n            <returns>The computed checksum.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarHeader.MakeCheckSum(System.Byte[])\">\n            <summary>\n            Make a checksum for a tar entry ignoring the checksum contents.\n            </summary>\n            <param name = \"buffer\">The tar entry's header buffer.</param>\n            <returns>The checksum for the buffer</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Name\">\n            <summary>\n            Get/set the name for this tar entry.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\">Thrown when attempting to set the property to null.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Mode\">\n            <summary>\n            Get/set the entry's Unix style permission mode.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.UserId\">\n            <summary>\n            The entry's user id.\n            </summary>\n            <remarks>\n            This is only directly relevant to unix systems.\n            The default is zero.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.GroupId\">\n            <summary>\n            Get/set the entry's group id.\n            </summary>\n            <remarks>\n            This is only directly relevant to linux/unix systems.\n            The default value is zero.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Size\">\n            <summary>\n            Get/set the entry's size.\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">Thrown when setting the size to less than zero.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.ModTime\">\n            <summary>\n            Get/set the entry's modification time.\n            </summary>\n            <remarks>\n            The modification time is only accurate to within a second.\n            </remarks>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">Thrown when setting the date time to less than 1/1/1970.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Checksum\">\n            <summary>\n            Get the entry's checksum.  This is only valid/updated after writing or reading an entry.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.IsChecksumValid\">\n            <summary>\n            Get value of true if the header checksum is valid, false otherwise.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.TypeFlag\">\n            <summary>\n            Get/set the entry's type flag.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.LinkName\">\n            <summary>\n            The entry's link name.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\">Thrown when attempting to set LinkName to null.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Magic\">\n            <summary>\n            Get/set the entry's magic tag.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\">Thrown when attempting to set Magic to null.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.Version\">\n            <summary>\n            The entry's version.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\">Thrown when attempting to set Version to null.</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.UserName\">\n            <summary>\n            The entry's user name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.GroupName\">\n            <summary>\n            Get/set the entry's group name.\n            </summary>\n            <remarks>\n            This is only directly relevant to unix systems.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.DevMajor\">\n            <summary>\n            Get/set the entry's major device number.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarHeader.DevMinor\">\n            <summary>\n            Get/set the entry's minor device number.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ScanEventArgs\">\n            <summary>\n            Event arguments for scanning.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ScanEventArgs.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.ScanEventArgs\"/>\n            </summary>\n            <param name=\"name\">The file or directory name.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ScanEventArgs.Name\">\n            <summary>\n            The fie or directory name for this event.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ScanEventArgs.ContinueRunning\">\n            <summary>\n            Get set a value indicating if scanning should continue or not.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ProgressEventArgs\">\n            <summary>\n            Event arguments during processing of a single file or directory.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.#ctor(System.String,System.Int64,System.Int64)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.ScanEventArgs\"/>\n            </summary>\n            <param name=\"name\">The file or directory name if known.</param>\n            <param name=\"processed\">The number of bytes processed so far</param>\n            <param name=\"target\">The total number of bytes to process, 0 if not known</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.Name\">\n            <summary>\n            The name for this event if known.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.ContinueRunning\">\n            <summary>\n            Get set a value indicating wether scanning should continue or not.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.PercentComplete\">\n            <summary>\n            Get a percentage representing how much of the <see cref=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.Target\"></see> has been processed\n            </summary>\n            <value>0.0 to 100.0 percent; 0 if target is not known.</value>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.Processed\">\n            <summary>\n            The number of bytes processed so far\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ProgressEventArgs.Target\">\n            <summary>\n            The number of bytes to process.\n            </summary>\n            <remarks>Target may be 0 or negative if the value isnt known.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.DirectoryEventArgs\">\n            <summary>\n            Event arguments for directories.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.DirectoryEventArgs.#ctor(System.String,System.Boolean)\">\n            <summary>\n            Initialize an instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.DirectoryEventArgs\"></see>.\n            </summary>\n            <param name=\"name\">The name for this directory.</param>\n            <param name=\"hasMatchingFiles\">Flag value indicating if any matching files are contained in this directory.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.DirectoryEventArgs.HasMatchingFiles\">\n            <summary>\n            Get a value indicating if the directory contains any matching files or not.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs\">\n            <summary>\n            Arguments passed when scan failures are detected.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs\"></see>\n            </summary>\n            <param name=\"name\">The name to apply.</param>\n            <param name=\"e\">The exception to use.</param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs.Name\">\n            <summary>\n            The applicable name.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs.Exception\">\n            <summary>\n            The applicable exception.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Core.ScanFailureEventArgs.ContinueRunning\">\n            <summary>\n            Get / set a value indicating wether scanning should continue.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ProcessDirectoryHandler\">\n            <summary>\n            Delegate invoked before starting to process a directory.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ProcessFileHandler\">\n            <summary>\n            Delegate invoked before starting to process a file.\n            </summary>\n            <param name=\"sender\">The source of the event</param>\n            <param name=\"e\">The event arguments.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.ProgressHandler\">\n            <summary>\n            Delegate invoked during processing of a file or directory\n            </summary>\n            <param name=\"sender\">The source of the event</param>\n            <param name=\"e\">The event arguments.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.CompletedFileHandler\">\n            <summary>\n            Delegate invoked when a file has been completely processed.\n            </summary>\n            <param name=\"sender\">The source of the event</param>\n            <param name=\"e\">The event arguments.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.DirectoryFailureHandler\">\n            <summary>\n            Delegate invoked when a directory failure is detected.\n            </summary>\n            <param name=\"sender\">The source of the event</param>\n            <param name=\"e\">The event arguments.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.FileFailureHandler\">\n            <summary>\n            Delegate invoked when a file failure is detected.\n            </summary>\n            <param name=\"sender\">The source of the event</param>\n            <param name=\"e\">The event arguments.</param>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Core.FileSystemScanner\">\n            <summary>\n            FileSystemScanner provides facilities scanning of files and directories.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.#ctor(System.String)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.FileSystemScanner\"></see>\n            </summary>\n            <param name=\"filter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">file filter</see> to apply when scanning.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.#ctor(System.String,System.String)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.FileSystemScanner\"></see>\n            </summary>\n            <param name=\"fileFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\">file filter</see> to apply.</param>\n            <param name=\"directoryFilter\">The <see cref=\"T:ICSharpCode.SharpZipLib.Core.PathFilter\"> directory filter</see> to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.#ctor(ICSharpCode.SharpZipLib.Core.IScanFilter)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.FileSystemScanner\"></see>\n            </summary>\n            <param name=\"fileFilter\">The file <see cref=\"T:ICSharpCode.SharpZipLib.Core.IScanFilter\">filter</see> to apply.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.#ctor(ICSharpCode.SharpZipLib.Core.IScanFilter,ICSharpCode.SharpZipLib.Core.IScanFilter)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Core.FileSystemScanner\"></see>\n            </summary>\n            <param name=\"fileFilter\">The file <see cref=\"T:ICSharpCode.SharpZipLib.Core.IScanFilter\">filter</see>  to apply.</param>\n            <param name=\"directoryFilter\">The directory <see cref=\"T:ICSharpCode.SharpZipLib.Core.IScanFilter\">filter</see>  to apply.</param>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.ProcessDirectory\">\n            <summary>\n            Delegate to invoke when a directory is processed.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.ProcessFile\">\n            <summary>\n            Delegate to invoke when a file is processed.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.CompletedFile\">\n            <summary>\n            Delegate to invoke when processing for a file has finished.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.DirectoryFailure\">\n            <summary>\n            Delegate to invoke when a directory failure is detected.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.FileFailure\">\n            <summary>\n            Delegate to invoke when a file failure is detected.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.OnDirectoryFailure(System.String,System.Exception)\">\n            <summary>\n            Raise the DirectoryFailure event.\n            </summary>\n            <param name=\"directory\">The directory name.</param>\n            <param name=\"e\">The exception detected.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.OnFileFailure(System.String,System.Exception)\">\n            <summary>\n            Raise the FileFailure event.\n            </summary>\n            <param name=\"file\">The file name.</param>\n            <param name=\"e\">The exception detected.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.OnProcessFile(System.String)\">\n            <summary>\n            Raise the ProcessFile event.\n            </summary>\n            <param name=\"file\">The file name.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.OnCompleteFile(System.String)\">\n            <summary>\n            Raise the complete file event\n            </summary>\n            <param name=\"file\">The file name</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.OnProcessDirectory(System.String,System.Boolean)\">\n            <summary>\n            Raise the ProcessDirectory event.\n            </summary>\n            <param name=\"directory\">The directory name.</param>\n            <param name=\"hasMatchingFiles\">Flag indicating if the directory has matching files.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Core.FileSystemScanner.Scan(System.String,System.Boolean)\">\n            <summary>\n            Scan a directory.\n            </summary>\n            <param name=\"directory\">The base directory to scan.</param>\n            <param name=\"recurse\">True to recurse subdirectories, false to scan a single directory.</param>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.fileFilter_\">\n            <summary>\n            The file filter currently in use.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.directoryFilter_\">\n            <summary>\n            The directory filter currently in use.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Core.FileSystemScanner.alive_\">\n            <summary>\n            Flag indicating if scanning should continue running.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer\">\n            <summary>\n            An input buffer customised for use by <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream\"/>\n            </summary>\n            <remarks>\n            The buffer supports decryption of incoming data.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.#ctor(System.IO.Stream)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer\"/> with a default buffer size\n            </summary>\n            <param name=\"stream\">The stream to buffer.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer\"/>\n            </summary>\n            <param name=\"stream\">The stream to buffer.</param>\n            <param name=\"bufferSize\">The size to use for the buffer</param>\n            <remarks>A minimum buffer size of 1KB is permitted.  Lower sizes are treated as 1KB.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.SetInflaterInput(ICSharpCode.SharpZipLib.Zip.Compression.Inflater)\">\n            <summary>\n            Call <see cref=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.SetInput(System.Byte[],System.Int32,System.Int32)\"/> passing the current clear text buffer contents.\n            </summary>\n            <param name=\"inflater\">The inflater to set input for.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.Fill\">\n            <summary>\n            Fill the buffer from the underlying input stream.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadRawBuffer(System.Byte[])\">\n            <summary>\n            Read a buffer directly from the input stream\n            </summary>\n            <param name=\"buffer\">The buffer to fill</param>\n            <returns>Returns the number of bytes read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadRawBuffer(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read a buffer directly from the input stream\n            </summary>\n            <param name=\"outBuffer\">The buffer to read into</param>\n            <param name=\"offset\">The offset to start reading data into.</param>\n            <param name=\"length\">The number of bytes to read.</param>\n            <returns>Returns the number of bytes read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadClearTextBuffer(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read clear text data from the input stream.\n            </summary>\n            <param name=\"outBuffer\">The buffer to add data to.</param>\n            <param name=\"offset\">The offset to start adding data at.</param>\n            <param name=\"length\">The number of bytes to read.</param>\n            <returns>Returns the number of bytes actually read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadLeByte\">\n            <summary>\n            Read a <see cref=\"T:System.Byte\"/> from the input stream.\n            </summary>\n            <returns>Returns the byte read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadLeShort\">\n            <summary>\n            Read an <see cref=\"T:System.Int16\"/> in little endian byte order.\n            </summary>\n            <returns>The short value read case to an int.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadLeInt\">\n            <summary>\n            Read an <see cref=\"T:System.Int32\"/> in little endian byte order.\n            </summary>\n            <returns>The int value read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadLeLong\">\n            <summary>\n            Read a <see cref=\"T:System.Int64\"/> in little endian byte order.\n            </summary>\n            <returns>The long value read.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.RawLength\">\n            <summary>\n            Get the length of bytes bytes in the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.RawData\"/>\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.RawData\">\n            <summary>\n            Get the contents of the raw data buffer.\n            </summary>\n            <remarks>This may contain encrypted data.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ClearTextLength\">\n            <summary>\n            Get the number of useable bytes in <see cref=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ClearText\"/>\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ClearText\">\n            <summary>\n            Get the contents of the clear text buffer.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.Available\">\n            <summary>\n            Get/set the number of bytes available\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.CryptoTransform\">\n            <summary>\n            Get/set the <see cref=\"T:System.Security.Cryptography.ICryptoTransform\"/> to apply to any data.\n            </summary>\n            <remarks>Set this value to null to have no transform applied.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarOutputStream\">\n            <summary>\n            The TarOutputStream writes a UNIX tar archive as an OutputStream.\n            Methods are provided to put entries, and then write their contents\n            by writing to this stream using write().\n            </summary>\n            public\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Construct TarOutputStream using default block factor\n            </summary>\n            <param name=\"outputStream\">stream to write to</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Construct TarOutputStream with user specified block factor\n            </summary>\n            <param name=\"outputStream\">stream to write to</param>\n            <param name=\"blockFactor\">blocking factor</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            set the position within the current stream\n            </summary>\n            <param name=\"offset\">The offset relative to the <paramref name=\"origin\"/> to seek to</param>\n            <param name=\"origin\">The <see cref=\"T:System.IO.SeekOrigin\"/> to seek from.</param>\n            <returns>The new position in the stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.SetLength(System.Int64)\">\n            <summary>\n            Set the length of the current stream\n            </summary>\n            <param name=\"value\">The new stream length.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.ReadByte\">\n            <summary>\n            Read a byte from the stream and advance the position within the stream \n            by one byte or returns -1 if at the end of the stream.\n            </summary>\n            <returns>The byte value or -1 if at end of stream</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            read bytes from the current stream and advance the position within the \n            stream by the number of bytes read.\n            </summary>\n            <param name=\"buffer\">The buffer to store read bytes in.</param>\n            <param name=\"offset\">The index into the buffer to being storing bytes at.</param>\n            <param name=\"count\">The desired number of bytes to read.</param>\n            <returns>The total number of bytes read, or zero if at the end of the stream.\n            The number of bytes may be less than the <paramref name=\"count\">count</paramref>\n            requested if data is not avialable.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Flush\">\n            <summary>\n            All buffered data is written to destination\n            </summary>\t\t\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Finish\">\n            <summary>\n            Ends the TAR archive without closing the underlying OutputStream.\n            The result is that the EOF block of nulls is written.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Close\">\n            <summary>\n            Ends the TAR archive and closes the underlying OutputStream.\n            </summary>\n            <remarks>This means that Finish() is called followed by calling the\n            TarBuffer's Close().</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.GetRecordSize\">\n            <summary>\n            Get the record size being used by this stream's TarBuffer.\n            </summary>\n            <returns>\n            The TarBuffer record size.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.PutNextEntry(ICSharpCode.SharpZipLib.Tar.TarEntry)\">\n            <summary>\n            Put an entry on the output stream. This writes the entry's\n            header and positions the output stream for writing\n            the contents of the entry. Once this method is called, the\n            stream is ready for calls to write() to write the entry's\n            contents. Once the contents are written, closeEntry()\n            <B>MUST</B> be called to ensure that all buffered data\n            is completely written to the output stream.\n            </summary>\n            <param name=\"entry\">\n            The TarEntry to be written to the archive.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.CloseEntry\">\n            <summary>\n            Close an entry. This method MUST be called for all file\n            entries that contain data. The reason is that we must\n            buffer data written to the stream in order to satisfy\n            the buffer's block based writes. Thus, there may be\n            data fragments still being assembled that must be written\n            to the output stream before this entry is closed and the\n            next entry written.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.WriteByte(System.Byte)\">\n            <summary>\n            Writes a byte to the current tar archive entry.\n            This method simply calls Write(byte[], int, int).\n            </summary>\n            <param name=\"value\">\n            The byte to be written.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes bytes to the current tar archive entry. This method\n            is aware of the current entry and will throw an exception if\n            you attempt to write bytes past the length specified for the\n            current entry. The method is also (painfully) aware of the\n            record buffering required by TarBuffer, and manages buffers\n            that are not a multiple of recordsize in length, including\n            assembling records from small buffers.\n            </summary>\n            <param name = \"buffer\">\n            The buffer to write to the archive.\n            </param>\n            <param name = \"offset\">\n            The offset in the buffer from which to get bytes.\n            </param>\n            <param name = \"count\">\n            The number of bytes to write.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarOutputStream.WriteEofBlock\">\n            <summary>\n            Write an EOF (end of archive) block to the tar archive.\n            An EOF block consists of all zeros.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.currBytes\">\n            <summary>\n            bytes written for this entry so far\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.assemblyBufferLength\">\n            <summary>\n            current 'Assembly' buffer length\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.isClosed\">\n            <summary>\n            Flag indicating wether this instance has been closed or not.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.currSize\">\n            <summary>\n            Size for the current entry\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.blockBuffer\">\n            <summary>\n            single block working buffer \n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.assemblyBuffer\">\n            <summary>\n            'Assembly' buffer used to assemble data before writing\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.buffer\">\n            <summary>\n            TarBuffer used to provide correct blocking factor\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarOutputStream.outputStream\">\n            <summary>\n            the destination stream for the archive contents\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.CanRead\">\n            <summary>\n            true if the stream supports reading; otherwise, false.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.CanSeek\">\n            <summary>\n            true if the stream supports seeking; otherwise, false.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.CanWrite\">\n            <summary>\n            true if stream supports writing; otherwise, false.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Length\">\n            <summary>\n            length of stream in bytes\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.Position\">\n            <summary>\n            gets or sets the position within the current stream.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.RecordSize\">\n            <summary>\n            Get the record size being used by this stream's TarBuffer.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarOutputStream.IsEntryOpen\">\n            <summary>\n            Get a value indicating wether an entry is open, requiring more data to be written.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Deflater\">\n             <summary>\n             This is the Deflater class.  The deflater class compresses input\n             with the deflate algorithm described in RFC 1951.  It has several\n             compression levels and three different strategies described below.\n            \n             This class is <i>not</i> thread safe.  This is inherent in the API, due\n             to the split of deflate and setInput.\n             \n             author of the original java version : Jochen Hoenicke\n             </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.BEST_COMPRESSION\">\n            <summary>\n            The best and slowest compression level.  This tries to find very\n            long and distant string repetitions.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.BEST_SPEED\">\n            <summary>\n            The worst but fastest compression level.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.DEFAULT_COMPRESSION\">\n            <summary>\n            The default compression level.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.NO_COMPRESSION\">\n            <summary>\n            This level won't compress at all but output uncompressed blocks.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.DEFLATED\">\n            <summary>\n            The compression method.  This is the only method supported so far.\n            There is no need to use this constant at all.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.#ctor\">\n            <summary>\n            Creates a new deflater with default compression level.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.#ctor(System.Int32)\">\n            <summary>\n            Creates a new deflater with given compression level.\n            </summary>\n            <param name=\"level\">\n            the compression level, a value between NO_COMPRESSION\n            and BEST_COMPRESSION, or DEFAULT_COMPRESSION.\n            </param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">if lvl is out of range.</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.#ctor(System.Int32,System.Boolean)\">\n            <summary>\n            Creates a new deflater with given compression level.\n            </summary>\n            <param name=\"level\">\n            the compression level, a value between NO_COMPRESSION\n            and BEST_COMPRESSION.\n            </param>\n            <param name=\"noZlibHeaderOrFooter\">\n            true, if we should suppress the Zlib/RFC1950 header at the\n            beginning and the adler checksum at the end of the output.  This is\n            useful for the GZIP/PKZIP formats.\n            </param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">if lvl is out of range.</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Reset\">\n            <summary>\n            Resets the deflater.  The deflater acts afterwards as if it was\n            just created with the same compression level and strategy as it\n            had before.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Flush\">\n            <summary>\n            Flushes the current input block.  Further calls to deflate() will\n            produce enough output to inflate everything in the current input\n            block.  This is not part of Sun's JDK so I have made it package\n            private.  It is used by DeflaterOutputStream to implement\n            flush().\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Finish\">\n            <summary>\n            Finishes the deflater with the current input block.  It is an error\n            to give more input after this method was called.  This method must\n            be called to force all bytes to be flushed.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetInput(System.Byte[])\">\n            <summary>\n            Sets the data which should be compressed next.  This should be only\n            called when needsInput indicates that more input is needed.\n            If you call setInput when needsInput() returns false, the\n            previous input that is still pending will be thrown away.\n            The given byte array should not be changed, before needsInput() returns\n            true again.\n            This call is equivalent to <code>setInput(input, 0, input.length)</code>.\n            </summary>\n            <param name=\"input\">\n            the buffer containing the input data.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            if the buffer was finished() or ended().\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetInput(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Sets the data which should be compressed next.  This should be\n            only called when needsInput indicates that more input is needed.\n            The given byte array should not be changed, before needsInput() returns\n            true again.\n            </summary>\n            <param name=\"input\">\n            the buffer containing the input data.\n            </param>\n            <param name=\"offset\">\n            the start of the data.\n            </param>\n            <param name=\"count\">\n            the number of data bytes of input.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            if the buffer was Finish()ed or if previous input is still pending.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetLevel(System.Int32)\">\n            <summary>\n            Sets the compression level.  There is no guarantee of the exact\n            position of the change, but if you call this when needsInput is\n            true the change of compression level will occur somewhere near\n            before the end of the so far given input.\n            </summary>\n            <param name=\"level\">\n            the new compression level.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.GetLevel\">\n            <summary>\n            Get current compression level\n            </summary>\n            <returns>Returns the current compression level</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetStrategy(ICSharpCode.SharpZipLib.Zip.Compression.DeflateStrategy)\">\n            <summary>\n            Sets the compression strategy. Strategy is one of\n            DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED.  For the exact\n            position where the strategy is changed, the same as for\n            SetLevel() applies.\n            </summary>\n            <param name=\"strategy\">\n            The new compression strategy.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Deflate(System.Byte[])\">\n            <summary>\n            Deflates the current input block with to the given array.\n            </summary>\n            <param name=\"output\">\n            The buffer where compressed data is stored\n            </param>\n            <returns>\n            The number of compressed bytes added to the output, or 0 if either\n            IsNeedingInput() or IsFinished returns true or length is zero.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Deflate(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Deflates the current input block to the given array.\n            </summary>\n            <param name=\"output\">\n            Buffer to store the compressed data.\n            </param>\n            <param name=\"offset\">\n            Offset into the output array.\n            </param>\n            <param name=\"length\">\n            The maximum number of bytes that may be stored.\n            </param>\n            <returns>\n            The number of compressed bytes added to the output, or 0 if either\n            needsInput() or finished() returns true or length is zero.\n            </returns>\n            <exception cref=\"T:System.InvalidOperationException\">\n            If Finish() was previously called.\n            </exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            If offset or length don't match the array length.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetDictionary(System.Byte[])\">\n            <summary>\n            Sets the dictionary which should be used in the deflate process.\n            This call is equivalent to <code>setDictionary(dict, 0, dict.Length)</code>.\n            </summary>\n            <param name=\"dictionary\">\n            the dictionary.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            if SetInput () or Deflate () were already called or another dictionary was already set.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.SetDictionary(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Sets the dictionary which should be used in the deflate process.\n            The dictionary is a byte array containing strings that are\n            likely to occur in the data which should be compressed.  The\n            dictionary is not stored in the compressed output, only a\n            checksum.  To decompress the output you need to supply the same\n            dictionary again.\n            </summary>\n            <param name=\"dictionary\">\n            The dictionary data\n            </param>\n            <param name=\"index\">\n            The index where dictionary information commences.\n            </param>\n            <param name=\"count\">\n            The number of bytes in the dictionary.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            If SetInput () or Deflate() were already called or another dictionary was already set.\n            </exception>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.level\">\n            <summary>\n            Compression level.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.noZlibHeaderOrFooter\">\n            <summary>\n            If true no Zlib/RFC1950 headers or footers are generated\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.state\">\n            <summary>\n            The current state.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.totalOut\">\n            <summary>\n            The total bytes of output written.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.pending\">\n            <summary>\n            The pending output.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.engine\">\n            <summary>\n            The deflater engine.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.Adler\">\n            <summary>\n            Gets the current adler checksum of the data that was processed so far.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.TotalIn\">\n            <summary>\n            Gets the number of input bytes processed so far.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.TotalOut\">\n            <summary>\n            Gets the number of output bytes so far.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.IsFinished\">\n            <summary>\n            Returns true if the stream was finished and no more output bytes\n            are available.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Deflater.IsNeedingInput\">\n            <summary>\n            Returns true, if the input buffer is empty.\n            You should then call setInput(). \n            NOTE: This method can also return true when the stream\n            was finished.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarInputStream\">\n            <summary>\n            The TarInputStream reads a UNIX tar archive as an InputStream.\n            methods are provided to position at each successive entry in\n            the archive, and the read each entry as a normal input stream\n            using read().\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Construct a TarInputStream with default block factor\n            </summary>\n            <param name=\"inputStream\">stream to source data from</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.#ctor(System.IO.Stream,System.Int32)\">\n            <summary>\n            Construct a TarInputStream with user specified block factor\n            </summary>\n            <param name=\"inputStream\">stream to source data from</param>\n            <param name=\"blockFactor\">block factor to apply to archive</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Flush\">\n            <summary>\n            Flushes the baseInputStream\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            Set the streams position.  This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"offset\">The offset relative to the origin to seek to.</param>\n            <param name=\"origin\">The <see cref=\"T:System.IO.SeekOrigin\"/> to start seeking from.</param>\n            <returns>The new position in the stream.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.SetLength(System.Int64)\">\n            <summary>\n            Sets the length of the stream\n            This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"value\">The new stream length.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes a block of bytes to this stream using data from a buffer.\n            This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"buffer\">The buffer containing bytes to write.</param>\n            <param name=\"offset\">The offset in the buffer of the frist byte to write.</param>\n            <param name=\"count\">The number of bytes to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.WriteByte(System.Byte)\">\n            <summary>\n            Writes a byte to the current position in the file stream.\n            This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"value\">The byte value to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.ReadByte\">\n            <summary>\n            Reads a byte from the current tar archive entry.\n            </summary>\n            <returns>A byte cast to an int; -1 if the at the end of the stream.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Reads bytes from the current tar archive entry.\n            \n            This method is aware of the boundaries of the current\n            entry in the archive and will deal with them appropriately\n            </summary>\n            <param name=\"buffer\">\n            The buffer into which to place bytes read.\n            </param>\n            <param name=\"offset\">\n            The offset at which to place bytes read.\n            </param>\n            <param name=\"count\">\n            The number of bytes to read.\n            </param>\n            <returns>\n            The number of bytes read, or 0 at end of stream/EOF.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Close\">\n            <summary>\n            Closes this stream. Calls the TarBuffer's close() method.\n            The underlying stream is closed by the TarBuffer.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.SetEntryFactory(ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory)\">\n            <summary>\n            Set the entry factory for this instance.\n            </summary>\n            <param name=\"factory\">The factory for creating new entries</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.GetRecordSize\">\n            <summary>\n            Get the record size being used by this stream's TarBuffer.\n            </summary>\n            <returns>\n            TarBuffer record size.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Skip(System.Int64)\">\n            <summary>\n            Skip bytes in the input buffer. This skips bytes in the\n            current entry's data, not the entire archive, and will\n            stop at the end of the current entry's data if the number\n            to skip extends beyond that point.\n            </summary>\n            <param name=\"skipCount\">\n            The number of bytes to skip.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Mark(System.Int32)\">\n            <summary>\n            Since we do not support marking just yet, we do nothing.\n            </summary>\n            <param name =\"markLimit\">\n            The limit to mark.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.Reset\">\n            <summary>\n            Since we do not support marking just yet, we do nothing.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntry\">\n            <summary>\n            Get the next entry in this tar archive. This will skip\n            over any remaining data in the current entry, if there\n            is one, and place the input stream at the header of the\n            next entry, and read the header and instantiate a new\n            TarEntry from the header bytes and return that entry.\n            If there are no more entries in the archive, null will\n            be returned to indicate that the end of the archive has\n            been reached.\n            </summary>\n            <returns>\n            The next TarEntry in the archive, or null.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.CopyEntryContents(System.IO.Stream)\">\n            <summary>\n            Copies the contents of the current tar archive entry directly into\n            an output stream.\n            </summary>\n            <param name=\"outputStream\">\n            The OutputStream into which to write the entry's data.\n            </param>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.hasHitEOF\">\n            <summary>\n            Flag set when last block has been read\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.entrySize\">\n            <summary>\n            Size of this entry as recorded in header\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.entryOffset\">\n            <summary>\n            Number of bytes read for this entry so far\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.readBuffer\">\n            <summary>\n            Buffer used with calls to <code>Read()</code>\n            </summary>\t\t\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.buffer\">\n            <summary>\n            Working buffer\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.currentEntry\">\n            <summary>\n            Current entry being read\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.entryFactory\">\n            <summary>\n            Factory used to create TarEntry or descendant class instance\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Tar.TarInputStream.inputStream\">\n            <summary>\n            Stream used as the source of input data.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.CanRead\">\n            <summary>\n            Gets a value indicating whether the current stream supports reading\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.CanSeek\">\n            <summary>\n            Gets a value indicating whether the current stream supports seeking\n            This property always returns false.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.CanWrite\">\n            <summary>\n            Gets a value indicating if the stream supports writing.\n            This property always returns false.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.Length\">\n            <summary>\n            The length in bytes of the stream\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.Position\">\n            <summary>\n            Gets or sets the position within the stream. \n            Setting the Position is not supported and throws a NotSupportedExceptionNotSupportedException\n            </summary>\n            <exception cref=\"T:System.NotSupportedException\">Any attempt to set position</exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.RecordSize\">\n            <summary>\n            Get the record size being used by this stream's TarBuffer.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.Available\">\n            <summary>\n            Get the available data that can be read from the current\n            entry in the archive. This does not indicate how much data\n            is left in the entire archive, only in the current entry.\n            This value is determined from the entry's size header field\n            and the amount of data already read from the current entry.\n            </summary>\n            <returns>\n            The number of available bytes for the current entry.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Tar.TarInputStream.IsMarkSupported\">\n            <summary>\n            Return a value of true if marking is supported; false otherwise.\n            </summary>\n            <remarks>Currently marking is not supported, the return value is always false.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory\">\n            <summary>\n            This interface is provided, along with the method <see cref=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.SetEntryFactory(ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory)\"/>, to allow\n            the programmer to have their own <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/> subclass instantiated for the\n            entries return from <see cref=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntry\"/>.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory.CreateEntry(System.String)\">\n            <summary>\n            Create an entry based on name alone\n            </summary>\n            <param name=\"name\">\n            Name of the new EntryPointNotFoundException to create\n            </param>\n            <returns>created TarEntry or descendant class</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory.CreateEntryFromFile(System.String)\">\n            <summary>\n            Create an instance based on an actual file\n            </summary>\n            <param name=\"fileName\">\n            Name of file to represent in the entry\n            </param>\n            <returns>\n            Created TarEntry or descendant class\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.IEntryFactory.CreateEntry(System.Byte[])\">\n            <summary>\n            Create a tar entry based on the header information passed\n            </summary>\n            <param name=\"headerBuf\">\n            Buffer containing header information to base entry on\n            </param>\n            <returns>\n            Created TarEntry or descendant class\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Tar.TarInputStream.EntryFactoryAdapter\">\n            <summary>\n            Standard entry factory class creating instances of the class TarEntry\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.EntryFactoryAdapter.CreateEntry(System.String)\">\n            <summary>\n            Create a <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/> based on named\n            </summary>\n            <param name=\"name\">The name to use for the entry</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.EntryFactoryAdapter.CreateEntryFromFile(System.String)\">\n            <summary>\n            Create a tar entry with details obtained from <paramref name=\"fileName\">file</paramref>\n            </summary>\n            <param name=\"fileName\">The name of the file to retrieve details from.</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Tar.TarInputStream.EntryFactoryAdapter.CreateEntry(System.Byte[])\">\n            <summary>\n            Create an entry based on details in <paramref name=\"headerBuf\">header</paramref>\n            </summary>\t\t\t\n            <param name=\"headerBuffer\">The buffer containing entry details.</param>\n            <returns>A new <see cref=\"T:ICSharpCode.SharpZipLib.Tar.TarEntry\"/></returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.HostSystemID\">\n            <summary>\n            Defines known values for the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.HostSystemID\"/> property.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Msdos\">\n            <summary>\n            Host system = MSDOS\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Amiga\">\n            <summary>\n            Host system = Amiga\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.OpenVms\">\n            <summary>\n            Host system = Open VMS\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Unix\">\n            <summary>\n            Host system = Unix\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.VMCms\">\n            <summary>\n            Host system = VMCms\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.AtariST\">\n            <summary>\n            Host system = Atari ST\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.OS2\">\n            <summary>\n            Host system = OS2\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Macintosh\">\n            <summary>\n            Host system = Macintosh\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.ZSystem\">\n            <summary>\n            Host system = ZSystem\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Cpm\">\n            <summary>\n            Host system = Cpm\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.WindowsNT\">\n            <summary>\n            Host system = Windows NT\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.MVS\">\n            <summary>\n            Host system = MVS\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Vse\">\n            <summary>\n            Host system = VSE\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.AcornRisc\">\n            <summary>\n            Host system = Acorn RISC\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Vfat\">\n            <summary>\n            Host system = VFAT\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.AlternateMvs\">\n            <summary>\n            Host system = Alternate MVS\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.BeOS\">\n            <summary>\n            Host system = BEOS\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.Tandem\">\n            <summary>\n            Host system = Tandem\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.OS400\">\n            <summary>\n            Host system = OS400\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.OSX\">\n            <summary>\n            Host system = OSX\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.HostSystemID.WinZipAES\">\n            <summary>\n            Host system = WinZIP AES\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\">\n            <summary>\n            This class represents an entry in a zip archive.  This can be a file\n            or a directory\n            ZipFile and ZipInputStream will give you instances of this class as \n            information about the members in an archive.  ZipOutputStream\n            uses an instance of this class when creating an entry in a Zip file.\n            <br/>\n            <br/>Author of the original java version : Jochen Hoenicke\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.#ctor(System.String)\">\n            <summary>\n            Creates a zip entry with the given name.\n            </summary>\n            <param name=\"name\">\n            The name for this entry. Can include directory components.\n            The convention for names is 'unix' style paths with relative names only.\n            There are with no device names and path elements are separated by '/' characters.\n            </param>\n            <exception cref=\"T:System.ArgumentNullException\">\n            The name passed is null\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.#ctor(System.String,System.Int32)\">\n            <summary>\n            Creates a zip entry with the given name and version required to extract\n            </summary>\n            <param name=\"name\">\n            The name for this entry. Can include directory components.\n            The convention for names is 'unix'  style paths with no device names and \n            path elements separated by '/' characters.  This is not enforced see <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.CleanName(System.String)\">CleanName</see>\n            on how to ensure names are valid if this is desired.\n            </param>\n            <param name=\"versionRequiredToExtract\">\n            The minimum 'feature version' required this entry\n            </param>\n            <exception cref=\"T:System.ArgumentNullException\">\n            The name passed is null\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.#ctor(System.String,System.Int32,System.Int32,ICSharpCode.SharpZipLib.Zip.CompressionMethod)\">\n            <summary>\n            Initializes an entry with the given name and made by information\n            </summary>\n            <param name=\"name\">Name for this entry</param>\n            <param name=\"madeByInfo\">Version and HostSystem Information</param>\n            <param name=\"versionRequiredToExtract\">Minimum required zip feature version required to extract this entry</param>\n            <param name=\"method\">Compression method for this entry.</param>\n            <exception cref=\"T:System.ArgumentNullException\">\n            The name passed is null\n            </exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            versionRequiredToExtract should be 0 (auto-calculate) or &gt; 10\n            </exception>\n            <remarks>\n            This constructor is used by the ZipFile class when reading from the central header\n            It is not generally useful, use the constructor specifying the name only.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.#ctor(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Creates a deep copy of the given zip entry.\n            </summary>\n            <param name=\"entry\">\n            The entry to copy.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.HasDosAttributes(System.Int32)\">\n            <summary>\n            Test the external attributes for this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/> to\n            see if the external attributes are Dos based (including WINNT and variants)\n            and match the values\n            </summary>\n            <param name=\"attributes\">The attributes to test.</param>\n            <returns>Returns true if the external attributes are known to be DOS/Windows \n            based and have the same attributes set as the value passed.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.ForceZip64\">\n            <summary>\n            Force this entry to be recorded using Zip64 extensions.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsZip64Forced\">\n            <summary>\n            Get a value indicating wether Zip64 extensions were forced.\n            </summary>\n            <returns>A <see cref=\"T:System.Boolean\"/> value of true if Zip64 extensions have been forced on; false if not.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.ProcessExtraData(System.Boolean)\">\n            <summary>\n            Process extra data fields updating the entry based on the contents.\n            </summary>\n            <param name=\"localHeader\">True if the extra data fields should be handled\n            for a local header, rather than for a central header.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCompressionMethodSupported\">\n            <summary>\n            Test entry to see if data can be extracted.\n            </summary>\n            <returns>Returns true if data can be extracted for this entry; false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.Clone\">\n            <summary>\n            Creates a copy of this zip entry.\n            </summary>\n            <returns>An <see cref=\"T:System.Object\"/> that is a copy of the current instance.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.ToString\">\n            <summary>\n            Gets a string representation of this ZipEntry.\n            </summary>\n            <returns>A readable textual representation of this <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipEntry\"/></returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCompressionMethodSupported(ICSharpCode.SharpZipLib.Zip.CompressionMethod)\">\n            <summary>\n            Test a <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CompressionMethod\">compression method</see> to see if this library\n            supports extracting data compressed with that method\n            </summary>\n            <param name=\"method\">The compression method to test.</param>\n            <returns>Returns true if the compression method is supported; false otherwise</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.CleanName(System.String)\">\n            <summary>\n            Cleans a name making it conform to Zip file conventions.\n            Devices names ('c:\\') and UNC share names ('\\\\server\\share') are removed\n            and forward slashes ('\\') are converted to back slashes ('/').\n            Names are made relative by trimming leading slashes which is compatible\n            with the ZIP naming convention.\n            </summary>\n            <param name=\"name\">The name to clean</param>\n            <returns>The 'cleaned' name.</returns>\n            <remarks>\n            The <seealso cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\">Zip name transform</seealso> class is more flexible.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.HasCrc\">\n            <summary>\n            Get a value indicating wether the entry has a CRC value available.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCrypted\">\n            <summary>\n            Get/Set flag indicating if entry is encrypted.\n            A simple helper routine to aid interpretation of <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Flags\">flags</see>\n            </summary>\n            <remarks>This is an assistant that interprets the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Flags\">flags</see> property.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsUnicodeText\">\n            <summary>\n            Get / set a flag indicating wether entry name and comment text are\n            encoded in <a href=\"http://www.unicode.org\">unicode UTF8</a>.\n            </summary>\n            <remarks>This is an assistant that interprets the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Flags\">flags</see> property.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CryptoCheckValue\">\n            <summary>\n            Value used during password checking for PKZIP 2.0 / 'classic' encryption.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Flags\">\n            <summary>\n            Get/Set general purpose bit flag for entry\n            </summary>\n            <remarks>\n            General purpose bit flag<br/>\n            <br/>\n            Bit 0: If set, indicates the file is encrypted<br/>\n            Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating<br/>\n            Imploding:<br/>\n            Bit 1 if set indicates an 8K sliding dictionary was used.  If clear a 4k dictionary was used<br/>\n            Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise<br/>\n            <br/>\n            Deflating:<br/>\n              Bit 2    Bit 1<br/>\n                0        0       Normal compression was used<br/>\n                0        1       Maximum compression was used<br/>\n                1        0       Fast compression was used<br/>\n                1        1       Super fast compression was used<br/>\n            <br/>\n            Bit 3: If set, the fields crc-32, compressed size\n            and uncompressed size are were not able to be written during zip file creation\n            The correct values are held in a data descriptor immediately following the compressed data. <br/>\n            Bit 4: Reserved for use by PKZIP for enhanced deflating<br/>\n            Bit 5: If set indicates the file contains compressed patch data<br/>\n            Bit 6: If set indicates strong encryption was used.<br/>\n            Bit 7-10: Unused or reserved<br/>\n            Bit 11: If set the name and comments for this entry are in <a href=\"http://www.unicode.org\">unicode</a>.<br/>\n            Bit 12-15: Unused or reserved<br/>\n            </remarks>\n            <seealso cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsUnicodeText\"></seealso>\n            <seealso cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCrypted\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.ZipFileIndex\">\n            <summary>\n            Get/Set index of this entry in Zip file\n            </summary>\n            <remarks>This is only valid when the entry is part of a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"></see></remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Offset\">\n            <summary>\n            Get/set offset for use in central header\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.ExternalFileAttributes\">\n            <summary>\n            Get/Set external file attributes as an integer.\n            The values of this are operating system dependant see\n            <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.HostSystem\">HostSystem</see> for details\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.VersionMadeBy\">\n            <summary>\n            Get the version made by for this entry or zero if unknown.\n            The value / 10 indicates the major version number, and \n            the value mod 10 is the minor version number\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsDOSEntry\">\n            <summary>\n            Get a value indicating this entry is for a DOS/Windows system.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.HostSystem\">\n            <summary>\n            Gets the compatability information for the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.ExternalFileAttributes\">external file attribute</see>\n            If the external file attributes are compatible with MS-DOS and can be read\n            by PKZIP for DOS version 2.04g then this value will be zero.  Otherwise the value\n            will be non-zero and identify the host system on which the attributes are compatible.\n            </summary>\n            \t\t\n            <remarks>\n            The values for this as defined in the Zip File format and by others are shown below.  The values are somewhat\n            misleading in some cases as they are not all used as shown.  You should consult the relevant documentation\n            to obtain up to date and correct information.  The modified appnote by the infozip group is\n            particularly helpful as it documents a lot of peculiarities.  The document is however a little dated.\n            <list type=\"table\">\n            <item>0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)</item>\n            <item>1 - Amiga</item>\n            <item>2 - OpenVMS</item>\n            <item>3 - Unix</item>\n            <item>4 - VM/CMS</item>\n            <item>5 - Atari ST</item>\n            <item>6 - OS/2 HPFS</item>\n            <item>7 - Macintosh</item>\n            <item>8 - Z-System</item>\n            <item>9 - CP/M</item>\n            <item>10 - Windows NTFS</item>\n            <item>11 - MVS (OS/390 - Z/OS)</item>\n            <item>12 - VSE</item>\n            <item>13 - Acorn Risc</item>\n            <item>14 - VFAT</item>\n            <item>15 - Alternate MVS</item>\n            <item>16 - BeOS</item>\n            <item>17 - Tandem</item>\n            <item>18 - OS/400</item>\n            <item>19 - OS/X (Darwin)</item>\n            <item>99 - WinZip AES</item>\n            <item>remainder - unused</item>\n            </list>\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Version\">\n            <summary>\n            Get minimum Zip feature version required to extract this entry\n            </summary>\t\t\n            <remarks>\n            Minimum features are defined as:<br/>\n            1.0 - Default value<br/>\n            1.1 - File is a volume label<br/>\n            2.0 - File is a folder/directory<br/>\n            2.0 - File is compressed using Deflate compression<br/>\n            2.0 - File is encrypted using traditional encryption<br/>\n            2.1 - File is compressed using Deflate64<br/>\n            2.5 - File is compressed using PKWARE DCL Implode<br/>\n            2.7 - File is a patch data set<br/>\n            4.5 - File uses Zip64 format extensions<br/>\n            4.6 - File is compressed using BZIP2 compression<br/>\n            5.0 - File is encrypted using DES<br/>\n            5.0 - File is encrypted using 3DES<br/>\n            5.0 - File is encrypted using original RC2 encryption<br/>\n            5.0 - File is encrypted using RC4 encryption<br/>\n            5.1 - File is encrypted using AES encryption<br/>\n            5.1 - File is encrypted using corrected RC2 encryption<br/>\n            5.1 - File is encrypted using corrected RC2-64 encryption<br/>\n            6.1 - File is encrypted using non-OAEP key wrapping<br/>\n            6.2 - Central directory encryption (not confirmed yet)<br/>\n            6.3 - File is compressed using LZMA<br/>\n            6.3 - File is compressed using PPMD+<br/>\n            6.3 - File is encrypted using Blowfish<br/>\n            6.3 - File is encrypted using Twofish<br/>\n            </remarks>\n            <seealso cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CanDecompress\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CanDecompress\">\n            <summary>\n            Get a value indicating wether this entry can be decompressed by the library.\n            </summary>\n            <remarks>This is based on the <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Version\"></see> and \n            wether the <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCompressionMethodSupported\">compression method</see> is supported.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.LocalHeaderRequiresZip64\">\n            <summary>\n            Gets a value indicating if the entry requires Zip64 extensions \n            to store the full entry values.\n            </summary>\n            <value>A <see cref=\"T:System.Boolean\"/> value of true if a local header requires Zip64 extensions; false if not.</value>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CentralHeaderRequiresZip64\">\n            <summary>\n            Get a value indicating wether the central directory entry requires Zip64 extensions to be stored.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.DosTime\">\n            <summary>\n            Get/Set DosTime value.\n            </summary>\n            <remarks>\n            The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.DateTime\">\n            <summary>\n            Gets/Sets the time of last modification of the entry.\n            </summary>\n            <remarks>\n            The <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.DosTime\"></see> property is updated to match this as far as possible.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Name\">\n             <summary>\n             Returns the entry name.\n             </summary>\n             <remarks>\n             The unix naming convention is followed.\n             Path components in the entry should always separated by forward slashes ('/').\n             Dos device names like C: should also be removed.\n             See the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipNameTransform\"/> class, or <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipEntry.CleanName(System.String)\"/>\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Size\">\n            <summary>\n            Gets/Sets the size of the uncompressed data.\n            </summary>\n            <returns>\n            The size or -1 if unknown.\n            </returns>\n            <remarks>Setting the size before adding an entry to an archive can help\n            avoid compatability problems with some archivers which dont understand Zip64 extensions.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CompressedSize\">\n            <summary>\n            Gets/Sets the size of the compressed data.\n            </summary>\n            <returns>\n            The compressed entry size or -1 if unknown.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Crc\">\n            <summary>\n            Gets/Sets the crc of the uncompressed data.\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Crc is not in the range 0..0xffffffffL\n            </exception>\n            <returns>\n            The crc value or -1 if unknown.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.CompressionMethod\">\n            <summary>\n            Gets/Sets the compression method. Only Deflated and Stored are supported.\n            </summary>\n            <returns>\n            The compression method for this entry\n            </returns>\n            <see cref=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.Deflated\"/>\n            <see cref=\"F:ICSharpCode.SharpZipLib.Zip.CompressionMethod.Stored\"/>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.ExtraData\">\n            <summary>\n            Gets/Sets the extra data.\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            Extra data is longer than 64KB (0xffff) bytes.\n            </exception>\n            <returns>\n            Extra data or null if not set.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.Comment\">\n            <summary>\n            Gets/Sets the entry comment.\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            If comment is longer than 0xffff.\n            </exception>\n            <returns>\n            The comment or null if not set.\n            </returns>\n            <remarks>\n            A comment is only available for entries when read via the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipFile\"/> class.\n            The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipInputStream\"/> class doesnt have the comment data available.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsDirectory\">\n            <summary>\n            Gets a value indicating if the entry is a directory.\n            however.\n            </summary>\n            <remarks>\n            A directory is determined by an entry name with a trailing slash '/'.\n            The external file attributes can also indicate an entry is for a directory.\n            Currently only dos/windows attributes are tested in this manner.\n            The trailing slash convention should always be followed.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipEntry.IsFile\">\n            <summary>\n            Get a value of true if the entry appears to be a file; false otherwise\n            </summary>\n            <remarks>\n            This only takes account of DOS/Windows attributes.  Other operating systems are ignored.\n            For linux and others the result may be incorrect.\n            </remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\">\n            <summary>\n            ExtraData tagged value interface.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ITaggedData.SetData(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Set the contents of this instance from the data passed.\n            </summary>\n            <param name=\"data\">The data to extract contents from.</param>\n            <param name=\"offset\">The offset to begin extracting data from.</param>\n            <param name=\"count\">The number of bytes to extract.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ITaggedData.GetData\">\n            <summary>\n            Get the data representing this instance.\n            </summary>\n            <returns>Returns the data for this instance.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ITaggedData.TagID\">\n            <summary>\n            Get the ID for this tagged data value.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.RawTaggedData\">\n            <summary>\n            A raw binary tagged value\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.RawTaggedData.#ctor(System.Int16)\">\n            <summary>\n            Initialise a new instance.\n            </summary>\n            <param name=\"tag\">The tag ID.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.RawTaggedData.SetData(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Set the data from the raw values provided.\n            </summary>\n            <param name=\"data\">The raw data to extract values from.</param>\n            <param name=\"offset\">The index to start extracting values from.</param>\n            <param name=\"count\">The number of bytes available.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.RawTaggedData.GetData\">\n            <summary>\n            Get the binary data representing this instance.\n            </summary>\n            <returns>The raw binary data representing this instance.</returns>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.RawTaggedData.tag_\">\n            <summary>\n            The tag ID for this instance.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.RawTaggedData.TagID\">\n            <summary>\n            Get the ID for this tagged data value.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.RawTaggedData.Data\">\n            <summary>\n            Get /set the binary data representing this instance.\n            </summary>\n            <returns>The raw binary data representing this instance.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData\">\n            <summary>\n            Class representing extended unix date time values.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.SetData(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Set the data from the raw values provided.\n            </summary>\n            <param name=\"data\">The raw data to extract values from.</param>\n            <param name=\"index\">The index to start extracting values from.</param>\n            <param name=\"count\">The number of bytes available.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.GetData\">\n            <summary>\n            Get the binary data representing this instance.\n            </summary>\n            <returns>The raw binary data representing this instance.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.IsValidValue(System.DateTime)\">\n            <summary>\n            Test a <see cref=\"T:System.DateTime\"> value to see if is valid and can be represented here.</see>\n            </summary>\n            <param name=\"value\">The <see cref=\"T:System.DateTime\">value</see> to test.</param>\n            <returns>Returns true if the value is valid and can be represented; false if not.</returns>\n            <remarks>The standard Unix time is a signed integer data type, directly encoding the Unix time number,\n            which is the number of seconds since 1970-01-01.\n            Being 32 bits means the values here cover a range of about 136 years.\n            The minimum representable time is 1901-12-13 20:45:52,\n            and the maximum representable time is 2038-01-19 03:14:07.\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.TagID\">\n            <summary>\n            Get the ID\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.ModificationTime\">\n            <summary>\n            Get /set the Modification Time\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"></exception>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.IsValidValue(System.DateTime)\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.AccessTime\">\n            <summary>\n            Get / set the Access Time\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"></exception>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.IsValidValue(System.DateTime)\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.CreateTime\">\n            <summary>\n            Get / Set the Create Time\n            </summary>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"></exception>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.IsValidValue(System.DateTime)\"></seealso>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Include\">\n            <summary>\n            Get/set the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Flags\">values</see> to include.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Flags\">\n            <summary>\n            Flags indicate which values are included in this instance.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Flags.ModificationTime\">\n            <summary>\n            The modification time is included\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Flags.AccessTime\">\n            <summary>\n            The access time is included\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.ExtendedUnixData.Flags.CreateTime\">\n            <summary>\n            The create time is included.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.NTTaggedData\">\n            <summary>\n            Class handling NT date time values.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.NTTaggedData.SetData(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Set the data from the raw values provided.\n            </summary>\n            <param name=\"data\">The raw data to extract values from.</param>\n            <param name=\"index\">The index to start extracting values from.</param>\n            <param name=\"count\">The number of bytes available.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.NTTaggedData.GetData\">\n            <summary>\n            Get the binary data representing this instance.\n            </summary>\n            <returns>The raw binary data representing this instance.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.NTTaggedData.IsValidValue(System.DateTime)\">\n            <summary>\n            Test a <see cref=\"T:System.DateTime\"> valuie to see if is valid and can be represented here.</see>\n            </summary>\n            <param name=\"value\">The <see cref=\"T:System.DateTime\">value</see> to test.</param>\n            <returns>Returns true if the value is valid and can be represented; false if not.</returns>\n            <remarks>\n            NTFS filetimes are 64-bit unsigned integers, stored in Intel\n            (least significant byte first) byte order. They determine the\n            number of 1.0E-07 seconds (1/10th microseconds!) past WinNT \"epoch\",\n            which is \"01-Jan-1601 00:00:00 UTC\". 28 May 60056 is the upper limit\n            </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.NTTaggedData.TagID\">\n            <summary>\n            Get the ID for this tagged data value.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.NTTaggedData.LastModificationTime\">\n            <summary>\n            Get/set the <see cref=\"T:System.DateTime\">last modification time</see>.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.NTTaggedData.CreateTime\">\n            <summary>\n            Get /set the <see cref=\"T:System.DateTime\">create time</see>\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.NTTaggedData.LastAccessTime\">\n            <summary>\n            Get /set the <see cref=\"T:System.DateTime\">last access time</see>.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedDataFactory\">\n            <summary>\n            A factory that creates <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\">tagged data</see> instances.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ITaggedDataFactory.Create(System.Int16,System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Get data for a specific tag value.\n            </summary>\n            <param name=\"tag\">The tag ID to find.</param>\n            <param name=\"data\">The data to search.</param>\n            <param name=\"offset\">The offset to begin extracting data from.</param>\n            <param name=\"count\">The number of bytes to extract.</param>\n            <returns>The located <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\">value found</see>, or null if not found.</returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipExtraData\">\n            \n            <summary>\n            A class to handle the extra data field for Zip entries\n            </summary>\n            <remarks>\n            Extra data contains 0 or more values each prefixed by a header tag and length.\n            They contain zero or more bytes of actual data.\n            The data is held internally using a copy on write strategy.  This is more efficient but\n            means that for extra data created by passing in data can have the values modified by the caller\n            in some circumstances.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.#ctor\">\n            <summary>\n            Initialise a default instance.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.#ctor(System.Byte[])\">\n            <summary>\n            Initialise with known extra data.\n            </summary>\n            <param name=\"data\">The extra data.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetEntryData\">\n            <summary>\n            Get the raw extra data value\n            </summary>\n            <returns>Returns the raw byte[] extra data this instance represents.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Clear\">\n            <summary>\n            Clear the stored data.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetStreamForTag(System.Int32)\">\n            <summary>\n            Get a read-only <see cref=\"T:System.IO.Stream\"/> for the associated tag.\n            </summary>\n            <param name=\"tag\">The tag to locate data for.</param>\n            <returns>Returns a <see cref=\"T:System.IO.Stream\"/> containing tag data or null if no tag was found.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetData(System.Int16)\">\n            <summary>\n            Get the <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\">tagged data</see> for a tag.\n            </summary>\n            <param name=\"tag\">The tag to search for.</param>\n            <returns>Returns a <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\">tagged value</see> or null if none found.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\">\n            <summary>\n            Find an extra data value\n            </summary>\n            <param name=\"headerID\">The identifier for the value to find.</param>\n            <returns>Returns true if the value was found; false otherwise.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddEntry(ICSharpCode.SharpZipLib.Zip.ITaggedData)\">\n            <summary>\n            Add a new entry to extra data.\n            </summary>\n            <param name=\"taggedData\">The <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ITaggedData\"/> value to add.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddEntry(System.Int32,System.Byte[])\">\n            <summary>\n            Add a new entry to extra data\n            </summary>\n            <param name=\"headerID\">The ID for this entry.</param>\n            <param name=\"fieldData\">The data to add.</param>\n            <remarks>If the ID already exists its contents are replaced.</remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\">\n            <summary>\n            Start adding a new entry.\n            </summary>\n            <remarks>Add data using <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddData(System.Byte[])\"/>, <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeShort(System.Int32)\"/>, <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeInt(System.Int32)\"/>, or <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeLong(System.Int64)\"/>.\n            The new entry is completed and actually added by calling <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddNewEntry(System.Int32)\"/></remarks>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddEntry(ICSharpCode.SharpZipLib.Zip.ITaggedData)\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddNewEntry(System.Int32)\">\n            <summary>\n            Add entry data added since <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/> using the ID passed.\n            </summary>\n            <param name=\"headerID\">The identifier to use for this entry.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddData(System.Byte)\">\n            <summary>\n            Add a byte of data to the pending new entry.\n            </summary>\n            <param name=\"data\">The byte to add.</param>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddData(System.Byte[])\">\n            <summary>\n            Add data to a pending new entry.\n            </summary>\n            <param name=\"data\">The data to add.</param>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeShort(System.Int32)\">\n            <summary>\n            Add a short value in little endian order to the pending new entry.\n            </summary>\n            <param name=\"toAdd\">The data to add.</param>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeInt(System.Int32)\">\n            <summary>\n            Add an integer value in little endian order to the pending new entry.\n            </summary>\n            <param name=\"toAdd\">The data to add.</param>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeLong(System.Int64)\">\n            <summary>\n            Add a long value in little endian order to the pending new entry.\n            </summary>\n            <param name=\"toAdd\">The data to add.</param>\n            <seealso cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.StartNewEntry\"/>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Delete(System.Int32)\">\n            <summary>\n            Delete an extra data field.\n            </summary>\n            <param name=\"headerID\">The identifier of the field to delete.</param>\n            <returns>Returns true if the field was found and deleted.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadLong\">\n            <summary>\n            Read a long in little endian form from the last <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\">found</see> data value\n            </summary>\n            <returns>Returns the long value read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadInt\">\n            <summary>\n            Read an integer in little endian form from the last <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\">found</see> data value.\n            </summary>\n            <returns>Returns the integer read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShort\">\n            <summary>\n            Read a short value in little endian form from the last <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\">found</see> data value.\n            </summary>\n            <returns>Returns the short value read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadByte\">\n            <summary>\n            Read a byte from an extra data\n            </summary>\n            <returns>The byte value read or -1 if the end of data has been reached.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Skip(System.Int32)\">\n            <summary>\n            Skip data during reading.\n            </summary>\n            <param name=\"amount\">The number of bytes to skip.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShortInternal\">\n            <summary>\n            Internal form of <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShort\"/> that reads data at any location.\n            </summary>\n            <returns>Returns the short value read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Dispose\">\n            <summary>\n            Dispose of this instance.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Length\">\n            <summary>\n            Gets the current extra data length.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ValueLength\">\n            <summary>\n            Get the length of the last value found by <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\"/>\n            </summary>\n            <remarks>This is only value if <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\"/> has previsouly returned true.</remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipExtraData.CurrentReadIndex\">\n            <summary>\n            Get the index for the current read value.\n            </summary>\n            <remarks>This is only valid if <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find(System.Int32)\"/> has previously returned true.\n            Initially it will be the index of the first byte of actual data.  The value is updated after calls to\n            <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadInt\"/>, <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShort\"/> and <see cref=\"M:ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadLong\"/>. </remarks>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipExtraData.UnreadCount\">\n            <summary>\n            Get the number of bytes remaining to be read for the current value;\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.DescriptorData\">\n            <summary>\n            Holds data pertinent to a data descriptor.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.DescriptorData.CompressedSize\">\n            <summary>\n            Get /set the compressed size of data.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.DescriptorData.Size\">\n            <summary>\n            Get / set the uncompressed size of data\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.DescriptorData.Crc\">\n            <summary>\n            Get /set the crc value.\n            </summary>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.ZipHelperStream\">\n            <summary>\n            This class assists with writing/reading from Zip files.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.#ctor(System.String)\">\n            <summary>\n            Initialise an instance of this class.\n            </summary>\n            <param name=\"name\">The name of the file to open.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Initialise a new instance of <see cref=\"T:ICSharpCode.SharpZipLib.Zip.ZipHelperStream\"/>.\n            </summary>\n            <param name=\"stream\">The stream to use.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Close\">\n            <summary>\n            Close the stream.\n            </summary>\n            <remarks>\n            The underlying stream is closed only if <see cref=\"P:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.IsStreamOwner\"/> is true.\n            </remarks>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.LocateBlockWithSignature(System.Int32,System.Int64,System.Int32,System.Int32)\">\n            <summary>\n            Locates a block with the desired <paramref name=\"signature\"/>.\n            </summary>\n            <param name=\"signature\">The signature to find.</param>\n            <param name=\"endLocation\">Location, marking the end of block.</param>\n            <param name=\"minimumBlockSize\">Minimum size of the block.</param>\n            <param name=\"maximumVariableData\">The maximum variable data.</param>\n            <returns>Eeturns the offset of the first byte after the signature; -1 if not found</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteZip64EndOfCentralDirectory(System.Int64,System.Int64,System.Int64)\">\n            <summary>\n            Write Zip64 end of central directory records (File header and locator).\n            </summary>\n            <param name=\"noOfEntries\">The number of entries in the central directory.</param>\n            <param name=\"sizeEntries\">The size of entries in the central directory.</param>\n            <param name=\"centralDirOffset\">The offset of the dentral directory.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteEndOfCentralDirectory(System.Int64,System.Int64,System.Int64,System.Byte[])\">\n            <summary>\n            Write the required records to end the central directory.\n            </summary>\n            <param name=\"noOfEntries\">The number of entries in the directory.</param>\n            <param name=\"sizeEntries\">The size of the entries in the directory.</param>\n            <param name=\"startOfCentralDirectory\">The start of the central directory.</param>\n            <param name=\"comment\">The archive comment.  (This can be null).</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEShort\">\n            <summary>\n            Read an unsigned short in little endian byte order.\n            </summary>\n            <returns>Returns the value read.</returns>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n            <exception cref=\"T:System.IO.EndOfStreamException\">\n            The file ends prematurely\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEInt\">\n            <summary>\n            Read an int in little endian byte order.\n            </summary>\n            <returns>Returns the value read.</returns>\n            <exception cref=\"T:System.IO.IOException\">\n            An i/o error occurs.\n            </exception>\n            <exception cref=\"T:System.IO.EndOfStreamException\">\n            The file ends prematurely\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLELong\">\n            <summary>\n            Read a long in little endian byte order.\n            </summary>\n            <returns>The value read.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEShort(System.Int32)\">\n            <summary>\n            Write an unsigned short in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUshort(System.UInt16)\">\n            <summary>\n            Write a ushort in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEInt(System.Int32)\">\n            <summary>\n            Write an int in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUint(System.UInt32)\">\n            <summary>\n            Write a uint in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLELong(System.Int64)\">\n            <summary>\n            Write a long in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUlong(System.UInt64)\">\n            <summary>\n            Write a ulong in little endian byte order.\n            </summary>\n            <param name=\"value\">The value to write.</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteDataDescriptor(ICSharpCode.SharpZipLib.Zip.ZipEntry)\">\n            <summary>\n            Write a data descriptor.\n            </summary>\n            <param name=\"entry\">The entry to write a descriptor for.</param>\n            <returns>Returns the number of descriptor bytes written.</returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadDataDescriptor(System.Boolean,ICSharpCode.SharpZipLib.Zip.DescriptorData)\">\n            <summary>\n            Read data descriptor at the end of compressed data.\n            </summary>\n            <param name=\"zip64\">if set to <c>true</c> [zip64].</param>\n            <param name=\"data\">The data to fill in.</param>\n            <returns>Returns the number of bytes read in the descriptor.</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.ZipHelperStream.IsStreamOwner\">\n            <summary>\n            Get / set a value indicating wether the the underlying stream is owned or not.\n            </summary>\n            <remarks>If the stream is owned it is closed when this instance is closed.</remarks>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Inflater\">\n             <summary>\n             Inflater is used to decompress data that has been compressed according\n             to the \"deflate\" standard described in rfc1951.\n             \n             By default Zlib (rfc1950) headers and footers are expected in the input.\n             You can use constructor <code> public Inflater(bool noHeader)</code> passing true\n             if there is no Zlib header information\n            \n             The usage is as following.  First you have to set some input with\n             <code>SetInput()</code>, then Inflate() it.  If inflate doesn't\n             inflate any bytes there may be three reasons:\n             <ul>\n             <li>IsNeedingInput() returns true because the input buffer is empty.\n             You have to provide more input with <code>SetInput()</code>.\n             NOTE: IsNeedingInput() also returns true when, the stream is finished.\n             </li>\n             <li>IsNeedingDictionary() returns true, you have to provide a preset\n                dictionary with <code>SetDictionary()</code>.</li>\n             <li>IsFinished returns true, the inflater has finished.</li>\n             </ul>\n             Once the first output byte is produced, a dictionary will not be\n             needed at a later stage.\n            \n             author of the original java version : John Leuner, Jochen Hoenicke\n             </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.DECODE_HEADER\">\n            <summary>\n            These are the possible states for an inflater\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.CPLENS\">\n            <summary>\n            Copy lengths for literal codes 257..285\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.CPLEXT\">\n            <summary>\n            Extra bits for literal codes 257..285\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.CPDIST\">\n            <summary>\n            Copy offsets for distance codes 0..29\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.CPDEXT\">\n            <summary>\n            Extra bits for distance codes\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.mode\">\n            <summary>\n            This variable contains the current state.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.readAdler\">\n            <summary>\n            The adler checksum of the dictionary or of the decompressed\n            stream, as it is written in the header resp. footer of the\n            compressed stream. \n            Only valid if mode is DECODE_DICT or DECODE_CHKSUM.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.neededBits\">\n            <summary>\n            The number of bits needed to complete the current state.  This\n            is valid, if mode is DECODE_DICT, DECODE_CHKSUM,\n            DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.isLastBlock\">\n            <summary>\n            True, if the last block flag was set in the last block of the\n            inflated stream.  This means that the stream ends after the\n            current block.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.totalOut\">\n            <summary>\n            The total number of inflated bytes.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.totalIn\">\n            <summary>\n            The total number of bytes set with setInput().  This is not the\n            value returned by the TotalIn property, since this also includes the\n            unprocessed input.\n            </summary>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.noHeader\">\n            <summary>\n            This variable stores the noHeader flag that was given to the constructor.\n            True means, that the inflated stream doesn't contain a Zlib header or \n            footer.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.#ctor\">\n            <summary>\n            Creates a new inflater or RFC1951 decompressor\n            RFC1950/Zlib headers and footers will be expected in the input data\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.#ctor(System.Boolean)\">\n            <summary>\n            Creates a new inflater.\n            </summary>\n            <param name=\"noHeader\">\n            True if no RFC1950/Zlib header and footer fields are expected in the input data\n            \n            This is used for GZIPed/Zipped input.\n            \n            For compatibility with\n            Sun JDK you should provide one byte of input more than needed in\n            this case.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Reset\">\n            <summary>\n            Resets the inflater so that a new stream can be decompressed.  All\n            pending input and output will be discarded.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.DecodeHeader\">\n            <summary>\n            Decodes a zlib/RFC1950 header.\n            </summary>\n            <returns>\n            False if more input is needed.\n            </returns>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            The header is invalid.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.DecodeDict\">\n            <summary>\n            Decodes the dictionary checksum after the deflate header.\n            </summary>\n            <returns>\n            False if more input is needed.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.DecodeHuffman\">\n            <summary>\n            Decodes the huffman encoded symbols in the input stream.\n            </summary>\n            <returns>\n            false if more input is needed, true if output window is\n            full or the current block ends.\n            </returns>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            if deflated stream is invalid.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.DecodeChksum\">\n            <summary>\n            Decodes the adler checksum after the deflate stream.\n            </summary>\n            <returns>\n            false if more input is needed.\n            </returns>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            If checksum doesn't match.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Decode\">\n            <summary>\n            Decodes the deflated stream.\n            </summary>\n            <returns>\n            false if more input is needed, or if finished.\n            </returns>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            if deflated stream is invalid.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.SetDictionary(System.Byte[])\">\n            <summary>\n            Sets the preset dictionary.  This should only be called, if\n            needsDictionary() returns true and it should set the same\n            dictionary, that was used for deflating.  The getAdler()\n            function returns the checksum of the dictionary needed.\n            </summary>\n            <param name=\"buffer\">\n            The dictionary.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.SetDictionary(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Sets the preset dictionary.  This should only be called, if\n            needsDictionary() returns true and it should set the same\n            dictionary, that was used for deflating.  The getAdler()\n            function returns the checksum of the dictionary needed.\n            </summary>\n            <param name=\"buffer\">\n            The dictionary.\n            </param>\n            <param name=\"index\">\n            The index into buffer where the dictionary starts.\n            </param>\n            <param name=\"count\">\n            The number of bytes in the dictionary.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            No dictionary is needed.\n            </exception>\n            <exception cref=\"T:ICSharpCode.SharpZipLib.SharpZipBaseException\">\n            The adler checksum for the buffer is invalid\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.SetInput(System.Byte[])\">\n            <summary>\n            Sets the input.  This should only be called, if needsInput()\n            returns true.\n            </summary>\n            <param name=\"buffer\">\n            the input.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.SetInput(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Sets the input.  This should only be called, if needsInput()\n            returns true.\n            </summary>\n            <param name=\"buffer\">\n            The source of input data\n            </param>\n            <param name=\"index\">\n            The index into buffer where the input starts.\n            </param>\n            <param name=\"count\">\n            The number of bytes of input to use.\n            </param>\n            <exception cref=\"T:System.InvalidOperationException\">\n            No input is needed.\n            </exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            The index and/or count are wrong.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Inflate(System.Byte[])\">\n            <summary>\n            Inflates the compressed stream to the output buffer.  If this\n            returns 0, you should check, whether IsNeedingDictionary(),\n            IsNeedingInput() or IsFinished() returns true, to determine why no\n            further output is produced.\n            </summary>\n            <param name=\"buffer\">\n            the output buffer.\n            </param>\n            <returns>\n            The number of bytes written to the buffer, 0 if no further\n            output can be produced.\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            if buffer has length 0.\n            </exception>\n            <exception cref=\"T:System.FormatException\">\n            if deflated stream is invalid.\n            </exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Inflate(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Inflates the compressed stream to the output buffer.  If this\n            returns 0, you should check, whether needsDictionary(),\n            needsInput() or finished() returns true, to determine why no\n            further output is produced.\n            </summary>\n            <param name=\"buffer\">\n            the output buffer.\n            </param>\n            <param name=\"offset\">\n            the offset in buffer where storing starts.\n            </param>\n            <param name=\"count\">\n            the maximum number of bytes to output.\n            </param>\n            <returns>\n            the number of bytes written to the buffer, 0 if no further output can be produced.\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            if count is less than 0.\n            </exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n            if the index and / or count are wrong.\n            </exception>\n            <exception cref=\"T:System.FormatException\">\n            if deflated stream is invalid.\n            </exception>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.IsNeedingInput\">\n            <summary>\n            Returns true, if the input buffer is empty.\n            You should then call setInput(). \n            NOTE: This method also returns true when the stream is finished.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.IsNeedingDictionary\">\n            <summary>\n            Returns true, if a preset dictionary is needed to inflate the input.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.IsFinished\">\n            <summary>\n            Returns true, if the inflater has finished.  This means, that no\n            input is needed and no output can be produced.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Adler\">\n            <summary>\n            Gets the adler checksum.  This is either the checksum of all\n            uncompressed bytes returned by inflate(), or if needsDictionary()\n            returns true (and thus no output was yet produced) this is the\n            adler checksum of the expected dictionary.\n            </summary>\n            <returns>\n            the adler checksum.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.TotalOut\">\n            <summary>\n            Gets the total number of output bytes returned by Inflate().\n            </summary>\n            <returns>\n            the total number of output bytes.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.TotalIn\">\n            <summary>\n            Gets the total number of processed compressed input bytes.\n            </summary>\n            <returns>\n            The total number of bytes of processed input bytes.\n            </returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Zip.Compression.Inflater.RemainingInput\">\n            <summary>\n            Gets the number of unprocessed input bytes.  Useful, if the end of the\n            stream is reached and you want to further process the bytes after\n            the deflate stream.\n            </summary>\n            <returns>\n            The number of bytes of the input which have not been processed.\n            </returns>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream\">\n            <summary>\n            An input stream that decompresses files in the BZip2 format \n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.#ctor(System.IO.Stream)\">\n            <summary>\n            Construct instance for reading from stream\n            </summary>\n            <param name=\"stream\">Data source</param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Flush\">\n            <summary>\n            Flushes the stream.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Seek(System.Int64,System.IO.SeekOrigin)\">\n            <summary>\n            Set the streams position.  This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"offset\">A byte offset relative to the <paramref name=\"origin\"/> parameter.</param>\n            <param name=\"origin\">A value of type <see cref=\"T:System.IO.SeekOrigin\"/> indicating the reference point used to obtain the new position.</param>\n            <returns>The new position of the stream.</returns>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.SetLength(System.Int64)\">\n            <summary>\n            Sets the length of this stream to the given value.\n            This operation is not supported and will throw a NotSupportedExceptionortedException\n            </summary>\n            <param name=\"value\">The new length for the stream.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Write(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Writes a block of bytes to this stream using data from a buffer.\n            This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"buffer\">The buffer to source data from.</param>\n            <param name=\"offset\">The offset to start obtaining data from.</param>\n            <param name=\"count\">The number of bytes of data to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.WriteByte(System.Byte)\">\n            <summary>\n            Writes a byte to the current position in the file stream.\n            This operation is not supported and will throw a NotSupportedException\n            </summary>\n            <param name=\"value\">The value to write.</param>\n            <exception cref=\"T:System.NotSupportedException\">Any access</exception>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Read(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Read a sequence of bytes and advances the read position by one byte.\n            </summary>\n            <param name=\"buffer\">Array of bytes to store values in</param>\n            <param name=\"offset\">Offset in array to begin storing data</param>\n            <param name=\"count\">The maximum number of bytes to read</param>\n            <returns>The total number of bytes read into the buffer. This might be less\n            than the number of bytes requested if that number of bytes are not \n            currently available or zero if the end of the stream is reached.\n            </returns>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Close\">\n            <summary>\n            Closes the stream, releasing any associated resources.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.ReadByte\">\n            <summary>\n            Read a byte from stream advancing position\n            </summary>\n            <returns>byte read or -1 on end of stream</returns>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.IsStreamOwner\">\n            <summary>\n            Get/set flag indicating ownership of underlying stream.\n            When the flag is true <see cref=\"M:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Close\"></see> will close the underlying stream also.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.CanRead\">\n            <summary>\n            Gets a value indicating if the stream supports reading\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.CanSeek\">\n            <summary>\n            Gets a value indicating whether the current stream supports seeking.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.CanWrite\">\n            <summary>\n            Gets a value indicating whether the current stream supports writing.\n            This property always returns false\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Length\">\n            <summary>\n            Gets the length in bytes of the stream.\n            </summary>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.BZip2.BZip2InputStream.Position\">\n            <summary>\n            Gets or sets the streams position.\n            Setting the position is not supported and will throw a NotSupportException\n            </summary>\n            <exception cref=\"T:System.NotSupportedException\">Any attempt to set the position</exception>\n        </member>\n        <member name=\"T:ICSharpCode.SharpZipLib.Checksums.Adler32\">\n            <summary>\n            Computes Adler32 checksum for a stream of data. An Adler32\n            checksum is not as reliable as a CRC32 checksum, but a lot faster to\n            compute.\n            \n            The specification for Adler32 may be found in RFC 1950.\n            ZLIB Compressed Data Format Specification version 3.3)\n            \n            \n            From that document:\n            \n                 \"ADLER32 (Adler-32 checksum)\n                  This contains a checksum value of the uncompressed data\n                  (excluding any dictionary data) computed according to Adler-32\n                  algorithm. This algorithm is a 32-bit extension and improvement\n                  of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073\n                  standard.\n            \n                  Adler-32 is composed of two sums accumulated per byte: s1 is\n                  the sum of all bytes, s2 is the sum of all s1 values. Both sums\n                  are done modulo 65521. s1 is initialized to 1, s2 to zero.  The\n                  Adler-32 checksum is stored as s2*65536 + s1 in most-\n                  significant-byte first (network) order.\"\n            \n             \"8.2. The Adler-32 algorithm\n            \n               The Adler-32 algorithm is much faster than the CRC32 algorithm yet\n               still provides an extremely low probability of undetected errors.\n            \n               The modulo on unsigned long accumulators can be delayed for 5552\n               bytes, so the modulo operation time is negligible.  If the bytes\n               are a, b, c, the second sum is 3a + 2b + c + 3, and so is position\n               and order sensitive, unlike the first sum, which is just a\n               checksum.  That 65521 is prime is important to avoid a possible\n               large class of two-byte errors that leave the check unchanged.\n               (The Fletcher checksum uses 255, which is not prime and which also\n               makes the Fletcher check insensitive to single byte changes 0 -\n               255.)\n            \n               The sum s1 is initialized to 1 instead of zero to make the length\n               of the sequence part of s2, so that the length does not have to be\n               checked separately. (Any sequence of zeroes has a Fletcher\n               checksum of zero.)\"\n            </summary>\n            <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream\"/>\n            <see cref=\"T:ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream\"/>\n        </member>\n        <member name=\"F:ICSharpCode.SharpZipLib.Checksums.Adler32.BASE\">\n            <summary>\n            largest prime smaller than 65536\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Adler32.#ctor\">\n            <summary>\n            Creates a new instance of the Adler32 class.\n            The checksum starts off with a value of 1.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Adler32.Reset\">\n            <summary>\n            Resets the Adler32 checksum to the initial value.\n            </summary>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Adler32.Update(System.Int32)\">\n            <summary>\n            Updates the checksum with a byte value.\n            </summary>\n            <param name=\"value\">\n            The data value to add. The high byte of the int is ignored.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Adler32.Update(System.Byte[])\">\n            <summary>\n            Updates the checksum with an array of bytes.\n            </summary>\n            <param name=\"buffer\">\n            The source of the data to update with.\n            </param>\n        </member>\n        <member name=\"M:ICSharpCode.SharpZipLib.Checksums.Adler32.Update(System.Byte[],System.Int32,System.Int32)\">\n            <summary>\n            Updates the checksum with the bytes taken from the array.\n            </summary>\n            <param name=\"buffer\">\n            an array of bytes\n            </param>\n            <param name=\"offset\">\n            the start of the data used for this update\n            </param>\n            <param name=\"count\">\n            the number of bytes to use for this update\n            </param>\n        </member>\n        <member name=\"P:ICSharpCode.SharpZipLib.Checksums.Adler32.Value\">\n            <summary>\n            Returns the Adler32 data checksum computed so far.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "package-GitSharp.cmd",
    "content": "tools\\nant\\nant.exe -buildfile:GitSharp.build %1 -t:net-3.5 -D:build.config=release -D:build.vcs.number.1=%BUILD_VCS_NUMBER% clean dist\n"
  },
  {
    "path": "runtests-GitSharp.cmd",
    "content": "tools\\nant\\nant.exe -buildfile:GitSharp.build %1 -t:net-3.5 -D:build.config=debug -D:build.vcs.number.1=%BUILD_VCS_NUMBER%"
  },
  {
    "path": "tools/docu/.gitignore",
    "content": "output\n"
  },
  {
    "path": "tools/docu/docu.XML",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>docu</name>\n    </assembly>\n    <members>\n        <member name=\"M:Docu.Console.ISwitch.Handle(System.String)\">\n            <summary>\n            Handle the argument\n            </summary>\n            <param name=\"arg\">argument</param>\n            <returns>Continue/true or exit/false</returns>\n        </member>\n        <member name=\"M:Docu.Output.PatternTemplateResolver.Resolve(System.String,System.Collections.Generic.IList{Docu.Documentation.Namespace})\">\n            <summary>\n            Expands a path into a collection of output files\n            </summary>\n            <example>\n            given template path and a list of namespaces:\n            \n            test.htm.spark, null                  == [test.htm]\n            !namespace.htm.spark, [one, two]      == [one.htm, two.htm]\n            !namespace/test.htm.spark, [one, two] == [one/test.htm, two/test.htm]\n            </example>\n            <param name=\"path\">Template path</param>\n            <param name=\"namespaces\">Namespaces</param>\n            <returns>List of resolved output matches</returns>\n        </member>\n        <member name=\"T:Docu.Output.Rendering.SparkTemplateBase\">\n            <summary>\n            All public or protected methods and properties on this class are available within documentation templates\n            </summary>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetMethodUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to methods referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The namespace of the type that contains the method</description></item>\n            <item><term>{type}</term><description>The short name of the type that contains the method</description></item>\n            <item><term>{method}</term><description>The name of method</description></item>\n            </list>\n            <para>The default is {type.namespace}/{type}.htm#{method}</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetTypeUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to types referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The namespace of the type</description></item>\n            <item><term>{type}</term><description>The short name of the type</description></item>\n            </list>\n            <para>The default is {type.namespace}/{type}.htm</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetPropertyUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to properties referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The namespace of the type that contains the property</description></item>\n            <item><term>{type}</term><description>The short name of the type that contains the property</description></item>\n            <item><term>{property}</term><description>The name of the property</description></item>\n            </list>\n            <para>The default is {type.namespace}/{type}.htm#{property}</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetEventUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to events referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The namespace of the type that contains the event</description></item>\n            <item><term>{type}</term><description>The short name of the type that contains the event</description></item>\n            <item><term>{event}</term><description>The name of the event</description></item>\n            </list>\n            <para>The default is {type.namespace}/{type}.htm#{event}</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetFieldUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to fields referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The namespace of the type that contains the field</description></item>\n            <item><term>{type}</term><description>The short name of the type that contains the field</description></item>\n            <item><term>{field}</term><description>The name of the field</description></item>\n            </list>\n            <para>The default is {type.namespace}/{type}.htm#{field}</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.SetNamespaceUrlFormat(System.String)\">\n            <summary>\n            Configures the pattern that will be used to construct links to namespaces referenced in the documentation of other symbols\n            </summary>\n            <remarks>\n            The pattern can be constructed using the following placeholders:\n            <list type=\"definition\">\n            <item><term>{type.namespace}</term><description>The name of the namespace</description></item>\n            </list>\n            <para>The default is {namespace}.htm</para></remarks>\n            <param name=\"format\">The pattern used to construct the link</param>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.WriteProductName(System.Reflection.Assembly)\">\n            <summary>\n            Returns the product name of an assembly\n            </summary>\n            <param name=\"assembly\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.WriteFileDescription(System.Reflection.Assembly)\">\n            <summary>\n            Returns the description of an assembly\n            </summary>\n            <param name=\"assembly\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.WriteAssemblyTitle(System.Reflection.Assembly)\">\n            <summary>\n            Returns the title of an assembly\n            </summary>\n            <param name=\"assembly\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.WriteVersion(System.Reflection.Assembly)\">\n            <summary>\n            Returns the version number of an assembly\n            </summary>\n            <param name=\"assembly\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.h(System.String)\">\n            <summary>\n            HTML encodes the content\n            </summary>\n            <param name=\"content\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.Format(Docu.Documentation.Comments.IComment)\">\n            <summary>\n            Returns the comments in a format suitable for display\n            </summary>\n            <param name=\"comment\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.Format(Docu.Documentation.IReferencable,System.Linq.Expressions.Expression{System.Func{System.Object,System.String}}[])\">\n            <summary>\n            Returns a hyperlink to another symbol\n            </summary>\n            <remarks>The format of the URL in the returned hyperlink can be controlled by the methods <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetNamespaceUrlFormat(System.String)\"/>, <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetTypeUrlFormat(System.String)\"/>,  <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetPropertyUrlFormat(System.String)\"/>, <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetMethodUrlFormat(System.String)\"/>, <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetFieldUrlFormat(System.String)\"/> and <see cref=\"M:Docu.Output.Rendering.SparkTemplateBase.SetEventUrlFormat(System.String)\"/></remarks>\n            <param name=\"referencable\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.WriteInterfaces(System.Collections.Generic.IList{Docu.Documentation.IReferencable})\">\n            <summary>\n            Returns a comma-delimited list of the interfaces impleted by a given type\n            </summary>\n            <param name=\"interfaces\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:Docu.Output.Rendering.SparkTemplateBase.OutputMethodParams(Docu.Documentation.Method)\">\n            <summary>\n            Returns a comma-delimited list of the parameters of a given method\n            </summary>\n            <param name=\"method\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.Assemblies\">\n            <summary>\n            All of the assemblies being documented\n            </summary>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.Namespaces\">\n            <summary>\n             All of the namespaces in the assemblies being documented\n            </summary>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.Types\">\n            <summary>\n            All of the types in the assemblies being documented\n            </summary>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.Namespace\">\n            <summary>\n            The current namespace being documented within the special !namespace template\n            </summary>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.Type\">\n            <summary>\n            The current type being documented withing the special !type template\n            </summary>\n        </member>\n        <member name=\"P:Docu.Output.Rendering.SparkTemplateBase.RelativeOutputPath\">\n            <summary>\n            The path of the file that this view represents, relative to the output directory.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/docu/generate_documentation.bat",
    "content": "rem ==========================\nrem Generates the documentation\nrem ==========================\nrem\nrem Note: this assumes, that you have built the debug version of gitsharp with visual studio.\n\ndocu ../GitSharp/bin/Debug/GitSharp.dll\nrem xcopy /S /Y output\\*.* .."
  },
  {
    "path": "tools/docu/templates/!namespace/!type.htm.spark",
    "content": "﻿<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n  <head>\n    <title>${h(Type.PrettyName)} - ${WriteProductName(Assemblies[0])} Documentation</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"../main.css\" />\n    <script type=\"text/javascript\" src=\"../js/jquery-1.3.2.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../js/jquery.scrollTo-min.js\"></script>\n    <script type=\"text/javascript\" src=\"../js/navigation.js\"></script>\n  </head>\n  <body>\n    <namespaces />\n    <types />\n    <div class=\"header\">\n\t\t<p class=\"class\"><strong>Type</strong> ${h(Type.PrettyName)}</p>\n\t\t<p><strong>Namespace</strong> ${Namespace.Name}</p>\n\t\t<p if=\"Type.ParentType != null && Type.ParentType.PrettyName != 'object'\"><strong>Parent</strong> ${Format(Type.ParentType)}</p>\n\t\t<p if=\"Type.Interfaces.Count > 0\"><strong>Interfaces</strong> ${WriteInterfaces(Type.Interfaces)}</p>\n\t</div>\n    <div class=\"sub-header\">\n\t\t<if condition=\"(Type.Summary != null && Type.Summary.Children.Count() > 0) || (Type.Remarks != null && Type.Remarks.Children.Count() > 0)\">\n\t\t\t<div id=\"summary\">\n\t\t\t\t<comment content=\"Type.Summary\" />\n\t\t\t\t<remarks content=\"Type.Remarks\" />\n\t\t\t</div>\n\t\t</if>\n\t\t\n\t\t<if condition=\"Type.Events.Count > 0\">\n\t\t\t<h3 class=\"section\">Events</h3>\n\t\t\t<ul>\n\t\t\t\t<li each=\"var ev in Type.Events\">${Format(ev)}</li>\n\t\t\t</ul>\n\t\t</if>\n\t\t\n\t\t<if condition=\"Type.Methods.Count > 0\">\n\t\t\t<h3 class=\"section\">Methods</h3>\n\t\t\t<ul>\n\t\t\t\t<li each=\"var method in Type.Methods\">${Format(method)}</li>\n\t\t\t</ul>\n\t\t</if>\n\t\t\n\t\t<if condition=\"Type.Properties.Count > 0\">\n\t\t\t<h3 class=\"section\">Properties</h3>\n\t\t\t<ul>\n\t\t\t\t<li each=\"var property in Type.Properties\">${Format(property)}</li>\n\t\t\t</ul>\n\t\t</if>\n\t\t\n\t\t<if condition=\"Type.Fields.Count > 0\">\n\t\t\t<h3 class=\"section\">Fields</h3>\n\t\t\t<ul>\n\t\t\t\t<li each=\"var field in Type.Fields\">${Format(field)}</li>\n\t\t\t</ul>\n\t\t</if>\n\t</div>\n\t\n\t<events events=\"Type.Events\" title=\"'Events'\" />\n\t\n\t<var publicInstanceMethods=\"Type.Methods.Where(x => x.IsPublic && !x.IsStatic)\" />\n\t<methods methods=\"publicInstanceMethods\" title=\"'Public instance methods'\" />\n\t\n\t<var publicStaticMethods=\"Type.Methods.Where(x => x.IsPublic && x.IsStatic)\" />\n\t<methods methods=\"publicStaticMethods\" title=\"'Public static methods'\" />\n\t\n\t<properties properties=\"Type.Properties\" title=\"'Public properties'\" />\n\t<fields fields=\"Type.Fields\" title=\"'Public fields'\" />\n\t\n\t<use file=\"../_footer\" />\n  </body>\n</html>"
  },
  {
    "path": "tools/docu/templates/!namespace/_comment.spark",
    "content": "﻿${Format(content)}"
  },
  {
    "path": "tools/docu/templates/!namespace/_events.spark",
    "content": "﻿<if condition=\"events.Count() > 0\">\n  <h3 class=\"section\">${title}</h3>\n\n  <div id=\"${ev.Name}\" class=\"method\" each=\"var ev in events\">\n    <h4><strong>${h(ev.Name)}</strong></h4>\n    <div class=\"content\">\n      <comment content=\"ev.Summary\" />\n      <remarks content=\"ev.Remarks\" />\n    </div>\n  </div>\n</if>"
  },
  {
    "path": "tools/docu/templates/!namespace/_fields.spark",
    "content": "﻿<if condition=\"fields.Count() > 0\">\n  <h3 class=\"section\">${title}</h3>\n\n  <div id=\"${field.Name}\" class=\"method\" each=\"var field in fields\">\n    <h4>${h(field.ReturnType.PrettyName)} <strong>${h(field.Name)}</strong></h4>\n    <div class=\"content\">\n      <comment content=\"field.Summary\" />\n      <remarks content=\"field.Remarks\" />\n      <table>\n        <tr>\n          <td>\n            <code>return ${Format(field.ReturnType)}</code>\n          </td>\n        </tr>\n      </table>\n    </div>\n  </div>\n</if>"
  },
  {
    "path": "tools/docu/templates/!namespace/_methods.spark",
    "content": "﻿<if condition=\"methods.Count() > 0\">\n\t<h3 class=\"section\">${title}</h3>\n\t\n\t<div id=\"${method.Name}\" class=\"method\" each=\"var method in methods\">\n\t\t<h4>${Format(method.ReturnType)} <strong>${h(method.PrettyName)}</strong>(${OutputMethodParams(method)})</h4>\n\t\t<div class=\"content\">\n      <comment content=\"method.Summary\" />\n      <remarks content=\"method.Remarks\" />\n\n      <var hasReturn=\"method.ReturnType.PrettyName != 'void'\" />\n      <var hasParams=\"method.Parameters.Any(x => x.HasDocumentation)\" />\n\n      <div class=\"parameters\" if=\"hasParams\">\n        <h5>Parameters</h5>\n\n        <for each=\"var param in method.Parameters\">\n          <h6><code>${Format(param.Reference)}</code> ${param.Name}</h6>\n          <p class=\"comments\" if=\"!param.Summary.IsEmpty\"><comment content=\"param.Summary\" /></p>\n        </for>\n      </div>\n\n      <div class=\"return\" if=\"!method.Returns.IsEmpty\">\n        <h5>Return</h5>\n        <h6><code>${Format(method.ReturnType)}</code></h6>\n        <p><comment content=\"method.Returns\" /></p>\n      </div>\n      \n      <value content=\"method.Value\" />\n\t\t</div>\n\t</div>\n</if>"
  },
  {
    "path": "tools/docu/templates/!namespace/_namespaces.spark",
    "content": "﻿#Formatter.NamespaceUrlFormat = \"~/{namespace}/index.html\";\n<div id=\"namespaces\">\n\t<h2 class=\"fixed\">Namespaces</h2>\n\t<div class=\"scroll\">\n\t\t<ul>\n\t\t\t<li each=\"var ns in Namespaces\">\n        <if condition=\"ns == Namespace\">\n          ${Format(ns, class => \"current\")}\n        <else />\n          ${Format(ns)}\n        </if>\n      </li>\n\t\t</ul>\n\t</div>\n</div>"
  },
  {
    "path": "tools/docu/templates/!namespace/_properties.spark",
    "content": "﻿<if condition=\"properties.Count() > 0\">\n  <h3 class=\"section\">${title}</h3>\n\n  <div id=\"${property.Name}\" class=\"method\" each=\"var property in properties\">\n    <h4>${Format(property.ReturnType)} <strong>${h(property.Name)}</strong> <if condition=\"property.HasGet\">get;</if> <if condition=\"property.HasSet\">set;</if></h4>\n    <div class=\"content\">\n      <comment content=\"property.Summary\" />\n      <remarks content=\"property.Remarks\" />\n      \n      <div class=\"return\" if=\"property.ReturnType.HasDocumentation\">\n        <h5>Property type</h5>\n        <h6><code>${Format(property.ReturnType)}</code></h6>\n        <p><comment content=\"property.ReturnType.Summary\" /></p>\n      </div>\n      <value content=\"property.Value\" />\n    </div>\n  </div>\n</if>"
  },
  {
    "path": "tools/docu/templates/!namespace/_remarks.spark",
    "content": "﻿<blockquote class=\"remarks\" if=\"content != null && content.Children.Count() > 0\">\n  ${Format(content)}\n</blockquote>"
  },
  {
    "path": "tools/docu/templates/!namespace/_types.spark",
    "content": "﻿<div id=\"types\">\n  <h2 class=\"fixed\">Types in ${Namespace.PrettyName}</h2>\n\t<div class=\"scroll\">\n\t\t<ul>\n\t\t\t\t<li each=\"var type in Namespace.Types\">\n          <if condition=\"type == Type\">\n            ${Format(type, class => \"current\")}\n          <else />\n            ${Format(type)}\n          </if>\n        </li>\n\t\t</ul>\n\t</div>\n</div>"
  },
  {
    "path": "tools/docu/templates/!namespace/_value.spark",
    "content": "﻿<blockquote class=\"value\" if=\"content.Children.Count() > 0\">\n  <strong>Value: </strong>${Format(content)}\n</blockquote>"
  },
  {
    "path": "tools/docu/templates/!namespace/index.html.spark",
    "content": "﻿<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n  <head>\n    <title>${Namespace.Name} - ${WriteProductName(Assemblies[0])} Documentation</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"../main.css\" />\n    <script type=\"text/javascript\" src=\"../js/jquery-1.3.2.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../js/jquery.scrollTo-min.js\"></script>\n    <script type=\"text/javascript\" src=\"../js/navigation.js\"></script>\n  </head>\n  <body>\n\t<namespaces />\n    <types />\n    <div class=\"header\">\n\t\t<p class=\"class\"><strong>Namespace</strong> ${Namespace.Name}</p>\n\t</div>\n    <div class=\"sub-header\">\n\t\t<if condition=\"Namespace.HasClasses\">\n\t\t\t<h3 class=\"section\">Classes</h3>\n\t\t\t<ul>\n\t\t\t\t<for each=\"var type in Namespace.Classes\">\n\t\t\t\t\t<li>${Format(type)}</li>\n\t\t\t\t</for>\n\t\t\t</ul>\n\t\t</if>\n\t\t\n\t\t<if condition=\"Namespace.HasInterfaces\">\n\t\t\t<h3 class=\"section\">Interfaces</h3>\n\t\t\t<ul>\n\t\t\t\t<for each=\"var type in Namespace.Interfaces\">\n\t\t\t\t\t<li>${Format(type)}</li>\n\t\t\t\t</for>\n\t\t\t</ul>\n\t\t</if>\n\t\t<p if=\"!Namespace.HasTypes\">This namespace is empty.</p>\n\t</div>\n\t\n\t<use file=\"../_footer\" />\n  </body>\n</html>"
  },
  {
    "path": "tools/docu/templates/_footer.spark",
    "content": "﻿<div id=\"footer\">\n  <p><b><big>Learn more about <a href=\"http://www.eqqon.com/index.php/GitSharp\"> GitSharp. </a></big></b></p>\n  <p>Based on v${WriteVersion(Assemblies[0])} of ${WriteAssemblyTitle(Assemblies[0])}</p>\n  <p>Generated by <a href=\"http://docu.jagregory.com\">docu</a></p>\n</div>"
  },
  {
    "path": "tools/docu/templates/_namespaces.spark",
    "content": "﻿#Formatter.NamespaceUrlFormat = \"~/{namespace}/index.html\";\n<div id=\"namespaces\">\n\t<h2 class=\"fixed\">Namespaces</h2>\n\t<div class=\"scroll\">\n\t\t<ul>\n\t\t\t<li each=\"var ns in Namespaces\">${Format(ns)}</li>\n\t\t</ul>\n\t</div>\n</div>"
  },
  {
    "path": "tools/docu/templates/_types.spark",
    "content": "﻿<div id=\"types\">\n\t<h2 class=\"fixed\">All Types</h2>\n\t<div class=\"scroll\">\n\t\t<ul>\n\t\t\t<for each=\"var ns in Namespaces\">\n\t\t\t\t<li each=\"var type in ns.Types\">${Format(type)}</li>\n\t\t\t</for>\n\t\t</ul>\n\t</div>\n</div>"
  },
  {
    "path": "tools/docu/templates/index.html.spark",
    "content": "﻿<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<head>\n\t\t<title>${WriteProductName(Assemblies[0])} Documentation</title>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n\t\t<link type=\"text/css\" rel=\"stylesheet\" href=\"main.css\" />\n\t</head>\n\t<body>\n    <namespaces />\n    <types />\n    <div class=\"header\">\n\t\t<p class=\"class\">${WriteProductName(Assemblies[0])} Documentation</p>\n\t</div>\n    \n    <use file=\"_footer\" />\n  </body>\n</html>"
  },
  {
    "path": "tools/docu/templates/js/jquery.scrollTo-min.js",
    "content": "/**\n * jQuery.ScrollTo - Easy element scrolling using jQuery.\n * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com\n * Dual licensed under MIT and GPL.\n * Date: 5/25/2009\n * @author Ariel Flesler\n * @version 1.4.2\n *\n * http://flesler.blogspot.com/2007/10/jqueryscrollto.html\n */\n;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\\d+(\\.\\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);"
  },
  {
    "path": "tools/docu/templates/js/navigation.js",
    "content": "﻿$(document).ready(function() {\n  var scroll = function(selector) {\n    var currentItem = $(selector + ' .current');\n    \n    if (currentItem)\n      $(selector + ' div.scroll').scrollTo(currentItem);\n  };\n  \n  scroll('#namespaces');\n  scroll('#types');\n});"
  },
  {
    "path": "tools/docu/templates/main.css",
    "content": "﻿body {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-family: Verdana,Arial,Helvetica,sans-serif;\n\tfont-size: 90%;\n}\n\n.header {\n\tbackground: #048;\n\tborder-bottom: 3px solid #006;\n\tmargin: 0;\n\tcolor: #FFF;\n\tpadding: 10px;\n\tclear: left;\n\tfont-size: 13px;\n}\n\n.header p {\n\tmargin: 0 0 4px 0;\n}\n\n.header .class {\n\tfont-size: 24px;\n\tfont-weight: bold;\n}\n\n.header strong {\n\tfont-size: 13px;\n\twidth: 100px;\n\tfloat: left;\n}\n\n.header a {\n\tbackground: transparent;\n\tcolor: #FFF;\n}\n\n.header a:hover {\n\tbackground: #FFF;\n\tcolor: #039;\n}\n\n.sub-header {\n\tmargin: 0 20px;\n}\n\n.sub-header ul {\n\tmargin: 0 0 0 30px;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.sub-header ul li {\n\tfloat: left;\n\tmargin: 0 15px 0 0;\n\tpadding: 0;\n\ttext-indent: 0;\n}\n\n.section {\n\tcolor: #333;\n\tborder-bottom: 1px solid #999;\n\tmargin: 10px 10px 0 10px;\n\tpadding: 10px 0 0 0;\n\tclear: left;\n}\n\ndiv.method {\n\tbackground: #EFEFEF;\n\tborder: 1px dotted #CCC;\n\tmargin: 5px 10px 15px 10px;\n\tpadding: 0;\n}\n\ndiv.method h4 {\n\tbackground: #CCC;\n\tborder-bottom: 1px solid #666;\n\tcolor: #000;\n\tpadding: 2px 5px;\n\tmargin: 0 0 10px 0;\n\tfont-weight: normal;\n}\n\ndiv.method h4 a {\n\tbackground: transparent;\n}\n\ndiv.method .content {\n\tpadding: 0 10px 5px 10px;\n}\n\ndiv.parameters, div.return {\n\tbackground: #fff;\n\tborder: 1px solid #ccc;\n\tpadding: 10px;\n\tmargin-top: 10px;\n}\n\ndiv.parameters h5, div.return h5 {\n\tcolor: #666;\n\tmargin: -10px 0 0 -10px;\n\tpadding: 3px;\n\tfont-weight: normal;\n\tfont-size: 10px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-right: 1px solid #ccc;\n\tfloat: left;\n}\n\ndiv.parameters h6, div.return h6 {\n\tclear: left;\n\tfont-size: 14px;\n\tfont-weight: normal;\n\tmargin: 0;\n\tpadding: 6px 0 3px 0;\n}\n\ndiv.parameters p, div.return p {\n\tborder-top: 1px solid #ccc;\n\tmargin: 0;\n\tpadding: 3px 3px 0 3px;\n}\n\n#summary {\n\tbackground: #EFEFEF;\n\tborder: 1px dotted #999999;\n\tmargin: 5px 10px 15px 10px;\n\tpadding: 5px 10px;\n}\n\n#namespaces {\n\twidth: 50%;\n\tfloat: left;\n\tbackground: #FFF;\n}\n\n#types {\n\twidth: 50%;\n\tfloat: left;\n\tbackground: #FFF;\n\tmargin-left: -1px;\n}\n\nh2.fixed {\n\tbackground: #CCC;\n\tcolor: #000;\n\tborder-top: 1px solid #999;\n\tborder-bottom: 1px solid #999;\n\tmargin: 0;\n\tpadding: 2px 10px;\n\tfont-size: 12px;\n\tfont-weight: bold;\n}\n\ndiv.scroll {\n\toverflow: scroll;\n\theight: 150px;\n}\n\n#namespaces ul, #types ul {\n\tlist-style: none;\n\tmargin: 0 0 10px 0;\n\tpadding: 0;\n}\n\n#namespaces ul li, #types ul li {\n\ttext-indent: 0;\n\tpadding-left: 10px;\n}\n\na {\n\tbackground: #eef;\n\tcolor: #039;\n\ttext-decoration: none;\n}\n\na:hover {\n\tcolor: #FFF;\n\tbackground: #039;\n}\n\n#namespaces a.current, #types a.current {\n\tbackground: #039;\n\tcolor: #FFF;\n\ttext-decoration: none;\n}\n\n#footer {\n\ttext-align: center;\n\tfont-size: 10px;\n\tcolor: #888;\n\tclear: left;\n\tpadding-top: 10px;\n}\n\nblockquote {\n\tmargin: 10px;\n\tpadding: 6px;\n\tbackground: #F5F5F5;\n\tborder-top: 3px solid #CCC;\n\tborder-bottom: 3px solid #CCC;\n}\n\n.value {\n\tborder-top-width: 1px;\n\tborder-bottom-width: 1px;\n\tfont-size: 90%;\n}"
  },
  {
    "path": "tools/nant/NAnt.CompressionTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.CompressionTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.Compression.Tasks.ExpandBaseTask\">\n            <summary>\n            Summary description for ExpandTask.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.ExpandBaseTask.ExtractFile(System.IO.Stream,System.String,System.String,System.DateTime,System.Int64)\">\n            <summary>\n            Extracts a file entry from the specified stream.\n            </summary>\n            <param name=\"inputStream\">The <see cref=\"T:System.IO.Stream\"/> containing the compressed entry.</param>\n            <param name=\"destDirectory\">The directory where to store the expanded file.</param>\n            <param name=\"entryName\">The name of the entry including directory information.</param>\n            <param name=\"entryDate\">The date of the entry.</param>\n            <param name=\"entrySize\">The uncompressed size of the entry.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The destination directory for the entry could not be created.</para>\n              <para>-or-</para>\n              <para>The entry could not be extracted.</para>\n            </exception>\n            <remarks>\n            We cannot rely on the fact that the directory entry of a given file\n            is created before the file is extracted, so we should create the\n            directory if it doesn't yet exist.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.ExpandBaseTask.ExtractDirectory(System.IO.Stream,System.String,System.String,System.DateTime)\">\n            <summary>\n            Extracts a directory entry from the specified stream.\n            </summary>\n            <param name=\"inputStream\">The <see cref=\"T:System.IO.Stream\"/> containing the directory entry.</param>\n            <param name=\"destDirectory\">The directory where to create the subdirectory.</param>\n            <param name=\"entryName\">The name of the directory entry.</param>\n            <param name=\"entryDate\">The date of the entry.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The destination directory for the entry could not be created.</para>\n            </exception>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ExpandBaseTask.Overwrite\">\n            <summary>\n            Overwrite files, even if they are newer than the corresponding \n            entries in the archive. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Tasks.GUnzip\">\n            <summary>\n            Expands a file packed using GZip compression.\n            </summary>\n            <example>\n              <para>Expands &quot;test.tar.gz&quot; to &quot;test2.tar&quot;.</para>\n              <code>\n                <![CDATA[\n            <gunzip src=\"test.tar.gz\" dest=\"test.tar\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.GUnzip.ExecuteTask\">\n            <summary>\n            Extracts the file from the gzip archive.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.GUnzip.SrcFile\">\n            <summary>\n            The file to expand.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.GUnzip.DestFile\">\n            <summary>\n            The destination file.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Tasks.TarTask\">\n            <summary>\n            Creates a tar file from the specified filesets.\n            </summary>\n            <remarks>\n              <para>Uses <see href=\"http://www.icsharpcode.net/OpenSource/SharpZipLib/\">#ziplib</see> (SharpZipLib), an open source Tar/Zip/GZip library written entirely in C#.</para>\n            </remarks>\n            <example>\n              <para>\n              Tar all files in <c>${build.dir}</c> and <c>${doc.dir}</c> into a file\n              called &quot;backup.tar.gz&quot;, and apply gzip compression to it.\n              </para>\n              <code>\n                <![CDATA[\n            <tar destfile=\"backup.tar.gz\" compression=\"GZip\">\n                <fileset basedir=\"${bin.dir}\" prefix=\"bin\">\n                    <include name=\"**/*\" />\n                </fileset>\n                <fileset basedir=\"${doc.dir}\" prefix=\"doc\">\n                    <include name=\"**/*\" />\n                </fileset>\n            </tar>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.TarTask.ExecuteTask\">\n            <summary>\n            Creates the tar file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.TarTask.DestFile\">\n            <summary>\n            The tar file to create.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.TarTask.IncludeEmptyDirs\">\n            <summary>\n            Include empty directories in the generated tar file. The default is\n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.TarTask.TarFileSets\">\n            <summary>\n            The set of files to be included in the archive.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.TarTask.CompressionMethod\">\n            <summary>\n            The compression method. The default is <see cref=\"F:NAnt.Compression.Types.TarCompressionMethod.None\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Tasks.UnTarTask\">\n            <summary>\n            Extracts files from a tar archive.\n            </summary>\n            <remarks>\n              <para>\n              Uses <see href=\"http://www.icsharpcode.net/OpenSource/SharpZipLib/\">#ziplib</see>\n              (SharpZipLib), an open source Zip/GZip library written entirely in C#.\n              </para>\n            </remarks>\n            <example>\n              <para>Extracts all files from a gzipped tar, preserving the directory structure.</para>\n              <code>\n                <![CDATA[\n            <untar src=\"nant-bin.tar.gz\" dest=\"bin\" compression=\"gzip\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.UnTarTask.ExecuteTask\">\n            <summary>\n            Extracts the files from the archive.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnTarTask.SrcFile\">\n            <summary>\n            The archive file to expand.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnTarTask.DestinationDirectory\">\n            <summary>\n            The directory where to store the expanded file(s). The default is\n            the project base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnTarTask.CompressionMethod\">\n            <summary>\n            The compression method. The default is <see cref=\"F:NAnt.Compression.Types.TarCompressionMethod.None\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Tasks.UnZipTask\">\n            <summary>\n            Extracts files from a zip archive.\n            </summary>\n            <remarks>\n              <para>\n              Uses <see href=\"http://www.icsharpcode.net/OpenSource/SharpZipLib/\">#ziplib</see>\n              (SharpZipLib), an open source Zip/GZip library written entirely in C#.\n              </para>\n            </remarks>\n            <example>\n              <para>Extracts all the file from the zip, preserving the directory structure.</para>\n              <code>\n                <![CDATA[\n            <unzip zipfile=\"backup.zip\"/>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.UnZipTask.ExecuteTask\">\n            <summary>\n            Extracts the files from the zip file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnZipTask.ZipFile\">\n            <summary>\n            The archive file to expand.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnZipTask.ToDirectory\">\n            <summary>\n            The directory where the expanded files should be stored. The \n            default is the project base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.UnZipTask.Encoding\">\n            <summary>\n            The character encoding that has been used for filenames inside the\n            zip file. The default is the system's OEM code page.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Tasks.ZipTask\">\n            <summary>\n            Creates a zip file from the specified filesets.\n            </summary>\n            <remarks>\n              <para>\n              Uses <see href=\"http://www.icsharpcode.net/OpenSource/SharpZipLib/\">#ziplib</see>\n              (SharpZipLib), an open source Tar/Zip/GZip library written entirely in C#.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Zip all files in <c>${build.dir}</c> and <c>${doc.dir}</c> into a file\n              called &quot;backup.zip&quot;.\n              </para>\n              <code>\n                <![CDATA[\n            <zip zipfile=\"backup.zip\">\n                <fileset basedir=\"${bin.dir}\" prefix=\"bin\">\n                    <include name=\"**/*\" />\n                </fileset>\n                <fileset basedir=\"${doc.dir}\" prefix=\"doc\">\n                    <include name=\"**/*\" />\n                </fileset>\n            </zip>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Compression.Tasks.ZipTask.ExecuteTask\">\n            <summary>\n            Creates the zip file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.ZipFile\">\n            <summary>\n            The zip file to create.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.Comment\">\n            <summary>\n            The comment for the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.Stamp\">\n            <summary>\n            Date/time stamp for the files in the format MM/DD/YYYY HH:MM:SS.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.ZipLevel\">\n            <summary>\n            Desired level of compression. Possible values are 0 (STORE only) \n            to 9 (highest). The default is <c>6</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.IncludeEmptyDirs\">\n            <summary>\n            Include empty directories in the generated zip file. The default is\n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.ZipFileSets\">\n            <summary>\n            The set of files to be included in the archive.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.DuplicateHandling\">\n            <summary>\n            Specifies the behaviour when a duplicate file is found. The default\n            is <see cref=\"F:NAnt.Compression.Types.DuplicateHandling.Add\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Tasks.ZipTask.Encoding\">\n            <summary>\n            The character encoding to use for filenames and comment inside the\n            zip file. The default is the system's OEM code page.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.DuplicateHandling\">\n            <summary>\n            Specifies how entries with the same name should be processed.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.DuplicateHandling.Add\">\n            <summary>\n            Overwrite existing entry with same name.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.DuplicateHandling.Preserve\">\n            <summary>\n            Preserve existing entry with the same name.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.DuplicateHandling.Fail\">\n            <summary>\n            Report failure when two entries have the same name.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.DuplicateHandlingConverter\">\n            <summary>\n            Specialized <see cref=\"T:System.ComponentModel.EnumConverter\"/> for <see cref=\"T:NAnt.Compression.Types.TarCompressionMethod\"/>\n            that ignores case when converting from string.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.DuplicateHandlingConverter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.DuplicateHandlingConverter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.DuplicateHandlingConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)\">\n            <summary>\n            Converts the given object to the type of this converter, using the \n            specified context and culture information.\n            </summary>\n            <param name=\"context\">An <see cref=\"T:System.ComponentModel.ITypeDescriptorContext\"/> that provides a format context.</param>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/> object. If a <see langword=\"null\"/> is passed, the current culture is assumed.</param>\n            <param name=\"value\">The <see cref=\"T:System.Object\"/> to convert.</param>\n            <returns>\n            An <see cref=\"T:System.Object\"/> that represents the converted value.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.TarCompressionMethod\">\n            <summary>\n            Specifies the compression methods supported by <see cref=\"T:NAnt.Compression.Tasks.TarTask\"/>\n            and <see cref=\"T:NAnt.Compression.Tasks.UnTarTask\"/>.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.TarCompressionMethod.None\">\n            <summary>\n            No compression.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.TarCompressionMethod.GZip\">\n            <summary>\n            GZIP compression.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Compression.Types.TarCompressionMethod.BZip2\">\n            <summary>\n            BZIP2 compression.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.TarCompressionMethodConverter\">\n            <summary>\n            Specialized <see cref=\"T:System.ComponentModel.EnumConverter\"/> for <see cref=\"T:NAnt.Compression.Types.TarCompressionMethod\"/>\n            that ignores case when converting from string.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarCompressionMethodConverter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.TarCompressionMethodConverter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarCompressionMethodConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)\">\n            <summary>\n            Converts the given object to the type of this converter, using the \n            specified context and culture information.\n            </summary>\n            <param name=\"context\">An <see cref=\"T:System.ComponentModel.ITypeDescriptorContext\"/> that provides a format context.</param>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/> object. If a <see langword=\"null\"/> is passed, the current culture is assumed.</param>\n            <param name=\"value\">The <see cref=\"T:System.Object\"/> to convert.</param>\n            <returns>\n            An <see cref=\"T:System.Object\"/> that represents the converted value.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.TarFileSet\">\n            <summary>\n            A <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> is a <see cref=\"T:NAnt.Core.Types.FileSet\"/> with extra \n            attributes useful in the context of the <see cref=\"T:NAnt.Compression.Tasks.TarTask\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.FileMode\">\n            <summary>\n            A 3 digit octal string, specify the user, group and other modes \n            in the standard Unix fashion. Only applies to plain files. The \n            default is <c>644</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.DirMode\">\n            <summary>\n            A 3 digit octal string, specify the user, group and other modes \n            in the standard Unix fashion. Only applies to directories. The \n            default is <c>755</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.UserName\">\n            <summary>\n            The username for the tar entry.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.Uid\">\n            <summary>\n            The user identifier (UID) for the tar entry. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.GroupName\">\n            <summary>\n            The groupname for the tar entry.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.Gid\">\n            <summary>\n            The group identifier (GID) for the tar entry.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSet.Prefix\">\n            <summary>\n            The top level directory prefix. If set, all file and directory paths \n            in the fileset will have this value prepended. Can either be a single \n            directory name or a \"/\" separated path.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.TarFileSetCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.#ctor(NAnt.Compression.Types.TarFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.#ctor(NAnt.Compression.Types.TarFileSet[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.Add(NAnt.Compression.Types.TarFileSet)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.AddRange(NAnt.Compression.Types.TarFileSet[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.AddRange(NAnt.Compression.Types.TarFileSetCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.Contains(NAnt.Compression.Types.TarFileSet)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.CopyTo(NAnt.Compression.Types.TarFileSet[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.IndexOf(NAnt.Compression.Types.TarFileSet)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/>. If the <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.Insert(System.Int32,NAnt.Compression.Types.TarFileSet)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Compression.Types.TarFileSetEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetCollection.Remove(NAnt.Compression.Types.TarFileSet)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSetCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSetCollection.FileCount\">\n            <summary>\n            Get the total number of files that are represented by the \n            filesets in this collection.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.TarFileSetEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Compression.Types.TarFileSet\"/> elements of a <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetEnumerator.#ctor(NAnt.Compression.Types.TarFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.TarFileSetEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Compression.Types.TarFileSetCollection\"/>.\n            </summary>\n            <param name=\"TarFileSets\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.TarFileSetEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.TarFileSetEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.ZipFileSet\">\n            <summary>\n            A <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> is a <see cref=\"T:NAnt.Core.Types.FileSet\"/> with extra \n            attributes useful in the context of the <see cref=\"T:NAnt.Compression.Tasks.ZipTask\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.ZipFileSet.Prefix\">\n            <summary>\n            The top level directory prefix. If set, all file and directory paths \n            in the fileset will have this value prepended. Can either be a single \n            directory name or a \"/\" separated path.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.ZipFileSetCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.#ctor(NAnt.Compression.Types.ZipFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.#ctor(NAnt.Compression.Types.ZipFileSet[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.Add(NAnt.Compression.Types.ZipFileSet)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.AddRange(NAnt.Compression.Types.ZipFileSet[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.AddRange(NAnt.Compression.Types.ZipFileSetCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.Contains(NAnt.Compression.Types.ZipFileSet)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.CopyTo(NAnt.Compression.Types.ZipFileSet[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.IndexOf(NAnt.Compression.Types.ZipFileSet)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/>. If the <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.Insert(System.Int32,NAnt.Compression.Types.ZipFileSet)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Compression.Types.ZipFileSetEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetCollection.Remove(NAnt.Compression.Types.ZipFileSet)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.ZipFileSetCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.ZipFileSetCollection.FileCount\">\n            <summary>\n            Get the total number of files that are represented by the \n            filesets in this collection.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Compression.Types.ZipFileSetEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Compression.Types.ZipFileSet\"/> elements of a <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetEnumerator.#ctor(NAnt.Compression.Types.ZipFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Compression.Types.ZipFileSetEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Compression.Types.ZipFileSetCollection\"/>.\n            </summary>\n            <param name=\"ZipFileSets\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Compression.Types.ZipFileSetEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Compression.Types.ZipFileSetEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.Core.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.Core</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.Core.Attributes.BooleanValidatorAttribute\">\n            <summary>\n            Used to indicate that a property should be able to be converted into a \n            <see cref=\"T:System.Boolean\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.ValidatorAttribute\">\n            <summary>\n            Base class for all validator attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.ValidatorAttribute.Validate(System.Object)\">\n            <summary>\n            Validates the specified value.\n            </summary>\n            <param name=\"value\">The value to be validated.</param>\n            <exception cref=\"T:NAnt.Core.ValidationException\">The validation fails.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BooleanValidatorAttribute.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.BooleanValidatorAttribute\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BooleanValidatorAttribute.Validate(System.Object)\">\n            <summary>\n            Checks if the specified value can be converted to a <see cref=\"T:System.Boolean\"/>.\n            </summary>\n            <param name=\"value\">The value to be checked.</param>\n            <exception cref=\"T:NAnt.Core.ValidationException\"><paramref name=\"value\"/> cannot be converted to a <see cref=\"T:System.Boolean\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.BuildAttributeAttribute\">\n            <summary>\n            Indicates that property should be treated as a XML attribute for the \n            task.\n            </summary>\n            <example>\n              Examples of how to specify task attributes\n              <code>\n            #region Public Instance Properties\n            \n            [BuildAttribute(\"out\", Required=true)]\n            public string Output {\n                get { return _out; }\n                set { _out = value; }\n            }\n                        [BuildAttribute(\"optimize\")]\n            [BooleanValidator()]\n            public bool Optimize {\n                get { return _optimize; }\n                set { _optimize = value; }\n            }\n                        [BuildAttribute(\"warnlevel\")]\n            [Int32Validator(0,4)] // limit values to 0-4\n            public int WarnLevel {\n                get { return _warnLevel; }\n                set { _warnLevel = value; }\n            }\n                        [BuildElement(\"sources\")]\n            public FileSet Sources {\n                get { return _sources; }\n                set { _sources = value; }\n            }\n            \n            #endregion Public Instance Properties\n            \n            #region Private Instance Fields\n            \n            private string _out = null;\n            private bool _optimize = false;\n            private int _warnLevel = 4;\n            private FileSet _sources = new FileSet();\n            \n            #endregion Private Instance Fields\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BuildAttributeAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.BuildAttributeAttribute\"/> with the \n            specified name.\n            </summary>\n            <param name=\"name\">The name of the attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildAttributeAttribute.Name\">\n            <summary>\n            Gets or sets the name of the XML attribute.\n            </summary>\n            <value>\n            The name of the XML attribute.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildAttributeAttribute.Required\">\n            <summary>\n            Gets or sets a value indicating whether the attribute is required.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the attribute is required; otherwise, \n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildAttributeAttribute.ExpandProperties\">\n            <summary>\n            Gets or sets a value indicating whether property references should \n            be expanded.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if properties should be expanded; otherwise \n            <see langword=\"false\" />. The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildAttributeAttribute.ProcessXml\">\n            <summary>\n            Used to specify how this attribute will be handled as the XML is \n            parsed and given to the element.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if XML should be processed; otherwise \n            <see langword=\"false\" />. The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.BuildElementArrayAttribute\">\n            <summary>\n            Indicates that property should be treated as a XML arrayList\n            </summary>\n            <remarks>\n            <para>\n            Should only be applied to properties exposing strongly typed arrays or \n            strongly typed collections.\n            </para>\n            <para>\n            The XML format is like this:\n            <code>\n                <![CDATA[\n            <task>\n                <elementName ... />\n                <elementName ... />\n                <elementName ... />\n                <elementName ... />\n            </task>\n                ]]>\n            </code>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.BuildElementAttribute\">\n            <summary>\n            Indicates that the property should be treated as an XML element and \n            further processing should be done.\n            </summary>\n            <remarks>\n            <para>\n            The XML format is like this:\n            <code>\n                <![CDATA[\n            <task>\n                <elementName ...>\n                    <morestuff />\n                </elementName>\n            </task>\n                ]]>\n            </code>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BuildElementAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.BuildElementAttribute\"/> with the \n            specified name.\n            </summary>\n            <param name=\"name\">The name of the attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildElementAttribute.Name\">\n            <summary>\n            Gets or sets the name of the attribute.\n            </summary>\n            <value>\n            The name of the attribute.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildElementAttribute.Required\">\n            <summary>\n            Gets or sets a value indicating whether the attribute is required.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the attribute is required; otherwise, \n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildElementAttribute.ProcessXml\">\n            <summary>\n            Used to specify how this element will be handled as the XML is parsed \n            and given to the element.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if XML should be processed; otherwise \n            <see langword=\"false\" />. The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BuildElementArrayAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.BuildElementArrayAttribute\"/> \n            with the specified name.\n            </summary>\n            <param name=\"name\">The name of the attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildElementArrayAttribute.ElementType\">\n            <summary>\n            Gets or sets the type of objects that this container holds.\n            </summary>\n            <value>\n            The type of the elements that this container holds.\n            </value>\n            <remarks>\n            <para>\n            This can be used for validation and schema generation.\n            </para>\n            <para>\n            If not specified, the type of the elements will be determined using\n            reflection.\n            </para>\n            </remarks>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.BuildElementCollectionAttribute\">\n            <summary>\n            Indicates that the property should be treated as a container for a \n            collection of build elements.\n            </summary>\n            <remarks>\n            <para>\n            Should only be applied to properties exposing strongly typed arrays or \n            strongly typed collections.\n            </para>\n            <para>\n            The XML format is like this:\n            <code>\n                <![CDATA[\n            <task>\n                <collectionName>\n                    <elementName ... />\n                    <elementName ... />\n                    <elementName ... />\n                    <elementName ... />\n                </collectionName>\n            </task>\n                ]]>\n            </code>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.BuildElementCollectionAttribute.#ctor(System.String,System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.BuildElementCollectionAttribute\"/> with the \n            specified name and child element name.\n            </summary>\n            <param name=\"collectionName\">The name of the collection.</param>\n            <param name=\"childName\">The name of the child elements in the collection</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"childName\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"childName\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.BuildElementCollectionAttribute.ChildElementName\">\n            <summary>\n            The name of the child element within the collection.\n            </summary>\n            <value>\n            The name to check for in the XML of the elements in the collection.\n            </value>\n            <remarks>\n            This can be used for validation and schema generation.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.DateTimeValidatorAttribute\">\n            <summary>\n            Used to indicate that a property should be able to be converted into a \n            <see cref=\"T:System.DateTime\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.DateTimeValidatorAttribute.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.DateTimeValidatorAttribute\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.DateTimeValidatorAttribute.Validate(System.Object)\">\n            <summary>\n            Checks if the specified value can be converted to a <see cref=\"T:System.DateTime\"/>.\n            </summary>\n            <param name=\"value\">The value to be checked.</param>\n            <exception cref=\"T:NAnt.Core.ValidationException\"><paramref name=\"value\"/> cannot be converted to a <see cref=\"T:System.DateTime\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.ElementNameAttribute\">\n            <summary>\n            Indicates that class should be treated as a NAnt element.\n            </summary>\n            <remarks>\n            Attach this attribute to a subclass of Element to have NAnt be able\n            to recognize it.  The name should be short but must not confict\n            with any other element already in use.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.ElementNameAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cre=\"ElementNameAttribute\"/> \n            with the specified name.\n            </summary>\n            <param name=\"name\">The name of the element.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.ElementNameAttribute.Name\">\n            <summary>\n            Gets or sets the name of the element.\n            </summary>\n            <value>\n            The name of the element.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.FileSetAttribute\">\n            <summary>\n            Indicates that a property should be treated as a XML file set for the \n            task.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.FileSetAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.FileSetAttribute\"/> with the\n            specified name.\n            </summary>\n            <param name=\"name\">The name of the attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.FrameworkConfigurableAttribute\">\n            <summary>\n            Indicates that the value of the property to which the attribute is \n            assigned, can be configured on the framework-level in the NAnt application \n            configuration file.\n            </summary>\n            <example>\n            <para>\n            The following example shows a property of which the value can be \n            configured for a specific framework in the NAnt configuration file.\n            </para>\n            <code lang=\"C#\">\n            [FrameworkConfigurable(\"exename\", Required=true)]\n            public virtual string ExeName {\n                get { return _exeName; }\n                set { _exeName = value; }\n            }\n            </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.FrameworkConfigurableAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.FrameworkConfigurableAttribute\"/>\n            with the specified attribute name.\n            </summary>\n            <param name=\"name\">The name of the framework configuration attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is a <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FrameworkConfigurableAttribute.Name\">\n            <summary>\n            Gets or sets the name of the framework configuration attribute.\n            </summary>\n            <value>The name of the framework configuration attribute.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FrameworkConfigurableAttribute.Required\">\n            <summary>\n            Gets or sets a value indicating whether the configuration attribute \n            is required.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the configuration attribute is required; \n            otherwise, <see langword=\"true\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FrameworkConfigurableAttribute.ExpandProperties\">\n            <summary>\n            Gets or sets a value indicating whether property references should \n            be expanded.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if properties should be expanded; otherwise \n            <see langword=\"false\" />. The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.FunctionAttribute\">\n            <summary>\n            Indicates that the method should be exposed as a function in NAnt build \n            files.\n            </summary>\n            <remarks>\n            Attach this attribute to a method of a class that derives from \n            <see cref=\"T:NAnt.Core.FunctionSetBase\"/> to have NAnt be able to recognize it.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.FunctionAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.FunctionAttribute\"/>\n            class with the specified name.\n            </summary>\n            <param name=\"name\">The name of the function.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FunctionAttribute.Name\">\n            <summary>\n            Gets or sets the name of the function.\n            </summary>\n            <value>\n            The name of the function.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.FunctionSetAttribute\">\n            <summary>\n            Indicates that class should be treated as a set of functions.\n            </summary>\n            <remarks>\n            Attach this attribute to a class that derives from <see cref=\"T:NAnt.Core.FunctionSetBase\"/> \n            to have NAnt be able to recognize it as containing custom functions.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.FunctionSetAttribute.#ctor(System.String,System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.FunctionSetAttribute\"/> \n            class with the specified name.\n            </summary>\n            <param name=\"prefix\">The prefix used to distinguish the functions.</param>\n            <param name=\"category\">The category of the functions.</param>\n            <exception cref=\"T:System.ArgumentNullException\">\n              <para><paramref name=\"prefix\"/> is <see langword=\"null\"/>.</para>\n              <para>-or-</para>\n              <para><paramref name=\"category\"/> is <see langword=\"null\"/>.</para>\n            </exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">\n              <para><paramref name=\"prefix\"/> is a zero-length <see cref=\"T:System.String\"/>.</para>\n              <para>-or-</para>\n              <para><paramref name=\"category\"/> is a zero-length <see cref=\"T:System.String\"/>.</para>\n            </exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FunctionSetAttribute.Category\">\n            <summary>\n            Gets or sets the category of the function set.\n            </summary>\n            <value>\n            The name of the category of the function set.\n            </value>\n            <remarks>\n            This will be displayed in the user docs.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.FunctionSetAttribute.Prefix\">\n            <summary>\n            Gets or sets the prefix of all functions in this function set.\n            </summary>\n            <value>\n            The prefix of the functions in this function set.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.Int32ValidatorAttribute\">\n            <summary>\n            Indicates that property should be able to be converted into a <see cref=\"T:System.Int32\"/> \n            within the given range.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.Int32ValidatorAttribute.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.Int32ValidatorAttribute\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.Int32ValidatorAttribute.#ctor(System.Int32,System.Int32)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.Int32ValidatorAttribute\"/> \n            class with the specied minimum and maximum values.\n            </summary>\n            <param name=\"minValue\">The minimum value.</param>\n            <param name=\"maxValue\">The maximum value.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.Int32ValidatorAttribute.Validate(System.Object)\">\n            <summary>\n            Checks whether the specified value can be converted to an <see cref=\"T:System.Int32\"/> \n            and whether the value lies within the range defined by the <see cref=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MinValue\"/> \n            and <see cref=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MaxValue\"/> properties.\n            </summary>\n            <param name=\"value\">The value to be checked.</param>\n            <exception cref=\"T:NAnt.Core.ValidationException\">\n              <para>\n              <paramref name=\"value\"/> cannot be converted to an <see cref=\"T:System.Int32\"/>.\n              </para>\n              <para>-or-</para>\n              <para>\n              <paramref name=\"value\"/> is not in the range defined by <see cref=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MinValue\"/>\n              and <see cref=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MaxValue\"/>.\n              </para>\n            </exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MinValue\">\n            <summary>\n            Gets or sets the minimum value.\n            </summary>\n            <value>\n            The minimum value. The default is <see cref=\"F:System.Int32.MinValue\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.MaxValue\">\n            <summary>\n            Gets or sets the maximum value.\n            </summary>\n            <value>\n            The maximum value. The default is <see cref=\"F:System.Int32.MaxValue\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.Int32ValidatorAttribute.Base\">\n            <summary>\n            The base of the number to validate, which must be 2, 8, 10, or 16.\n            </summary>\n            <value>\n            The base of the number to validate.\n            </value>\n            <remarks>\n            The default is 10.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.LocationType\">\n            <summary>\n            Defines possible locations in which a task executable can be located.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Attributes.LocationType.FrameworkDir\">\n            <summary>\n            Locates the task executable in the current Framework directory.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Attributes.LocationType.FrameworkSdkDir\">\n            <summary>\n            Locates the task executable in the current Framework SDK directory.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.ProgramLocationAttribute\">\n            <summary>\n            Indicates the location that a task executable can be located in.\n            </summary>\n            <remarks>\n              <para>\n              When applied to a task deriving from <see cref=\"T:NAnt.Core.Tasks.ExternalProgramBase\"/>,\n              the program to execute will first be searched for in the designated\n              location.\n              </para>\n              <para>\n              If the program does not exist in that location, and the file name is\n              not an absolute path then the list of tool paths of the current\n              target framework will be searched (in the order in which they are\n              defined in the NAnt configuration file).\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.ProgramLocationAttribute.#ctor(NAnt.Core.Attributes.LocationType)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.ProgramLocationAttribute\"/> \n            with the specified location.\n            </summary>\n            <param type=\"type\">The <see cref=\"P:NAnt.Core.Attributes.ProgramLocationAttribute.LocationType\"/> of the attribute.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.ProgramLocationAttribute.LocationType\">\n            <summary>\n            Gets or sets the <see cref=\"P:NAnt.Core.Attributes.ProgramLocationAttribute.LocationType\"/> of the task.\n            </summary>\n            <value>\n            The location type of the task to which the attribute is assigned.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.StringValidatorAttribute\">\n            <summary>\n            Used to indicate whether a <see cref=\"T:System.String\"/> property should allow \n            an empty string value or not.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.StringValidatorAttribute.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.StringValidatorAttribute\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.StringValidatorAttribute.Validate(System.Object)\">\n            <summary>\n            Checks if the specified value adheres to the rules defined by the \n            properties of the <see cref=\"T:NAnt.Core.Attributes.StringValidatorAttribute\"/>.\n            </summary>\n            <param name=\"value\">The value to be checked.</param>\n            <exception cref=\"T:NAnt.Core.ValidationException\"><paramref name=\"value\"/> is an empty string value and <see cref=\"P:NAnt.Core.Attributes.StringValidatorAttribute.AllowEmpty\"/> is set to <see langword=\"false\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.StringValidatorAttribute.AllowEmpty\">\n            <summary>\n            Gets or sets a value indicating whether an empty string or\n            <see langword=\"null\" /> should be a considered a valid value.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if an empty string or <see langword=\"null\" />\n            should be considered a valid value; otherwise, <see langword=\"false\" />.\n            The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.StringValidatorAttribute.Expression\">\n            <summary>\n            Gets or sets a regular expression.  The string will be validated to\n                determine if it matches the expression.\n            </summary>\n            <value>\n            <see cref=\"N:System.Text.RegularExpressions\"/>\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Attributes.StringValidatorAttribute.ExpressionErrorMessage\">\n            <summary>\n            An optional error message that can be used to better describe the\n            regular expression error.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.TaskAttributeAttribute\">\n            <summary>\n            Indicates that property should be treated as a XML attribute for the \n            task.\n            </summary>\n            <example>\n            Examples of how to specify task attributes\n            <code>\n            // task XmlType default is string\n            [TaskAttribute(\"out\", Required=true)]\n            string _out = null; // assign default value here\n                        [TaskAttribute(\"optimize\")]\n            [BooleanValidator()]\n            // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)\n            string _optimize = Boolean.FalseString;\n                        [TaskAttribute(\"warnlevel\")]\n            [Int32Validator(0,4)] // limit values to 0-4\n            // during ExecuteTask you can safely use Convert.ToInt32(_optimize)\n            string _warnlevel = \"0\";\n                        [BuildElement(\"sources\")]\n            FileSet _sources = new FileSet();\n            </code>\n            NOTE: Attribute values must be of type of string if you want\n            to be able to have macros.  The field stores the exact value during\n            Initialize.  Just before ExecuteTask is called NAnt will expand\n            all the macros with the current values.\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.TaskAttributeAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.TaskAttributeAttribute\"/>\n            with the specified attribute name.\n            </summary>\n            <param name=\"name\">The name of the task attribute.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is a <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Attributes.TaskNameAttribute\">\n            <summary>\n            Indicates that class should be treated as a task.\n            </summary>\n            <remarks>\n            Attach this attribute to a subclass of Task to have NAnt be able\n            to recognize it.  The name should be short but must not confict\n            with any other task already in use.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Attributes.TaskNameAttribute.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Attributes.TaskNameAttribute\"/> \n            with the specified name.\n            </summary>\n            <param name=\"name\">The name of the task.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"name\"/> is a zero-length <see cref=\"T:System.String\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Element\">\n            <summary>\n            Models a NAnt XML element in the build file.\n            </summary>\n            <remarks>\n            <para>\n            Automatically validates attributes in the element based on attributes \n            applied to members in derived classes.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Element\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Element.#ctor(NAnt.Core.Element)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Element\"/> class\n            from the specified element.\n            </summary>\n            <param name=\"e\">The element that should be used to create a new instance of the <see cref=\"T:NAnt.Core.Element\"/> class.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Element.Initialize(System.Xml.XmlNode)\">\n            <summary>\n            Performs default initialization.\n            </summary>\n            <remarks>\n            Derived classes that wish to add custom initialization should override \n            the <see cref=\"M:NAnt.Core.Element.Initialize\"/> method.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to be logged.</param>\n            <remarks>\n            The actual logging is delegated to the project.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            The actual logging is delegated to the project.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.InitializeElement(System.Xml.XmlNode)\">\n            <summary>\n            Derived classes should override to this method to provide extra \n            initialization and validation not covered by the base class.\n            </summary>\n            <param name=\"elementNode\">The XML node of the element to use for initialization.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Element.Initialize\">\n            <summary>\n            Derived classes should override to this method to provide extra \n            initialization and validation not covered by the base class.\n            </summary>\n            <remarks>\n            Access to the <see cref=\"P:NAnt.Core.Element.XmlNode\"/> that was used to initialize\n            this <see cref=\"T:NAnt.Core.Element\"/> is available through <see cref=\"P:NAnt.Core.Element.XmlNode\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.CopyTo(NAnt.Core.Element)\">\n            <summary>\n            Copies all instance data of the <see cref=\"T:NAnt.Core.Element\"/> to a given\n            <see cref=\"T:NAnt.Core.Element\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Element.Initialize(System.Xml.XmlNode,NAnt.Core.PropertyDictionary,NAnt.Core.FrameworkInfo)\">\n            <summary>\n            Performs initialization using the given set of properties.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Element.InitializeXml(System.Xml.XmlNode,NAnt.Core.PropertyDictionary,NAnt.Core.FrameworkInfo)\">\n            <summary>\n            Initializes all build attributes and child elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Element.GetAttributeConfigurationNode(NAnt.Core.FrameworkInfo,System.String)\">\n            <summary>\n            Locates the XML node for the specified attribute in the project \n            configuration node.\n            </summary>\n            <param name=\"attributeName\">The name of attribute for which the XML configuration node should be located.</param>\n            <param name=\"framework\">The framework to use to obtain framework specific information, or <see langword=\"null\" /> if no framework specific information should be used.</param>\n            <returns>\n            The XML configuration node for the specified attribute, or \n            <see langword=\"null\" /> if no corresponding XML node could be \n            located.\n            </returns>\n            <remarks>\n            If there's a valid current framework, the configuration section for\n            that framework will first be searched.  If no corresponding \n            configuration node can be located in that section, the framework-neutral\n            section of the project configuration node will be searched.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Element.GetElementNameFromType(System.Type)\">\n            <summary>\n            Returns the <see cref=\"P:NAnt.Core.Attributes.ElementNameAttribute.Name\"/> of the \n            <see cref=\"T:NAnt.Core.Attributes.ElementNameAttribute\"/> assigned to the specified\n            <see cref=\"T:System.Type\"/>.\n            </summary>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> of which the assigned <see cref=\"P:NAnt.Core.Attributes.ElementNameAttribute.Name\"/> should be retrieved.</param>\n            <returns>\n            The <see cref=\"P:NAnt.Core.Attributes.ElementNameAttribute.Name\"/> assigned to the specified \n            <see cref=\"T:System.Type\"/> or a null reference is no <see cref=\"P:NAnt.Core.Attributes.ElementNameAttribute.Name\"/>\n            is assigned to the <paramref name=\"type\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Element.Parent\">\n            <summary>\n            Gets or sets the parent of the element.\n            </summary>\n            <value>\n            The parent of the element.\n            </value>\n            <remarks>\n            This will be the parent <see cref=\"T:NAnt.Core.Task\"/>, <see cref=\"T:NAnt.Core.Target\"/>, or \n            <see cref=\"P:NAnt.Core.Element.Project\"/> depending on where the element is defined.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Element.Name\">\n            <summary>\n            Gets the name of the XML element used to initialize this element.\n            </summary>\n            <value>\n            The name of the XML element used to initialize this element.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Element.Project\">\n            <summary>\n            Gets or sets the <see cref=\"P:NAnt.Core.Element.Project\"/> to which this element belongs.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.Element.Project\"/> to which this element belongs.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Element.Properties\">\n            <summary>\n            Gets the properties local to this <see cref=\"T:NAnt.Core.Element\"/> and the \n            <see cref=\"P:NAnt.Core.Element.Project\"/>.\n            </summary>\n            <value>\n            The properties local to this <see cref=\"T:NAnt.Core.Element\"/> and the <see cref=\"P:NAnt.Core.Element.Project\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Element.NamespaceManager\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.Element.NamespaceManager\"/> defines the current namespace \n            scope and provides methods for looking up namespace information.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Element.XmlNode\">\n            <summary>\n            Gets or sets the XML node of the element.\n            </summary>\n            <value>\n            The XML node of the element.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Element.Location\">\n            <summary>\n            Gets or sets the location in the build file where the element is \n            defined.\n            </summary>\n            <value>\n            The location in the build file where the element is defined.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Element.CustomXmlProcessing\">\n            <summary>\n            Gets a value indicating whether the element is performing additional\n            processing using the <see cref=\"P:NAnt.Core.Element.XmlNode\"/> that was used to \n            initialize the element.\n            </summary>\n            <value>\n            <see langword=\"false\"/>.\n            </value>\n            <remarks>\n            <para>\n            Elements that need to perform additional processing of the \n            <see cref=\"P:NAnt.Core.Element.XmlNode\"/> that was used to initialize the element, should\n            override this property and return <see langword=\"true\"/>.\n            </para>\n            <para>\n            When <see langword=\"true\"/>, no build errors will be reported for\n            unknown nested build elements.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Element.AttributeConfigurator\">\n            <summary>\n            Configures an <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> using meta-data provided by\n            assigned attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Element.AttributeConfigurator.#ctor(NAnt.Core.Element,System.Xml.XmlNode,NAnt.Core.PropertyDictionary,NAnt.Core.FrameworkInfo)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Element.AttributeConfigurator\"/>\n            class for the given <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/>.\n            </summary>\n            <param name=\"element\">The <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> for which an <see cref=\"T:NAnt.Core.Element.AttributeConfigurator\"/> should be created.</param>\n            <param name=\"elementNode\">The <see cref=\"P:NAnt.Core.Element.XmlNode\"/> to initialize the <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> with.</param>\n            <param name=\"properties\">The <see cref=\"T:NAnt.Core.PropertyDictionary\"/> to use for property expansion.</param>\n            <param name=\"targetFramework\">The framework that the <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> should target.</param>\n            <exception cref=\"T:System.ArgumentNullException\">\n                <para><paramref name=\"element\"/> is <see langword=\"null\"/>.</para>\n                <para>-or-</para>\n                <para><paramref name=\"elementNode\"/> is <see langword=\"null\"/>.</para>\n                <para>-or-</para>\n                <para><paramref name=\"properties\"/> is <see langword=\"null\"/>.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Element.AttributeConfigurator.CreateChildBuildElement(System.Reflection.PropertyInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Xml.XmlNode,NAnt.Core.PropertyDictionary,NAnt.Core.FrameworkInfo)\">\n            <summary>\n            Creates a child <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> using property set/get methods.\n            </summary>\n            <param name=\"propInf\">The <see cref=\"T:System.Reflection.PropertyInfo\"/> instance that represents the property of the current class.</param>\n            <param name=\"getter\">A <see cref=\"T:System.Reflection.MethodInfo\"/> representing the get accessor for the property.</param>\n            <param name=\"setter\">A <see cref=\"T:System.Reflection.MethodInfo\"/> representing the set accessor for the property.</param>\n            <param name=\"xml\">The <see cref=\"P:NAnt.Core.Element.XmlNode\"/> used to initialize the new <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> instance.</param>\n            <param name=\"properties\">The collection of property values to use for macro expansion.</param>\n            <param name=\"framework\">The <see cref=\"T:NAnt.Core.FrameworkInfo\"/> from which to obtain framework-specific information.</param>\n            <returns>The <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> child.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Element.AttributeConfigurator.CreateAttributeSetter(System.Type)\">\n            <summary>\n            Creates an <see cref=\"T:NAnt.Core.Element.AttributeConfigurator.IAttributeSetter\"/> for the given \n            <see cref=\"T:System.Type\"/>.\n            </summary>\n            <param name=\"attributeType\">The <see cref=\"T:System.Type\"/> for which an <see cref=\"T:NAnt.Core.Element.AttributeConfigurator.IAttributeSetter\"/> should be created.</param>\n            <returns>\n            An <see cref=\"T:NAnt.Core.Element.AttributeConfigurator.IAttributeSetter\"/> for the given <see cref=\"T:System.Type\"/>.\n            </returns>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._element\">\n            <summary>\n            Holds the <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> that should be initialized.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._elementXml\">\n            <summary>\n            Holds the <see cref=\"P:NAnt.Core.Element.XmlNode\"/> that should be used to initialize\n            the <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/>.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._properties\">\n            <summary>\n            Holds the dictionary that should be used for property \n            expansion.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._targetFramework\">\n            <summary>\n            Holds the framework that should be targeted by the \n            <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.Element\"/> that we're configuring, or\n            <see langword=\"null\"/> if there's no current target\n            framework.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._unprocessedAttributes\">\n            <summary>\n            Holds the names of the attributes that still need to be \n            processed.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator._unprocessedChildNodes\">\n            <summary>\n            Holds the names of the child nodes that still need to be \n            processed.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator.logger\">\n            <summary>\n            Holds the logger for the current class.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Element.AttributeConfigurator.AttributeSetters\">\n            <summary>\n            Holds the cache of <see cref=\"T:NAnt.Core.Element.AttributeConfigurator.IAttributeSetter\"/> instances.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Element.AttributeConfigurator.NamespaceManager\">\n            <summary>\n            Gets the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.Element.AttributeConfigurator.NamespaceManager\"/> defines the current namespace \n            scope and provides methods for looking up namespace information.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Element.AttributeConfigurator.IAttributeSetter\">\n            <summary>\n            Internal interface used for setting element attributes. \n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Configuration.DirList\">\n            <summary>\n            Represents an explicitly named list of directories.\n            </summary>\n            <remarks>\n            A <see cref=\"T:NAnt.Core.Configuration.DirList\"/> is useful when you want to capture a list of\n            directories regardless whether they currently exist.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Configuration.DirList.Directory\">\n            <summary>\n            The base of the directory of this dirlist. The default is the project\n            base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Configuration.ManagedExecutionMode.Environment\">\n            <summary>\n            Gets the collection of environment variables that should be passed\n            to external programs that are launched.\n            </summary>\n            <value>\n            <summary>\n            The collection of environment variables that should be passed\n            to external programs that are launched.\n            </summary>\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Configuration.RuntimeEngine.Arguments\">\n            <summary>\n            The command-line arguments for the runtime engine.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Extensibility.ExtensionAssembly\">\n            <summary>\n            Represents an <see cref=\"P:NAnt.Core.Extensibility.ExtensionAssembly.Assembly\"/> in which one or more extensions\n            are found.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Extensibility.ExtensionAssembly.#ctor(System.Reflection.Assembly)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/>\n            class for a given <see cref=\"P:NAnt.Core.Extensibility.ExtensionAssembly.Assembly\"/>.\n            </summary>\n            <param name=\"assembly\">The <see cref=\"P:NAnt.Core.Extensibility.ExtensionAssembly.Assembly\"/> for which to construct an <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/>.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Extensibility.ExtensionAssembly.Assembly\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.Extensibility.ExtensionAssembly.Assembly\"/> containing extensions.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Extensibility.ExtensionBuilder.#ctor(NAnt.Core.Extensibility.ExtensionAssembly)\">\n            <summary>\n            Initializes a instance of the <see cref=\"T:NAnt.Core.Extensibility.ExtensionBuilder\"/> \n            class for an extension in a given <see cref=\"P:NAnt.Core.Extensibility.ExtensionBuilder.ExtensionAssembly\"/>.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"P:NAnt.Core.Extensibility.ExtensionBuilder.ExtensionAssembly\"/> in which the extension is found.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"extensionAssembly\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Extensibility.ExtensionBuilder.ExtensionAssembly\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.Extensibility.ExtensionBuilder.ExtensionAssembly\"/> in which the extension\n            was found.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Extensibility.ExtensionBuilder.Assembly\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.Extensibility.ExtensionBuilder.Assembly\"/> from which the extension will \n            be created.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.Extensibility.ExtensionBuilder.Assembly\"/> containing the extension.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Extensibility.PluginConsumerAttribute.#ctor(System.Type)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Extensibility.PluginConsumerAttribute\"/> \n            with the specified type.\n            </summary>\n            <param name=\"type\">The type of the <see cref=\"T:NAnt.Core.Extensibility.IPlugin\"/> to consume.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"type\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Extensibility.PluginScanner\">\n            <summary>\n            Responsible for scanning types for plugins, and maintaining a cache of\n            <see cref=\"T:NAnt.Core.Extensibility.PluginBuilder\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Extensibility.PluginScanner.ScanTypeForPlugins(NAnt.Core.Extensibility.ExtensionAssembly,System.Type,NAnt.Core.Task)\">\n            <summary>\n            Scans a given <see cref=\"T:System.Type\"/> for plugins.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> represents a\n            <see cref=\"T:NAnt.Core.Extensibility.IPlugin\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Extensibility.PluginScanner.RegisterPlugins(NAnt.Core.Extensibility.IPluginConsumer)\">\n            <summary>\n            Registers matching plugins for the specified <see cref=\"T:NAnt.Core.Extensibility.IPluginConsumer\"/>.\n            </summary>\n            <param name=\"consumer\">The <see cref=\"T:NAnt.Core.Extensibility.IPluginConsumer\"/> which plugins must be registered for.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"consumer\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ChainableReader\">\n            <summary>\n            Functions as a chainable TextReader\n            </summary>\n            <remarks>\n            Implements a abstraction over a TextReader that allows the class to represent\n            either a TextReader or another ChainableReader to which it is chained.\n                        By passing a ChainableReader as a constructor paramater it is possiable to\n            chain many ChainableReaders together.  The last ChainableReader in the chain must\n            be based on a TextReader.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Chain(NAnt.Core.Filters.ChainableReader)\">\n            <summary>\n            Makes it so all calls to Read and Peek are passed  the ChainableReader\n            passed as a parameter.\n            </summary>\n            <param name=\"parentChainedReader\">ChainableReader to forward calls to</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Chain(System.IO.TextReader)\">\n            <summary>\n            Makes it so all calls to Read and Peek are passed the TextReader\n            passed as a parameter.\n            </summary>\n            <param name=\"baseReader\">TextReader to forward calls to</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Peek\">\n            <summary>\n            Forwards Peek calls to the TextReader or ChainableReader passed in the corresponding constructor.\n            </summary>\n            <returns>Character or -1 if end of stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Read\">\n            <summary>\n            Forwards Read calls to the TextReader or ChainableReader passed in the corresponding constructor.\n            </summary>\n            <returns>\n            Character or -1 if end of stream.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Close\">\n            <summary>\n            Closes the reader.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ChainableReader.Dispose\">\n            <summary>\n            Calls close and supresses the finalizer for the object.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ChainableReader.Base\">\n            <summary>\n            Gets a value indicating if the reader is backed by a stream in the \n            chain.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the reader is backed by a stream;\n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.Filter\">\n            <summary>\n            Allows a file's content to be modified while performing an operation.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.Filter.InitializeFilter\">\n            <summary>\n            Called after construction and after properties are set. Allows\n            for filter initialization.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.Filter.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the filter will be used; otherwise, \n            skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.Filter.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Filters.Filter.IfDefined\"/>. If <see langword=\"false\"/> \n            then the filter will be executed; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilder.#ctor(NAnt.Core.Extensibility.ExtensionAssembly,System.String)\">\n            <summary>\n            Creates a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> class\n            for the specified <see cref=\"T:NAnt.Core.Filters.Filter\"/> class in the specified\n            <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/>.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:NAnt.Core.Filters.Filter\"/>.</param>\n            <param name=\"className\">The class representing the <see cref=\"T:NAnt.Core.Filters.Filter\"/>.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterBuilder.ClassName\">\n            <summary>\n            Gets the name of the <see cref=\"T:NAnt.Core.Filters.Filter\"/> class that can be created\n            using this <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/>.\n            </summary>\n            <value>\n            The name of the <see cref=\"T:NAnt.Core.Filters.Filter\"/> class that can be created using\n            this <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterBuilder.FilterName\">\n            <summary>\n            Gets the name of the filter which the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/>\n            can create.\n            </summary>\n            <value>\n            The name of the task which the <see cref=\"T:NAnt.Core.TaskBuilder\"/> can \n            create.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterBuilderCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.#ctor(NAnt.Core.Filters.FilterBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.#ctor(NAnt.Core.Filters.FilterBuilder[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.Add(NAnt.Core.Filters.FilterBuilder)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.AddRange(NAnt.Core.Filters.FilterBuilder[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.AddRange(NAnt.Core.Filters.FilterBuilderCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.Contains(NAnt.Core.Filters.FilterBuilder)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> for the specified \n            task is in the collection.\n            </summary>\n            <param name=\"taskName\">The name of task for which the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> should be located in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> for \n            the specified task is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.CopyTo(NAnt.Core.Filters.FilterBuilder[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.IndexOf(NAnt.Core.Filters.FilterBuilder)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/>. If the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.Insert(System.Int32,NAnt.Core.Filters.FilterBuilder)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Filters.FilterBuilderEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderCollection.Remove(NAnt.Core.Filters.FilterBuilder)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterBuilderCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterBuilderCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> for the specified task.\n            </summary>\n            <param name=\"filterName\">The name of the filter for which the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> should be located in the collection.</param> \n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterBuilderEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> elements of a <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderEnumerator.#ctor(NAnt.Core.Filters.FilterBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterBuilderEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Filters.FilterBuilderCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterBuilderEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterBuilderEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterChain\">\n            <summary>\n            Represent a chain of NAnt filters that can be applied to a <see cref=\"T:NAnt.Core.Task\"/>.\n            </summary>\n            <remarks>\n            <para>\n            A FilterChain represents a collection of one or more filters that can \n            be appled to a <see cref=\"T:NAnt.Core.Task\"/> such as the <see cref=\"T:NAnt.Core.Tasks.CopyTask\"/>.\n            In the case of the <see cref=\"T:NAnt.Core.Tasks.CopyTask\"/>, the contents of the copied \n            files are filtered through each filter specified in the filter chain. \n            Filtering occurs in the order the filters are specified with filtered\n            output of one filter feeding into another.\n            </para>\n            <para>\n               :--------:---&gt;:----------:---&gt;:----------: ... :----------:---&gt;:--------:<br/>\n               :.Source.:---&gt;:.Filter 1.:---&gt;:.Filter 2.: ... :.Filter n.:---&gt;:.target.:<br/>\n               :--------:---&gt;:----------:---&gt;:----------: ... :----------:---&gt;:--------:<br/>\n            </para>\n            <para>\n            A list of all filters that come with NAnt is available <see href=\"../filters/index.html\">here</see>.\n            </para>\n            <para>\n            The following tasks support filtering with a FilterChain:\n            </para>\n            <list type=\"bullet\">\n              <item>\n                <description><see cref=\"T:NAnt.Core.Tasks.CopyTask\"/></description>\n              </item>\n              <item>\n                <description><see cref=\"T:NAnt.Core.Tasks.MoveTask\"/></description>\n              </item>\n            </list>\n            </remarks>\n            <example>\n              <para>\n              Replace all occurrences of @NOW@ with the current date/time and \n              replace tabs with spaces in all copied files.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"NOW\" value=\"${datetime::now()}\" />\n            <copy todir=\"out\">\n                <fileset basedir=\"in\">\n                    <include name=\"**/*\" />\n                </fileset>\n                <filterchain>\n                    <replacetokens>\n                        <token key=\"NOW\" value=\"${TODAY}\" />\n                    </replacetokens>\n                    <tabstospaces />\n                </filterchain>\n            </copy>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.DataTypeBase\">\n            <summary>\n            Provides the abstract base class for types.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBase.Reset\">\n            <summary>\n            Should be overridden by derived classes. clones the referenced types \n            data into the current instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBase.CopyTo(NAnt.Core.DataTypeBase)\">\n            <summary>\n            Copies all instance data of the <see cref=\"T:NAnt.Core.DataTypeBase\"/> to a given\n            <see cref=\"T:NAnt.Core.DataTypeBase\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBase.ID\">\n            <summary>\n            The ID used to be referenced later.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBase.RefID\">\n            <summary>\n            The ID to use as the reference.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBase.CanBeReferenced\">\n            <summary>\n            Gets a value indicating whether a reference to the type can be\n            defined.\n            </summary>\n            <remarks>\n            Only types with an <see cref=\"T:NAnt.Core.Attributes.ElementNameAttribute\"/> assigned \n            to it, can be referenced.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBase.Name\">\n            <summary>\n            Gets the name of the datatype.\n            </summary>\n            <value>\n            The name of the datatype.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterChain.InitializeXml(System.Xml.XmlNode,NAnt.Core.PropertyDictionary,NAnt.Core.FrameworkInfo)\">\n            <summary>\n            Initializes all build attributes and child elements.\n            </summary>\n            <remarks>\n            <see cref=\"T:NAnt.Core.Filters.FilterChain\"/> needs to maintain the order in which the\n            filters are specified in the build file.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterChain.GetBaseFilter(NAnt.Core.Filters.PhysicalTextReader)\">\n            <summary>\n            Used to to instantiate and return the chain of stream based filters.\n            </summary>\n            <param name=\"physicalTextReader\">The <see cref=\"T:NAnt.Core.Filters.PhysicalTextReader\"/> that is the source of input to the filter chain.</param>\n            <remarks>\n            The <paramref name=\"physicalTextReader\"/> is the first <see cref=\"T:NAnt.Core.Filters.Filter\"/>\n            in the chain, which is based on a physical stream that feeds the chain.\n            </remarks>\n            <returns>\n            The last <see cref=\"T:NAnt.Core.Filters.Filter\"/> in the chain.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterChain.Filters\">\n            <summary>\n            The filters to apply.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterChain.InputEncoding\">\n            <summary>\n            The encoding to assume when filter-copying files. The default is\n            system's current ANSI code page.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterChain.FilterChainConfigurator\">\n            <summary>\n            Configurator that initializes filters in the order in which they've\n            been specified in the build file.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Filters.Filter\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.#ctor(NAnt.Core.Filters.FilterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.#ctor(NAnt.Core.Filters.Filter[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Filters.Filter\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.Add(NAnt.Core.Filters.Filter)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Filters.Filter\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.Filter\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.AddRange(NAnt.Core.Filters.Filter[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Filters.Filter\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Filters.Filter\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.AddRange(NAnt.Core.Filters.FilterCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.Contains(NAnt.Core.Filters.Filter)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Filters.Filter\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.Filter\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.CopyTo(NAnt.Core.Filters.Filter[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.IndexOf(NAnt.Core.Filters.Filter)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Filters.Filter\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.Filter\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Filters.Filter\"/>. If the <see cref=\"T:NAnt.Core.Filters.Filter\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.Insert(System.Int32,NAnt.Core.Filters.Filter)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Filters.Filter\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.Filter\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Filters.FilterEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterCollection.Remove(NAnt.Core.Filters.Filter)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Filters.Filter\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.FilterEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Filters.Filter\"/> elements of a <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterEnumerator.#ctor(NAnt.Core.Filters.FilterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Filters.FilterEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Filters.FilterCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.FilterEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.FilterEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.PhysicalTextReader\">\n            <summary>\n            Represents a physical <see cref=\"T:System.IO.TextReader\"/>.  That is a reader based \n            on a stream.\n            </summary>\n            <remarks>\n            Used by <see cref=\"T:NAnt.Core.Filters.ChainableReader\"/> to represent a <see cref=\"T:NAnt.Core.Filters.Filter\"/>\n            based on a <see cref=\"T:System.IO.TextReader\"/> in the chain.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ExpandProperties\">\n            <summary>\n            Parses NAnt properties and expressions\n            </summary>\n            <remarks>\n            <para>\n            This filter parses any NAnt properties or expressions found in its input, \n            inlining their values in its output.\n            </para>\n            <para>\n            Note: Due to limitations on buffering, expressions longer than 2048 \n            characters are not guaranteed to be expanded.\n            </para>\n            Filters are intended to be used as a element of a <see cref=\"T:NAnt.Core.Filters.FilterChain\"/>.\n            </remarks>\n            <example>\n              <para>Replace all properties with their corresponding values.</para>\n              <code>\n                <![CDATA[\n            <expandproperties />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.Core.Filters.ExpandProperties._buffer\">\n            <summary>\n            Holds data for expression expansion between input and output.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ExpandProperties.InitializeFilter\">\n            <summary>\n            Called after construction and after properties are set. Allows\n            for filter initialization.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ExpandProperties.Read\">\n            <summary>\n            Reads the next character applying the filter logic.\n            </summary>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ExpandProperties.Peek\">\n            <summary>\n            Reads the next character applying the filter logic without advancing the current position in the stream.\n            </summary>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ExpandProperties.Advance\">\n            <summary>\n            Moves to the next character.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ExpandProperties.ReplenishBuffer\">\n            <summary>\n            Refills the buffer, running our input through \n            <see cref=\"M:NAnt.Core.PropertyDictionary.ExpandProperties(System.String,NAnt.Core.Location)\"/>.)\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ExpandProperties.AtEnd\">\n            <summary>\n            Determines whether we've passed the end of our data.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ReplaceString\">\n            <summary>\n            Replaces all occurrences of a given string in the original input with \n            user-supplied replacement string.\n            </summary>\n            <remarks>\n            <para>\n            This filter replaces all occurrences of a given string in the original \n            input stream with a user-supplied replacement string. By default string \n            comparisons are case sensitive but this can be changed by setting the \n            optional <see cref=\"P:NAnt.Core.Filters.ReplaceString.IgnoreCase\"/> attribute to <see langword=\"true\"/>.\n            </para>\n            <para>\n            To use this filter specify the string to be replaced with the \n            <see cref=\"P:NAnt.Core.Filters.ReplaceString.From\"/> attribute and the string to replace it with using the \n            <see cref=\"P:NAnt.Core.Filters.ReplaceString.To\"/> attribute. \n            </para>\n            <para>\n            Filters are intended to be used as a element of a <see cref=\"T:NAnt.Core.Filters.FilterChain\"/>.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Replace all occurrences of \"3.14\" with \"PI\".\n              </para>\n              <code>\n                <![CDATA[\n            <replacestring from=\"3.14\" to=\"PI\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Replace all occurrences of \"string\", \"String\", etc. with \"System.String\".\n              </para>\n              <code>\n                <![CDATA[\n            <replacestring from=\"String\" to=\"System.String\" ignorecase=\"true\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.Chain(NAnt.Core.Filters.ChainableReader)\">\n            <summary>\n            Construct that allows this filter to be chained to the one\n            in the parameter chainedReader.\n            </summary>\n            <param name=\"chainedReader\">Filter that the filter will be chained to</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.Read\">\n            <summary>\n            Reads the next character applying the filter logic.\n            </summary>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.Peek\">\n            <summary>\n            Reads the next character applying the filter logic without\n            advancing the current position in the stream.\n                        Peek currently is not supported.\n            </summary>\n            <returns>\n            Char as an int or -1 if at the end of the stream.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.FindString(System.Int32,System.Boolean@,System.String@)\">\n            <summary>\n            <para>\n            Helper function used to search for the filter's traget string. If the string\n            is found the result is true. If the string was not found false is returned and\n            nonMatchingChars contains the characters that were read to determine if the \n            string is present.\n            </para>\n            \n            <para>\n            It is assumed the stream is positioned at the character after the first character \n            in the target string.\n            </para>\n            </summary>\n            <param name=\"startChar\">First character in target string</param>\n            <param name=\"streamEnded\">Ture if the stream ended while search for the string.</param>\n            <param name=\"nonMatchingChars\">Characters that were read while searching for the string.</param>\n            <returns></returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.GetNextCharacter(NAnt.Core.Filters.ReplaceString.AcquireCharDelegate)\">\n            <summary>\n            Returns the next character in the stream replacing the specified character. Using the\n            <see cref=\"T:NAnt.Core.Filters.ReplaceString.AcquireCharDelegate\"/> allows for the same implementation for Read and Peek\n            </summary>\n            <param name=\"AcquireChar\">Delegate to acquire the next character. (Read/Peek)</param>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceString.CompareCharacters(System.Int32,System.Int32)\">\n            <summary>\n            Compares to characters taking into account the _ignoreCase flag.\n            </summary>\n            <param name=\"char1\"></param>\n            <param name=\"char2\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceString.From\">\n            <summary>\n            The string to be replaced.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceString.To\">\n            <summary>\n            The new value for the replaced string.\n            Am empty string is permissible.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceString.IgnoreCase\">\n            <summary>\n            Determines if case will be ignored.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ReplaceString.AcquireCharDelegate\">\n            <summary>\n            Delegate for Read and Peek. Allows the same implementation\n            to be used for both methods.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ReplaceTokens\">\n            <summary>\n            Replaces tokens in the original input with user-supplied values.\n            </summary>\n            <remarks>\n            <para>\n            This filter replaces all token surrounded by a beginning and ending\n            token. The default beginning and ending tokens both default to '@'. The \n            optional <see cref=\"P:NAnt.Core.Filters.ReplaceTokens.BeginToken\"/> and <see cref=\"P:NAnt.Core.Filters.ReplaceTokens.EndToken\"/> attributes\n            can be specified to change either token. By default string \n            comparisons are case sensitive but this can be changed by setting the \n            optional <see cref=\"P:NAnt.Core.Filters.ReplaceTokens.IgnoreCase\"/> attribute to <see langword=\"true\"/>.\n            </para>\n            <para>\n            Tokens are specified by using the <see cref=\"T:NAnt.Core.Types.Token\"/> element. It is \n            possible to specify from 1 to n tokens and replacement values. Values can \n            be any valid NAnt expression.\n            </para>\n            <para>\n            Filters are intended to be used as a element of a <see cref=\"T:NAnt.Core.Filters.FilterChain\"/>.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Replace all occurrences of the string @DATE@ with the value of property\n              \"TODAY\".\n              </para>\n              <code>\n                <![CDATA[\n            <replacetokens>\n                <token key=\"DATE\" value=\"${TODAY}\" />\n            </replacetokens>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Replace all occurrences of the string &lt;DATE&gt; with the value of \n              property \"TODAY\".\n              </para>\n              <code>\n                <![CDATA[\n            <replacetokens begintoken=\"&lt;\" endtoken=\"&gt;\">\n                <token key=\"DATE\" value=\"${TODAY}\" />\n            </replacetokens>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.Chain(NAnt.Core.Filters.ChainableReader)\">\n            <summary>\n            Construct that allows this filter to be chained to the one\n            in the parameter chainedReader.\n            </summary>\n            <param name=\"chainedReader\">Filter that the filter will be chained to</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.Read\">\n            <summary>\n            Reads the next character applying the filter logic.\n            </summary>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.Peek\">\n            <summary>\n            Reads the next character applying the filter logic without\n            advancing the current position in the stream.\n                        Peek currently is not supported.\n            </summary>\n            <returns>\n            Char as an int or -1 if at the end of the stream.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.Initialize\">\n            <summary>\n            Initialize the filter by setting its parameters.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.FindTokenContents(System.Boolean@,System.Boolean@,System.Boolean@)\">\n            <summary>\n            Finds a token give that we are positioned at a beginning token character.  Either a\n            token replacement is returned or the characters that were read looking for the token.\n            </summary>\n            <param name=\"tokenNotFound\">A token was not found</param>\n            <param name=\"unknownToken\">A token was found by there is no replacement</param>\n            <param name=\"streamEnded\">The stream ended while looking for the token</param>\n            <returns>Either the replacement token or the characters that were read looking for the token</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.GetNextCharacter(NAnt.Core.Filters.ReplaceTokens.AcquireCharDelegate)\">\n            <summary>\n            Returns the next character in the stream replacing the specified character. Using the\n            <see cref=\"T:NAnt.Core.Filters.ReplaceTokens.AcquireCharDelegate\"/> allows for the same implementation for Read and Peek\n            </summary>\n            <param name=\"AcquireChar\">Delegate to acquire the next character. (Read/Peek)</param>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.ReplaceTokens.CompareCharacters(System.Int32,System.Int32)\">\n            <summary>\n            Compares to characters taking <see cref=\"P:NAnt.Core.Filters.ReplaceTokens.IgnoreCase\"/> into account.\n            </summary>\n            <param name=\"char1\"></param>\n            <param name=\"char2\"></param>\n            <returns>\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceTokens.BeginToken\">\n            <summary>\n            Marks the beginning of a token. The default is \"@\".\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceTokens.EndToken\">\n            <summary>\n            Marks the end of a token. The default is \"@\".\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceTokens.Tokens\">\n            <summary>\n            Tokens and replacement values.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.ReplaceTokens.IgnoreCase\">\n            <summary>\n            Determines if case will be ignored.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.ReplaceTokens.AcquireCharDelegate\">\n            <summary>\n            Delegate for Read and Peek. Allows the same implementation\n            to be used for both methods.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.TabsToSpaces\">\n            <summary>\n            Converts tabs to spaces.\n            </summary>\n            <remarks>\n            <para>\n            The <see cref=\"T:NAnt.Core.Filters.TabsToSpaces\"/> filter replaces tabs in a text file \n            with spaces.\n            </para>\n            <para>\n            Filters are intended to be used as a element of a <see cref=\"T:NAnt.Core.Filters.FilterChain\"/>.\n            </para>\n            </remarks>\n            <example>\n             <para>Replace all tabs with four spaces.</para>\n             <code>\n               <![CDATA[\n            <tabtospaces tablength=\"4\" />\n               ]]>\n             </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.TabsToSpaces.Chain(NAnt.Core.Filters.ChainableReader)\">\n            <summary>\n            Construct that allows this filter to be chained to the one\n            in the parameter chainedReader.\n            </summary>\n            <param name=\"chainedReader\">Filter that the filter will be chained to</param>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.TabsToSpaces.Peek\">\n            <summary>\n            <para>Retrieves the next character with moving the position in the stream.</para>\n            <note>This method is not implemented</note>\n            </summary>\n            <returns>-1 if end of stream otherwise a character</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.TabsToSpaces.Read\">\n            <summary>\n            <para>Retrieves the next character in the stream.</para>\n            </summary>\n            <returns>-1 if end of stream otherwise a character</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Filters.TabsToSpaces.GetNextCharacter(NAnt.Core.Filters.TabsToSpaces.AcquireCharDelegate)\">\n            <summary>\n            Returns the next character in the stream replacing the specified character. Using the\n            <see cref=\"T:NAnt.Core.Filters.TabsToSpaces.AcquireCharDelegate\"/> allows for the same implementation for Read and Peek\n            </summary>\n            <param name=\"AcquireChar\">Delegate to acquire the next character. (Read/Peek)</param>\n            <returns>Char as an int or -1 if at the end of the stream</returns>\n        </member>\n        <member name=\"P:NAnt.Core.Filters.TabsToSpaces.TabLength\">\n            <summary>\n            The number of spaces used when converting a tab. The default is \n            \"8\".\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Filters.TabsToSpaces.AcquireCharDelegate\">\n            <summary>\n            Delegate for Read and Peek. Allows the same implementation\n            to be used for both methods.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.AssemblyFunctions\">\n            <summary>\n            Functions to return information for a given assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.FunctionSetBase.Project\">\n            <summary>\n            Gets or sets the <see cref=\"P:NAnt.Core.FunctionSetBase.Project\"/> that this functionset will \n            reference.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.FunctionSetBase.Project\"/> that this functionset will reference.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyFunctions.LoadFromFile(System.String)\">\n            <summary>\n            Loads an assembly given its file name or path.\n            </summary>\n            <param name=\"assemblyFile\">The name or path of the file that contains the manifest of the assembly.</param>\n            <returns>\n            The loaded assembly.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"assemblyFile\"/> is an empty <see cref=\"T:System.String\"/>.</exception>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"assemblyFile\"/> is not found, or the module you are trying to load does not specify a filename extension.</exception>\n            <exception cref=\"T:System.BadImageFormatException\"><paramref name=\"assemblyFile\"/> is not a valid assembly.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">An assembly or module was loaded twice with two different evidences, or the assembly name is longer than MAX_PATH characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyFunctions.Load(System.String)\">\n            <summary>\n            Loads an assembly given the long form of its name.\n            </summary>\n            <param name=\"assemblyString\">The long form of the assembly name.</param>\n            <returns>\n            The loaded assembly.\n            </returns>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"assemblyString\"/> is a <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"assemblyString\"/> is not found.</exception>\n            <example>\n              <para>\n              Determine the location of the Microsoft Access 11 Primary Interop \n              Assembly by loading it using its fully qualified name, and copy it\n              to the build directory.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"access.pia.path\" value=\"${assembly::get-location(assembly::load('Microsoft.Office.Interop.Access, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'))}\" />\n            <copy file=\"${access.pia.path}\" todir=\"${build.dir}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyFunctions.GetFullName(System.Reflection.Assembly)\">\n            <summary>\n            Gets the full name of the assembly, also known as the display name.\n            </summary>\n            <param name=\"assembly\">The assembly to get the full name for.</param>\n            <returns>\n            The full name of the assembly, also known as the display name.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\">\n            <summary>\n            Gets an <see cref=\"T:System.Reflection.AssemblyName\"/> for the specified assembly.\n            </summary>\n            <param name=\"assembly\">The assembly to get an <see cref=\"T:System.Reflection.AssemblyName\"/> for.</param>\n            <returns>\n            An <see cref=\"T:System.Reflection.AssemblyName\"/> for the specified assembly.\n            </returns>\n            <seealso cref=\"T:NAnt.Core.Functions.AssemblyNameFunctions\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyFunctions.GetLocation(System.Reflection.Assembly)\">\n            <summary>\n            Gets the physical location, in codebase format, of the loaded file \n            that contains the manifest.\n            </summary>\n            <param name=\"assembly\">The assembly to get the location for.</param>\n            <returns>\n            The location of the specified assembly.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.AssemblyNameFunctions\">\n            <summary>\n            Functions that return information about an assembly's identity.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetCodeBase(System.Reflection.AssemblyName)\">\n            <summary>\n            Gets the location of the assembly as a URL.\n            </summary>\n            <param name=\"assemblyName\">The <see cref=\"T:System.Reflection.AssemblyName\"/> of the assembly.</param>\n            <returns>\n            The location of the assembly as a URL.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetEscapedCodeBase(System.Reflection.AssemblyName)\">\n            <summary>\n            Gets the URI, including escape characters, that represents the codebase.\n            </summary>\n            <param name=\"assemblyName\">The <see cref=\"T:System.Reflection.AssemblyName\"/> of the assembly.</param>\n            <returns>\n            The URI, including escape characters, that represents the codebase.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetFullName(System.Reflection.AssemblyName)\">\n            <summary>\n            Gets the full name of the assembly, also known as the display name.\n            </summary>\n            <param name=\"assemblyName\">The <see cref=\"T:System.Reflection.AssemblyName\"/> of the assembly.</param>\n            <returns>\n            The full name of the assembly, also known as the display name.\n            </returns>\n            <example>\n              <para>\n              Output the full name of the <c>nunit.framework</c> assembly to the\n              build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"${assemblyname::get-full-name(assemblyname::get-assembly-name('nunit.framework.dll'))}\" />\n                ]]>\n              </code>\n            </example>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetName(System.Reflection.AssemblyName)\">\n            <summary>\n            Gets the simple, unencrypted name of the assembly.\n            </summary>\n            <param name=\"assemblyName\">The <see cref=\"T:System.Reflection.AssemblyName\"/> of the assembly.</param>\n            <returns>\n            The simple, unencrypted name of the assembly.\n            </returns>\n            <example>\n              <para>\n              Output the simple name of the <c>nunit.framework</c> assembly to \n              the build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"${assemblyname::get-name(assemblyname::get-assembly-name('nunit.framework.dll'))}\" />\n                ]]>\n              </code>\n            </example>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\">\n            <summary>\n            Gets the version of the assembly.\n            </summary>\n            <param name=\"assemblyName\">The <see cref=\"T:System.Reflection.AssemblyName\"/> of the assembly.</param>\n            <returns>\n            The version of the assembly.\n            </returns>\n            <example>\n              <para>\n              Output the major version of the <c>nunit.framework</c> assembly \n              to the build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"${version::get-major-version(assemblyname::get-version(assemblyname::get-assembly-name('nunit.framework.dll')))}\" />\n                ]]>\n              </code>\n            </example>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyFunctions.GetName(System.Reflection.Assembly)\"/>\n            <seealso cref=\"T:NAnt.Core.Functions.VersionFunctions\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetAssemblyName(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:System.Reflection.AssemblyName\"/> for a given file.\n            </summary>\n            <param name=\"assemblyFile\">The assembly file for which to get the <see cref=\"T:System.Reflection.AssemblyName\"/>.</param>\n            <returns>\n            An <see cref=\"T:System.Reflection.AssemblyName\"/> object representing the given file.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"assemblyFile\"/> is an empty <see cref=\"T:System.String\"/>.</exception>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"assemblyFile\"/> does not exist.</exception>\n            <exception cref=\"T:System.BadImageFormatException\"><paramref name=\"assemblyFile\"/> is not a valid assembly.</exception>\n            <remarks>\n            The assembly is not added to this domain.\n            </remarks>\n            <example>\n              <para>\n              Output the full name of the <c>nunit.framework</c> assembly to the\n              build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"${assemblyname::get-full-name(assemblyname::get-assembly-name('nunit.framework.dll'))}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.BooleanConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a logical value to \n            its <see cref=\"T:System.Boolean\"/> equivalent.\n            </summary>\n            <param name=\"s\">A string containing the value to convert.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is equivalent to \n            \"True\"; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> is not equivalent to <see cref=\"F:System.Boolean.TrueString\"/> or <see cref=\"F:System.Boolean.FalseString\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.BooleanConversionFunctions.ToString(System.Boolean)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.Boolean\"/> to its equivalent string\n            representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.Boolean\"/> to convert.</param>\n            <returns>\n            \"True\" if <paramref name=\"value\"/> is <see langword=\"true\"/>, or \n            \"False\" if <paramref name=\"value\"/> is <see langword=\"false\"/>. \n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ConversionFunctions.ToInt(System.Int32)\">\n            <summary>\n            Converts the argument to an integer.\n            </summary>\n            <param name=\"value\">value to be converted</param>\n            <returns><paramref name=\"value\" /> converted to integer. The function fails with an exception when the conversion is not possible.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ConversionFunctions.ToDouble(System.Double)\">\n            <summary>\n            Converts the argument to double\n            </summary>\n            <param name=\"value\">The value to be converted.</param>\n            <returns><paramref name=\"value\" /> converted to double. The function fails with an exception when the conversion is not possible.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ConversionFunctions.ConvertToString(System.String)\">\n            <summary>\n            Converts the argument to a string.\n            </summary>\n            <param name=\"value\">The value to be converted.</param>\n            <returns>\n            <paramref name=\"value\" /> converted to string. The function fails \n            with an exception when the conversion is not possible.\n            </returns>\n            <remarks>\n            Named method ConvertToString as a static ToString method would break\n            CLS compliance.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ConversionFunctions.ToDateTime(System.DateTime)\">\n            <summary>\n            Converts the argument to a datetime.\n            </summary>\n            <param name=\"value\">value to be converted</param>\n            <returns><paramref name=\"value\" /> converted to datetime. The function fails with an exception when the conversion is not possible.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ConversionFunctions.ToBoolean(System.Boolean)\">\n            <summary>\n            Converts the argument to a boolean \n            </summary>\n            <param name=\"value\">The string value to be converted to boolean. Must be 'true' or 'false'.</param>\n            <returns>\n            <paramref name=\"value\" /> converted to boolean. The function fails \n            with an exception when the conversion is not possible.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.Now\">\n            <summary>\n            Gets a <see cref=\"T:System.DateTime\"/> that is the current local date and \n            time on this computer.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.DateTime\"/> whose value is the current date and time.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetYear(System.DateTime)\">\n            <summary>\n            Gets the year component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the year component.</param>\n            <returns>\n            The year, between 1 and 9999.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetMonth(System.DateTime)\">\n            <summary>\n            Gets the month component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the month component.</param>\n            <returns>\n            The month, between 1 and 12.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetDay(System.DateTime)\">\n            <summary>\n            Gets the day of the month represented by the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the day of the month.</param>\n            <returns>\n            The day value, between 1 and 31.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetHour(System.DateTime)\">\n            <summary>\n            Gets the hour component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the hour component.</param>\n            <returns>\n            The hour, between 0 and 23.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetMinute(System.DateTime)\">\n            <summary>\n            Gets the minute component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the minute component.</param>\n            <returns>\n            The minute, between 0 and 59.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetSecond(System.DateTime)\">\n            <summary>\n            Gets the seconds component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the seconds component.</param>\n            <returns>\n            The seconds, between 0 and 59.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetMillisecond(System.DateTime)\">\n            <summary>\n            Gets the milliseconds component of the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the milliseconds component.</param>\n            <returns>\n            The millisecond, between 0 and 999.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetTicks(System.DateTime)\">\n            <summary>\n            Gets the number of ticks that represent the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the number of ticks.</param>\n            <returns>\n            The number of ticks that represent the date and time of the \n            specified date.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetDayOfWeek(System.DateTime)\">\n            <summary>\n            Gets the day of the week represented by the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the day of the week.</param>\n            <returns>\n            The day of the week, ranging from zero, indicating Sunday, to six, \n            indicating Saturday.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetDayOfYear(System.DateTime)\">\n            <summary>\n            Gets the day of the year represented by the specified date.\n            </summary>\n            <param name=\"date\">The date of which to get the day of the year.</param>\n            <returns>\n            The day of the year, between 1 and 366.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.GetDaysInMonth(System.Int32,System.Int32)\">\n            <summary>\n            Returns the number of days in the specified month of the specified \n            year.\n            </summary>\n            <param name=\"year\">The year.</param>\n            <param name=\"month\">The month (a number ranging from 1 to 12).</param>\n            <returns>\n            The number of days in <paramref name=\"month\"/> for the specified \n            <paramref name=\"year\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"month\"/> is less than 1 or greater than 12.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeFunctions.IsLeapYear(System.Int32)\">\n            <summary>\n            Returns an indication whether the specified year is a leap year.\n            </summary>\n            <param name=\"year\">A 4-digit year.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"year\" /> is a leap year; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a date and time to \n            its <see cref=\"T:System.DateTime\"/> equivalent.\n            </summary>\n            <param name=\"s\">A string containing a date and time to convert.</param>\n            <returns>\n            A <see cref=\"T:System.DateTime\"/> equivalent to the date and time contained \n            in <paramref name=\"s\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> does not contain a valid string representation of a date and time.</exception>\n            <remarks>\n            The <see cref=\"T:System.Globalization.DateTimeFormatInfo\"/> for the invariant culture is \n            used to supply formatting information about <paramref name=\"s\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DateTimeConversionFunctions.ToString(System.DateTime)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.DateTime\"/> to its equivalent\n            string representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.DateTime\"/> to convert.</param>\n            <returns>\n            A string representation of <paramref name=\"value\"/> formatted using\n            the general format specifier (\"G\").\n            </returns>\n            <remarks>\n            <paramref name=\"value\"/> is formatted with the \n            <see cref=\"T:System.Globalization.DateTimeFormatInfo\"/> for the invariant culture.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.DirectoryFunctions\">\n            <summary>\n            Groups a set of functions for dealing with directories.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetCreationTime(System.String)\">\n            <summary>\n            Returns the creation date and time of the specified directory.\n            </summary>\n            <param name=\"path\">The directory for which to obtain creation date and time information.</param>\n            <returns>\n            The creation date and time of the specified directory.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified directory does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetLastWriteTime(System.String)\">\n            <summary>\n            Returns the date and time the specified directory was last written to.\n            </summary>\n            <param name=\"path\">The directory for which to obtain write date and time information.</param>\n            <returns>\n            The date and time the specified directory was last written to.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified directory does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetLastAccessTime(System.String)\">\n            <summary>\n            Returns the date and time the specified directory was last accessed.\n            </summary>\n            <param name=\"path\">The directory for which to obtain access date and time information.</param>\n            <returns>\n            The date and time the specified directory was last accessed.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified directory does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n            <exception cref=\"T:System.NotSupportedException\">The <paramref name=\"path\"/> parameter is in an invalid format.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetCurrentDirectory\">\n             <summary>\n             Gets the current working directory.\n             </summary>\n             <returns>\n             A <see cref=\"T:System.String\"/> containing the path of the current working \n             directory.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetParentDirectory(System.String)\">\n            <summary>\n            Retrieves the parent directory of the specified path.\n            </summary>\n            <param name=\"path\">The path for which to retrieve the parent directory.</param>\n            <returns>\n            The parent directory, or an empty <see cref=\"T:System.String\"/> if \n            <paramref name=\"path\"/> is the root directory, including the root \n            of a UNC server or share name.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The directory specified by <paramref name=\"path\"/> is read-only.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n            <exception cref=\"T:System.IO.DirectoryNotFoundException\">The specified path was not found.</exception>\n            <example>\n              <para>\n              Copy \"readme.txt\" from the current working directory to \n              its parent directory.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"current.dir\" value=\"${directory::get-current-directory()}\" />\n            <property name=\"current.dir.parent\" value=\"${directory::get-parent-directory(current.dir)}\" />\n            <copy file=\"${path::combine(current.dir, 'readme.txt')} todir=\"${current.dir.parent}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.GetDirectoryRoot(System.String)\">\n            <summary>\n            Returns the volume information, root information, or both for the \n            specified path.\n            </summary>\n            <param name=\"path\">The path for which to retrieve the parent directory.</param>\n            <returns>\n            A string containing the volume information, root information, or \n            both for the specified path.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DirectoryFunctions.Exists(System.String)\">\n            <summary>\n            Determines whether the given path refers to an existing directory \n            on disk.\n            </summary>\n            <param name=\"path\">The path to test.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"path\" /> refers to an\n            existing directory; otherwise, <see langword=\"false\" />.\n            </returns>\n            <example>\n              <para>Remove directory \"test\", if it exists.</para>\n              <code>\n                <![CDATA[\n            <delete dir=\"test\" if=\"${directory::exists('test')}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.DnsFunctions\">\n            <summary>\n            Functions for requesting information from DNS.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DnsFunctions.GetHostName\">\n            <summary>\n            Gets the host name of the local computer.\n            </summary>\n            <returns>\n            A string that contains the DNS host name of the local computer. \n            </returns>\n            <exception cref=\"T:System.Net.Sockets.SocketException\">An error is encountered when resolving the local host name.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DoubleConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a number to its \n            double-precision floating point number equivalent.\n            </summary>\n            <param name=\"s\">A string containing a number to convert.</param>\n            <returns>\n            A double-precision floating point number equivalent to the numeric \n            value or symbol specified in <paramref name=\"s\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> is not a number in a valid format.</exception>\n            <exception cref=\"T:System.OverflowException\"><paramref name=\"s\"/> represents a number less than <see cref=\"F:System.Double.MinValue\"/> or greater than <see cref=\"F:System.Double.MaxValue\"/>.</exception>\n            <remarks>\n            The <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture is \n            used to supply formatting information about <paramref name=\"s\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.DoubleConversionFunctions.ToString(System.Double)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.Double\"/> to its equivalent \n            string representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.Double\"/> to convert.</param>\n            <returns>\n            The string representation of <paramref name=\"value\"/> formatted\n            using the general format specifier (\"G\").\n            </returns>\n            <remarks>\n            <paramref name=\"value\"/> is formatted with the \n            <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.EnvironmentFunctions\">\n            <summary>\n            Provide information about the current environment and platform.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetFolderPath(System.Environment.SpecialFolder)\">\n            <summary>\n            Gets the path to the system special folder identified by the \n            specified enumeration.\n            </summary>\n            <param name=\"folder\">An enumerated constant that identifies a system special folder.</param>\n            <returns>\n            The path to the specified system special folder, if that folder \n            physically exists on your computer; otherwise, the empty string (\"\").\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"folder\"/> is not a member of <see cref=\"T:System.Environment.SpecialFolder\"/>.</exception>\n            <example>\n              <para>\n              Copy \"out.log\" from the project base directory to the\n              program files directory.\n              </para>\n              <code>\n                <![CDATA[\n            <copy file=\"out.log\" todir=\"${environment::get-folder-path('ProgramFiles')}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetMachineName\">\n            <summary>\n            Gets the NetBIOS name of this local computer.\n            </summary>\n            <returns>\n            The NetBIOS name of this local computer.\n            </returns>\n            <exception cref=\"T:System.InvalidOperationException\">The name of this computer cannot be obtained.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem\">\n            <summary>\n            Gets an <see cref=\"T:System.OperatingSystem\"/> object that represents the \n            current operating system.\n            </summary>\n            <returns>\n            An <see cref=\"T:System.OperatingSystem\"/> object that contains the current \n            platform identifier and version number.\n            </returns>\n            <example>\n              <para>\n              Output string representation of the current operating system.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"OS=${operating-system::to-string(environment::get-operating-system())}\" />\n                ]]>\n              </code>\n              <para>If the operating system is Windows 2000, the output is:</para>\n              <code>\n            Microsoft Windows NT 5.0.2195.0\n              </code>\n            </example>\n            <seealso cref=\"T:NAnt.Core.Functions.OperatingSystemFunctions\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetUserName\">\n            <summary>\n            Gets the user name of the person who started the current thread.\n            </summary>\n            <returns>\n            The name of the person logged on to the system who started the \n            current thread.\n            </returns>\n            <example>\n              <para>\n              Modify the home directory of the current user on unix-based systems.\n              </para>\n              <code>\n                <![CDATA[\n            <exec program=\"usermod\">\n                <arg value=\"-d\" />\n                <arg value=\"/home/temp\" />\n                <arg value=\"${environment::get-user-name()}\" />\n            </exec>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVariable(System.String)\">\n            <summary>\n            Returns the value of the specified environment variable.\n            </summary>\n            <param name=\"name\">The environment variable of which the value should be returned.</param>\n            <returns>\n            The value of the specified environment variable.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\">Environment variable <paramref name=\"name\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.VariableExists(System.String)\">\n            <summary>\n            Gets a value indicating whether the specified environment variable\n            exists.\n            </summary>\n            <param name=\"name\">The environment variable that should be checked.</param>\n            <returns>\n            <see langword=\"true\" /> if the environment variable exists; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n            <example>\n              <para>\n              Execute a set of tasks only if the &quot;BUILD_DEBUG&quot; environment\n              variable is set.\n              </para>\n              <code>\n                <![CDATA[\n            <if test=\"${environment::variable-exists('BUILD_DEBUG')}\">\n                ...\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\">\n            <summary>\n            Gets a <see cref=\"T:System.Version\"/> object that describes the major, \n            minor, build, and revision numbers of the Common Language Runtime.\n            </summary>\n            <returns>\n            A Version object.\n            </returns>\n            <example>\n              <para>Output the major version of the CLR.</para>\n              <code>\n                <![CDATA[\n            <echo message=\"Major version=${version::get-major(environment::get-version())}\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.FileFunctions\">\n            <summary>\n            Groups a set of functions for dealing with files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.GetCreationTime(System.String)\">\n            <summary>\n            Returns the creation date and time of the specified file.\n            </summary>\n            <param name=\"path\">The file for which to obtain creation date and time information.</param>\n            <returns>\n            The creation date and time of the specified file.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified file does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n            <exception cref=\"T:System.NotSupportedException\">The <paramref name=\"path\"/> parameter is in an invalid format.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.GetLastWriteTime(System.String)\">\n            <summary>\n            Returns the date and time the specified file was last written to.\n            </summary>\n            <param name=\"path\">The file for which to obtain write date and time information.</param>\n            <returns>\n            The date and time the specified file was last written to.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified file does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.GetLastAccessTime(System.String)\">\n            <summary>\n            Returns the date and time the specified file was last accessed.\n            </summary>\n            <param name=\"path\">The file for which to obtain access date and time information.</param>\n            <returns>\n            The date and time the specified file was last accessed.\n            </returns>\n            <exception cref=\"T:System.IO.IOException\">The specified file does not exist.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n            <exception cref=\"T:System.NotSupportedException\">The <paramref name=\"path\"/> parameter is in an invalid format.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.Exists(System.String)\">\n            <summary>\n            Determines whether the specified file exists.\n            </summary>\n            <param name=\"file\">The file to check.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"file\" /> refers to an \n            existing file; otherwise, <see langword=\"false\" />.\n            </returns>\n            <example>\n              <para>Execute a set of tasks, if file \"output.xml\" does not exist.</para>\n              <code>\n                <![CDATA[\n            <if test=\"${not file::exists('output.xml')}\">\n                ...\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.UpToDate(System.String,System.String)\">\n            <summary>\n            Determines whether <paramref name=\"targetFile\"/> is more or equal \n            up-to-date than <paramref name=\"srcFile\"/>.\n            </summary>\n            <param name=\"srcFile\">The file to check against the target file.</param>\n            <param name=\"targetFile\">The file for which we want to determine the status.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"targetFile\"/> is more \n            or equal up-to-date than <paramref name=\"srcFile\"/>; otherwise,\n            <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"srcFile\"/> or <paramref name=\"targetFile\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both of either <paramref name=\"srcFile\"/> or <paramref name=\"targetFile\"/> exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.GetLength(System.String)\">\n            <summary>\n            Gets the length of the file.\n            </summary>\n            <param name=\"file\">filename</param>\n            <returns>\n            Length in bytes, of the file named <paramref name=\"file\"/>.\n            </returns>\n            <exception cref=\"T:System.IO.FileNotFoundException\">The file specified cannot be found.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileFunctions.IsAssembly(System.String)\">\n            <summary>\n            Checks if a given file is an assembly.\n            </summary>\n            <param name=\"assemblyFile\">The name or path of the file to be checked.</param>\n            <returns>True if the file is a valid assembly, false if it's not or if the assembly seems corrupted (invalid headers or metadata).</returns>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"assemblyFile\"/> is a null <see cref=\"T:System.String\"/>.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"assemblyFile\"/> is an empty <see cref=\"T:System.String\"/>.</exception>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"assemblyFile\"/> is not found, or the file you are trying to check does not specify a filename extension.</exception>\n            <exception cref=\"T:System.Security.SecurityException\">The caller does not have path discovery permission.</exception>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.FileVersionInfoFunctions\">\n            <summary>\n            Functions that provide version information for a physical file on disk.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileVersionInfoFunctions.GetVersionInfo(System.String)\">\n            <summary>\n            Returns a <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> representing the version \n            information associated with the specified file.\n            </summary>\n            <param name=\"fileName\">The file to retrieve the version information for.</param>\n            <returns>\n            A <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> containing information about the file.\n            </returns>\n            <exception cref=\"T:System.IO.FileNotFoundException\">The file specified cannot be found.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileVersionInfoFunctions.GetCompanyName(System.Diagnostics.FileVersionInfo)\">\n            <summary>\n            Gets the name of the company that produced the file.\n            </summary>\n            <param name=\"fileVersionInfo\">A <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> instance containing version information about a file.</param>\n            <returns>\n            The name of the company that produced the file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileVersionInfoFunctions.GetFileVersion(System.Diagnostics.FileVersionInfo)\">\n            <summary>\n            Gets the file version of a file.\n            </summary>\n            <param name=\"fileVersionInfo\">A <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> instance containing version information about a file.</param>\n            <returns>\n            The file version of a file.\n            </returns>\n            <see cref=\"T:NAnt.Core.Functions.VersionFunctions\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileVersionInfoFunctions.GetProductName(System.Diagnostics.FileVersionInfo)\">\n            <summary>\n            Gets the name of the product the file is distributed with.\n            </summary>\n            <param name=\"fileVersionInfo\">A <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> instance containing version information about a file.</param>\n            <returns>\n            The name of the product the file is distributed with.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FileVersionInfoFunctions.GetProductVersion(System.Diagnostics.FileVersionInfo)\">\n            <summary>\n            Gets the product version of a file.\n            </summary>\n            <param name=\"fileVersionInfo\">A <see cref=\"T:System.Diagnostics.FileVersionInfo\"/> instance containing version information about a file.</param>\n            <returns>\n            The product version of a file.\n            </returns>\n            <see cref=\"T:NAnt.Core.Functions.VersionFunctions\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.Exists(System.String)\">\n            <summary>\n            Checks whether the specified framework exists, and is valid.\n            </summary>\n            <param name=\"framework\">The framework to test.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified framework exists ; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.SdkExists(System.String)\">\n            <summary>\n            Checks whether the SDK for the specified framework is installed.\n            </summary>\n            <param name=\"framework\">The framework to test.</param>\n            <returns>\n            <see langword=\"true\"/> if the SDK for specified framework is installed; \n            otherwise, <see langword=\"false\"/>.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\">\n            <summary>\n            Gets the identifier of the current target framework.\n            </summary>\n            <returns>\n            The identifier of the current target framework.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\">\n            <summary>\n            Gets the identifier of the runtime framework.\n            </summary>\n            <returns>\n            The identifier of the runtime framework.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetFamily(System.String)\">\n            <summary>\n            Gets the family of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the family should be returned.</param>\n            <returns>\n            The family of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetVersion\">\n            <summary>\n            Gets the version of the current target framework.\n            </summary>\n            <returns>\n            The version of the current target framework.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetVersion(System.String)\">\n            <summary>\n            Gets the version of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the version should be returned.</param>\n            <returns>\n            The version of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetDescription\">\n            <summary>\n            Gets the description of the current target framework.\n            </summary>\n            <returns>\n            The description of the current target framework.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetDescription(System.String)\">\n            <summary>\n            Gets the description of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the description should be returned.</param>\n            <returns>\n            The description of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetClrVersion\">\n            <summary>\n            Gets the Common Language Runtime version of the current target\n            framework.\n            </summary>\n            <returns>\n            The Common Language Runtime version of the current target framework.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetClrVersion(System.String)\">\n            <summary>\n            Gets the Common Language Runtime version of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the Common Language Runtime version should be returned.</param>\n            <returns>\n            The Common Language Runtime version of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetFrameworkDirectory(System.String)\">\n            <summary>\n            Gets the framework directory of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the framework directory should be returned.</param>\n            <returns>\n            The framework directory of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetAssemblyDirectory(System.String)\">\n            <summary>\n            Gets the assembly directory of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the assembly directory should be returned.</param>\n            <returns>\n            The assembly directory of the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetSdkDirectory(System.String)\">\n            <summary>\n            Gets the SDK directory of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the SDK directory should be returned.</param>\n            <returns>\n            The SDK directory of the specified framework, or an empty \n            <see cref=\"T:System.String\"/> if the SDK of the specified framework is not \n            installed.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetToolPath(System.String)\">\n            <summary>\n            Gets the absolute path of the specified tool for the current\n            target framework.\n            </summary>\n            <param name=\"tool\">The file name of the tool to search for.</param>\n            <returns>\n            The absolute path to <paramref name=\"tool\"/> if found in one of the\n            configured tool paths; otherwise, an error is reported.\n            </returns>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"tool\"/> could not be found in the configured tool paths.</exception>\n            <remarks>\n              <para>\n              The configured tool paths are scanned in the order in which they\n              are defined in the framework configuration.\n              </para>\n              <para>\n              The file name of the tool to search should include the extension.\n              </para>\n            </remarks>\n            <example>\n              <para>Use <b>gacutil</b> to install an assembly in the GAC.</para>\n              <code>\n                <![CDATA[\n            <exec program=\"${framework::get-tool-path('gacutil.exe')}\" managed=\"strict\">\n                <arg value=\"/i\" />\n                <arg file=\"Cegeka.HealthFramework.dll\" />\n            </exec>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeEngine(System.String)\">\n            <summary>\n            Gets the runtime engine of the specified framework.\n            </summary>\n            <param name=\"framework\">The framework of which the runtime engine should be returned.</param>\n            <returns>\n            The full path to the runtime engine of the specified framework, or\n            an empty <see cref=\"T:System.String\"/> if no runtime engine is defined\n            for the specified framework.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetRuntimeFramework\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.FrameworkFunctions.GetTargetFramework\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetFrameworks(NAnt.Core.FrameworkTypes)\">\n            <summary>\n            Gets a comma-separated list of frameworks filtered by the specified\n            <see cref=\"T:NAnt.Core.FrameworkTypes\"/>.\n            </summary>\n            <param name=\"types\">A bitwise combination of <see cref=\"T:NAnt.Core.FrameworkTypes\"/> values that filter the frameworks to retrieve.</param>\n            <returns>\n            A comma-separated list of frameworks filtered by the specified\n            <see cref=\"T:NAnt.Core.FrameworkTypes\"/>, sorted on name.\n            </returns>\n            <example>\n              <para>\n              Define a <b>build-all</b> target that executes the <b>build</b>\n              target once for each installed framework targeting compact\n              devices.\n              </para>\n              <code>\n                <![CDATA[\n            <target name=\"build-all\">\n                <foreach item=\"String\" in=\"${framework::get-frameworks('installed compact')}\" delim=\",\" property=\"framework\">\n                    <property name=\"nant.settings.currentframework\" value=\"${framework}\" />\n                    <call target=\"build\" />\n                </foreach>\n            </target>\n            \n            <target name=\"build\">\n                ...\n            </target>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.FrameworkFunctions.GetFramework(System.String)\">\n            <summary>\n            Checks whether the specified framework is valid.\n            </summary>\n            <param name=\"framework\">The framework to check.</param>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"framework\"/> is not a valid framework identifier.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.Int32ConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a number to its \n            32-bit signed integer equivalent.\n            </summary>\n            <param name=\"s\">A string containing a number to convert.</param>\n            <returns>\n            A 32-bit signed integer equivalent to the number contained in \n            <paramref name=\"s\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> is not of the correct format.</exception>\n            <exception cref=\"T:System.OverflowException\"><paramref name=\"s\"/> represents a number less than <see cref=\"F:System.Int32.MinValue\"/> or greater than <see cref=\"F:System.Int32.MaxValue\"/>.</exception>\n            <remarks>\n            The <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture is \n            used to supply formatting information about <paramref name=\"s\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.Int32ConversionFunctions.ToString(System.Int32)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.Int32\"/> to its equivalent string\n            representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.Int32\"/> to convert.</param>\n            <returns>\n            The string representation of <paramref name=\"value\"/>, consisting \n            of a negative sign if the value is negative, and a sequence of \n            digits ranging from 0 to 9 with no leading zeroes.\n            </returns>\n            <remarks>\n            <paramref name=\"value\"/> is formatted with the \n            <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.Int64ConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a number to its \n            64-bit signed integer equivalent.\n            </summary>\n            <param name=\"s\">A string containing a number to convert.</param>\n            <returns>\n            A 64-bit signed integer equivalent to the number contained in \n            <paramref name=\"s\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> is not of the correct format.</exception>\n            <exception cref=\"T:System.OverflowException\"><paramref name=\"s\"/> represents a number less than <see cref=\"F:System.Int64.MinValue\"/> or greater than <see cref=\"F:System.Int64.MaxValue\"/>.</exception>\n            <remarks>\n            The <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture is \n            used to supply formatting information about <paramref name=\"s\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.Int64ConversionFunctions.ToString(System.Int64)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.Int64\"/> to its equivalent string\n            representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.Int64\"/> to convert.</param>\n            <returns>\n            The string representation of <paramref name=\"value\"/>, consisting \n            of a negative sign if the value is negative, and a sequence of \n            digits ranging from 0 to 9 with no leading zeroes.\n            </returns>\n            <remarks>\n            <paramref name=\"value\"/> is formatted with the \n            <see cref=\"T:System.Globalization.NumberFormatInfo\"/> for the invariant culture.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.MathFunctions.Round(System.Double)\">\n            <summary>\n            Rounds the value to the nearest whole number\n            </summary>\n            <param name=\"value\">Number to be rounded, can be anything convertible to a double.</param>\n            <returns>\n            Rounded value.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.MathFunctions.Floor(System.Double)\">\n            <summary>\n            Returns the largest whole number less than or equal to the specified \n            number.\n            </summary>\n            <param name=\"value\">value to be , can be anything convertible to a double</param>\n            <returns>\n            The largest whole number less than or equal to the specified number.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.MathFunctions.Ceiling(System.Double)\">\n            <summary>\n            Returns the smallest whole number greater than or equal to the specified number\n            </summary>\n            <param name=\"value\">value</param>\n            <returns>\n            The smallest whole number greater than or equal to the specified number.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.MathFunctions.Abs(System.Double)\">\n            <summary>\n            Returns the absolute value of the specified number\n            </summary>\n            <param name=\"value\">value to take the absolute value from</param>\n            <returns>\n            <paramref name=\"value\" /> when <paramref name=\"value\" /> is greater \n            than or equal to zero; otherwise, -<paramref name=\"value\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.NAntFunctions.GetBaseDirectory\">\n            <summary>\n            Gets the base directory of the appdomain in which NAnt is running.\n            </summary>\n            <returns>\n            The base directory of the appdomain in which NAnt is running.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.NAntFunctions.GetAssembly\">\n            <summary>\n            Gets the NAnt assembly.\n            </summary>\n            <returns>\n            The NAnt assembly.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.NAntFunctions.ScanProbingPaths(System.String)\">\n            <summary>\n            Searches the probing paths of the current target framework for the\n            specified file.\n            </summary>\n            <param name=\"fileName\">The name of the file to search for.</param>\n            <returns>\n            The absolute path to <paramref name=\"fileName\"/> if found in one of the\n            configured probing; otherwise, an error is reported.\n            </returns>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"fileName\"/> could not be found in the configured probing paths.</exception>\n            <remarks>\n              <para>\n              The (relative) probing paths are resolved relative to the base\n              directory of the appdomain in which NAnt is running.\n              </para>\n              <para>\n              The configured probing paths are scanned recursively in the order\n              in which they are defined in the framework configuration.\n              </para>\n              <para>\n              The file name to search should include the extension.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Compile an assembly referencing the <c>nunit.framework</c> assembly\n              for the current target framework that is shipped as part of the\n              NAnt distribution.\n              </para>\n              <code>\n                <![CDATA[\n            <csc target=\"library\" output=\"NAnt.Core.Tests.dll\">\n                <sources basedir=\"NAnt.Core\">\n                    <include name=\"**/*.cs\" />\n                </sources>\n                <references>\n                    <include name=\"NAnt.Core.dll\" />\n                    <include name=\"${framework::get-lib-path('nunit.framework.dll')}\" />\n                </references>\n            </csc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.NAntFunctions.ScanProbingPaths(System.String,System.String)\">\n            <summary>\n            Searches the probing paths of the current target framework for the\n            specified file.\n            </summary>\n            <param name=\"baseDirectory\">The directory to use a base directory for the probing paths.</param>\n            <param name=\"fileName\">The name of the file to search for.</param>\n            <returns>\n            The absolute path to <paramref name=\"fileName\"/> if found in one of the\n            configured probing; otherwise, an error is reported.\n            </returns>\n            <exception cref=\"T:System.IO.FileNotFoundException\"><paramref name=\"fileName\"/> could not be found in the configured probing paths.</exception>\n            <remarks>\n              <para>\n              The (relative) probing paths are resolved relative to the specified\n              base directory.\n              </para>\n              <para>\n              The configured probing paths are scanned recursively in the order\n              in which they are defined in the framework configuration.\n              </para>\n              <para>\n              The file name to search should include the extension.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Compile an assembly referencing the <c>nunit.framework</c> assembly\n              for the current target framework that is shipped as part of the\n              NAnt distribution.\n              </para>\n              <code>\n                <![CDATA[\n            <csc target=\"library\" output=\"NAnt.Core.Tests.dll\">\n                <sources basedir=\"NAnt.Core\">\n                    <include name=\"**/*.cs\" />\n                </sources>\n                <references>\n                    <include name=\"NAnt.Core.dll\" />\n                    <include name=\"${framework::get-lib-path('nunit.framework.dll')}\" />\n                </references>\n            </csc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ProjectFunctions.GetName\">\n            <summary>\n            Gets the name of the current project.\n            </summary>\n            <returns>\n            The name of the current project, or an empty <see cref=\"T:System.String\"/>\n            if no name is specified in the build file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ProjectFunctions.GetBuildFileUri\">\n            <summary>\n            Gets the <see cref=\"T:System.Uri\"/> form of the build file.\n            </summary>\n            <returns>\n            The <see cref=\"T:System.Uri\"/> form of the build file, or \n            an empty <see cref=\"T:System.String\"/> if the project is not file backed.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ProjectFunctions.GetBuildFilePath\">\n            <summary>\n            Gets the local path to the build file.\n            </summary>\n            <returns>\n            The local path of the build file, or an empty <see cref=\"T:System.String\"/>\n            if the project is not file backed.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ProjectFunctions.GetDefaultTarget\">\n            <summary>\n            Gets the name of the target that will be executed when no other \n            build targets are specified.\n            </summary>\n            <returns>\n            The name of the target that will be executed when no other build\n            targets are specified, or an empty <see cref=\"T:System.String\"/> if no\n            default target is defined for the project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.ProjectFunctions.GetBaseDirectory\">\n            <summary>\n            Gets the base directory of the current project.\n            </summary>\n            <returns>\n            The base directory of the current project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TargetFunctions.Exists(System.String)\">\n            <summary>\n            Checks whether the specified target exists.\n            </summary>\n            <param name=\"name\">The target to test.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified target exists; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n            <example>\n              <para>\n              Execute target &quot;clean&quot;, if it exists.\n              </para>\n              <code>\n                <![CDATA[\n            <if test=\"${target::exists('clean')}\">\n                <call target=\"clean\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TargetFunctions.GetCurrentTarget\">\n            <summary>\n            Gets the name of the target being executed.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.String\"/> that contains the name of the target\n            being executed.\n            </returns>\n            <exception cref=\"T:System.InvalidOperationException\">No target is being executed.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TargetFunctions.HasExecuted(System.String)\">\n            <summary>\n            Checks whether the specified target has already been executed.\n            </summary>\n            <param name=\"name\">The target to test.</param>\n            <returns>\n            <see langword=\"true\"/> if the specified target has already been \n            executed; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\">Target <paramref name=\"name\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TaskFunctions.Exists(System.String)\">\n            <summary>\n            Checks whether the specified task exists.\n            </summary>\n            <param name=\"name\">The task to test.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified task exists; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TaskFunctions.GetAssembly(System.String)\">\n            <summary>\n            Returns the <see cref=\"T:System.Reflection.Assembly\"/> from which the specified task\n            was loaded.\n            </summary>\n            <param name=\"name\">The name of the task to get the <see cref=\"T:System.Reflection.Assembly\"/> of.</param>\n            <returns>\n            The <see cref=\"T:System.Reflection.Assembly\"/> from which the specified task was loaded.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\">Task <paramref name=\"name\"/> is not available.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PropertyFunctions.Exists(System.String)\">\n            <summary>\n            Checks whether the specified property exists.\n            </summary>\n            <param name=\"name\">The property to test.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified property exists; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n            <example>\n              <para>\n              Execute a set of tasks if the &quot;build.debug&quot; property\n              exists.\n              </para>\n              <code>\n                <![CDATA[\n            <if test=\"${property::exists('build.debug')}\">\n                <echo message=\"Starting debug build\" />\n                <call target=\"init-debug\" />\n                <call target=\"build\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PropertyFunctions.IsReadOnly(System.String)\">\n            <summary>\n            Checks whether the specified property is read-only.\n            </summary>\n            <param name=\"name\">The property to test.</param>\n            <returns>\n            <see langword=\"true\"/> if the specified property is read-only; \n            otherwise, <see langword=\"false\"/>.\n            </returns>\n            <example>\n              <para>Check whether the \"debug\" property is read-only.</para>\n              <code>property::is-readonly('debug')</code>\n            </example>\n            <exception cref=\"T:System.ArgumentException\">Property <paramref name=\"name\"/> has not been set.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PropertyFunctions.IsDynamic(System.String)\">\n            <summary>\n            Checks whether the specified property is a dynamic property.\n            </summary>\n            <param name=\"name\">The property to test.</param>\n            <returns>\n            <see langword=\"true\"/> if the specified property is a dynamic\n            property; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\">Property <paramref name=\"name\"/> has not been set.</exception>\n            <example>\n              <para>\n              Check whether the \"debug\" property is a dynamic property.\n              </para>\n              <code>property::is-dynamic('debug')</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PlatformFunctions.GetName\">\n            <summary>\n            Gets the name of the platform on which NAnt is running.\n            </summary>\n            <returns>\n            The name of the platform on which NAnt is running.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PlatformFunctions.IsWin32\">\n            <summary>\n            Checks whether NAnt is running on Windows (and not just 32-bit Windows\n            as the name may lead you to believe).\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if NAnt is running on Windows;\n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PlatformFunctions.IsWindows\">\n            <summary>\n            Checks whether NAnt is running on Windows.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if NAnt is running on Windows;\n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PlatformFunctions.IsUnix\">\n            <summary>\n            Checks whether NAnt is running on Unix.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if NAnt is running on Unix;\n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Functions.OperatingSystemFunctions\">\n            <summary>\n            Functions that return information about an operating system.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetPlatform(System.OperatingSystem)\">\n            <summary>\n            Gets a <see cref=\"T:System.PlatformID\"/> value that identifies the operating \n            system platform.\n            </summary>\n            <param name=\"operatingSystem\">The operating system.</param>\n            <returns>\n            <see cref=\"T:System.PlatformID\"/> value that identifies the operating system\n            platform.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\">\n            <summary>\n            Gets a <see cref=\"T:System.Version\"/> object that identifies this operating\n            system.\n            </summary>\n            <param name=\"operatingSystem\">The operating system.</param>\n            <returns>\n            A <see cref=\"T:System.Version\"/> object that describes the major version, \n            minor version, build, and revision of the operating system.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.OperatingSystemFunctions.ToString(System.OperatingSystem)\">\n            <summary>\n            Converts the value of the specified operating system to its equivalent\n            <see cref=\"T:System.String\"/> representation.\n            </summary>\n            <param name=\"operatingSystem\">The operating system.</param>\n            <returns>\n            The <see cref=\"T:System.String\"/> representation of \n            <paramref name=\"operatingSystem\"/>.\n            </returns>\n            <example>\n              <para>\n              Output string representation of the current operating system.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"OS=${operating-system::to-string(environment::get-operating-system())}\" />\n                ]]>\n              </code>\n              <para>If the operating system is Windows 2000, the output is:</para>\n              <code>\n            Microsoft Windows NT 5.0.2195.0\n              </code>\n            </example>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetFullPath(System.String)\">\n            <summary>\n            Returns the fully qualified path.\n            </summary>\n            <param name=\"path\">The file or directory for which to obtain absolute path information.</param>\n            <returns>\n            A string containing the fully qualified location of <paramref name=\"path\"/>,\n            such as \"C:\\MyFile.txt\".\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> is a zero-length string, contains only white space, or contains one or more invalid characters.</exception>\n            <exception cref=\"T:System.NotSupportedException\"><paramref name=\"path\"/> contains a colon (\":\").</exception>\n            <exception cref=\"T:System.IO.PathTooLongException\">The specified path, file name, or both exceed the system-defined maximum length.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.Combine(System.String,System.String)\">\n            <summary>\n            Combines two paths.\n            </summary>\n            <param name=\"path1\">first path</param>\n            <param name=\"path2\">second path</param>\n            <returns>\n            A string containing the combined paths. If one of the specified paths \n            is a zero-length string, this method returns the other path. If \n            <paramref name=\"path2\"/> contains an absolute path, this method \n            returns <paramref name=\"path2\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path1\"/> or <paramref name=\"path2\"/> contain one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.ChangeExtension(System.String,System.String)\">\n            <summary>\n            Changes the extension of the path string.\n            </summary>\n            <param name=\"path\">The path information to modify. The path cannot contain any of the characters \n            defined in <see cref=\"F:System.IO.Path.InvalidPathChars\"/>InvalidPathChars.</param>\n            <param name=\"extension\">The new extension (with a leading period). Specify a null reference \n            to remove an existing extension from <paramref name=\"path\"/>.</param>\n            <returns>\n            <para>\n            A string containing the modified path information.\n            </para>\n            <para>\n            On Windows-based desktop platforms, if <paramref name=\"path\"/> is \n            an empty <see cref=\"T:System.String\"/>, the path information is returned \n            unmodified. If <paramref name=\"path\"/> has no extension, the returned \n            path <see cref=\"T:System.String\"/> contains <paramref name=\"extension\"/> \n            appended to the end of <paramref name=\"path\"/>.\n            </para>\n            </returns>\n            <remarks>\n            For more information see the <see cref=\"T:System.IO.Path\"/> documentation.\n            </remarks>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetDirectoryName(System.String)\">\n            <summary>\n            Returns the directory information for the specified path string.\n            </summary>\n            <param name=\"path\">The path of a file or directory.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing directory information for \n            <paramref name=\"path\"/>, or an empty <see cref=\"T:System.String\"/> if \n            <paramref name=\"path\"/> denotes a root directory, or does not\n            contain directory information.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains invalid characters, is empty, or contains only white spaces.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetExtension(System.String)\">\n            <summary>\n            Returns the extension for the specified path string.\n            </summary>\n            <param name=\"path\">The path string from which to get the extension.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing the extension of the specified \n            <paramref name=\"path\"/> (including the \".\"), or an empty \n            <see cref=\"T:System.String\"/> if <paramref name=\"path\"/> does not have \n            extension information.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetFileName(System.String)\">\n            <summary>\n            Returns the filename for the specified path string.\n            </summary>\n            <param name=\"path\">The path string from which to obtain the file name and extension.</param>\n            <returns>\n            <para>\n            A <see cref=\"T:System.String\"/> consisting of the characters after the last \n            directory character in path. \n            </para>\n            <para>\n            If the last character of <paramref name=\"path\"/> is a directory or \n            volume separator character, an empty <see cref=\"T:System.String\"/> is returned.\n            </para>\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetFileNameWithoutExtension(System.String)\">\n            <summary>\n            Returns the filename without extension for the specified path string.\n            </summary>\n            <param name=\"path\">The path of the file.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing the <see cref=\"T:System.String\"/> returned \n            by <see cref=\"M:NAnt.Core.Functions.PathFunctions.GetFileName(System.String)\"/>, minus the last period (.) and all \n            characters following it.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetPathRoot(System.String)\">\n            <summary>\n            Gets the root directory of the specified path.\n            </summary>\n            <param name=\"path\">The path from which to obtain root directory information.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing the root directory of \n            <paramref name=\"path\"/>, such as \"C:\\\", or an empty <see cref=\"T:System.String\"/> \n            if <paramref name=\"path\"/> does not contain root directory information.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains invalid characters, or is empty.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetTempFileName\">\n            <summary>\n            Returns a uniquely named zero-byte temporary file on disk and returns the full path to that file.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing the name of the temporary file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.GetTempPath\">\n            <summary>\n            Gets the path to the temporary directory.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.String\"/> containing the path information of a \n            temporary directory.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.HasExtension(System.String)\">\n            <summary>\n            Determines whether a path string includes an extension.\n            </summary>\n            <param name=\"path\">The path to search for an extension.</param>\n            <returns>\n            <see langword=\"true\"/>. if the characters that follow the last \n            directory separator or volume separator in the <paramref name=\"path\"/> \n            include a period (.) followed by one or more characters; \n            otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PathFunctions.IsPathRooted(System.String)\">\n            <summary>\n            Determines whether a path string is absolute.\n            </summary>\n            <param name=\"path\">The path to test.</param>\n            <returns>\n            <see langword=\"true\"/> if path contains an absolute <paramref name=\"path\"/>; \n            otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> contains one or more invalid characters.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.GetVariable(System.String,System.String)\">\n            <summary>\n            Gets the value of a variable for the specified package.\n            </summary>\n            <param name=\"package\">The package for which the variable should be retrieved.</param>\n            <param name=\"name\">The name of the variable.</param>\n            <returns>\n            The value of variable <paramref name=\"name\"/> for the specified \n            package.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"package\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.GetLinkFlags(System.String)\">\n            <summary>\n            Gets the link flags required to compile the package, including all\n            its dependencies.\n            </summary>\n            <param name=\"package\">The package for which the link flags should be retrieved.</param>\n            <returns>\n            The link flags required to compile the package.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"package\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.GetCompileFlags(System.String)\">\n            <summary>\n            Gets the compile flags required to compile the package, including all\n            its dependencies.\n            </summary>\n            <param name=\"package\">The package for which the compile flags should be retrieved.</param>\n            <returns>\n            The pre-processor and compile flags required to compile the package.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"package\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.GetModVersion(System.String)\">\n            <summary>\n            Determines the version of the given package.\n            </summary>\n            <param name=\"package\">The package to get the version of.</param>\n            <returns>\n            The version of the given package.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"package\"/> does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.IsAtLeastVersion(System.String,System.String)\">\n            <summary>\n            Determines whether the given package is at least version \n            <paramref name=\"version\"/>.\n            </summary>\n            <param name=\"package\">The package to check.</param>\n            <param name=\"version\">The version the package should at least have.</param>\n            <returns>\n            <see langword=\"true\"/> if the given package is at least version\n            <paramref name=\"version\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.IsExactVersion(System.String,System.String)\">\n            <summary>\n            Determines whether the given package is exactly version \n            <paramref name=\"version\"/>.\n            </summary>\n            <param name=\"package\">The package to check.</param>\n            <param name=\"version\">The version the package should have.</param>\n            <returns>\n            <see langword=\"true\"/> if the given package is exactly version\n            <paramref name=\"version\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.IsMaxVersion(System.String,System.String)\">\n            <summary>\n            Determines whether the given package is at no newer than version\n            <paramref name=\"version\"/>.\n            </summary>\n            <param name=\"package\">The package to check.</param>\n            <param name=\"version\">The version the package should maximum have.</param>\n            <returns>\n            <see langword=\"true\"/> if the given package is at no newer than \n            version <paramref name=\"version\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.IsBetweenVersion(System.String,System.String,System.String)\">\n            <summary>\n            Determines whether the given package is between two versions.\n            </summary>\n            <param name=\"package\">The package to check.</param>\n            <param name=\"minVersion\">The version the package should at least have.</param>\n            <param name=\"maxVersion\">The version the package should maximum have.</param>\n            <returns>\n            <see langword=\"true\"/> if the given package is between <paramref name=\"minVersion\"/>\n            and <paramref name=\"maxVersion\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.Exists(System.String)\">\n            <summary>\n            Determines whether the given package exists.\n            </summary>\n            <param name=\"package\">The package to check.</param>\n            <returns>\n            <see langword=\"true\"/> if the package exists; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>pkg-config</c> could not be started.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.RunPkgConfigBool(NAnt.Core.Types.Argument[])\">\n            <summary>\n            Runs pkg-config with the specified arguments and returns a \n            <see cref=\"T:System.Boolean\"/> based on the exit code.\n            </summary>\n            <param name=\"args\">The arguments to pass to pkg-config.</param>\n            <returns>\n            <see langword=\"true\"/> if pkg-config exited with exit code 0;\n            otherwise, <see langword=\"false\"/>\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.RunPkgConfigString(NAnt.Core.Types.Argument[])\">\n            <summary>\n            Runs pkg-config with the specified arguments and returns the result \n            as a <see cref=\"T:System.String\"/>.\n            </summary>\n            <param name=\"args\">The arguments to pass to pkg-config.</param>\n            <returns>\n            The result of running pkg-config with the specified arguments.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.PkgConfigFunctions.GetTask(System.IO.Stream)\">\n            <summary>\n            Factory method to return a new instance of ExecTask\n            </summary>\n            <param name=\"stream\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.GetLength(System.String)\">\n            <summary>\n            Returns the length of the specified string.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string's length.\n            </returns>\n            <example>\n            <code>string::get-length('foo') ==> 3</code>\n            </example>\n            <example>\n            <code>string::get-length('') ==> 0</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.Substring(System.String,System.Int32,System.Int32)\">\n            <summary>\n            Returns a substring of the specified string.\n            </summary>\n            <param name=\"str\">input string</param>\n            <param name=\"startIndex\">position of the start of the substring</param>\n            <param name=\"length\">the length of the substring</param>\n            <returns>\n            <para>\n            If the <paramref name=\"length\"/> is greater than zero, the\n            function returns a substring starting at character position\n            <paramref name=\"startIndex\"/> with a length of <paramref name=\"length\"/>\n            characters.\n            </para>\n            <para>\n            If the <paramref name=\"length\"/> is equal to zero, the function\n            returns an empty string.\n            </para>\n            </returns>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"startIndex\"/> or <paramref name=\"length\"/> is less than zero.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"startIndex\"/> is greater than the length of <paramref name=\"str\"/>.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\"><paramref name=\"startIndex\"/> plus <paramref name=\"length\"/> indicates a position not within <paramref name=\"str\"/>.</exception>\n            <example>\n            <code>string::substring('testing string', 0, 4) ==&gt; 'test'</code>\n            </example>\n            <example>\n            <code>string::substring('testing string', 8, 3) ==&gt; 'str'</code>\n            </example>\n            <example>\n            <code>string::substring('testing string', 8, 0) ==&gt; ''</code>\n            </example>\n            <example>\n            <code>string::substring('testing string', -1, 5) ==&gt; ERROR</code>\n            </example>\n            <example>\n            <code>string::substring('testing string', 8, -1) ==&gt; ERROR</code>\n            </example>\n            <example>\n            <code>string::substring('testing string', 5, 17) ==&gt; ERROR</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.StartsWith(System.String,System.String)\">\n            <summary>\n            Tests whether the specified string starts with the specified prefix\n            string.\n            </summary>\n            <param name=\"s1\">test string</param>\n            <param name=\"s2\">prefix string</param>\n            <returns>\n            <see langword=\"true\" /> when <paramref name=\"s2\" /> is a prefix for\n            the string <paramref name=\"s1\" />. Meaning, the characters at the \n            beginning of <paramref name=\"s1\" /> are identical to\n            <paramref name=\"s2\" />; otherwise, <see langword=\"false\" />.\n            </returns>\n            <remarks>\n            This function performs a case-sensitive word search using the \n            invariant culture.\n            </remarks>\n            <example>\n            <code>string::starts-with('testing string', 'test') ==> true</code>\n            </example>\n            <example>\n            <code>string::starts-with('testing string', 'testing') ==> true</code>\n            </example>\n            <example>\n            <code>string::starts-with('testing string', 'string') ==> false</code>\n            </example>\n            <example>\n            <code>string::starts-with('test', 'testing string') ==> false</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.EndsWith(System.String,System.String)\">\n            <summary>\n            Tests whether the specified string ends with the specified suffix\n            string.\n            </summary>\n            <param name=\"s1\">test string</param>\n            <param name=\"s2\">suffix string</param>\n            <returns>\n            <see langword=\"true\" /> when <paramref name=\"s2\" /> is a suffix for\n            the string <paramref name=\"s1\" />. Meaning, the characters at the \n            end of <paramref name=\"s1\" /> are identical to \n            <paramref name=\"s2\" />; otherwise, <see langword=\"false\" />.\n            </returns>\n            <remarks>\n            This function performs a case-sensitive word search using the \n            invariant culture.\n            </remarks>\n            <example>\n            <code>string::ends-with('testing string', 'string') ==> true</code>\n            </example>\n            <example>\n            <code>string::ends-with('testing string', '') ==> true</code>\n            </example>\n            <example>\n            <code>string::ends-with('testing string', 'bring') ==> false</code>\n            </example>\n            <example>\n            <code>string::ends-with('string', 'testing string') ==> false</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.ToLower(System.String)\">\n            <summary>\n            Returns the specified string converted to lowercase.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string <paramref name=\"s\" /> in lowercase.\n            </returns>\n            <remarks>\n            The casing rules of the invariant culture are used to convert the\n            <paramref name=\"s\" /> to lowercase.\n            </remarks>\n            <example>\n            <code>string::to-lower('testing string') ==> 'testing string'</code>\n            </example>\n            <example>\n            <code>string::to-lower('Testing String') ==> 'testing string'</code>\n            </example>\n            <example>\n            <code>string::to-lower('Test 123') ==> 'test 123'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.ToUpper(System.String)\">\n            <summary>\n            Returns the specified string converted to uppercase.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string <paramref name=\"s\" /> in uppercase.\n            </returns>\n            <remarks>\n            The casing rules of the invariant culture are used to convert the\n            <paramref name=\"s\" /> to uppercase.\n            </remarks>\n            <example>\n            <code>string::to-upper('testing string') ==> 'TESTING STRING'</code>\n            </example>\n            <example>\n            <code>string::to-upper('Testing String') ==> 'TESTING STRING'</code>\n            </example>\n            <example>\n            <code>string::to-upper('Test 123') ==> 'TEST 123'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.Replace(System.String,System.String,System.String)\">\n            <summary>\n            Returns a string corresponding to the replacement of a given string\n            with another in the specified string.\n            </summary>\n            <param name=\"str\">input string</param>\n            <param name=\"oldValue\">A <see cref=\"T:System.String\"/> to be replaced.</param>\n            <param name=\"newValue\">A <see cref=\"T:System.String\"/> to replace all occurrences of <paramref name=\"oldValue\"/>.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> equivalent to <paramref name=\"str\"/> but \n            with all instances of <paramref name=\"oldValue\"/> replaced with \n            <paramref name=\"newValue\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"oldValue\"/> is an empty string.</exception>\n            <remarks>\n            This function performs a word (case-sensitive and culture-sensitive) \n            search to find <paramref name=\"oldValue\"/>.\n            </remarks>\n            <example>\n            <code>string::replace('testing string', 'test', 'winn') ==&gt; 'winning string'</code>\n            </example>\n            <example>\n            <code>string::replace('testing string', 'foo', 'winn') ==&gt; 'testing string'</code>\n            </example>\n            <example>\n            <code>string::replace('testing string', 'ing', '') ==&gt; 'test str'</code>\n            </example>\n            <example>\n            <code>string::replace('banana', 'ana', 'ana') ==&gt; 'banana'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.Contains(System.String,System.String)\">\n            <summary>\n            Tests whether the specified string contains the given search string.\n            </summary>\n            <param name=\"source\">The string to search.</param>\n            <param name=\"value\">The string to locate within <paramref name=\"source\" />.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"value\" /> is found in \n            <paramref name=\"source\" />; otherwise, <see langword=\"false\" />.\n            </returns>\n            <remarks>\n            This function performs a case-sensitive word search using the \n            invariant culture.\n            </remarks>\n            <example>\n            <code>string::contains('testing string', 'test') ==> true</code>\n            </example>\n            <example>\n            <code>string::contains('testing string', '') ==> true</code>\n            </example>\n            <example>\n            <code>string::contains('testing string', 'Test') ==> false</code>\n            </example>\n            <example>\n            <code>string::contains('testing string', 'foo') ==> false</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.IndexOf(System.String,System.String)\">\n            <summary>\n            Returns the position of the first occurrence in the specified string\n            of the given search string.\n            </summary>\n            <param name=\"source\">The string to search.</param>\n            <param name=\"value\">The string to locate within <paramref name=\"source\" />.</param>\n            <returns>\n            <para>\n            The lowest-index position of <paramref name=\"value\" /> in\n            <paramref name=\"source\" /> if it is found, or -1 if <paramref name=\"source\" /> \n            does not contain <paramref name=\"value\" />.\n            </para>\n            <para>\n            If <paramref name=\"value\" /> is an empty string, the return value\n            will always be <c>0</c>.\n            </para>\n            </returns>\n            <remarks>\n            This function performs a case-sensitive word search using the \n            invariant culture.\n            </remarks>\n            <example>\n            <code>string::index-of('testing string', 'test') ==> 0</code>\n            </example>\n            <example>\n            <code>string::index-of('testing string', '') ==> 0</code>\n            </example>\n            <example>\n            <code>string::index-of('testing string', 'Test') ==> -1</code>\n            </example>\n            <example>\n            <code>string::index-of('testing string', 'ing') ==> 4</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.LastIndexOf(System.String,System.String)\">\n            <summary>\n            Returns the position of the last occurrence in the specified string\n            of the given search string.\n            </summary>\n            <param name=\"source\">The string to search.</param>\n            <param name=\"value\">The string to locate within <paramref name=\"source\" />.</param>\n            <returns>\n            <para>\n            The highest-index position of <paramref name=\"value\" /> in\n            <paramref name=\"source\" /> if it is found, or -1 if <paramref name=\"source\" /> \n            does not contain <paramref name=\"value\" />.\n            </para>\n            <para>\n            If <paramref name=\"value\" /> is an empty string, the return value\n            is the last index position in <paramref name=\"source\" />.\n            </para>\n            </returns>\n            <remarks>\n            This function performs a case-sensitive word search using the \n            invariant culture.\n            </remarks>\n            <example>\n            <code>string::last-index-of('testing string', 'test') ==> 0</code>\n            </example>\n            <example>\n            <code>string::last-index-of('testing string', '') ==> 13</code>\n            </example>\n            <example>\n            <code>string::last-index-of('testing string', 'Test') ==> -1</code>\n            </example>\n            <example>\n            <code>string::last-index-of('testing string', 'ing') ==> 11</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.PadLeft(System.String,System.Int32,System.String)\">\n            <summary>\n            Returns the given string left-padded to the given length.\n            </summary>\n            <param name=\"s\">The <see cref=\"T:System.String\"/> that needs to be left-padded.</param>\n            <param name=\"totalWidth\">The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.</param>\n            <param name=\"paddingChar\">A Unicode padding character.</param>\n            <returns>\n            If the length of <paramref name=\"s\"/> is at least \n            <paramref name=\"totalWidth\"/>, then a new <see cref=\"T:System.String\"/> identical\n            to <paramref name=\"s\"/> is returned. Otherwise, <paramref name=\"s\"/> \n            will be padded on the left with as many <paramref name=\"paddingChar\"/>\n            characters as needed to create a length of <paramref name=\"totalWidth\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"totalWidth\"/> is less than zero.</exception>\n            <remarks>\n            Note that only the first character of <paramref name=\"paddingChar\"/>\n            will be used when padding the result.\n            </remarks>\n            <example>\n            <code>string::pad-left('test', 10, ' ') ==&gt; '      test'</code>\n            </example>\n            <example>\n            <code>string::pad-left('test', 10, 'test') ==&gt; 'tttttttest'</code>\n            </example>\n            <example>\n            <code>string::pad-left('test', 3, ' ') ==&gt; 'test'</code>\n            </example>\n            <example>\n            <code>string::pad-left('test', -4, ' ') ==&gt; ERROR</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.PadRight(System.String,System.Int32,System.String)\">\n            <summary>\n            Returns the given string right-padded to the given length.\n            </summary>\n            <param name=\"s\">The <see cref=\"T:System.String\"/> that needs to be right-padded.</param>\n            <param name=\"totalWidth\">The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.</param>\n            <param name=\"paddingChar\">A Unicode padding character.</param>\n            <returns>\n            If the length of <paramref name=\"s\"/> is at least \n            <paramref name=\"totalWidth\"/>, then a new <see cref=\"T:System.String\"/> identical\n            to <paramref name=\"s\"/> is returned. Otherwise, <paramref name=\"s\"/> \n            will be padded on the right with as many <paramref name=\"paddingChar\"/>\n            characters as needed to create a length of <paramref name=\"totalWidth\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"totalWidth\"/> is less than zero.</exception>\n            <remarks>\n            Note that only the first character of <paramref name=\"paddingChar\"/>\n            will be used when padding the result.\n            </remarks>\n            <example>\n            <code>string::pad-right('test', 10, ' ') ==&gt; 'test      '</code>\n            </example>\n            <example>\n            <code>string::pad-right('test', 10, 'abcd') ==&gt; 'testaaaaaa'</code>\n            </example>\n            <example>\n            <code>string::pad-right('test', 3, ' ') ==&gt; 'test'</code>\n            </example>\n            <example>\n            <code>string::pad-right('test', -3, ' ') ==&gt; ERROR</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.Trim(System.String)\">\n            <summary>\n            Returns the given string trimmed of whitespace.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string <paramref name=\"s\" /> with any leading or trailing\n            white space characters removed.\n            </returns>\n            <example>\n            <code>string::trim('  test  ') ==> 'test'</code>\n            </example>\n            <example>\n            <code>string::trim('\\t\\tfoo  \\r\\n') ==> 'foo'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.TrimStart(System.String)\">\n            <summary>\n            Returns the given string trimmed of leading whitespace.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string <paramref name=\"s\" /> with any leading\n            whites pace characters removed.\n            </returns>\n            <example>\n            <code>string::trim-start('  test  ') ==> 'test  '</code>\n            </example>\n            <example>\n            <code>string::trim-start('\\t\\tfoo  \\r\\n') ==> 'foo  \\r\\n'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.StringFunctions.TrimEnd(System.String)\">\n            <summary>\n            Returns the given string trimmed of trailing whitespace.\n            </summary>\n            <param name=\"s\">input string</param>\n            <returns>\n            The string <paramref name=\"s\" /> with any trailing\n            white space characters removed.\n            </returns>\n            <example>\n            <code>string::trim-end('  test  ') ==> '  test'</code>\n            </example>\n            <example>\n            <code>string::trim-end('\\t\\tfoo  \\r\\n') ==> '\\t\\tfoo'</code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTotalDays(System.TimeSpan)\">\n            <summary>\n            Returns the total number of days represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>, expressed in whole and fractional days.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The total number of days represented by the given <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTotalHours(System.TimeSpan)\">\n            <summary>\n            Returns the total number of hours represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>, expressed in whole and fractional hours.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The total number of hours represented by the given <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTotalMinutes(System.TimeSpan)\">\n            <summary>\n            Returns the total number of minutes represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>, expressed in whole and fractional minutes.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The total number of minutes represented by the given <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTotalSeconds(System.TimeSpan)\">\n            <summary>\n            Returns the total number of seconds represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>, expressed in whole and fractional seconds.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The total number of seconds represented by the given <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTotalMilliseconds(System.TimeSpan)\">\n            <summary>\n            Returns the total number of milliseconds represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>, expressed in whole and fractional milliseconds.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The total number of milliseconds represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetDays(System.TimeSpan)\">\n            <summary>\n            Returns the number of whole days represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of whole days represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n            <example>\n              <para>\n              Remove all files that have not been modified in the last 7 days from directory \"binaries\".</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"File\" in=\"binaries\" property=\"filename\">\n                <if test=\"${timespan::get-days(datetime::now() - file::get-last-write-time(filename)) >= 7}\">\n                    <delete file=\"${filename}\" />\n                </if>\n            </foreach>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetHours(System.TimeSpan)\">\n            <summary>\n            Returns the number of whole hours represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of whole hours represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetMinutes(System.TimeSpan)\">\n            <summary>\n            Returns the number of whole minutes represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of whole minutes represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetSeconds(System.TimeSpan)\">\n            <summary>\n            Returns the number of whole seconds represented by the specified \n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of whole seconds represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetMilliseconds(System.TimeSpan)\">\n            <summary>\n            Returns the number of whole milliseconds represented by the specified\n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of whole milliseconds represented by the given \n            <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.GetTicks(System.TimeSpan)\">\n            <summary>\n            Returns the number of ticks contained in the specified\n            <see cref=\"T:System.TimeSpan\"/>.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/>.</param>\n            <returns>\n            The number of ticks contained in the given <see cref=\"T:System.TimeSpan\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromDays(System.Double)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified number\n            of days, where the specification is accurate to the nearest millisecond.\n            </summary>\n            <param name=\"value\">A number of days, accurate to the nearest millisecond.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromHours(System.Double)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified number\n            of hours, where the specification is accurate to the nearest \n            millisecond.\n            </summary>\n            <param name=\"value\">A number of hours, accurate to the nearest millisecond.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromMinutes(System.Double)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified number\n            of minutes, where the specification is accurate to the nearest \n            millisecond.\n            </summary>\n            <param name=\"value\">A number of minutes, accurate to the nearest millisecond.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromSeconds(System.Double)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified number\n            of seconds, where the specification is accurate to the nearest \n            millisecond.\n            </summary>\n            <param name=\"value\">A number of seconds, accurate to the nearest millisecond.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromMilliseconds(System.Double)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified number\n            of milliseconds.\n            </summary>\n            <param name=\"value\">A number of milliseconds.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanFunctions.FromTicks(System.Int64)\">\n            <summary>\n            Returns a <see cref=\"T:System.TimeSpan\"/> that represents a specified time, \n            where the specification is in units of ticks.\n            </summary>\n            <param name=\"value\">A number of ticks that represent a time.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that represents <paramref name=\"value\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanConversionFunctions.Parse(System.String)\">\n            <summary>\n            Constructs a <see cref=\"T:System.TimeSpan\"/> from a time indicated by a \n            specified string.\n            </summary>\n            <param name=\"s\">A string.</param>\n            <returns>\n            A <see cref=\"T:System.TimeSpan\"/> that corresponds to <paramref name=\"s\"/>.\n            </returns>\n            <exception cref=\"T:System.FormatException\"><paramref name=\"s\"/> has an invalid format.</exception>\n            <exception cref=\"T:System.OverflowException\">At least one of the hours, minutes, or seconds components is outside its valid range.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.TimeSpanConversionFunctions.ToString(System.TimeSpan)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.TimeSpan\"/> to its equivalent \n            string representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.TimeSpan\"/> to convert.</param>\n            <returns>\n            The string representation of <paramref name=\"value\"/>. The format \n            of the return value is of the form: [-][d.]hh:mm:ss[.ff].\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionFunctions.GetMajor(System.Version)\">\n            <summary>\n            Gets the value of the major component of a given version.\n            </summary>\n            <param name=\"version\">A version.</param>\n            <returns>\n            The major version number.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionFunctions.GetMinor(System.Version)\">\n            <summary>\n            Gets the value of the minor component of a given version.\n            </summary>\n            <param name=\"version\">A version.</param>\n            <returns>\n            The minor version number.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionFunctions.GetBuild(System.Version)\">\n            <summary>\n            Gets the value of the build component of a given version.\n            </summary>\n            <param name=\"version\">A version.</param>\n            <returns>\n            The build number, or -1 if the build number is undefined.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionFunctions.GetRevision(System.Version)\">\n            <summary>\n            Gets the value of the revision component of a given version.\n            </summary>\n            <param name=\"version\">A version.</param>\n            <returns>\n            The revision number, or -1 if the revision number is undefined.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionConversionFunctions.Parse(System.String)\">\n            <summary>\n            Converts the specified string representation of a version to \n            its <see cref=\"T:System.Version\"/> equivalent.\n            </summary>\n            <param name=\"version\">A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.').</param>\n            <returns>\n            A <see cref=\"T:System.Version\"/> instance representing the specified \n            <see cref=\"T:System.String\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"version\"/> has fewer than two components or more than four components.</exception>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">A major, minor, build, or revision component is less than zero.</exception>\n            <exception cref=\"T:System.FormatException\">At least one component of <paramref name=\"version\"/> does not parse to a decimal integer.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Functions.VersionConversionFunctions.ToString(System.Version)\">\n            <summary>\n            Converts the specified <see cref=\"T:System.Version\"/> to its equivalent\n            string representation.\n            </summary>\n            <param name=\"value\">A <see cref=\"T:System.Version\"/> to convert.</param>\n            <returns>\n            The string representation of the values of the major, minor, build, \n            and revision components of the specified <see cref=\"T:System.Version\"/>.\n            </returns>\n            <seealso cref=\"M:NAnt.Core.Functions.AssemblyNameFunctions.GetVersion(System.Reflection.AssemblyName)\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/>\n            <seealso cref=\"M:NAnt.Core.Functions.OperatingSystemFunctions.GetVersion(System.OperatingSystem)\"/>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.AttribTask\">\n            <summary>\n            Changes the file attributes of a file or set of files and directories.\n            </summary>\n            <remarks>\n            <para>\n            <see cref=\"T:NAnt.Core.Tasks.AttribTask\"/> does not have the concept of turning \n            attributes off.  Instead you specify all the attributes that you want \n            turned on and the rest are turned off by default.\n            </para>\n            <para>\n            Refer to the <see cref=\"T:System.IO.FileAttributes\"/> enumeration in the .NET SDK \n            for more information about file attributes.\n            </para>\n            </remarks>\n            <example>\n              <para>\n                Set the <c>read-only</c> file attribute for the specified file in \n                the project directory.\n              </para>\n              <code>\n                <![CDATA[\n            <attrib file=\"myfile.txt\" readonly=\"true\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n                Set the <c>normal</c> file attribute for the specified file.\n              </para>\n              <code>\n                <![CDATA[\n            <attrib file=\"myfile.txt\" normal=\"true\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n                Set the <c>normal</c> file attribute for all executable files in \n                the current project directory and sub-directories.\n                </para>\n              <code>\n                <![CDATA[\n            <attrib normal=\"true\">\n                <fileset>\n                    <include name=\"**/*.exe\" />\n                    <include name=\"bin\" />\n                </fileset>\n            </attrib>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Task\">\n            <summary>\n            Provides the abstract base class for tasks.\n            </summary>\n            <remarks>\n            A task is a piece of code that can be executed.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Task.Execute\">\n            <summary>\n            Executes the task unless it is skipped.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Task.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to be logged.</param>\n            <remarks>\n            <para>\n            The actual logging is delegated to the project.\n            </para>\n            <para>\n            If the <see cref=\"P:NAnt.Core.Task.Verbose\"/> attribute is set on the task and a\n            message is logged with level <see cref=\"F:NAnt.Core.Level.Verbose\"/>, the\n            priority of the message will be increased to <see cref=\"F:NAnt.Core.Level.Info\"/>\n            when the threshold of the build log is <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </para>\n            <para>\n            This will allow individual tasks to run in verbose mode while\n            the build log itself is still configured with threshold \n            <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </para>\n            <para>\n            The threshold of the project is not taken into account to determine\n            whether a message should be passed to the logging infrastructure, \n            as build listeners might be interested in receiving all messages.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Task.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a formatted message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            <para>\n            The actual logging is delegated to the project.\n            </para>\n            <para>\n            If the <see cref=\"P:NAnt.Core.Task.Verbose\"/> attribute is set on the task and a \n            message is logged with level <see cref=\"F:NAnt.Core.Level.Verbose\"/>, the \n            priority of the message will be increased to <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            when the threshold of the build log is <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </para>\n            <para>\n            This will allow individual tasks to run in verbose mode while\n            the build log itself is still configured with threshold \n            <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Task.IsLogEnabledFor(NAnt.Core.Level)\">\n            <summary>\n            Determines whether build output is enabled for the given \n            <see cref=\"T:NAnt.Core.Level\"/>.\n            </summary>\n            <param name=\"messageLevel\">The <see cref=\"T:NAnt.Core.Level\"/> to check.</param>\n            <returns>\n            <see langword=\"true\"/> if messages with the given <see cref=\"T:NAnt.Core.Level\"/>\n            should be passed on to the logging infrastructure; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            The threshold of the project is not taken into account to determine\n            whether a message should be passed to the logging infrastructure, \n            as build listeners might be interested in receiving all messages.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Task.InitializeTaskConfiguration\">\n            <summary>\n            Initializes the configuration of the task using configuration \n            settings retrieved from the NAnt configuration file.\n            </summary>\n            <remarks>\n            TO-DO : Remove this temporary hack when a permanent solution is \n            available for loading the default values from the configuration\n            file if a build element is constructed from code.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Task.Initialize\">\n            <summary>Initializes the task.</summary>\n        </member>\n        <member name=\"M:NAnt.Core.Task.InitializeTask(System.Xml.XmlNode)\">\n            <summary>Initializes the task.</summary>\n        </member>\n        <member name=\"M:NAnt.Core.Task.ExecuteTask\">\n            <summary>Executes the task.</summary>\n        </member>\n        <member name=\"M:NAnt.Core.Task.GetAttributeConfigurationNode(NAnt.Core.FrameworkInfo,System.String)\">\n            <summary>\n            Locates the XML node for the specified attribute in either the\n            configuration section of the extension assembly or the.project.\n            </summary>\n            <param name=\"attributeName\">The name of attribute for which the XML configuration node should be located.</param>\n            <param name=\"framework\">The framework to use to obtain framework specific information, or <see langword=\"null\" /> if no framework specific information should be used.</param>\n            <returns>\n            The XML configuration node for the specified attribute, or \n            <see langword=\"null\" /> if no corresponding XML node could be \n            located.\n            </returns>\n            <remarks>\n            If there's a valid current framework, the configuration section for\n            that framework will first be searched.  If no corresponding \n            configuration node can be located in that section, the framework-neutral\n            section of the project configuration node will be searched.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Task.FailOnError\">\n            <summary>\n            Determines if task failure stops the build, or is just reported. \n            The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.Verbose\">\n            <summary>\n            Determines whether the task should report detailed build log messages. \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the task will be executed; otherwise, \n            skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Task.IfDefined\"/>. If <see langword=\"false\"/> \n            then the task will be executed; otherwise, skipped. The default is \n            <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.Name\">\n            <summary>\n            The name of the task.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.LogPrefix\">\n            <summary>\n            The prefix used when sending messages to the log.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Task.Threshold\">\n            <summary>\n            Gets or sets the log threshold for this <see cref=\"T:NAnt.Core.Task\"/>. By\n            default the threshold of a task is <see cref=\"F:NAnt.Core.Level.Debug\"/>,\n            causing no messages to be filtered in the task itself.\n            </summary>\n            <value>\n            The log threshold level for this <see cref=\"T:NAnt.Core.Task\"/>.\n            </value>\n            <remarks>\n            When the threshold of a <see cref=\"T:NAnt.Core.Task\"/> is higher than the\n            threshold of the <see cref=\"T:NAnt.Core.Project\"/>, then all messages will\n            still be delivered to the build listeners.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Task.TaskBuilder\">\n            <summary>\n            Returns the TaskBuilder used to construct an instance of this\n            <see cref=\"T:NAnt.Core.Task\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.File\">\n            <summary>\n            The name of the file which will have its attributes set. This is \n            provided as an alternate to using the task's fileset.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.AttribFileSet\">\n            <summary>\n            All the matching files and directories in this fileset will have \n            their attributes set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.ArchiveAttrib\">\n            <summary>\n            Set the archive attribute. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.HiddenAttrib\">\n            <summary>\n            Set the hidden attribute. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.NormalAttrib\">\n            <summary>\n            Set the normal file attributes. This attribute is only valid if used \n            alone. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.ReadOnlyAttrib\">\n            <summary>\n            Set the read-only attribute. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AttribTask.SystemAttrib\">\n            <summary>\n            Set the system attribute. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.AvailableTask\">\n            <summary>\n            Checks if a resource is available at runtime.\n            </summary>\n            <remarks>\n              <para>\n              The specified property is set to <see langword=\"true\"/> if the \n              requested resource is available at runtime, and <see langword=\"false\"/> \n              if the resource is not available.\n              </para>\n              <note>\n              we advise you to use the following functions instead:\n              </note>\n              <list type=\"table\">\n                <listheader>\n                    <term>Function</term>\n                    <description>Description</description>\n                </listheader>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.FileFunctions.Exists(System.String)\"/></term>\n                    <description>Determines whether the specified file exists.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.DirectoryFunctions.Exists(System.String)\"/></term>\n                    <description>Determines whether the given path refers to an existing directory on disk.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.FrameworkFunctions.Exists(System.String)\"/></term>\n                    <description>Checks whether the specified framework exists..</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.FrameworkFunctions.SdkExists(System.String)\"/></term>\n                    <description>Checks whether the SDK for the specified framework is installed.</description>\n                </item>\n              </list>  \n            </remarks>\n            <example>\n              <para>\n              Sets the <c>myfile.present</c> property to <see langword=\"true\"/> if the \n              file is available on the filesystem and <see langword=\"false\"/> if the \n              file is not available.\n              </para>\n              <code>\n                <![CDATA[\n            <available type=\"File\" resource=\"myfile.txt\" property=\"myfile.present\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Sets the <c>build.dir.present</c> property to <see langword=\"true\"/> \n              if the directory is available on the filesystem and <see langword=\"false\"/> \n              if the directory is not available.\n              </para>\n              <code>\n                <![CDATA[\n            <available type=\"Directory\" resource=\"build\" property=\"build.dir.present\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Sets the <c>mono-0.21.framework.present</c> property to <see langword=\"true\"/> \n              if the Mono 0.21 framework is available on the current system and \n              <see langword=\"false\"/> if the framework is not available.\n              </para>\n              <code>\n                <![CDATA[\n            <available type=\"Framework\" resource=\"mono-0.21\" property=\"mono-0.21.framework.present\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Sets the <c>net-1.1.frameworksdk.present</c> property to <see langword=\"true\"/> \n              if the .NET 1.1 Framework SDK is available on the current system and \n              <see langword=\"false\"/> if the SDK is not available.\n              </para>\n              <code>\n                <![CDATA[\n            <available type=\"FrameworkSDK\" resource=\"net-1.1\" property=\"net-1.1.frameworksdk.present\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.ExecuteTask\">\n            <summary>\n            Executes the task.\n            </summary>\n            <remarks>\n            <para>\n            Sets the property identified by <see cref=\"P:NAnt.Core.Tasks.AvailableTask.PropertyName\"/> to \n            <see langword=\"true\"/> when the resource exists and to <see langword=\"false\"/> \n            when the resource doesn't exist.\n            </para>\n            </remarks>\n            <exception cref=\"T:NAnt.Core.BuildException\">The availability of the resource could not be evaluated.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.Evaluate\">\n            <summary>\n            Evaluates the availability of a resource.\n            </summary>\n            <returns>\n            <see langword=\"true\"/> if the resource is available; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">The availability of the resource could not be evaluated.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.CheckFile\">\n            <summary>\n            Checks if the file specified in the <see cref=\"P:NAnt.Core.Tasks.AvailableTask.Resource\"/> property is \n            available on the filesystem.\n            </summary>\n            <returns>\n            <see langword=\"true\"/> when the file exists; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.CheckDirectory\">\n            <summary>\n            Checks if the directory specified in the <see cref=\"P:NAnt.Core.Tasks.AvailableTask.Resource\"/> \n            property is available on the filesystem.\n            </summary>\n            <returns>\n            <see langword=\"true\"/> when the directory exists; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.CheckFramework\">\n            <summary>\n            Checks if the framework specified in the <see cref=\"P:NAnt.Core.Tasks.AvailableTask.Resource\"/> \n            property is available on the current system.\n            </summary>\n            <returns>\n            <see langword=\"true\"/> when the framework is available; otherwise,\n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.AvailableTask.CheckFrameworkSDK\">\n            <summary>\n            Checks if the SDK for the framework specified in the <see cref=\"P:NAnt.Core.Tasks.AvailableTask.Resource\"/> \n            property is available on the current system.\n            </summary>\n            <returns>\n            <see langword=\"true\"/> when the SDK for the specified framework is \n            available; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AvailableTask.Resource\">\n            <summary>\n            The resource which must be available.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AvailableTask.Type\">\n            <summary>\n            The type of resource which must be present.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.AvailableTask.PropertyName\">\n            <summary>\n            The property that must be set if the resource is available.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.AvailableTask.ResourceType\">\n            <summary>\n            Defines the possible resource checks.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.AvailableTask.ResourceType.File\">\n            <summary>\n            Determines whether a given file exists.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.AvailableTask.ResourceType.Directory\">\n            <summary>\n            Determines whether a given directory exists.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.AvailableTask.ResourceType.Framework\">\n            <summary>\n            Determines whether a given framework is available.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.AvailableTask.ResourceType.FrameworkSDK\">\n            <summary>\n            Determines whether a given SDK is available.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.CallTask\">\n            <summary>\n            Calls a NAnt target in the current project.\n            </summary>\n            <remarks>\n              <para>\n              When the <see cref=\"T:NAnt.Core.Tasks.CallTask\"/> is used to execute a target, both that \n              target and all its dependent targets will be re-executed.\n              </para>\n              <para>\n              To avoid dependent targets from being executed more than once, two \n              options are available:\n              </para>\n              <list type=\"bullet\">\n                <item>\n                    <description>\n                    Add an \"unless\" attribute with value \"${<see href=\"../functions/target.has-executed.html\">target::has-executed</see>('<c>&lt;target name&gt;</c>')}\"\n                    to the dependent targets.\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    Set the <see cref=\"P:NAnt.Core.Tasks.CallTask.CascadeDependencies\"/> attribute on the \n                    <see cref=\"T:NAnt.Core.Tasks.CallTask\"/> to <see langword=\"false \"/> (<c>recommended</c>).\n                    </description>\n                </item>\n              </list>\n            </remarks>\n            <example>\n              <para>\n              Call the target \"build\".\n              </para>\n              <code>\n                <![CDATA[\n            <call target=\"build\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              This shows how a project could 'compile' a debug and release build \n              using a common compile target.\n              </para>\n              <code>\n                <![CDATA[\n            <project default=\"build\">\n                <property name=\"debug\" value=\"false\" />\n                <target name=\"init\">\n                    <echo message=\"initializing\" />\n                </target>\n                <target name=\"compile\" depends=\"init\">\n                    <echo message=\"compiling with debug = ${debug}\" />\n                </target>\n                <target name=\"build\">\n                    <property name=\"debug\" value=\"false\" />\n                    <call target=\"compile\" />\n                    <property name=\"debug\" value=\"true\" />\n                    <call target=\"compile\" />\n                </target>\n            </project>\n                ]]>\n              </code>\n              <para>\n              The <see cref=\"P:NAnt.Core.Tasks.CallTask.CascadeDependencies\"/> parameter of the \n              <see cref=\"T:NAnt.Core.Tasks.CallTask\"/> defaults to <see langword=\"true\"/>, \n              causing the \"init\" target to be executed for both\n              the \"debug\" and \"release\" build.\n              </para>\n              <para>\n              This results in the following build log:\n              </para>\n              <code>\n            build:\n              \n            init:\n                            [echo] initializing\n                \n            compile:\n            \n                [echo] compiling with debug = false\n                \n            init:\n            \n                [echo] initializing\n                \n            compile:\n            \n                [echo] compiling with debug = true\n                \n            BUILD SUCCEEDED\n              </code>\n              <para>\n              If the \"init\" should only be executed once, set the\n              <see cref=\"P:NAnt.Core.Tasks.CallTask.CascadeDependencies\"/> attribute of the <see cref=\"T:NAnt.Core.Tasks.CallTask\"/>\n              to <see langword=\"false\"/>.\n              </para>\n              <para>\n              The build log would then look like this:\n              </para>\n              <code>\n            build:\n              \n            init:\n                            [echo] initializing\n                \n            compile:\n            \n                [echo] compiling with debug = false\n                \n            compile:\n            \n                [echo] compiling with debug = true\n                \n            BUILD SUCCEEDED\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CallTask.ExecuteTask\">\n            <summary>\n            Executes the specified target.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CallTask.Initialize\">\n            <summary>\n            Makes sure the <see cref=\"T:NAnt.Core.Tasks.CallTask\"/> is not calling its own \n            parent.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CallTask.TargetName\">\n            <summary>\n            NAnt target to call.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CallTask.ForceExecute\">\n            <summary>\n            Force an execute even if the target has already been executed. The \n            default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CallTask.CascadeDependencies\">\n            <summary>\n            Execute the specified targets dependencies -- even if they have been \n            previously executed. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.CopyTask\">\n            <summary>\n            Copies a file or set of files to a new file or directory.\n            </summary>\n            <remarks>\n              <para>\n              Files are only copied if the source file is newer than the destination \n              file, or if the destination file does not exist.  However, you can \n              explicitly overwrite files with the <see cref=\"P:NAnt.Core.Tasks.CopyTask.Overwrite\"/> attribute.\n              </para>\n              <para>\n              When a <see cref=\"T:NAnt.Core.Types.FileSet\"/> is used to select files to copy, the \n              <see cref=\"P:NAnt.Core.Tasks.CopyTask.ToDirectory\"/> attribute must be set. Files that are \n              located under the base directory of the <see cref=\"T:NAnt.Core.Types.FileSet\"/> will\n              be copied to a directory under the destination directory matching the\n              path relative to the base directory of the <see cref=\"T:NAnt.Core.Types.FileSet\"/>,\n              unless the <see cref=\"P:NAnt.Core.Tasks.CopyTask.Flatten\"/> attribute is set to\n              <see langword=\"true\"/>.\n              </para>\n              <para>\n              Files that are not located under the the base directory of the\n              <see cref=\"T:NAnt.Core.Types.FileSet\"/> will be copied directly under to the destination \n              directory, regardless of the value of the <see cref=\"P:NAnt.Core.Tasks.CopyTask.Flatten\"/>\n              attribute.\n              </para>\n              <h4>Encoding</h4>\n              <para>\n              Unless an encoding is specified, the encoding associated with the \n              system's current ANSI code page is used.\n              </para>\n              <para>\n              An UTF-8, little-endian Unicode, and big-endian Unicode encoded text \n              file is automatically recognized, if the file starts with the \n              appropriate byte order marks.\n              </para>\n              <note>\n              If you employ filters in your copy operation, you should limit the copy \n              to text files. Binary files will be corrupted by the copy operation.\n              </note>\n            </remarks>\n            <example>\n              <para>\n              Copy a single file while changing its encoding from \"latin1\" to \n              \"utf-8\".\n              </para>\n              <code>\n                <![CDATA[\n            <copy \n                file=\"myfile.txt\"\n                tofile=\"mycopy.txt\"\n                inputencoding=\"latin1\"\n                outputencoding=\"utf-8\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Copy a set of files to a new directory.</para>\n              <code>\n                <![CDATA[\n            <copy todir=\"${build.dir}\">\n                <fileset basedir=\"bin\">\n                    <include name=\"*.dll\" />\n                </fileset>\n            </copy>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Copy a set of files to a directory, replacing <c>@TITLE@</c> with \n              \"Foo Bar\" in all files.\n              </para>\n              <code>\n                <![CDATA[\n            <copy todir=\"../backup/dir\">\n                <fileset basedir=\"src_dir\">\n                    <include name=\"**/*\" />\n                </fileset>\n                <filterchain>\n                    <replacetokens>\n                        <token key=\"TITLE\" value=\"Foo Bar\" />\n                    </replacetokens>\n                </filterchain>\n            </copy>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CopyTask.#ctor\">\n            <summary>\n            Initialize new instance of the <see cref=\"T:NAnt.Core.Tasks.CopyTask\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CopyTask.Initialize\">\n            <summary>\n            Checks whether the task is initialized with valid attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CopyTask.ExecuteTask\">\n            <summary>\n            Executes the Copy task.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">A file that has to be copied does not exist or could not be copied.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CopyTask.DoFileOperations\">\n            <summary>\n            Actually does the file copies.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.SourceFile\">\n            <summary>\n            The file to copy.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.ToFile\">\n            <summary>\n            The file to copy to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.ToDirectory\">\n            <summary>\n            The directory to copy to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.Overwrite\">\n            <summary>\n            Overwrite existing files even if the destination files are newer. \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.Flatten\">\n            <summary>\n            Ignore directory structure of source directory, copy all files into \n            a single directory, specified by the <see cref=\"P:NAnt.Core.Tasks.CopyTask.ToDirectory\"/> \n            attribute. The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.IncludeEmptyDirs\">\n            <summary>\n            Copy any empty directories included in the <see cref=\"T:NAnt.Core.Types.FileSet\"/>. \n            The default is <see langword=\"true\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.CopyFileSet\">\n            <summary>\n            Used to select the files to copy. To use a <see cref=\"T:NAnt.Core.Types.FileSet\"/>, \n            the <see cref=\"P:NAnt.Core.Tasks.CopyTask.ToDirectory\"/> attribute must be set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.Filters\">\n            <summary>\n            Chain of filters used to alter the file's content as it is copied.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.InputEncoding\">\n            <summary>\n            The encoding to use when reading files. The default is the system's\n            current ANSI code page.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.OutputEncoding\">\n            <summary>\n            The encoding to use when writing the files. The default is\n            the encoding of the input file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.FileCopyMap\">\n            <summary>\n            The set of files to perform a file operation on.\n            </summary>\n            <remarks>\n              <para>\n              The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the absolute path of \n              the destination file and the value is a <see cref=\"T:NAnt.Core.Tasks.CopyTask.FileDateInfo\"/>\n              holding the path and last write time of the most recently updated\n              source file that is selected to be copied or moved to the \n              destination file.\n              </para>\n              <para>\n              On Windows, the <see cref=\"T:System.Collections.Hashtable\"/> is case-insensitive.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.CopyTask.FileDateInfo\">\n            <summary>\n            Holds the absolute paths and last write time of a given file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.CopyTask.FileDateInfo.#ctor(System.String,System.DateTime)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Tasks.CopyTask.FileDateInfo\"/>\n            class for the specified file and last write time.\n            </summary>\n            <param name=\"path\">The absolute path of the file.</param>\n            <param name=\"lastWriteTime\">The last write time of the file.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.FileDateInfo.Path\">\n            <summary>\n            Gets the absolute path of the current file.\n            </summary>\n            <value>\n            The absolute path of the current file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.CopyTask.FileDateInfo.LastWriteTime\">\n            <summary>\n            Gets the time when the current file was last written to.\n            </summary>\n            <value>\n            The time when the current file was last written to.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.DeleteTask\">\n            <summary>\n            Deletes a file, fileset or directory.\n            </summary>\n            <remarks>\n              <para>\n              Deletes either a single file, all files in a specified directory and \n              its sub-directories, or a set of files specified by one or more filesets.\n              </para>\n              <para>\n              If the <see cref=\"P:NAnt.Core.Tasks.DeleteTask.File\"/> or <see cref=\"P:NAnt.Core.Tasks.DeleteTask.Directory\"/> attribute is \n              set then the fileset contents will be ignored. To delete the files \n              in the fileset ommit the <see cref=\"P:NAnt.Core.Tasks.DeleteTask.File\"/> and <see cref=\"P:NAnt.Core.Tasks.DeleteTask.Directory\"/>\n              attributes in the <c>&lt;delete&gt;</c> element.\n              </para>\n              <para>\n              If the specified file or directory does not exist, no error is \n              reported.\n              </para>\n              <note>\n              Read-only files cannot be deleted.  Use the <see cref=\"T:NAnt.Core.Tasks.AttribTask\"/> \n              first to remove the read-only attribute.\n              </note>\n            </remarks>\n            <example>\n              <para>Delete a single file.</para>\n              <code>\n                <![CDATA[\n            <delete file=\"myfile.txt\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Delete a directory and the contents within. If the directory does not \n              exist, no error is reported.\n              </para>\n              <code>\n                <![CDATA[\n            <delete dir=\"${build.dir}\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Delete a set of files.\n              </para>\n              <code>\n                <![CDATA[\n            <delete>\n                <fileset>\n                    <include name=\"${basename}-??.exe\" />\n                    <include name=\"${basename}-??.pdb\" />\n                </fileset>\n            </delete>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.DeleteTask.Initialize\">\n            <summary>\n            Ensures the supplied attributes are valid.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.DeleteTask.File\">\n            <summary>\n            The file to delete.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.DeleteTask.Directory\">\n            <summary>\n            The directory to delete.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.DeleteTask.IncludeEmptyDirs\">\n            <summary>\n            Remove any empty directories included in the <see cref=\"T:NAnt.Core.Types.FileSet\"/>. \n            The default is <see langword=\"true\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.DeleteTask.DeleteFileSet\">\n            <summary>\n            All the files in the file set will be deleted.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.DeleteTask.Verbose\">\n            <summary>\n            Controls whether to show the name of each deleted file or directory.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.DescriptionTask\">\n            <summary>\n            An empty task that allows a build file to contain a description.\n            </summary>\n            <example>\n              <para>Set a description.</para>\n              <code>\n                <![CDATA[\n            <description>This is a description.</description>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.EchoTask\">\n            <summary>\n            Writes a message to the build log or a specified file.\n            </summary>\n            <remarks>\n              <para>\n              The message can be specified using the <see cref=\"P:NAnt.Core.Tasks.EchoTask.Message\"/> attribute \n              or as inline content.\n              </para>\n              <para>\n              Macros in the message will be expanded.\n              </para>\n              <para>\n              When writing to a file, the <see cref=\"P:NAnt.Core.Tasks.EchoTask.MessageLevel\"/> attribute is\n              ignored.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Writes a message with level <see cref=\"F:NAnt.Core.Level.Debug\"/> to the build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"Hello, World!\" level=\"Debug\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Writes a message with expanded macro to the build log.\n              </para>\n              <code>\n                <![CDATA[\n            <echo message=\"Base build directory = ${nant.project.basedir}\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Functionally equivalent to the previous example.\n              </para>\n              <code>\n                <![CDATA[\n            <echo>Base build directory = ${nant.project.basedir}</echo>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Writes the previous message to a file in the project directory, \n              overwriting the file if it exists.\n              </para>\n              <code>\n                <![CDATA[\n            <echo file=\"buildmessage.txt\">Base build directory = ${nant.project.basedir}</echo>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.EchoTask.ExecuteTask\">\n            <summary>\n            Outputs the message to the build log or the specified file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.EchoTask.Message\">\n            <summary>\n            The message to output.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.EchoTask.Contents\">\n            <summary>\n            Gets or sets the inline content that should be output.\n            </summary>\n            <value>\n            The inline content that should be output.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.EchoTask.File\">\n            <summary>\n            The file to write the message to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.EchoTask.Append\">\n            <summary>\n            Determines whether the <see cref=\"T:NAnt.Core.Tasks.EchoTask\"/> should append to the \n            file, or overwrite it.  By default, the file will be overwritten.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if output should be appended to the file; \n            otherwise, <see langword=\"false\"/>. The default is \n            <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.EchoTask.MessageLevel\">\n            <summary>\n            The logging level with which the message should be output. The default \n            is <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.ExecTask\">\n            <summary>\n            Executes a system command.\n            </summary>\n            <remarks>\n              <para>\n              Use of nested <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Arguments\"/> element(s)\n              is advised over the <see cref=\"P:NAnt.Core.Tasks.ExecTask.CommandLineArguments\"/> parameter, as\n              it supports automatic quoting and can resolve relative to absolute\n               paths.\n              </para>\n            </remarks>\n            <example>\n              <para>Ping \"nant.sourceforge.net\".</para>\n              <code>\n                <![CDATA[\n            <exec program=\"ping\">\n                <arg value=\"nant.sourceforge.net\" />\n            </exec>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Execute a java application using <c>IKVM.NET</c> that requires the \n              Apache FOP jars, and a set of custom jars.\n              </para>\n              <code>\n                <![CDATA[\n                    <path id=\"fop-classpath\">\n                        <pathelement file=\"${fop.dist.dir}/build/fop.jar\" />\n                        <pathelement file=\"${fop.dist.dir}/lib/xercesImpl-2.2.1.jar\" />\n                        <pathelement file=\"${fop.dist.dir}/lib/avalon-framework-cvs-20020806.jar\" />\n                        <pathelement file=\"${fop.dist.dir}/lib/batik.jar\" />\n                    </path>\n                    <exec program=\"ikvm.exe\" useruntimeengine=\"true\">\n                        <arg value=\"-cp\" />\n                        <arg>\n                            <path>\n                                <pathelement dir=\"conf\" />\n                                <path refid=\"fop-classpath\" />\n                                <pathelement file=\"lib/mylib.jar\" />\n                                <pathelement file=\"lib/otherlib.zip\" />\n                            </path>\n                        </arg>\n                        <arg value=\"org.me.MyProg\" />\n                    </exec>\n                ]]>\n              </code>\n              <para>\n              Assuming the base directory of the build file is \"c:\\ikvm-test\" and\n              the value of the \"fop.dist.dir\" property is \"c:\\fop\", then the value\n              of the <c>-cp</c> argument that is passed to<c>ikvm.exe</c> is\n              \"c:\\ikvm-test\\conf;c:\\fop\\build\\fop.jar;conf;c:\\fop\\lib\\xercesImpl-2.2.1.jar;c:\\fop\\lib\\avalon-framework-cvs-20020806.jar;c:\\fop\\lib\\batik.jar;c:\\ikvm-test\\lib\\mylib.jar;c:\\ikvm-test\\lib\\otherlib.zip\"\n              on a DOS-based system.\n              </para>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.ExternalProgramBase\">\n            <summary>\n            Provides the abstract base class for tasks that execute external applications.\n            </summary>\n            <remarks>\n              <para>\n              When a <see cref=\"T:NAnt.Core.Attributes.ProgramLocationAttribute\"/> is applied to the\n              deriving class and <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.ExeName\"/> does not return an\n              absolute path, then the program to execute will first be searched for\n              in the location specified by <see cref=\"P:NAnt.Core.Attributes.ProgramLocationAttribute.LocationType\"/>.\n              </para>\n              <para>\n              If the program does not exist in that location, then the list of tool\n              paths of the current target framework will be scanned in the order in\n              which they are defined in the NAnt configuration file.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.ExternalProgramBase.UnknownExitCode\">\n            <summary>\n            Defines the exit code that will be returned by <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.ExitCode\"/>\n            if the process could not be started, or did not exit (in time).\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.ExternalProgramBase._lockObject\">\n            <summary>\n            Will be used to ensure thread-safe operations.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask\">\n            <summary>\n            Starts the external process and captures its output.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The external process did not finish within the configured timeout.</para>\n              <para>-or-</para>\n              <para>The exit code of the external process indicates a failure.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Updates the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> of the specified \n            <see cref=\"T:System.Diagnostics.Process\"/>.\n            </summary>\n            <param name=\"process\">The <see cref=\"T:System.Diagnostics.Process\"/> of which the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> should be updated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.StartProcess\">\n            <summary>\n            Starts the process and handles errors.\n            </summary>\n            <returns>The <see cref=\"T:System.Diagnostics.Process\"/> that was started.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.StreamReaderThread_Output\">\n            <summary>\n            Reads from the stream until the external program is ended.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.StreamReaderThread_Error\">\n            <summary>\n            Reads from the stream until the external program is ended.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExternalProgramBase.DetermineFilePath\">\n            <summary>\n            Determines the path of the external program that should be executed.\n            </summary>\n            <returns>\n            A fully qualifies pathname including the program name.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">The task is not available or not configured for the current framework.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ExeName\">\n            <summary>\n            The name of the executable that should be used to launch the \n            external program.\n            </summary>\n            <value>\n            The name of the executable that should be used to launch the external\n            program, or <see langword=\"null\" /> if no name is specified.\n            </value>\n            <remarks>\n            If available, the configured value in the NAnt configuration\n            file will be used if no name is specified.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n            <remarks>\n            Override in derived classes to explicitly set the location of the \n            external tool.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.Output\">\n            <summary>\n            Gets the file to which the standard output should be redirected.\n            </summary>\n            <value>\n            The file to which the standard output should be redirected, or \n            <see langword=\"null\" /> if the standard output should not be\n            redirected.\n            </value>\n            <remarks>\n            The default implementation will never allow the standard output\n            to be redirected to a file.  Deriving classes should override this \n            property to change this behaviour.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.OutputAppend\">\n            <summary>\n            Gets a value indicating whether output will be appended to the \n            <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Output\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if output should be appended to the <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Output\"/>; \n            otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.BaseDirectory\">\n            <summary>\n            Gets the working directory for the application.\n            </summary>\n            <value>\n            The working directory for the application.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.TimeOut\">\n            <summary>\n            The maximum amount of time the application is allowed to execute, \n            expressed in milliseconds.  Defaults to no time-out.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.Arguments\">\n            <summary>\n            The command-line arguments for the external program.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\">\n            <summary>\n            Specifies whether the external program is a managed application\n            which should be executed using a runtime engine, if configured. \n            The default is <see langword=\"false\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if the external program should be executed \n            using a runtime engine; otherwise, <see langword=\"false\"/>.\n            </value>\n            <remarks>\n              <para>\n              The value of <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\"/> is only used from\n              <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Managed\"/>, and then only if its value is set to\n              <see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/>. In which case\n              <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Managed\"/> returns <see cref=\"F:NAnt.Core.Types.ManagedExecution.Auto\"/>\n              if <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\"/> is <see langword=\"true\"/>.\n              </para>\n              <para>\n              In all other cases, the value of <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\"/>\n              is ignored.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.Managed\">\n            <summary>\n            Specifies whether the external program should be treated as a managed\n            application, possibly forcing it to be executed under the currently\n            targeted version of the CLR.\n            </summary>\n            <value>\n            A <see cref=\"T:NAnt.Core.Types.ManagedExecution\"/> indicating how the program should\n            be treated.\n            </value>\n            <remarks>\n              <para>\n              If <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Managed\"/> is set to <see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/>,\n              which is the default value, and <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\"/> is\n              <see langword=\"true\"/> then <see cref=\"F:NAnt.Core.Types.ManagedExecution.Auto\"/>\n              is returned.\n              </para>\n              <para>\n              When the changing <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Managed\"/> to <see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/>,\n              then <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.UseRuntimeEngine\"/> is set to <see langword=\"false\"/>;\n              otherwise, it is changed to <see langword=\"true\"/>.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.OutputWriter\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.IO.TextWriter\"/> to which standard output\n            messages of the external program will be written.\n            </summary>\n            <value>\n            The <see cref=\"T:System.IO.TextWriter\"/> to which standard output messages of \n            the external program will be written.\n            </value>\n            <remarks>\n            By default, standard output messages wil be written to the build log\n            with level <see cref=\"F:NAnt.Core.Level.Info\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ErrorWriter\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.IO.TextWriter\"/> to which error output\n            of the external program will be written.\n            </summary>\n            <value>\n            The <see cref=\"T:System.IO.TextWriter\"/> to which error output of the external \n            program will be written.\n            </value>\n            <remarks>\n            By default, error output wil be written to the build log with level \n            <see cref=\"F:NAnt.Core.Level.Warning\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ExitCode\">\n            <summary>\n            Gets the value that the process specified when it terminated.\n            </summary>\n            <value>\n            The code that the associated process specified when it terminated, \n            or <c>-1000</c> if the process could not be started or did not \n            exit (in time).\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.ProcessId\">\n            <summary>\n            Gets the unique identifier for the spawned application.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.Spawn\">\n            <summary>\n            Gets or sets a value indicating whether the application should be\n            spawned. If you spawn an application, its output will not be logged\n            by NAnt. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExternalProgramBase.CommandLine\">\n            <summary>\n            Gets the command-line arguments, separated by spaces.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExecTask.Initialize\">\n            <summary>\n            Performs additional checks after the task has been initialized.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\"><see cref=\"P:NAnt.Core.Tasks.ExecTask.FileName\"/> does not hold a valid file name.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.ExecTask.ExecuteTask\">\n            <summary>\n            Executes the external program.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.FileName\">\n            <summary>\n            The program to execute without command arguments.\n            </summary>\n            <remarks>\n            The path will not be evaluated to a full path using the project\n            base directory.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.CommandLineArguments\">\n            <summary>\n            The command-line arguments for the program.  These will be\n            passed as is to the external program. When quoting is necessary,\n            these must be explictly set as part of the value. Consider using\n            nested <see cref=\"P:NAnt.Core.Tasks.ExternalProgramBase.Arguments\"/> elements instead.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.EnvironmentSet\">\n            <summary>\n            Environment variables to pass to the program.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.WorkingDirectory\">\n            <summary>\n            The directory in which the command will be executed.\n            </summary>\n            <value>\n            The directory in which the command will be executed. The default \n            is the project's base directory.\n            </value>\n            <remarks>\n            <para>\n            The working directory will be evaluated relative to the project's\n            base directory if it is relative.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.ResultProperty\">\n            <summary>\n            <para>\n            The name of a property in which the exit code of the program should \n            be stored. Only of interest if <see cref=\"P:NAnt.Core.Task.FailOnError\"/> is \n            <see langword=\"false\"/>.\n            </para>\n            <para>\n            If the exit code of the program is \"-1000\" then the program could \n            not be started, or did not exit (in time).\n            </para>\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.UseRuntimeEngine\">\n            <summary>\n            Specifies whether the external program should be executed using a \n            runtime engine, if configured. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the external program should be executed \n            using a runtime engine; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.Managed\">\n            <summary>\n            Specifies whether the external program is a managed application\n            which should be executed using a runtime engine, if configured. \n            The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the external program should be executed \n            using a runtime engine; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.BaseDirectory\">\n            <summary>\n            The directory the program is in.\n            </summary>\n            <remarks>\n            <value>\n            The directory the program is in. The default is the project's base \n            directory.\n            </value>\n            <para>\n            The basedir will be evaluated relative to the project's base \n            directory if it is relative.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.Output\">\n            <summary>\n            The file to which the standard output will be redirected.\n            </summary>\n            <remarks>\n            By default, the standard output is redirected to the console.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.OutputAppend\">\n            <summary>\n            Gets or sets a value indicating whether output should be appended \n            to the output file. The default is <see langword=\"false\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if output should be appended to the <see cref=\"P:NAnt.Core.Tasks.ExecTask.Output\"/>; \n            otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.Spawn\">\n            <summary>\n            Gets or sets a value indicating whether the application should be\n            spawned. If you spawn an application, its output will not be logged\n            by NAnt. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.ExecTask.ProcessIdProperty\">\n            <summary>\n            The name of a property in which the unique identifier of the spawned\n            application should be stored. Only of interest if <see cref=\"P:NAnt.Core.Tasks.ExecTask.Spawn\"/>\n            is <see langword=\"true\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.FailTask\">\n            <summary>\n            Exits the current build by throwing a <see cref=\"T:NAnt.Core.BuildException\"/>, \n            optionally printing additional information.\n            </summary>\n            <remarks>\n              <para>\n              The cause of the build failure can be specified using the <see cref=\"P:NAnt.Core.Tasks.FailTask.Message\"/> \n              attribute or as inline content.\n              </para>\n              <para>\n              Macros in the message will be expanded.\n              </para>\n            </remarks>\n            <example>\n              <para>Exits the current build without giving further information.</para>\n              <code>\n                <![CDATA[\n            <fail />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Exits the current build and writes a message to the build log.</para>\n              <code>\n                <![CDATA[\n            <fail message=\"Something wrong here.\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Functionally equivalent to the previous example.</para>\n              <code>\n                <![CDATA[\n            <fail>Something wrong here.</fail>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.FailTask.Message\">\n            <summary>\n            A message giving further information on why the build exited.\n            </summary>\n            <remarks>\n            Inline content and <see cref=\"P:NAnt.Core.Tasks.FailTask.Message\"/> are mutually exclusive.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.FailTask.Contents\">\n            <summary>\n            Gets or sets the inline content that should be output in the build\n            log, giving further information on why the build exited.\n            </summary>\n            <value>\n            The inline content that should be output in the build log.\n            </value>\n            <remarks>\n            Inline content and <see cref=\"P:NAnt.Core.Tasks.FailTask.Message\"/> are mutually exclusive.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.GetTask\">\n            <summary>\n            Gets a particular file from a URL source.\n            </summary>\n            <remarks>\n              <para>\n              Options include verbose reporting and timestamp based fetches.\n              </para>\n              <para>\n              Currently, only HTTP and UNC protocols are supported. FTP support may \n              be added when more pluggable protocols are added to the System.Net \n              assembly.\n              </para>\n              <para>\n              The <see cref=\"P:NAnt.Core.Tasks.GetTask.UseTimeStamp\"/> option enables you to control downloads \n              so that the remote file is only fetched if newer than the local copy. \n              If there is no local copy, the download always takes place. When a file \n              is downloaded, the timestamp of the downloaded file is set to the remote \n              timestamp.\n              </para>\n              <note>\n              This timestamp facility only works on downloads using the HTTP protocol.\n              </note>\n            </remarks>\n            <example>\n              <para>\n              Gets the index page of the NAnt home page, and stores it in the file \n              <c>help/index.html</c> relative to the project base directory.\n              </para>\n              <code>\n                <![CDATA[\n            <get src=\"http://nant.sourceforge.org/\" dest=\"help/index.html\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Gets the index page of a secured web site using the given credentials, \n              while connecting using the specified password-protected proxy server.\n              </para>\n              <code>\n                <![CDATA[\n            <get src=\"http://password.protected.site/index.html\" dest=\"secure/index.html\">\n                <credentials username=\"user\" password=\"guess\" domain=\"mydomain\" />\n                <proxy host=\"proxy.company.com\" port=\"8080\">\n                    <credentials username=\"proxyuser\" password=\"dunno\" />\n                </proxy>\n            </get>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.GetTask.Initialize\">\n            <summary>\n            Initializes task and ensures the supplied attributes are valid.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.GetTask.ExecuteTask\">\n            <summary>\n            This is where the work is done \n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.GetTask.TouchFile(System.IO.FileInfo,System.DateTime)\">\n            <summary>\n            Sets the timestamp of a given file to a specified time.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.Source\">\n            <summary>\n            The URL from which to retrieve a file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.DestinationFile\">\n            <summary>\n            The file where to store the retrieved file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.HttpProxy\">\n            <summary>\n            If inside a firewall, proxy server/port information\n            Format: {proxy server name}:{port number}\n            Example: proxy.mycompany.com:8080 \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.Proxy\">\n            <summary>\n            The network proxy to use to access the Internet resource.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.Credentials\">\n            <summary>\n            The network credentials used for authenticating the request with \n            the Internet resource.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.IgnoreErrors\">\n            <summary>\n            Log errors but don't treat as fatal. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.UseTimeStamp\">\n            <summary>\n            Conditionally download a file based on the timestamp of the local \n            copy. HTTP only. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.Timeout\">\n            <summary>\n            The length of time, in milliseconds, until the request times out.\n            The default is <c>100000</c> milliseconds.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.GetTask.Certificates\">\n            <summary>\n            The security certificates to associate with the request.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.IfTask\">\n            <summary>\n            Checks the conditional attributes and executes the children if\n            <see langword=\"true\"/>.\n            </summary>\n            <remarks>\n              <para>\n              If no conditions are checked, all child tasks are executed. \n              </para>\n              <para>\n              If more than one attribute is used, they are &amp;&amp;'d. The first \n              to fail stops the check.\n              </para>\n              <para>\n              The order of condition evaluation is, <see cref=\"P:NAnt.Core.Tasks.IfTask.TargetNameExists\"/>, \n              <see cref=\"P:NAnt.Core.Tasks.IfTask.PropertyNameExists\"/>, <see cref=\"P:NAnt.Core.Tasks.IfTask.PropertyNameTrue\"/>, \n              <see cref=\"P:NAnt.Core.Tasks.IfTask.UpToDateFile\"/>.\n              </para>\n              <note>\n              instead of using the deprecated attributes, we advise you to use the\n              following functions in combination with the <see cref=\"P:NAnt.Core.Tasks.IfTask.Test\"/>\n              attribute:\n              </note>\n              <list type=\"table\">\n                <listheader>\n                    <term>Function</term>\n                    <description>Description</description>\n                </listheader>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.PropertyFunctions.Exists(System.String)\"/></term>\n                    <description>Checks whether the specified property exists.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.TargetFunctions.Exists(System.String)\"/></term>\n                    <description>Checks whether the specified target exists.</description>\n                </item>\n              </list>  \n            </remarks>\n            <example>\n              <para>Tests the value of a property using expressions.</para>\n              <code>\n                <![CDATA[\n            <if test=\"${build.configuration=='release'}\">\n                <echo>Build release configuration</echo>\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Tests the the output of a function.</para>\n              <code>\n                <![CDATA[\n            <if test=\"${not file::exists(filename) or file::get-length(filename) = 0}\">\n                <echo message=\"The version file ${filename} doesn't exist or is empty!\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para><c>(Deprecated)</c> Check that a target exists.</para>\n              <code>\n                <![CDATA[\n            <target name=\"myTarget\" />\n            <if targetexists=\"myTarget\">\n                <echo message=\"myTarget exists\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para><c>(Deprecated)</c> Check existence of a property.</para>\n              <code>\n                <![CDATA[\n            <if propertyexists=\"myProp\">\n                <echo message=\"myProp Exists. Value='${myProp}'\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para><c>(Deprecated)</c> Check that a property value is true.</para>\n              <code>\n                <![CDATA[\n            <if propertytrue=\"myProp\">\n                <echo message=\"myProp is true. Value='${myProp}'\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              <c>(Deprecated)</c> Check that a property exists and is <see langword=\"true\"/> \n              (uses multiple conditions).\n              </para>\n              <code>\n                <![CDATA[\n            <if propertyexists=\"myProp\" propertytrue=\"myProp\">\n                <echo message=\"myProp is '${myProp}'\" />\n            </if>\n                ]]>\n              </code>\n              <para>which is the same as</para>\n              <code>\n                <![CDATA[\n            <if propertyexists=\"myProp\">\n                <if propertytrue=\"myProp\">\n                    <echo message=\"myProp is '${myProp}'\" />\n                </if>\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              <c>(Deprecated)</c> Check file dates. If <c>myfile.dll</c> is uptodate,\n              then do stuff.\n              </para>\n              <code>\n                <![CDATA[\n            <if uptodatefile=\"myfile.dll\" comparefile=\"myfile.cs\">\n                <echo message=\"myfile.dll is newer/same-date as myfile.cs\" />\n            </if>\n                ]]>\n              </code>\n              <para>or</para>\n              <code>\n                <![CDATA[\n            <if uptodatefile=\"myfile.dll\">\n                <comparefiles>\n                    <include name=\"*.cs\" />\n                </comparefiles>\n                <echo message=\"myfile.dll is newer/same-date as myfile.cs\" />\n            </if>\n                ]]>\n              </code>\n              <para>or</para>\n              <code>\n                <![CDATA[\n            <if>\n                <uptodatefiles>\n                    <include name=\"myfile.dll\" />\n                </uptodatefiles>\n                <comparefiles>\n                    <include name=\"*.cs\" />\n                </comparefiles>\n                <echo message=\"myfile.dll is newer/same-date as myfile.cs\" />\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.TaskContainer\">\n            <summary>\n            Executes embedded tasks in the order in which they are defined.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskContainer.Initialize\">\n            <summary>\n            Automatically exclude build elements that are defined on the task \n            from things that get executed, as they are evaluated normally during\n            XML task initialization.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskContainer.ExecuteChildTasks\">\n            <summary>\n            Creates and executes the embedded (child XML nodes) elements.\n            </summary>\n            <remarks>\n            Skips any element defined by the host <see cref=\"T:NAnt.Core.Task\"/> that has \n            a <see cref=\"T:NAnt.Core.Attributes.BuildElementAttribute\"/> defined.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.TaskContainer.CustomXmlProcessing\">\n            <summary>\n            Gets a value indicating whether the element is performing additional\n            processing using the <see cref=\"T:System.Xml.XmlNode\"/> that was use to \n            initialize the element.\n            </summary>\n            <value>\n            <see langword=\"true\"/>, as a <see cref=\"T:NAnt.Core.TaskContainer\"/> is\n            responsable for creating tasks from the nested build elements.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.UpToDateFile\">\n            <summary>\n            The file to compare if uptodate.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.CompareFile\">\n            <summary>\n            The file to check against for the uptodate file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.CompareFiles\">\n            <summary>\n            The <see cref=\"T:NAnt.Core.Types.FileSet\"/> that contains the comparison files for \n            the <see cref=\"P:NAnt.Core.Tasks.IfTask.UpToDateFile\"/>(s) check.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.UpToDateFiles\">\n            <summary>\n            The <see cref=\"T:NAnt.Core.Types.FileSet\"/> that contains the uptodate files for \n            the <see cref=\"P:NAnt.Core.Tasks.IfTask.CompareFile\"/>(s) check.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.PropertyNameTrue\">\n            <summary>\n            Used to test whether a property is true.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.PropertyNameExists\">\n            <summary>\n            Used to test whether a property exists.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.TargetNameExists\">\n            <summary>\n            Used to test whether a target exists.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IfTask.Test\">\n            <summary>\n            Used to test arbitrary boolean expression.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.IfNotTask\">\n            <summary>\n            The opposite of the <c>if</c> task.\n            </summary>\n            <example>\n              <para>Check that a property does not exist.</para>\n              <code>\n                <![CDATA[\n            <ifnot propertyexists=\"myProp\">\n                <echo message=\"myProp does not exist.\"/>\n            </if>\n                ]]>\n              </code>\n              <para>Check that a property value is not true.</para>\n              <code>\n                <![CDATA[\n            <ifnot propertytrue=\"myProp\">\n                <echo message=\"myProp is not true.\"/>\n            </if>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Check that a target does not exist.</para>\n              <code>\n                <![CDATA[\n            <ifnot targetexists=\"myTarget\">\n                <echo message=\"myTarget does not exist.\"/>\n            </if>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.IncludeTask\">\n            <summary>\n            Includes an external build file.\n            </summary>\n            <remarks>\n              <para>\n              This task is used to break your build file into smaller chunks.  You \n              can load a partial build file and have it included into the build file.\n              </para>\n              <note>\n              Any global (project level) tasks in the included build file are executed \n              when this task is executed.  Tasks in target elements are only executed \n              if that target is executed.\n              </note>\n              <note>\n              The project element attributes are ignored.\n              </note>\n              <note>\n              This task can only be in the global (project level) section of the \n              build file.\n              </note>\n              <note>\n              This task can only include files from the file system.\n              </note>\n            </remarks>\n            <example>\n              <para>\n              Include a task that fetches the project version from the \n              <c>GetProjectVersion.include</c> build file.\n              </para>\n              <code>\n                <![CDATA[\n            <include buildfile=\"GetProjectVersion.include\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.IncludeTask._includedFileNames\">\n            <summary>\n            Used to check for recursived includes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.IncludeTask.Initialize\">\n            <summary>\n            Verifies parameters.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.IncludeTask.BuildFileName\">\n            <summary>\n            Build file to include.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.LoadFileTask\">\n            <summary>\n            Load a text file into a single property.\n            </summary>\n            <remarks>\n              <para>\n              Unless an encoding is specified, the encoding associated with the \n              system's current ANSI code page is used.\n              </para>\n              <para>\n              An UTF-8, little-endian Unicode, and big-endian Unicode encoded text \n              file is automatically recognized, if the file starts with the appropriate \n              byte order marks.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Load file <c>message.txt</c> into property \"message\".\n              </para>\n              <code>\n                <![CDATA[\n            <loadfile\n                file=\"message.txt\"\n                property=\"message\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Load a file using the \"latin-1\" encoding.\n              </para>\n              <code>\n                <![CDATA[\n            <loadfile\n                file=\"loadfile.xml\"\n                property=\"encoded-file\"\n                encoding=\"iso-8859-1\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Load a file, replacing all <c>@NOW@</c> tokens with the current \n              date/time. \n              </para>\n              <code>\n                <![CDATA[\n            <loadfile file=\"token.txt\" property=\"token-file\">\n                <filterchain>\n                    <replacetokens>\n                        <token key=\"NOW\" value=\"${datetime::now()}\" />\n                    </replacetokens>\n                </filterchain>\n            </loadfile>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadFileTask.File\">\n            <summary>\n            The file to load.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadFileTask.Property\">\n            <summary>\n            The name of the property to save the content to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadFileTask.Encoding\">\n            <summary>\n            The encoding to use when loading the file. The default is the encoding\n            associated with the system's current ANSI code page.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadFileTask.FilterChain\">\n            <summary>\n            The filterchain definition to use.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.LoadTasksTask\">\n             <summary>\n             Loads tasks form a given assembly or all assemblies in a given directory\n             or <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n             </summary>\n            <example>\n               <para>\n               Load tasks from a single assembly.\n               </para>\n               <code>\n                 <![CDATA[\n             <loadtasks assembly=\"c:foo\\NAnt.Contrib.Tasks.dll\" />\n                 ]]>\n               </code>\n             </example>\n             <example>\n               <para>\n               Scan a single directory for task assemblies.\n               </para>\n               <code>\n                 <![CDATA[\n             <loadtasks path=\"c:\\foo\" />\n                 ]]>\n               </code>\n             </example>\n             <example>\n               <para>\n               Use a <see cref=\"P:NAnt.Core.Tasks.LoadTasksTask.TaskFileSet\"/> containing both a directory and an \n               assembly.\n               </para>\n               <code>\n                 <![CDATA[\n             <loadtasks>\n                <fileset>\n                    <include name=\"C:\\cvs\\NAntContrib\\build\" />\n                    <include name=\"C:\\cvs\\NAntContrib\\build\\NAnt.Contrib.Tasks.dll\" />\n                </fileset>\n            </loadtasks>\n                 ]]>\n               </code>\n             </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.LoadTasksTask.ExecuteTask\">\n            <summary>\n            Executes the Load Tasks task.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">Specified assembly or path does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.LoadTasksTask.Initialize\">\n            <summary>\n            Validates the attributes.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">Both <see cref=\"P:NAnt.Core.Tasks.LoadTasksTask.AssemblyPath\"/> and <see cref=\"P:NAnt.Core.Tasks.LoadTasksTask.Path\"/> are set.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadTasksTask.AssemblyPath\">\n            <summary>\n            An assembly to load tasks from.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadTasksTask.Path\">\n            <summary>\n            A directory to scan for task assemblies.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoadTasksTask.TaskFileSet\">\n            <summary>\n            Used to select which directories or individual assemblies to scan.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.LoopTask\">\n            <summary>\n            Loops over a set of items.\n            </summary>\n            <remarks>\n              <para>\n              Can loop over files in directory, lines in a file, etc.\n              </para>\n              <para>\n              The property value is stored before the loop is done, and restored \n              when the loop is finished.\n              </para>\n              <para>\n              The property is returned to its normal value once it is used. Read-only \n              parameters cannot be overridden in this loop.\n              </para>\n            </remarks>\n            <example>\n              <para>Loops over the files in <c>c:\\</c>.</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"File\" in=\"c:\\\" property=\"filename\">\n                <echo message=\"${filename}\" />\n            </foreach>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Loops over all files in the project directory.</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"File\" property=\"filename\">\n                <in>\n                    <items>\n                        <include name=\"**\" />\n                    </items>\n                </in>\n                <do>\n                    <echo message=\"${filename}\" />\n                </do>\n            </foreach>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Loops over the folders in <c>c:\\</c>.</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"Folder\" in=\"c:\\\" property=\"foldername\">\n                <echo message=\"${foldername}\" />\n            </foreach>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Loops over all folders in the project directory.</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"Folder\" property=\"foldername\">\n                <in>\n                    <items>\n                        <include name=\"**\" />\n                    </items>\n                </in>\n                <do>\n                    <echo message=\"${foldername}\" />\n                </do>\n            </foreach>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Loops over a list.</para>\n              <code>\n                <![CDATA[\n            <foreach item=\"String\" in=\"1 2,3\" delim=\" ,\" property=\"count\">\n                <echo message=\"${count}\" />\n            </foreach>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Loops over lines in the file <c>properties.csv</c>, where each line \n              is of the format name,value.\n              </para>\n              <code>\n                <![CDATA[\n            <foreach item=\"Line\" in=\"properties.csv\" delim=\",\" property=\"x,y\">\n                <echo message=\"Read pair ${x}=${y}\" />\n            </foreach>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.Property\">\n            <summary>\n            The NAnt property name(s) that should be used for the current \n            iterated item.\n            </summary>\n            <remarks>\n            If specifying multiple properties, separate them with a comma.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.ItemType\">\n            <summary>\n            The type of iteration that should be done.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.TrimType\">\n            <summary>\n            The type of whitespace trimming that should be done. The default \n            is <see cref=\"F:NAnt.Core.Tasks.LoopTask.LoopTrim.None\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.Source\">\n            <summary>\n            The source of the iteration.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.Delimiter\">\n            <summary>\n            The deliminator char.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.InElement\">\n            <summary>\n            Stuff to operate in. Just like the <see cref=\"P:NAnt.Core.Tasks.LoopTask.Source\"/> \n            attribute, but supports more complicated things like a <see cref=\"T:NAnt.Core.Types.FileSet\"/> \n            and such.\n            <note>\n            Please remove the <see cref=\"P:NAnt.Core.Tasks.LoopTask.Source\"/> attribute if you \n            are using this element.\n            </note>\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.LoopTask.StuffToDo\">\n            <summary>\n            Tasks to execute for each matching item.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.LoopTask.LoopTrim.None\">\n            <summary>\n            Do not remove any white space characters.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.LoopTask.LoopTrim.End\">\n            <summary>\n            Remove all white space characters from the end of the current\n            item.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.LoopTask.LoopTrim.Start\">\n            <summary>\n            Remove all white space characters from the beginning of the \n            current item.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Tasks.LoopTask.LoopTrim.Both\">\n            <summary>\n            Remove all white space characters from the beginning and end of\n            the current item.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.MailTask\">\n            <summary>\n            Sends an SMTP message.\n            </summary>\n            <remarks>\n            <para>\n            Text and text files to include in the message body may be specified as \n            well as binary attachments.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Sends an email from <c>nant@sourceforge.net</c> to three recipients \n              with a subject about the attachments. The body of the message will be\n              the combined contents of all <c>.txt</c> files in the base directory.\n              All zip files in the base directory will be included as attachments.  \n              The message will be sent using the <c>smtpserver.anywhere.com</c> SMTP \n              server.\n              </para>\n              <code>\n                <![CDATA[\n            <mail \n                from=\"nant@sourceforge.net\" \n                tolist=\"recipient1@sourceforge.net\" \n                cclist=\"recipient2@sourceforge.net\" \n                bcclist=\"recipient3@sourceforge.net\" \n                subject=\"Msg 7: With attachments\" \n                mailhost=\"smtpserver.anywhere.com\">\n                <files>\n                    <include name=\"*.txt\" />\n                </files>   \n                <attachments>\n                    <include name=\"*.zip\" />\n                </attachments>\n            </mail>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.MailTask.Initialize\">\n            <summary>\n            Initializes task and ensures the supplied attributes are valid.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.MailTask.ExecuteTask\">\n            <summary>\n            This is where the work is done.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.MailTask.ReadFile(System.String)\">\n            <summary>\n            Reads a text file and returns the content\n            in a string.\n            </summary>\n            <param name=\"filename\">The file to read content of.</param>\n            <returns>\n            The content of the specified file.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.From\">\n            <summary>\n            Email address of sender.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.ToList\">\n            <summary>\n            Semicolon-separated list of recipient email addresses.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.CcList\">\n            <summary>\n            Semicolon-separated list of CC: recipient email addresses.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.BccList\">\n            <summary>\n            Semicolon-separated list of BCC: recipient email addresses.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Mailhost\">\n            <summary>\n            Host name of mail server. The default is <c>localhost</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Message\">\n            <summary>\n            Text to send in body of email message.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Subject\">\n            <summary>\n            Text to send in subject line of email message.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Format\">\n            <summary>\n            Format of the message. The default is <see cref=\"F:System.Web.Mail.MailFormat.Text\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Files\">\n            <summary>\n            Files that are transmitted as part of the body of the email message.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MailTask.Attachments\">\n            <summary>\n            Attachments that are transmitted with the message.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.MkDirTask\">\n            <summary>\n            Creates a directory and any non-existent parent directory if necessary.\n            </summary>\n            <example>\n              <para>Create the directory <c>build</c>.</para>\n              <code>\n                <![CDATA[\n            <mkdir dir=\"build\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Create the directory tree <c>one/two/three</c>.</para>\n              <code>\n                <![CDATA[\n            <mkdir dir=\"one/two/three\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.MkDirTask.ExecuteTask\">\n            <summary>\n            Creates the directory specified by the <see cref=\"P:NAnt.Core.Tasks.MkDirTask.Dir\"/> property.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">The directory could not be created.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MkDirTask.Dir\">\n            <summary>\n            The directory to create.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.MoveTask\">\n            <summary>\n            Moves a file or set of files to a new file or directory.\n            </summary>\n            <remarks>\n              <para>\n              Files are only moved if the source file is newer than the destination\n              file, or if the destination file does not exist.  However, you can\n              explicitly overwrite files with the <see cref=\"P:NAnt.Core.Tasks.CopyTask.Overwrite\"/> \n              attribute.\n              </para>\n              <para>\n              A <see cref=\"T:NAnt.Core.Types.FileSet\"/> can be used to select files to move. To use\n              a <see cref=\"T:NAnt.Core.Types.FileSet\"/>, the <see cref=\"P:NAnt.Core.Tasks.CopyTask.ToDirectory\"/> \n              attribute must be set.\n              </para>\n              <h3>Encoding</h3>\n              <para>\n              Unless an encoding is specified, the encoding associated with the \n              system's current ANSI code page is used.\n              </para>\n              <para>\n              An UTF-8, little-endian Unicode, and big-endian Unicode encoded text \n              file is automatically recognized, if the file starts with the \n              appropriate byte order marks.\n              </para>\n              <note>\n              If you employ filters in your move operation, you should limit the \n              move to text files. Binary files will be corrupted by the move \n              operation.\n              </note>\n            </remarks>\n            <example>\n              <para>\n              Move a single file while changing its encoding from \"latin1\" to \n              \"utf-8\".\n              </para>\n              <code>\n                <![CDATA[\n            <move\n                file=\"myfile.txt\"\n                tofile=\"mycopy.txt\"\n                inputencoding=\"latin1\"\n                outputencoding=\"utf-8\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Move a set of files.</para>\n              <code>\n                <![CDATA[\n            <move todir=\"${build.dir}\">\n                <fileset basedir=\"bin\">\n                    <include name=\"*.dll\" />\n                </fileset>\n            </move>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Move a set of files to a directory, replacing <c>@TITLE@</c> with \n              \"Foo Bar\" in all files.\n              </para>\n              <code>\n                <![CDATA[\n            <move todir=\"../backup/dir\">\n                <fileset basedir=\"src_dir\">\n                    <include name=\"**/*\" />\n                </fileset>\n                <filterchain>\n                    <replacetokens>\n                        <token key=\"TITLE\" value=\"Foo Bar\" />\n                    </replacetokens>\n                </filterchain>\n            </move>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.MoveTask.DoFileOperations\">\n            <summary>\n            Actually does the file moves.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.SourceFile\">\n            <summary>\n            The file to move.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.ToFile\">\n            <summary>\n            The file to move to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.ToDirectory\">\n            <summary>\n            The directory to move to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.CopyFileSet\">\n            <summary>\n            Used to select the files to move. To use a <see cref=\"T:NAnt.Core.Types.FileSet\"/>,\n            the <see cref=\"P:NAnt.Core.Tasks.MoveTask.ToDirectory\"/> attribute must be set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.Flatten\">\n            <summary>\n            Ignore directory structure of source directory, move all files into\n            a single directory, specified by the <see cref=\"P:NAnt.Core.Tasks.MoveTask.ToDirectory\"/>\n            attribute. The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.MoveTask.Filters\">\n            <summary>\n            Chain of filters used to alter the file's content as it is moved.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.NAntSchemaTask\">\n            <summary>\n            Creates an XSD File for all available tasks.\n            </summary>\n            <remarks>\n              <para>\n              This can be used in conjuntion with the command-line option to do XSD \n              Schema validation on the build file.\n              </para>\n            </remarks>\n            <example>\n              <para>Creates a <c>NAnt.xsd</c> file in the current project directory.</para>\n              <code>\n                <![CDATA[\n            <nantschema output=\"NAnt.xsd\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.NAntSchemaTask.WriteSchema(System.IO.Stream,System.Type[],System.Type[],System.String)\">\n            <summary>\n            Creates a NAnt Schema for given types\n            </summary>\n            <param name=\"stream\">The output stream to save the schema to. If <see langword=\"null\" />, writing is ignored, no exception generated.</param>\n            <param name=\"tasks\">The list of tasks to generate XML Schema for.</param>\n            <param name=\"dataTypes\">The list of datatypes to generate XML Schema for.</param>\n            <param name=\"targetNS\">The target namespace to output.</param>\n            <returns>The new NAnt Schema.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.NAntSchemaTask.CreateXsdAttribute(System.String,System.Boolean)\">\n            <summary>\n            Creates a new <see cref=\"T:System.Xml.Schema.XmlSchemaAttribute\"/> instance.\n            </summary>\n            <param name=\"name\">The name of the attribute.</param>\n            <param name=\"required\">Value indicating whether the attribute should be required.</param>\n            <returns>The new <see cref=\"T:System.Xml.Schema.XmlSchemaAttribute\"/> instance.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.NAntSchemaTask.CreateXsdSequence(System.Decimal,System.Decimal)\">\n            <summary>\n            Creates a new <see cref=\"T:System.Xml.Schema.XmlSchemaSequence\"/> instance.\n            </summary>\n            <param name=\"min\">The minimum value to allow for this choice</param>\n            <param name=\"max\">The maximum value to allow, Decimal.MaxValue sets it to 'unbound'</param>\n            <returns>The new <see cref=\"T:System.Xml.Schema.XmlSchemaSequence\"/> instance.</returns>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntSchemaTask.OutputFile\">\n            <summary>\n            The name of the output file to which the XSD should be written.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntSchemaTask.TargetNamespace\">\n            <summary>\n            The target namespace for the output. Defaults to \"http://tempuri.org/nant-donotuse.xsd\"\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntSchemaTask.ForType\">\n            <summary>\n            The <see cref=\"T:System.Type\"/> for which an XSD should be created. If not\n            specified, an XSD will be created for all available tasks.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.NAntSchemaTask.NAntSchemaGenerator.#ctor(System.Type[],System.Type[],System.String)\">\n            <summary>\n            Creates a new instance of the <see cref=\"T:NAnt.Core.Tasks.NAntSchemaTask.NAntSchemaGenerator\"/>\n            class.\n            </summary>\n            <param name=\"tasks\">Tasks for which a schema should be generated.</param>\n            <param name=\"dataTypes\">Data Types for which a schema should be generated.</param>\n            <param name=\"targetNS\">The namespace to use.\n            <example> http://tempuri.org/nant.xsd </example>\n            </param>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.NAntTask\">\n            <summary>\n            Runs NAnt on a supplied build file, or a set of build files.\n            </summary>\n            <remarks>\n              <para>\n              By default, all the properties of the current project will be available\n              in the new project. Alternatively, you can set <see cref=\"P:NAnt.Core.Tasks.NAntTask.InheritAll\"/>\n              to <see langword=\"false\"/> to not copy any properties to the new \n              project.\n              </para>\n              <para>\n              You can also set properties in the new project from the old project by \n              using nested property tags. These properties are always passed to the \n              new project regardless of the setting of <see cref=\"P:NAnt.Core.Tasks.NAntTask.InheritAll\"/>.\n              This allows you to parameterize your subprojects.\n              </para>\n              <para>\n              References to data types can also be passed to the new project, but by\n              default they are not. If you set the <see cref=\"P:NAnt.Core.Tasks.NAntTask.InheritRefs\"/> to \n              <see langword=\"true\"/>, all references will be copied.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Build a project located in a different directory if the <c>debug</c> \n              property is not <see langword=\"true\"/>.\n              </para>\n              <code>\n                <![CDATA[\n            <nant buildfile=\"${src.dir}/Extras/BuildServer/BuildServer.build\" unless=\"${debug}\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Build a project while adding a set of properties to that project.\n              </para>\n              <code>\n                <![CDATA[\n            <nant buildfile=\"${src.dir}/Extras/BuildServer/BuildServer.build\">\n                <properties>\n                    <property name=\"build.dir\" value=\"c:/buildserver\" />\n                    <property name=\"build.debug\" value=\"false\" />\n                    <property name=\"lib.dir\" value=\"c:/shared/lib\" readonly=\"true\" />\n                </properties>\n            </nant>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Build all projects named <c>default.build</c> located anywhere under \n              the project base directory.\n              </para>\n              <code>\n                <![CDATA[\n            <nant>\n                <buildfiles>\n                    <include name=\"**/default.build\" />\n                    <!-- avoid recursive execution of current build file -->\n                    <exclude name=\"${project::get-buildfile-path()}\" />\n                </buildfiles>\n            </nant>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.NAntTask.Initialize\">\n            <summary>\n            Validates the <see cref=\"T:NAnt.Core.Tasks.NAntTask\"/> element.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.BuildFile\">\n            <summary>\n            The build file to build.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.DefaultTarget\">\n            <summary>\n            The target to execute. To specify more than one target seperate \n            targets with a space. Targets are executed in order if possible. \n            The default is to use target specified in the project's default \n            attribute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.BuildFiles\">\n            <summary>\n            Used to specify a set of build files to process.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.InheritAll\">\n            <summary>\n            Specifies whether current property values should be inherited by \n            the executed project. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.InheritRefs\">\n            <summary>\n            Specifies whether all references will be copied to the new project. \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.NAntTask.OverrideProperties\">\n            <summary>\n            Specifies a collection of properties that should be created in the\n            executed project.  Note, existing properties with identical names \n            that are not read-only will be overwritten.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.PropertyTask\">\n            <summary>\n            Sets a property in the current project.\n            </summary>\n            <remarks>\n              <note>NAnt uses a number of predefined properties.</note>\n            </remarks>\n            <example>\n              <para>\n              Define a <c>debug</c> property with value <see langword=\"true\" />.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"debug\" value=\"true\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Use the user-defined <c>debug</c> property.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"trace\" value=\"${debug}\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Define a read-only property. This is just like passing in the param \n              on the command line.\n              </para>\n              <code>\n                <![CDATA[\n            <property name=\"do_not_touch_ME\" value=\"hammer\" readonly=\"true\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Define a property, but do not overwrite the value if the property already exists (eg. it was specified on the command line).\n              </para>\n              <code>\n                <![CDATA[\n            <project name=\"property-example\">\n              <property name=\"debug\" value=\"true\" overwrite=\"false\" />\n              <echo message=\"debug: ${debug}\" />\n            </project>\n                ]]>\n              </code>\n              <para>\n              Executing this build file with the command line option <c>-D:debug=false</c>,\n              would cause the value specified on the command line to remain unaltered.\n              </para>\n              <code>\n                <![CDATA[\n            [echo] debug: false\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.PropertyTask.PropertyName\">\n            <summary>\n            The name of the NAnt property to set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.PropertyTask.Value\">\n            <summary>\n            The value to assign to the NAnt property.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.PropertyTask.ReadOnly\">\n            <summary>\n            Specifies whether the property is read-only or not. \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.PropertyTask.Dynamic\">\n            <summary>\n            Specifies whether references to other properties should not be \n            expanded when the value of the property is set, but expanded when\n            the property is actually used.  By default, properties will be\n            expanded when set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.PropertyTask.Overwrite\">\n            <summary>\n            Specifies whether the value of a property should be overwritten if\n            the property already exists (unless the property is read-only). \n            The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.RegexTask\">\n            <summary>\n            Sets project properties based on the evaluatuion of a regular expression.\n            </summary>\n            <remarks>\n            <para>\n            The <see cref=\"P:NAnt.Core.Tasks.RegexTask.Pattern\"/> attribute must contain one or more \n            <see href=\"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpcongroupingconstructs.asp\">\n            named grouping constructs</see>, which represents the names of the \n            properties to be set. These named grouping constructs can be enclosed \n            by angle brackets (?&lt;name&gt;) or single quotes (?'name').\n            </para>\n            <note>\n            In the build file, use the XML element <![CDATA[&lt;]]> to specify &lt;, \n            and <![CDATA[&gt;]]> to specify &gt;.\n            </note>\n            <note>\n            The named grouping construct must not contain any punctuation and it \n            cannot begin with a number.\n            </note>\n            </remarks>\n            <example>\n              <para>\n              Find the last word in the given string and stores it in the property \n              <c>lastword</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <regex pattern=\"(?'lastword'\\w+)$\" input=\"This is a test sentence\" />\n            <echo message=\"${lastword}\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Split the full filename and extension of a filename.\n              </para>\n              <code>\n                <![CDATA[\n            <regex pattern=\"^(?'filename'.*)\\.(?'extension'\\w+)$\" input=\"d:\\Temp\\SomeDir\\SomeDir\\bla.xml\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Split the path and the filename. (This checks for <c>/</c> or <c>\\</c> \n              as the path separator).\n              </para>\n              <code>\n                <![CDATA[\n            <regex pattern=\"^(?'path'.*(\\\\|/)|(/|\\\\))(?'file'.*)$\" input=\"d:\\Temp\\SomeDir\\SomeDir\\bla.xml\" />\n                ]]>\n              </code>\n              <para>\n              Results in path=<c>d:\\Temp\\SomeDir\\SomeDir\\</c> and file=<c>bla.xml</c>.\n              </para>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.RegexTask.ExecuteTask\">\n            <summary>\n            Executes the task.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.RegexTask.Pattern\">\n            <summary>\n            Represents the regular expression to be evalued.\n            </summary>\n            <value>\n            The regular expression to be evalued.\n            </value>\n            <remarks>\n            The pattern must contain one or more named constructs, which may \n            not contain any punctuation and cannot begin with a number.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.RegexTask.Options\">\n            <summary>\n            A comma separated list of options to pass to the regex engine. The\n            default is <see cref=\"F:System.Text.RegularExpressions.RegexOptions.None\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.RegexTask.Input\">\n            <summary>\n            Represents the input for the regular expression.\n            </summary>\n            <value>\n            The input for the regular expression.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.SetEnvTask\">\n            <summary>\n            Sets an environment variable or a whole collection of them. Use an empty \n            <see cref=\"P:NAnt.Core.Tasks.SetEnvTask.LiteralValue\"/> attribute to clear a variable.\n            </summary>\n            <remarks>\n              <note>\n              Variables will be set for the current NAnt process and all child \n              processes that NAnt spawns (compilers, shell tools, etc). If the \n              intention is to only set a variable for a single child process, then\n              using the <see cref=\"T:NAnt.Core.Tasks.ExecTask\"/> and its nested <see cref=\"P:NAnt.Core.Tasks.ExecTask.EnvironmentSet\"/> \n              element might be a better option. \n              </note>\n              <note>\n              Expansion of inline environment variables is performed using the syntax \n              of the current platform. So on Windows platforms using the string %PATH% \n              in the <see cref=\"P:NAnt.Core.Tasks.SetEnvTask.LiteralValue\"/> attribute will result in the value of \n              the PATH variable being expanded in place before the variable is set.\n              </note>\n            </remarks>\n            <example>\n              <para>Set the MONO_PATH environment variable on a *nix platform.</para>\n              <code>\n                <![CDATA[\n                <setenv name==\"MONO_PATH\" value=\"/home/jimbob/dev/foo:%MONO_PATH%\"/>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Set a collection of environment variables. Note the nested variable used to set var3.</para>\n              <code>\n                <![CDATA[\n                <setenv>\n                        <variable name=\"var1\" value=\"value2\" />\n                        <variable name=\"var2\" value=\"value2\" />\n                        <variable name=\"var3\" value=\"value3:%var2%\" />\n                </setenv>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Set environment variables using nested path elements.</para>\n              <code>\n                <![CDATA[\n                <path id=\"build.path\">\n                       <pathelement dir=\"c:/windows\" />\n                       <pathelement dir=\"c:/cygwin/usr/local/bin\" />\n                   </path>\n                <setenv>         \n                        <variable name=\"build_path\" >\n                               <path refid=\"build.path\" />\n                        </variable>\n                        <variable name=\"path2\">\n                           <path>\n                               <pathelement dir=\"c:/windows\" />\n                               <pathelement dir=\"c:/cygwin/usr/local/bin\" />\n                           </path>\n                        </variable>\n                </setenv>    \n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.SetEnvironmentVariable(System.String,System.String)\">\n            <summary>\n            Win32 DllImport for the SetEnvironmentVariable function.\n            </summary>\n            <param name=\"lpName\"></param>\n            <param name=\"lpValue\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.setenv(System.String,System.String,System.Int32)\">\n            <summary>\n            *nix dllimport for the setenv function.\n            </summary>\n            <param name=\"name\"></param>\n            <param name=\"value\"></param>\n            <param name=\"overwrite\"></param>\n            <returns>\n            <c>0</c> if the execution is successful; otherwise, <c>-1</c>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.unsetenv(System.String)\">\n            <summary>\n            Deletes all instances of the variable name.\n            </summary>\n            <param name=\"name\">The variable to unset.</param>\n            <returns>\n            <c>0</c> if the execution is successful; otherwise, <c>-1</c>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.Initialize\">\n            <summary>\n            Checks whether the task is initialized with valid attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.ExecuteTask\">\n            <summary>\n            Set the environment variables\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SetEnvTask.SetSingleEnvironmentVariable(System.String,System.String)\">\n            <summary>\n            Do the actual work here.\n            </summary>\n            <param name=\"name\">The name of the environment variable.</param>\n            <param name=\"value\">The value of the environment variable.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SetEnvTask.EnvName\">\n            <summary>\n            The name of a single Environment variable to set\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SetEnvTask.LiteralValue\">\n            <summary>\n            The literal value for the environment variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SetEnvTask.File\">\n            <summary>\n            The value for a file-based environment variable. NAnt will convert \n            it to an absolute filename.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SetEnvTask.Directory\">\n            <summary>\n            The value for a directory-based environment variable. NAnt will \n            convert it to an absolute path.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SetEnvTask.Path\">\n            <summary>\n            The value for a PATH like environment variable. You can use \n            <c>:</c> or <c>;</c> as path separators and NAnt will convert it to \n            the platform's local conventions.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.SleepTask\">\n            <summary>\n            A task for sleeping a specified period of time, useful when a build or deployment process\n            requires an interval between tasks.\n            </summary>\n            <example>\n              <para>Sleep 1 hour, 2 minutes, 3 seconds and 4 milliseconds.</para>\n              <code>\n                <![CDATA[\n            <sleep hours=\"1\" minutes=\"2\" seconds=\"3\" milliseconds=\"4\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Sleep 123 milliseconds.</para>\n              <code>\n                <![CDATA[\n            <sleep milliseconds=\"123\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SleepTask.Initialize\">\n            <summary>\n             Verify parameters.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SleepTask.GetSleepTime\">\n            <summary>\n            Return time to sleep.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.SleepTask.DoSleep(System.Int32)\">\n            <summary>\n            Sleeps for the specified number of milliseconds.\n            </summary>\n            <param name=\"millis\">Number of milliseconds to sleep.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SleepTask.Hours\">\n            <summary>\n            Hours to add to the sleep time.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SleepTask.Minutes\">\n            <summary>\n            Minutes to add to the sleep time.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SleepTask.Seconds\">\n            <summary>\n            Seconds to add to the sleep time.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SleepTask.Milliseconds\">\n            <summary>\n            Milliseconds to add to the sleep time.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.StyleTask\">\n            <summary>\n            Processes a document via XSLT.\n            </summary>\n            <example>\n              <para>Create a report in HTML.</para>\n              <code>\n                <![CDATA[\n            <style style=\"report.xsl\" in=\"data.xml\" out=\"report.html\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Create a report in HTML, with a param.</para>\n              <code>\n                <![CDATA[\n            <style style=\"report.xsl\" in=\"data.xml\" out=\"report.html\">\n                <parameters>\n                    <parameter name=\"reportType\" namespaceuri=\"\" value=\"Plain\" />\n                </parameters>\n            </style>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Create a report in HTML, with a expanded param.</para>\n              <code>\n                <![CDATA[\n            <style style=\"report.xsl\" in=\"data.xml\" out=\"report.html\">\n                <parameters>\n                    <parameter name=\"reportType\" namespaceuri=\"\" value=\"${report.type}\" />\n                </parameters>\n            </style>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Create some code based on a directory of templates.</para>\n              <code>\n                <![CDATA[\n            <style style=\"CodeGenerator.xsl\" extension=\"java\">\n                <infiles>\n                    <include name=\"*.xml\" />\n                </infiles>\n                <parameters>\n                    <parameter name=\"reportType\" namespaceuri=\"\" value=\"Plain\" if=\"${report.plain}\" />\n                </parameters>\n            <style>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Create a report in HTML, with an extension object.</para>\n              <code>\n                <![CDATA[\n            <style style=\"report.xsl\" in=\"data.xml\" out=\"report.html\">\n                <extensionobjects>\n                    <extensionobject namespaceuri=\"urn:Formatter\" typename=\"XsltExtensionObjects.Formatter\" assembly=\"XsltExtensionObjects.dll\" />\n                </extensionobjects>\n            </style>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.DestDir\">\n            <summary>\n            Directory in which to store the results. The default is the project\n            base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.Extension\">\n            <summary>\n            Desired file extension to be used for the targets. The default is \n            <c>html</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.XsltFile\">\n            <summary>\n            URI or path that points to the stylesheet to use. If given as path, it can\n            be relative to the project's basedir or absolute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.SrcFile\">\n            <summary>\n            Specifies a single XML document to be styled. Should be used with \n            the <see cref=\"P:NAnt.Core.Tasks.StyleTask.OutputFile\"/> attribute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.OutputFile\">\n            <summary>\n            Specifies the output name for the styled result from the <see cref=\"P:NAnt.Core.Tasks.StyleTask.SrcFile\"/> \n            attribute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.InFiles\">\n            <summary>\n            Specifies a group of input files to which to apply the stylesheet.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.Parameters\">\n            <summary>\n            XSLT parameters to be passed to the XSLT transformation.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.ExtensionObjects\">\n            <summary>\n            XSLT extension objects to be passed to the XSLT transformation.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.StyleTask.Proxy\">\n            <summary>\n            The network proxy to use to access the Internet resource.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.SysInfoTask\">\n            <summary>\n            Sets properties with system information.\n            </summary>\n            <remarks>\n              <para>Sets a number of properties with information about the system environment.  The intent of this task is for nightly build logs to have a record of system information so that the build was performed on.</para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Property</term>\n                  <description>Value</description>\n                </listheader>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.clr.version</term>\n                  <description>Common Language Runtime version number.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.env.*</term>\n                  <description>Environment variables (e.g., &lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.env.PATH).</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.platform</term>\n                  <description>Operating system platform ID.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.version</term>\n                  <description>Operating system version.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os</term>\n                  <description>Operating system version string.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.applicationdata</term>\n                  <description>The directory that serves as a common repository for application-specific data for the current roaming user.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.commonapplicationdata</term>\n                  <description>The directory that serves as a common repository for application-specific data that is used by all users.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.commonprogramfiles</term>\n                  <description>The directory for components that are shared across applications.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.desktopdirectory</term>\n                  <description>The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.programfiles</term>\n                  <description>The Program Files directory.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.system</term>\n                  <description>The System directory.</description>\n                </item>\n                <item>\n                  <term>&lt;<see cref=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\"/>&gt;.os.folder.temp</term>\n                  <description>The temporary directory.</description>\n                </item>\n              </list>\n              <para>\n              When the name of an environment variable is not a valid property name,\n              the task will fail. In that case, set <see cref=\"P:NAnt.Core.Task.FailOnError\"/> to \n              <see langword=\"true\"/> to allow that environment variable to be \n              skipped.\n              </para>\n              <note>\n              we advise you to use the following functions instead:\n              </note>\n              <list type=\"table\">\n                <listheader>\n                    <term>Function</term>\n                    <description>Description</description>\n                </listheader>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetOperatingSystem\"/></term>\n                    <description>Gets a <see cref=\"T:System.OperatingSystem\"/> object that identifies this operating system.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetFolderPath(System.Environment.SpecialFolder)\"/></term>\n                    <description>Gets the path to a system special folder.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVariable(System.String)\"/></term>\n                    <description>Returns the value of a environment variable.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.PathFunctions.GetTempPath\"/></term>\n                    <description>Gets the path to the temporary directory.</description>\n                </item>\n                <item>\n                    <term><see cref=\"M:NAnt.Core.Functions.EnvironmentFunctions.GetVersion\"/></term>\n                    <description>Gets the Common Language Runtime version.</description>\n                </item>\n              </list>  \n            </remarks>\n            <example>\n              <para>Register the properties with the default property prefix.</para>\n              <code>\n                <![CDATA[\n            <sysinfo />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Register the properties without a prefix.</para>\n              <code>\n                <![CDATA[\n            <sysinfo prefix=\"\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Register properties and display a summary.</para>\n              <code>\n                <![CDATA[\n            <sysinfo verbose=\"true\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.SysInfoTask.Prefix\">\n            <summary>\n            The string to prefix the property names with. The default is \"sys.\".\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.TStampTask\">\n            <summary>\n            Sets properties with the current date and time.\n            </summary>\n            <remarks>\n              <para>\n              By default the <see cref=\"T:NAnt.Core.Tasks.TStampTask\"/> displays the current date \n              and time and sets the following properties:\n              </para>\n              <list type=\"bullet\">\n                <item><description>tstamp.date to yyyyMMdd</description></item>\n                <item><description>tstamp.time to HHmm</description></item>\n                <item><description>tstamp.now using the default DateTime.ToString() method</description></item>\n              </list>\n              <para>\n              To set an additional property with a custom date/time use the \n              <see cref=\"P:NAnt.Core.Tasks.TStampTask.Property\"/> and <see cref=\"P:NAnt.Core.Tasks.TStampTask.Pattern\"/> attributes.  \n              To set a number of additional properties with the exact same date and \n              time use the <see cref=\"P:NAnt.Core.Tasks.TStampTask.Formatters\"/> nested element (see example).\n              </para>\n              <para>\n              The date and time string displayed by the <see cref=\"T:NAnt.Core.Tasks.TStampTask\"/> \n              uses the computer's default long date and time string format.  You \n              might consider setting these to the \n              <see href=\"http://www.cl.cam.ac.uk/~mgk25/iso-time.html\">ISO 8601 standard \n              for date and time notation</see>.\n              </para>\n            </remarks>\n            <example>\n              <para>Set the <c>build.date</c> property.</para>\n              <code>\n                <![CDATA[\n            <tstamp property=\"build.date\" pattern=\"yyyyMMdd\" verbose=\"true\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Set a number of properties for Ant like compatibility.</para>\n              <code>\n                <![CDATA[\n            <tstamp verbose=\"true\">\n                <formatter property=\"TODAY\" pattern=\"dd MMM yyyy\"/>\n                <formatter property=\"DSTAMP\" pattern=\"yyyyMMdd\" unless=\"${date.not.needed}\" />\n                <formatter property=\"TSTAMP\" pattern=\"HHmm\" if=\"${need.hours}\" />\n            </tstamp>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TStampTask.Property\">\n            <summary>\n            The property to receive the date/time string in the given pattern.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TStampTask.Pattern\">\n            <summary>The date/time pattern to be used.</summary>\n            <remarks>\n              <para>The following table lists the standard format characters for each standard pattern. The format characters are case-sensitive; for example, 'g' and 'G' represent slightly different patterns.</para>\n              <list type=\"table\">\n                <listheader>\n                  <description>Format Character</description>\n                  <description>Description Example Format Pattern (en-US)</description>\n                </listheader>\n                <item><description>d</description><description>MM/dd/yyyy</description></item>\n                <item><description>D</description><description>dddd, dd MMMM yyyy</description></item>\n                <item><description>f</description><description>dddd, dd MMMM yyyy HH:mm</description></item>\n                <item><description>F</description><description>dddd, dd MMMM yyyy HH:mm:ss</description></item>\n                <item><description>g</description><description>MM/dd/yyyy HH:mm</description></item>\n                <item><description>G</description><description>MM/dd/yyyy HH:mm:ss</description></item>\n                <item><description>m, M</description><description>MMMM dd</description></item>\n                <item><description>r, R</description><description>ddd, dd MMM yyyy HH':'mm':'ss 'GMT'</description></item>\n                <item><description>s</description><description>yyyy'-'MM'-'dd'T'HH':'mm':'ss</description></item>\n                <item><description>t</description><description>HH:mm</description></item>\n                <item><description>T</description><description>HH:mm:ss</description></item>\n                <item><description>u</description><description>yyyy'-'MM'-'dd HH':'mm':'ss'Z'</description></item>\n                <item><description>U</description><description>dddd, dd MMMM yyyy HH:mm:ss</description></item>\n                <item><description>y, Y</description><description>yyyy MMMM</description></item>\n              </list>\n              <para>The following table lists the patterns that can be combined to construct custom patterns. The patterns are case-sensitive; for example, \"MM\" is recognized, but \"mm\" is not. If the custom pattern contains white-space characters or characters enclosed in single quotation marks, the output string will also contain those characters. Characters not defined as part of a format pattern or as format characters are reproduced literally.</para>\n              <list type=\"table\">\n                <listheader>\n                  <description>Format</description>\n                  <description>Pattern Description</description>\n                </listheader>\n                <item><description>d</description><description>The day of the month. Single-digit days will not have a leading zero.</description></item>\n                <item><description>dd</description><description>The day of the month. Single-digit days will have a leading zero.</description></item>\n                <item><description>ddd</description><description>The abbreviated name of the day of the week.</description></item>\n                <item><description>dddd</description><description>The full name of the day of the week.</description></item>\n                <item><description>M</description><description>The numeric month. Single-digit months will not have a leading zero.</description></item>\n                <item><description>MM</description><description>The numeric month. Single-digit months will have a leading zero.</description></item>\n                <item><description>MMM</description><description>The abbreviated name of the month.</description></item>\n                <item><description>MMMM</description><description>The full name of the month.</description></item>\n                <item><description>y</description><description>The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.</description></item>\n                <item><description>yy</description><description>The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.</description></item>\n                <item><description>yyyy</description><description>The year in four digits, including the century.</description></item>\n                <item><description>gg</description><description>The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.</description></item>\n                <item><description>h</description><description>The hour in a 12-hour clock. Single-digit hours will not have a leading zero.</description></item>\n                <item><description>hh</description><description>The hour in a 12-hour clock. Single-digit hours will have a leading zero.</description></item>\n                <item><description>H</description><description>The hour in a 24-hour clock. Single-digit hours will not have a leading zero.</description></item>\n                <item><description>HH</description><description>The hour in a 24-hour clock. Single-digit hours will have a leading zero.</description></item>\n                <item><description>m</description><description>The minute. Single-digit minutes will not have a leading zero.</description></item>\n                <item><description>mm</description><description>The minute. Single-digit minutes will have a leading zero.</description></item>\n                <item><description>s</description><description>The second. Single-digit seconds will not have a leading zero.</description></item>\n                <item><description>ss</description><description>The second. Single-digit seconds will have a leading zero.</description></item>\n                <item><description>f</description><description>The fraction of a second in single-digit precision. The remaining digits are truncated.</description></item>\n                <item><description>ff</description><description>The fraction of a second in double-digit precision. The remaining digits are truncated.</description></item>\n                <item><description>fff</description><description>The fraction of a second in three-digit precision. The remaining digits are truncated.</description></item>\n                <item><description>ffff</description><description>The fraction of a second in four-digit precision. The remaining digits are truncated.</description></item>\n                <item><description>fffff</description><description>The fraction of a second in five-digit precision. The remaining digits are truncated. </description></item>\n                <item><description>ffffff</description><description>The fraction of a second in six-digit precision. The remaining digits are truncated. </description></item>\n                <item><description>fffffff</description><description>The fraction of a second in seven-digit precision. The remaining digits are truncated. </description></item>\n                <item><description>t</description><description>The first character in the AM/PM designator.</description></item>\n                <item><description>tt</description><description>The AM/PM designator. </description></item>\n                <item><description>z</description><description>The time zone offset (\"+\" or \"-\" followed by the hour only). Single-digit hours will not have a leading zero. For example, Pacific Standard Time is \"-8\".</description></item>\n                <item><description>zz</description><description>The time zone offset (\"+\" or \"-\" followed by the hour only). Single-digit hours will have a leading zero. For example, Pacific Standard Time is \"-08\".</description></item>\n                <item><description>zzz</description><description>The full time zone offset (\"+\" or \"-\" followed by the hour and minutes). Single-digit hours and minutes will have leading zeros. For example, Pacific Standard Time is \"-08:00\".</description></item>\n                <item><description>:</description><description>The default time separator.</description></item>\n                <item><description>/</description><description>The default date separator.</description></item>\n                <item><description>\\ c</description><description>Pattern Where c is any character. Displays the character literally. To display the backslash character, use \"\\\\\". </description></item>\n              </list>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.TouchTask\">\n            <summary>\n            Touches a file or set of files -- corresponds to the Unix touch command.  \n            </summary>\n            <remarks>\n            <para>\n            If the file specified does not exist, the task will create it.\n            </para>\n            </remarks>\n            <example>\n              <para>Touch the <c>Main.cs</c> file.  The current time is used.</para>\n              <code>\n                <![CDATA[\n            <touch file=\"Main.cs\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Touch all executable files in the project base directory and its \n              subdirectories.\n              </para>\n              <code>\n                <![CDATA[\n            <touch>\n                <fileset>\n                    <include name=\"**/*.exe\" />\n                    <include name=\"**/*.dll\" />\n                </fileset>\n            </touch>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.TouchTask.Initialize\">\n            <summary>\n            Ensures the supplied attributes are valid.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TouchTask.File\">\n            <summary>\n            The file to touch.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TouchTask.Millis\">\n            <summary>\n            Specifies the new modification time of the file(s) in milliseconds \n            since midnight Jan 1 1970.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TouchTask.Datetime\">\n            <summary>\n            Specifies the new modification time of the file in the format \n            MM/DD/YYYY HH:MM:SS.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.TouchTask.TouchFileSet\">\n            <summary>\n            Used to select files that should be touched.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.UpToDateTask\">\n            <summary>\n            Check modification dates on groups of files.\n            </summary>\n            <remarks>\n            If all <see cref=\"P:NAnt.Core.Tasks.UpToDateTask.TargetFiles\"/> are same or newer than all <see cref=\"P:NAnt.Core.Tasks.UpToDateTask.SourceFiles\"/>, the specified property is set to <see langword=\"true\"/>, otherwise it\n            is set to <see langword=\"false\"/>.\n            </remarks>\n            <example>\n              <para>\n              Check file dates. If <c>myfile.dll</c> is same or newer than <c>myfile.cs</c>, then set <c>myfile.dll.uptodate</c> property \n              to either <see langword=\"true\"/> or <see langword=\"false\"/>.\n              </para>\n              <code>\n                <![CDATA[\n            <uptodate property=\"myfile.dll.uptodate\">\n                <sourcefiles>\n                    <include name=\"myfile.cs\" />\n                </sourcefiles>\n                <targetfiles>\n                    <include name=\"myfile.dll\" />\n                </targetfiles>\n            </uptodate>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.UpToDateTask.PropertyName\">\n            <summary>\n            Property that will be set to <see langword=\"true\" /> or <see langword=\"false\" /> depending on the \n            result of the date check.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.UpToDateTask.SourceFiles\">\n            <summary>\n            The <see cref=\"T:NAnt.Core.Types.FileSet\"/> that contains list of source files. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.UpToDateTask.TargetFiles\">\n            <summary>\n            The <see cref=\"T:NAnt.Core.Types.FileSet\"/> that contains list of target files. \n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.XmlPeekTask\">\n            <summary>\n            Extracts text from an XML file at the location specified by an XPath \n            expression.\n            </summary>\n            <remarks>\n            <para>\n            If the XPath expression specifies multiple nodes the node index is used \n            to determine which of the nodes' text is returned.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              The example provided assumes that the following XML file (App.config)\n              exists in the current build directory.\n              </para>\n              <code>\n                <![CDATA[\n            <?xml version=\"1.0\" encoding=\"utf-8\" ?>\n            <configuration xmlns=\"http://www.gordic.cz/shared/project-config/v_1.0.0.0\">\n                <appSettings>\n                    <add key=\"server\" value=\"testhost.somecompany.com\" />\n                </appSettings>\n            </configuration>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              The example will read the server value from the above\n              configuration file.\n              </para>\n              <code>\n                <![CDATA[\n            <xmlpeek\n                file=\"App.config\"\n                xpath=\"/x:configuration/x:appSettings/x:add[@key = 'server']/@value\"\n                property=\"configuration.server\">\n                <namespaces>\n                    <namespace prefix=\"x\" uri=\"http://www.gordic.cz/shared/project-config/v_1.0.0.0\" />\n                </namespaces>\n            </xmlpeek>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPeekTask.ExecuteTask\">\n            <summary>\n            Executes the XML peek task.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPeekTask.LoadDocument(System.String)\">\n            <summary>\n            Loads an XML document from a file on disk.\n            </summary>\n            <param name=\"fileName\">The file name of the file to load the XML document from.</param>\n            <returns>\n            A <see cref=\"T:System.Xml.XmlDocument\">document</see> containing\n            the document object representing the file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPeekTask.GetNodeContents(System.String,System.Xml.XmlDocument,System.Int32)\">\n            <summary>\n            Gets the contents of the node specified by the XPath expression.\n            </summary>\n            <param name=\"xpath\">The XPath expression used to determine which nodes to choose from.</param>\n            <param name=\"document\">The XML document to select the nodes from.</param>\n            <param name=\"nodeIndex\">The node index in the case where multiple nodes satisfy the expression.</param>\n            <returns>\n            The contents of the node specified by the XPath expression.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPeekTask.XmlFile\">\n            <summary>\n            The name of the file that contains the XML document\n            that is going to be peeked at.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPeekTask.NodeIndex\">\n            <summary>\n            The index of the node that gets its text returned when the query \n            returns multiple nodes.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPeekTask.Property\">\n            <summary>\n            The property that receives the text representation of the XML inside \n            the node returned from the XPath expression.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPeekTask.XPath\">\n            <summary>\n            The XPath expression used to select which node to read.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPeekTask.Namespaces\">\n            <summary>\n            Namespace definitions to resolve prefixes in the XPath expression.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Tasks.XmlPokeTask\">\n            <summary>\n            Replaces text in an XML file at the location specified by an XPath \n            expression.\n            </summary>\n            <remarks>\n            <para>\n            The location specified by the XPath expression must exist, it will\n            not create the parent elements for you. However, provided you have\n            a root element you could use a series of the tasks to build the\n            XML file up if necessary.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Change the <c>server</c> setting in the configuration from <c>testhost.somecompany.com</c> \n              to <c>productionhost.somecompany.com</c>.\n              </para>\n              <para>XML file:</para>\n              <code>\n                <![CDATA[\n            <?xml version=\"1.0\" encoding=\"utf-8\" ?>\n            <configuration>\n                <appSettings>\n                    <add key=\"server\" value=\"testhost.somecompany.com\" />\n                </appSettings>\n            </configuration>\n                ]]>\n              </code>\n              <para>Build fragment:</para>\n              <code>\n                <![CDATA[\n            <xmlpoke\n                file=\"App.config\"\n                xpath=\"/configuration/appSettings/add[@key = 'server']/@value\"\n                value=\"productionhost.somecompany.com\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Modify the <c>noNamespaceSchemaLocation</c> in an XML file.\n              </para>\n              <para>XML file:</para>\n              <code>\n                <![CDATA[\n            <?xml version=\"1.0\" encoding=\"utf-8\" ?>\n            <Commands xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"Path Value\">\n            </Commands>\n                ]]>\n              </code>\n              <para>Build fragment:</para>\n              <code>\n                <![CDATA[\n            <xmlpoke file=\"test.xml\" xpath=\"/Commands/@xsi:noNamespaceSchemaLocation\" value=\"d:\\Commands.xsd\">\n                <namespaces>\n                    <namespace prefix=\"xsi\" uri=\"http://www.w3.org/2001/XMLSchema-instance\" />\n                </namespaces>\n            </xmlpoke>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPokeTask.ExecuteTask\">\n            <summary>\n            Executes the XML poke task.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPokeTask.LoadDocument(System.String)\">\n            <summary>\n            Loads an XML document from a file on disk.\n            </summary>\n            <param name=\"fileName\">\n            The file name of the file to load the XML document from.\n            </param>\n            <returns>\n            An <see cref=\"T:System.Xml.XmlDocument\"/> containing\n            the document object model representing the file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPokeTask.SelectNodes(System.String,System.Xml.XmlDocument,System.Xml.XmlNamespaceManager)\">\n            <summary>\n            Given an XML document and an expression, returns a list of nodes\n            which match the expression criteria.\n            </summary>\n            <param name=\"xpath\">\n            The XPath expression used to select the nodes.\n            </param>\n            <param name=\"document\">\n            The XML document that is searched.\n            </param>\n            <param name=\"nsMgr\">\n            An <see cref=\"T:System.Xml.XmlNamespaceManager\"/> to use for resolving namespaces \n            for prefixes in the XPath expression.\n            </param>\n            <returns>\n            An <see cref=\"T:System.Xml.XmlNodeList\"/> containing references to the nodes \n            that matched the XPath expression.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPokeTask.UpdateNodes(System.Xml.XmlNodeList,System.String)\">\n            <summary>\n            Given a node list, replaces the XML within those nodes.\n            </summary>\n            <param name=\"nodes\">\n            The list of nodes to replace the contents of.\n            </param>\n            <param name=\"value\">\n            The text to replace the contents with.\n            </param>\n        </member>\n        <member name=\"M:NAnt.Core.Tasks.XmlPokeTask.SaveDocument(System.Xml.XmlDocument,System.String)\">\n            <summary>\n            Saves the XML document to a file.\n            </summary>\n            <param name=\"document\">The XML document to be saved.</param>\n            <param name=\"fileName\">The file name to save the XML document under.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPokeTask.XmlFile\">\n            <summary>\n            The name of the file that contains the XML document that is going \n            to be poked.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPokeTask.XPath\">\n            <summary>\n            The XPath expression used to select which nodes are to be modified.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPokeTask.Value\">\n            <summary>\n            The value that replaces the contents of the selected nodes.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Tasks.XmlPokeTask.Namespaces\">\n            <summary>\n            Namespace definitions to resolve prefixes in the XPath expression.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.Argument\">\n            <summary>\n            Represents a command-line argument.\n            </summary>\n            <remarks>\n              <para>\n              When passed to an external application, the argument will be quoted\n              when appropriate. This does not apply to the <see cref=\"P:NAnt.Core.Types.Argument.Line\"/>\n              parameter, which is always passed as is.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              A single command-line argument containing a space character.\n              </para>\n              <code>\n                <![CDATA[\n            <arg value=\"-l -a\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Two separate command-line arguments.\n              </para>\n              <code>\n                <![CDATA[\n            <arg line=\"-l -a\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              A single command-line argument with the value <c>\\dir;\\dir2;\\dir3</c>\n              on DOS-based systems and <c>/dir:/dir2:/dir3</c> on Unix-like systems.\n              </para>\n              <code>\n                <![CDATA[\n            <arg path=\"/dir;/dir2:\\dir3\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Argument\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Argument\"/> class\n            with the specified command-line argument.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.#ctor(System.IO.FileInfo)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Argument\"/> class\n            with the given file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.#ctor(NAnt.Core.Types.PathSet)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Argument\"/> class\n            with the given path.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.ToString\">\n            <summary>\n            Returns the argument as a <see cref=\"T:System.String\"/>.\n            </summary>\n            <returns>\n            The argument as a <see cref=\"T:System.String\"/>.\n            </returns>\n            <remarks>\n            File and individual path elements will be quoted if necessary.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Argument.QuoteArgument(System.String)\">\n            <summary>\n            Quotes a command line argument if it contains a single quote or a\n            space.\n            </summary>\n            <param name=\"argument\">The command line argument.</param>\n            <returns>\n            A quoted command line argument if <paramref name=\"argument\" /> \n            contains a single quote or a space; otherwise, \n            <paramref name=\"argument\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.Value\">\n            <summary>\n            A single command-line argument; can contain space characters.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.File\">\n            <summary>\n            The name of a file as a single command-line argument; will be \n            replaced with the absolute filename of the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.Directory\">\n            <summary>\n            The value for a directory-based command-line argument; will be\n            replaced with the absolute path of the directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.Path\">\n            <summary>\n            The value for a PATH-like command-line argument; you can use \n            <c>:</c> or <c>;</c> as path separators and NAnt will convert it \n            to the platform's local conventions, while resolving references to \n            environment variables.\n            </summary>\n            <remarks>\n            Individual parts will be replaced with the absolute path, resolved\n            relative to the project base directory.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.PathSet\">\n            <summary>\n            Sets a single command-line argument and treats it like a PATH - ensures \n            the right separator for the local platform is used.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.Line\">\n            <summary>\n            List of command-line arguments; will be passed to the executable\n            as is.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.IfDefined\">\n            <summary>\n            Indicates if the argument should be passed to the external program. \n            If <see langword=\"true\" /> then the argument will be passed; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.UnlessDefined\">\n            <summary>\n            Indicates if the argument should not be passed to the external \n            program. If <see langword=\"false\" /> then the argument will be \n            passed; otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Argument.StringValue\">\n            <summary>\n            Gets string value corresponding with the argument.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.ArgumentCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.Argument\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.#ctor(NAnt.Core.Types.ArgumentCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.#ctor(NAnt.Core.Types.Argument[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.Argument\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.Add(NAnt.Core.Types.Argument)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.Argument\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Argument\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.AddRange(NAnt.Core.Types.Argument[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.Argument\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.Argument\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.AddRange(NAnt.Core.Types.ArgumentCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.Contains(NAnt.Core.Types.Argument)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Argument\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Argument\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Argument\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.Argument\"/> with value \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.CopyTo(NAnt.Core.Types.Argument[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.IndexOf(NAnt.Core.Types.Argument)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.Argument\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Argument\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.Argument\"/>. If the <see cref=\"T:NAnt.Core.Types.Argument\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.Insert(System.Int32,NAnt.Core.Types.Argument)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.Argument\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Argument\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.ArgumentEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentCollection.Remove(NAnt.Core.Types.Argument)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Argument\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.ArgumentCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.ArgumentCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.Argument\"/> with the specified value.\n            </summary>\n            <param name=\"value\">The value of the <see cref=\"T:NAnt.Core.Types.Argument\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.ArgumentEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.Argument\"/> elements of a <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentEnumerator.#ctor(NAnt.Core.Types.ArgumentCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.ArgumentEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.ArgumentCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ArgumentEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.ArgumentEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.Credential\">\n            <summary>\n            Provides credentials for password-based authentication schemes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Credential.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Credential\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Credential.GetCredential\">\n            <summary>\n            Returns a <see cref=\"T:System.Net.NetworkCredential\"/> instance representing\n            the current <see cref=\"T:NAnt.Core.Types.Credential\"/>.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.Net.NetworkCredential\"/> instance representing the current \n            <see cref=\"T:NAnt.Core.Types.Credential\"/>, or <see langword=\"null\"/> if the \n            credentials should not be used to provide authentication information\n            to the external resource.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Credential.Domain\">\n            <summary>\n            The domain or computer name that verifies the credentials.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Credential.Password\">\n            <summary>\n            The password for the user name associated with the credentials.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Credential.UserName\">\n            <summary>\n            The user name associated with the credentials. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Credential.IfDefined\">\n            <summary>\n            Indicates if the credentials should be used to provide authentication\n            information to the external resource. If <see langword=\"true\" /> then \n            the credentials will be passed; otherwise, not. The default is \n            <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Credential.UnlessDefined\">\n            <summary>\n            Indicates if the credentials should not be used to provide authentication\n            information to the external resource. If <see langword=\"false\" /> then the \n            credentials will be passed; otherwise, not. The default is \n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.DirSet\">\n            <summary>\n            A specialized <see cref=\"T:NAnt.Core.Types.FileSet\"/> used for specifying a set of \n            directories.\n            </summary>\n            <remarks>\n            Hint for supporting tasks that the included directories instead of \n            files should be used.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Types.FileSet\">\n            <summary>\n            Filesets are groups of files.  These files can be found in a directory \n            tree starting in a base directory and are matched by patterns taken \n            from a number of patterns.  Filesets can appear inside tasks that support \n            this feature or at the project level, i.e., as children of <c>&lt;project&gt;</c>.\n            </summary>\n            <remarks>\n            <h3>Patterns</h3>\n            <para>\n            As described earlier, patterns are used for the inclusion and exclusion. \n            These patterns look very much like the patterns used in DOS and UNIX:\n            </para>\n            <list type=\"bullet\">\n                <item>\n                    <description>\n                        <para>'<c>*</c>' matches zero or more characters</para>\n                        <para>For example:</para>\n                        <para>\n                        <c>*.cs</c> matches <c>.cs</c>, <c>x.cs</c> and <c>FooBar.cs</c>, \n                        but not <c>FooBar.xml</c> (does not end with <c>.cs</c>).\n                        </para>\n                    </description>\n                </item>\n                <item>\n                    <description>\n                        <para>'<c>?</c>' matches one character</para>\n                        <para>For example:</para>\n                        <para>\n                        <c>?.cs</c> matches <c>x.cs</c>, <c>A.cs</c>, but not \n                        <c>.cs</c> or <c>xyz.cs</c> (both don't have one character\n                        before <c>.cs</c>).\n                        </para>\n                    </description>\n                </item>\n            </list>\n            <para>\n            Combinations of <c>*</c>'s and <c>?</c>'s are allowed.\n            </para>\n            <para>\n            Matching is done per-directory. This means that first the first directory \n            in the pattern is matched against the first directory in the path to match. \n            Then the second directory is matched, and so on. For example, when we have \n            the pattern <c>/?abc/*/*.cs</c> and the path <c>/xabc/foobar/test.cs</c>, \n            the first <c>?abc</c> is matched with <c>xabc</c>, then <c>*</c> is matched \n            with <c>foobar</c>, and finally <c>*.cs</c> is matched with <c>test.cs</c>. \n            They all match, so the path matches the pattern.\n            </para>\n            <para>\n            To make things a bit more flexible, we added one extra feature, which makes \n            it possible to match multiple directory levels. This can be used to match a \n            complete directory tree, or a file anywhere in the directory tree. To do this, \n            <c>**</c> must be used as the name of a directory. When <c>**</c> is used as \n            the name of a directory in the pattern, it matches zero or more directories. \n            For example: <c>/test/**</c> matches all files/directories under <c>/test/</c>, \n            such as <c>/test/x.cs</c>, or <c>/test/foo/bar/xyz.html</c>, but not <c>/xyz.xml</c>.\n            </para>\n            <para>\n            There is one \"shorthand\" - if a pattern ends with <c>/</c> or <c>\\</c>, then \n            <c>**</c> is appended. For example, <c>mypackage/test/</c> is interpreted as \n            if it were <c>mypackage/test/**</c>.\n            </para>\n            <h3>Case-Sensitivity</h3>\n            <para>\n            By default, pattern matching is case-sensitive on Unix and case-insensitive\n            on other platforms. The <see cref=\"P:NAnt.Core.Types.FileSet.CaseSensitive\"/> parameter can be used\n            to override this.\n            </para>\n            <h3>Default Excludes</h3>\n            <para>\n            There are a set of definitions that are excluded by default from all \n            tasks that use filesets. They are:\n            </para>\n            <list type=\"bullet\">\n                <item>\n                    <description>\n                    **/*~\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/#*#\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/.#*\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/%*%\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/CVS\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/CVS/**\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/.cvsignore\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/.svn\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/.svn/**\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/_svn\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/_svn/**\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/SCCS\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/SCCS/**\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/vssver.scc\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/vssver2.scc\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    **/_vti_cnf/**\n                    </description>\n                </item>\n            </list>\n            <para>\n            If you do not want these default excludes applied, you may disable them \n            by setting <see cref=\"P:NAnt.Core.Types.FileSet.DefaultExcludes\"/> to <see langword=\"false\"/>.\n            </para>\n            </remarks>\n            <example>\n            <list type=\"table\">\n                <listheader>\n                    <term>Pattern</term>\n                    <description>Match</description>\n                </listheader>\n                <item>\n                    <term><c>**/CVS/*</c></term>\n                    <description>\n                        <para>\n                        Matches all files in <c>CVS</c> directories that can be \n                        located anywhere in the directory tree.\n                        </para>\n                        <para>Matches:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>CVS/Repository</description>\n                            </item>\n                            <item>\n                                <description>org/apache/CVS/Entries</description>\n                            </item>\n                            <item>\n                                <description>org/apache/jakarta/tools/ant/CVS/Entries</description>\n                            </item>\n                        </list>\n                        <para>But not:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>org/apache/CVS/foo/bar/Entries (<c>foo/bar/</c> part does not match)</description>\n                            </item>\n                        </list>\n                    </description>\n                </item>\n                <item>\n                    <term><c>org/apache/jakarta/**</c></term>\n                    <description>\n                        <para>\n                        Matches all files in the <c>org/apache/jakarta</c> directory \n                        tree.\n                        </para>\n                        <para>Matches:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>org/apache/jakarta/tools/ant/docs/index.html</description>\n                            </item>\n                            <item>\n                                <description>org/apache/jakarta/test.xml</description>\n                            </item>\n                        </list>\n                        <para>But not:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>org/apache/xyz.java (<c>jakarta/</c> part is missing)</description>\n                            </item>\n                        </list>\n                    </description>\n                </item>\n                <item>\n                    <term><c>org/apache/**/CVS/*</c></term>\n                    <description>\n                        <para>\n                        Matches all files in <c>CVS</c> directories that are located \n                        anywhere in the directory tree under <c>org/apache</c>.\n                        </para>\n                        <para>Matches:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>org/apache/CVS/Entries</description>\n                            </item>\n                            <item>\n                                <description>org/apache/jakarta/tools/ant/CVS/Entries</description>\n                            </item>\n                        </list>\n                        <para>But not:</para>\n                        <list type=\"bullet\">\n                            <item>\n                                <description>org/apache/CVS/foo/bar/Entries (<c>foo/bar/</c> part does not match)</description>\n                            </item>\n                        </list>\n                    </description>\n                </item>\n                <item>\n                    <term><c>**/test/**</c></term>\n                    <description>\n                        <para>\n                        Matches all files that have a <c>test</c> element in their \n                        path, including <c>test</c> as a filename.\n                        </para>\n                    </description>\n                </item>\n            </list>\n            </example>\n            <seealso cref=\"T:NAnt.Core.Types.PatternSet\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.FileSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.#ctor(NAnt.Core.Types.FileSet)\">\n            <summary>\n            copy constructor\n            </summary>\n            <param name=\"fs\"></param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.AddPatternSet(NAnt.Core.Types.PatternSet)\">\n            <summary>\n            Adds a nested set of patterns, or references a standalone patternset.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.CopyTo(NAnt.Core.Types.FileSet)\">\n            <summary>\n            Copies all instance data of the <see cref=\"T:NAnt.Core.Types.FileSet\"/> to a given\n            <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.FindMoreRecentLastWriteTime(System.String,System.DateTime)\">\n            <summary>\n            Determines if a file has a more recent last write time than the \n            given time, or no longer exists.\n            </summary>\n            <param name=\"fileName\">A file to check the last write time against.</param>\n            <param name=\"targetLastWriteTime\">The datetime to compare against.</param>\n            <returns>\n            The name of the file that has a last write time greater than \n            <paramref name=\"targetLastWriteTime\" /> or that no longer exists; \n            otherwise, <see langword=\"null\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FileSet.FindMoreRecentLastWriteTime(System.Collections.Specialized.StringCollection,System.DateTime)\">\n            <summary>\n            Determines if one of the given files has a more recent last write \n            time than the given time. If one of the given files no longer exists,\n            the target will be considered out-of-date.\n            </summary>\n            <param name=\"fileNames\">A collection of filenames to check the last write time against.</param>\n            <param name=\"targetLastWriteTime\">The datetime to compare against.</param>\n            <returns>\n            The name of the first file that has a last write time greater than \n            <paramref name=\"targetLastWriteTime\" />; otherwise, null.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.CaseSensitive\">\n            <summary>\n            Indicates whether include and exclude patterns must be treated in a\n            case-sensitive way. The default is <see langword=\"true\" /> on Unix;\n            otherwise, <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.FailOnEmpty\">\n            <summary>\n            When set to <see langword=\"true\"/>, causes the fileset element to \n            throw a <see cref=\"T:NAnt.Core.ValidationException\"/> when no files match the \n            includes and excludes criteria. The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.DefaultExcludes\">\n            <summary>\n            Indicates whether default excludes should be used or not. \n            The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.BaseDirectory\">\n            <summary>\n            The base of the directory of this fileset. The default is the project \n            base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Includes\">\n            <summary>\n            Gets the collection of include patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Excludes\">\n            <summary>\n            Gets the collection of exclude patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.AsIs\">\n            <summary>\n            Gets the collection of files that will be added to the \n            <see cref=\"T:NAnt.Core.Types.FileSet\"/> without pattern matching or checking if the \n            file exists.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.FileNames\">\n            <summary>\n            Gets the collection of file names that match the fileset.\n            </summary>\n            <value>\n            A collection that contains the file names that match the \n            <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.DirectoryNames\">\n            <summary>\n            Gets the collection of directory names that match the fileset.\n            </summary>\n            <value>\n            A collection that contains the directory names that match the \n            <see cref=\"T:NAnt.Core.Types.FileSet\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ScannedDirectories\">\n            <summary>\n            Gets the collection of directory names that were scanned for files.\n            </summary>\n            <value>\n            A collection that contains the directory names that were scanned for\n            files.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.SetIncludes\">\n            <summary>\n            The items to include in the fileset.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludeElements\">\n            <summary>\n            The items to include in the fileset.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.SetExcludes\">\n            <summary>\n            The items to exclude from the fileset.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludeElements\">\n            <summary>\n            The items to exclude from the fileset.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.SetIncludesList\">\n            <summary>\n            The files from which a list of patterns or files to include should \n            be obtained.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludesFiles\">\n            <summary>\n            The files from which a list of patterns or files to include should\n            be obtained.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludesFiles\">\n            <summary>\n            The files from which a list of patterns or files to exclude should\n            be obtained.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.MostRecentLastWriteTimeFile\">\n            <summary>\n            Determines the most recently modified file in the fileset (by LastWriteTime of the <see cref=\"T:System.IO.FileInfo\"/>).\n            </summary>\n            <returns>\n            The <see cref=\"T:System.IO.FileInfo\"/> of the file that has the newest (closest to present) last write time.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Exclude.Pattern\">\n            <summary>\n            The pattern or file name to exclude.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Exclude.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the pattern will be excluded; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Exclude.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Types.FileSet.Exclude.IfDefined\"/>. If <see langword=\"false\"/> \n            then the pattern will be excluded; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Include.AsIs\">\n            <summary>\n            If <see langword=\"true\"/> then the file name will be added to \n            the <see cref=\"T:NAnt.Core.Types.FileSet\"/> without pattern matching or checking \n            if the file exists.  The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Include.FromPath\">\n            <summary>\n            If <see langword=\"true\" /> then the file will be searched for \n            on the path. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Include.Pattern\">\n            <summary>\n            The pattern or file name to include.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Include.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the pattern will be included; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.Include.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Types.FileSet.Include.IfDefined\"/>. If <see langword=\"false\"/> \n            then the pattern will be included; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludesFile.Patterns\">\n            <summary>\n            Gets the list of patterns in <see cref=\"P:NAnt.Core.Types.FileSet.ExcludesFile.PatternFile\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludesFile.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the patterns will be excluded; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludesFile.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Types.FileSet.ExcludesFile.IfDefined\"/>. If <see langword=\"false\"/> \n            then the patterns will be excluded; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.ExcludesFile.PatternFile\">\n            <summary>\n            The name of a file; each line of this file is taken to be a \n            pattern.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludesFile.AsIs\">\n            <summary>\n            If <see langword=\"true\"/> then the patterns in the include file \n            will be added to the <see cref=\"T:NAnt.Core.Types.FileSet\"/> without pattern \n            matching or checking if the file exists.  The default is \n            <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludesFile.FromPath\">\n            <summary>\n            If <see langword=\"true\" /> then the patterns in the include file\n            will be searched for on the path. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludesFile.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the patterns will be included;\n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FileSet.IncludesFile.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Types.FileSet.IncludesFile.IfDefined\"/>. If <see langword=\"false\"/> \n            then the patterns will be included; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.DirSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.DirSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.DirSet.#ctor(NAnt.Core.Types.FileSet)\">\n            <summary>\n            Copy constructor for <see cref=\"T:NAnt.Core.Types.FileSet\"/>. Required in order to \n            assign references of <see cref=\"T:NAnt.Core.Types.FileSet\"/> type where \n            <see cref=\"T:NAnt.Core.Types.DirSet\"/> is used.\n            </summary>\n            <param name=\"fs\">A <see cref=\"T:NAnt.Core.Types.FileSet\"/> instance to create a <see cref=\"T:NAnt.Core.Types.DirSet\"/> from.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.EnvironmentVariable\">\n            <summary>\n            Represents an environment variable.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariable.#ctor(System.String,System.String)\">\n            <summary>\n            Initializes a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> instance with the\n            specified name and value.\n            </summary>\n            <param name=\"name\">The name of the environment variable.</param>\n            <param name=\"value\">The value of the environment variable.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariable.#ctor\">\n            <summary>\n            Initializes a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> instance.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.VariableName\">\n            <summary>\n            The name of the environment variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.LiteralValue\">\n            <summary>\n            The literal value for the environment variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.File\">\n            <summary>\n            The value for a file-based environment variable. NAnt will convert \n            it to an absolute filename.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.Directory\">\n            <summary>\n            The value for a directory-based environment variable. NAnt will \n            convert it to an absolute path.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.Path\">\n            <summary>\n            The value for a PATH like environment variable. You can use \n            <c>:</c> or <c>;</c> as path separators and NAnt will convert it to \n            the platform's local conventions.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.PathSet\">\n            <summary>\n            Sets a single environment variable and treats it like a PATH - \n            ensures the right separator for the local platform is used.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.Value\">\n            <summary>\n            Gets the value of the environment variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.IfDefined\">\n            <summary>\n            Indicates if the environment variable should be passed to the \n            external program.  If <see langword=\"true\" /> then the environment\n            variable will be passed;  otherwise, skipped. The default is \n            <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariable.UnlessDefined\">\n            <summary>\n            Indicates if the environment variable should not be passed to the \n            external program.  If <see langword=\"false\" /> then the environment\n            variable will be passed;  otherwise, skipped. The default is \n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.EnvironmentSet\">\n            <summary>\n            A set of environment variables.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentSet.Options\">\n            <summary>\n            Environment variable to pass to a program.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentSet.EnvironmentVariables\">\n            <summary>\n            Environment variable to pass to a program.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.EnvironmentVariableCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.#ctor(NAnt.Core.Types.EnvironmentVariableCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.#ctor(NAnt.Core.Types.EnvironmentVariable[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.Add(NAnt.Core.Types.EnvironmentVariable)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.AddRange(NAnt.Core.Types.EnvironmentVariable[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.AddRange(NAnt.Core.Types.EnvironmentVariableCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.Contains(NAnt.Core.Types.EnvironmentVariable)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> with value \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.CopyTo(NAnt.Core.Types.EnvironmentVariable[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.IndexOf(NAnt.Core.Types.EnvironmentVariable)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/>. If the <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.Insert(System.Int32,NAnt.Core.Types.EnvironmentVariable)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.EnvironmentVariableEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableCollection.Remove(NAnt.Core.Types.EnvironmentVariable)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariableCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariableCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> with the specified name.\n            </summary>\n            <param name=\"name\">The name of the <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.EnvironmentVariableEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.EnvironmentVariable\"/> elements of a <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableEnumerator.#ctor(NAnt.Core.Types.EnvironmentVariableCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.EnvironmentVariableEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.EnvironmentVariableCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.EnvironmentVariableEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.EnvironmentVariableEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Formatter.Property\">\n            <summary>\n            The name of the NAnt property to set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Formatter.Pattern\">\n            <summary>\n            The string pattern to use to format the property.\n            </summary>       \n        </member>\n        <member name=\"P:NAnt.Core.Types.Formatter.IfDefined\">\n            <summary>\n            Indicates if the formatter should be used to format the timestamp.\n            If <see langword=\"true\" /> then the formatter will be used; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Formatter.UnlessDefined\">\n            <summary>\n            Indicates if the formatter should be not used to format the \n            timestamp. If <see langword=\"false\" /> then the formatter will be \n            used; otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.FormatterCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.Formatter\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.#ctor(NAnt.Core.Types.FormatterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.#ctor(NAnt.Core.Types.Formatter[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.Formatter\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.Add(NAnt.Core.Types.Formatter)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.Formatter\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Formatter\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.AddRange(NAnt.Core.Types.Formatter[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.Formatter\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.Formatter\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.AddRange(NAnt.Core.Types.FormatterCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.Contains(NAnt.Core.Types.Formatter)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Formatter\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Formatter\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.CopyTo(NAnt.Core.Types.Formatter[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.IndexOf(NAnt.Core.Types.Formatter)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.Formatter\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Formatter\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.Formatter\"/>. If the <see cref=\"T:NAnt.Core.Types.Formatter\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.Insert(System.Int32,NAnt.Core.Types.Formatter)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.Formatter\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Formatter\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.FormatterEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterCollection.Remove(NAnt.Core.Types.Formatter)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Formatter\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FormatterCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.FormatterEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.Formatter\"/> elements of a <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterEnumerator.#ctor(NAnt.Core.Types.FormatterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.FormatterEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.FormatterCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.FormatterEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.FormatterEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.ManagedExecution\">\n            <summary>\n            Specifies the execution mode for managed applications.\n            </summary>\n            <remarks>\n              <para>\n              For backward compatibility, the following string values can also be\n              used in build files:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Value</term>\n                  <description>Corresponding field</description>\n                </listheader>\n                <item>\n                  <term>\"true\"</term>\n                  <description><see cref=\"F:NAnt.Core.Types.ManagedExecution.Auto\"/></description>\n                </item>\n                <item>\n                  <term>\"false\"</term>\n                  <description><see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/></description>\n                </item>\n              </list>\n              <para>\n              Even if set to <see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/>, the operating system can still\n              run the program as a managed application.\n              </para>\n              <para>On Linux this can be done through <b>binfmt_misc</b>, while on\n              Windows installing the .NET Framework redistributable caused managed\n              applications to run on the MS CLR by default.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Types.ManagedExecution.Default\">\n            <summary>\n            Do not threat the program as a managed application.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Types.ManagedExecution.Auto\">\n            <summary>\n            Leave it up to the CLR to determine which specific version of\n            the CLR will be used to run the application.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Types.ManagedExecution.Strict\">\n            <summary>\n            Forces an application to run against the currently targeted\n            version of a given CLR.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.ManagedExecutionConverter\">\n            <summary>\n            Specialized <see cref=\"T:System.ComponentModel.EnumConverter\"/> that also supports \n            case-insensitive conversion of \"true\" to \n            <see cref=\"F:NAnt.Core.Types.ManagedExecution.Auto\"/> and \"false\" to\n            <see cref=\"F:NAnt.Core.Types.ManagedExecution.Default\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ManagedExecutionConverter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.ManagedExecutionConverter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.ManagedExecutionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)\">\n            <summary>\n            Converts the given object to the type of this converter, using the \n            specified context and culture information.\n            </summary>\n            <param name=\"context\">An <see cref=\"T:System.ComponentModel.ITypeDescriptorContext\"/> that provides a format context.</param>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/> object. If a <see langword=\"null\"/> is passed, the current culture is assumed.</param>\n            <param name=\"value\">The <see cref=\"T:System.Object\"/> to convert.</param>\n            <returns>\n            An <see cref=\"T:System.Object\"/> that represents the converted value.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.Option\">\n            <summary>\n            Represents an option.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Option.#ctor(System.String,System.String)\">\n            <summary>\n            name, value constructor\n            </summary>\n            <param name=\"name\"></param>\n            <param name=\"value\"></param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Option.#ctor\">\n            <summary>\n            Default constructor\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Option.OptionName\">\n            <summary>\n            Name of the option.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Option.Value\">\n            <summary>\n            Value of the option. The default is <see langword=\"null\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Option.IfDefined\">\n            <summary>\n            Indicates if the option should be passed to the task. \n            If <see langword=\"true\" /> then the option will be passed; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Option.UnlessDefined\">\n            <summary>\n            Indicates if the option should not be passed to the task.\n            If <see langword=\"false\" /> then the option will be passed; \n            otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.OptionCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.Option\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.#ctor(NAnt.Core.Types.OptionCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.#ctor(NAnt.Core.Types.Option[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.Option\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.Add(NAnt.Core.Types.Option)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.Option\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Option\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.AddRange(NAnt.Core.Types.Option[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.Option\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.Option\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.AddRange(NAnt.Core.Types.OptionCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.OptionCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.Contains(NAnt.Core.Types.Option)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Option\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Option\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Option\"/> for the specified \n            task is in the collection.\n            </summary>\n            <param name=\"taskName\">The name of task for which the <see cref=\"T:NAnt.Core.Types.Option\"/> should be located in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.Option\"/> for the specified \n            task is found in the collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.CopyTo(NAnt.Core.Types.Option[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.IndexOf(NAnt.Core.Types.Option)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.Option\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Option\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.Option\"/>. If the <see cref=\"T:NAnt.Core.Types.Option\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.Insert(System.Int32,NAnt.Core.Types.Option)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.Option\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Option\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.OptionEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionCollection.Remove(NAnt.Core.Types.Option)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Option\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.OptionCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.OptionCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.Option\"/> with the specified name.\n            </summary>\n            <param name=\"name\">The name of the option that should be located in the collection.</param> \n        </member>\n        <member name=\"T:NAnt.Core.Types.OptionEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.Option\"/> elements of a <see cref=\"T:NAnt.Core.Types.OptionCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionEnumerator.#ctor(NAnt.Core.Types.OptionCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.OptionEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.OptionCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.OptionEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.OptionEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.PathElement\">\n            <summary>\n            Represents a nested path element.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.File\">\n            <summary>\n            The name of a file to add to the path. Will be replaced with \n            the absolute path of the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.Directory\">\n            <summary>\n            The name of a directory to add to the path. Will be replaced with \n            the absolute path of the directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.Path\">\n            <summary>\n            A string that will be treated as a path-like string. You can use\n            <c>:</c> or <c>;</c> as path separators and NAnt will convert it \n            to the platform's local conventions, while resolving references\n            to environment variables.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the entry will be added to the\n            path; otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.UnlessDefined\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Types.PathElement.IfDefined\"/>. If <see langword=\"false\"/> \n            then the entry will be added to the path; otherwise, skipped. \n            The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PathElement.Parts\">\n            <summary>\n            Gets the parts of a path represented by this element.\n            </summary>\n            <value>\n            A <see cref=\"T:System.Collections.Specialized.StringCollection\"/> containing the parts of a path \n            represented by this element.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Types.PathSet\">\n            <summary>\n            <para>\n            Paths are groups of files and/or directories that need to be passed as a single\n            unit. The order in which parts of the path are specified in the build file is \n            retained, and duplicate parts are automatically suppressed.\n            </para>\n            </summary>\n            <example>\n              <para>\n              Define a global <c>&lt;path&gt;</c> that can be referenced by other\n              tasks or types.\n              </para>\n              <code>\n                <![CDATA[\n                    <path id=\"includes-path\">\n                        <pathelement path=\"%INCLUDE%\" />\n                        <pathelement dir=\"${build.dir}/include\" />\n                    </path>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.PathSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.#ctor(NAnt.Core.Project,System.String)\">\n            <summary>\n            Invoked by <see cref=\"T:NAnt.Core.Element.AttributeConfigurator\"/> for build \n            attributes with an underlying <see cref=\"T:NAnt.Core.Types.PathSet\"/> type.\n            </summary>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> to be used to resolve relative paths.</param>\n            <param name=\"path\">The string representing a path.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.ToString\">\n            <summary>\n            Returns a textual representation of the path, which can be used as\n            PATH environment variable definition.\n            </summary>\n            <returns>\n            A textual representation of the path.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.AddPath(NAnt.Core.Types.PathSet)\">\n            <summary>\n            Defines a set of path elements to add to the current path.\n            </summary>\n            <param name=\"path\">The <see cref=\"T:NAnt.Core.Types.PathSet\"/> to add.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.AddPathElement(NAnt.Core.Types.PathElement)\">\n            <summary>\n            Defines a path element to add to the current path.\n            </summary>\n            <param name=\"pathElement\">The <see cref=\"T:NAnt.Core.Types.PathElement\"/> to add.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.GetElements\">\n            <summary>\n            Returns all path elements defined by this path object.\n            </summary>\n            <returns>\n            A list of path elements.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PathSet.TranslatePath(NAnt.Core.Project,System.String)\">\n            <summary>\n            Splits a PATH (with ; or : as separators) into its parts, while \n            resolving references to environment variables.\n            </summary>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> to be used to resolve relative paths.</param>\n            <param name=\"source\">The path to translate.</param>\n            <returns>\n            A PATH split up its parts, with references to environment variables\n            resolved and duplicate entries removed.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Pattern.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Pattern\"/> class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Pattern.PatternName\">\n            <summary>\n            The name pattern to include/exclude.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Pattern.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the pattern will be used; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Pattern.UnlessDefined\">\n            <summary>\n            If <see langword=\"false\" /> then the pattern will be used;\n            otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.PatternCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.Pattern\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.PatternCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.Clear\">\n            <summary>\n            Removes all items from the <see cref=\"T:NAnt.Core.Types.PatternCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.Add(NAnt.Core.Types.Pattern)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.Pattern\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Pattern\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.AddRange(NAnt.Core.Types.Pattern[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.Pattern\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.Pattern\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.AddRange(NAnt.Core.Types.PatternCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.PatternCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.PatternCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.Contains(NAnt.Core.Types.Pattern)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.Pattern\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Pattern\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.CopyTo(NAnt.Core.Types.Pattern[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array,\n            starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.IndexOf(NAnt.Core.Types.Pattern)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.Pattern\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Pattern\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.Pattern\"/>. If the <see cref=\"T:NAnt.Core.Types.Pattern\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.Insert(System.Int32,NAnt.Core.Types.Pattern)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.Pattern\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Pattern\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.PatternEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternCollection.Remove(NAnt.Core.Types.Pattern)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.Pattern\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.PatternEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.Pattern\"/> elements of a <see cref=\"T:NAnt.Core.Types.PatternCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternEnumerator.#ctor(NAnt.Core.Types.PatternCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.PatternEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.PatternCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternEnumerator.System#Collections#IEnumerator#Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.PatternSet\">\n            <summary>\n            A set of patterns, mostly used to include or exclude certain files.\n            </summary>\n            <remarks>\n              <para>\n              The individual patterns support <c>if</c> and <c>unless</c> attributes\n              to specify that the element should only be used if or unless a given\n              condition is met.\n              </para>\n              <para>\n              The <see cref=\"P:NAnt.Core.Types.PatternSet.IncludesFile\"/> and <see cref=\"P:NAnt.Core.Types.PatternSet.ExcludesFile\"/>\n              elements load patterns from a file. When the file is a relative path,\n              it will be resolved relative to the project base directory in which\n              the patternset is defined. Each line of this file is taken to be a\n              pattern.\n              </para>\n              <para>\n              The number sign (#) as the first non-blank character in a line denotes\n              that all text following it is a comment:\n              </para>\n              <code>\n                <![CDATA[\n                   EventLog.cs\n                   # requires Mono.Posix\n                   SysLogEventLogImpl.cs\n                   # uses the win32 eventlog API\n                   Win32EventLogImpl.cs\n                ]]>\n              </code>\n              <para>\n              Patterns can be grouped to sets, and later be referenced by their\n              <see cref=\"P:NAnt.Core.DataTypeBase.ID\"/>.\n              </para>\n              <para>\n              When used as a standalone element (global type), any properties that\n              are referenced will be resolved when the definition is processed, not\n              when it actually used. Passing a reference to a nested build file \n              will not cause the properties to be re-evaluated.\n              </para>\n              <para>\n              To improve reuse of globally defined patternsets, avoid referencing\n              any properties altogether.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Define a set of patterns that matches all .cs files that do not contain\n              the text <c>Test</c> in their name.\n              </para>\n              <code>\n                <![CDATA[\n                    <patternset id=\"non.test.sources\">\n                        <include name=\"**/*.cs\" />\n                        <exclude name=\"**/*Test*\" />\n                    </patternset>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Define two sets. One holding C# sources, and one holding VB sources.\n              Both sets only include test sources when the <c>test</c> property is\n              set. A third set combines both C# and VB sources.\n              </para>\n              <code>\n                <![CDATA[\n                    <patternset id=\"cs.sources\">\n                        <include name=\"src/**/*.cs\" />\n                        <include name=\"test/**/*.cs\" if=${property::exist('test')}\" />\n                    </patternset>\n                    \n                    <patternset id=\"vb.sources\">\n                        <include name=\"src/**/*.vb\" />\n                        <include name=\"test/**/*.vb\" if=${property::exist('test')}\" />\n                    </patternset>\n                    \n                    <patternset id=\"all.sources\">\n                        <patternset refid=\"cs.sources\" />\n                        <patternset refid=\"vb.sources\" />\n                    </patternset>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Define a set from patterns in a file.\n              </para>\n              <code>\n                <![CDATA[\n                    <patternset id=\"sources\">\n                        <includesfile name=\"test.sources\" />\n                        <includesfile name=\"non.test.sources\" />\n                    </patternset>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Defines a patternset with patterns that are loaded from an external\n              file, and shows the behavior when that patternset is passed as a\n              reference to a nested build script.\n              </para>\n              <para>\n              External file \"c:\\foo\\build\\service.lst\" holding patterns\n              of source files to include for the Foo.Service assembly:\n              </para>\n              <code>\n                <![CDATA[\n                    AssemblyInfo.cs\n                    *Channel.cs\n                    ServiceFactory.cs]]></code>\n              <para>\n              Main build script located in \"c:\\foo\\default.build\":\n              </para>\n              <code>\n                <![CDATA[\n                    <project name=\"main\" default=\"build\">\n                        <property name=\"build.debug\" value=\"true\" />\n                    \n                        <patternset id=\"service.sources\">\n                            <include name=\"TraceListener.cs\" if=\"${build.debug}\" />\n                            <includesfile name=\"build/service.lst\" />\n                        </patternset>\n                        \n                        <property name=\"build.debug\" value=\"false\" />\n                        \n                        <target name=\"build\">\n                            <nant buildfile=\"service/default.build\" inheritrefs=\"true\" />\n                        </target>\n                    </project>]]></code>\n              <para>\n              Nested build script located in \"c:\\foo\\services\\default.build\"\n              which uses the patternset to feed sources files to the C# compiler:\n              </para>\n              <code>\n                <![CDATA[\n                    <project name=\"service\" default=\"build\">\n                        <target name=\"build\">\n                            <csc output=\"../bin/Foo.Service.dll\" target=\"library\">\n                                <fileset basedir=\"src\">\n                                    <patternset refid=\"service.sources\" />\n                                </fileset>\n                            </csc>\n                        </target>\n                    </project>]]></code>\n              <para>\n              At the time when the patternset is used in the \"service\"\n              build script, the following source files in \"c:\\foo\\services\\src\"\n              match the defined patterns:\n              </para>\n              <code>\n                <![CDATA[\n                    AssemblyInfo.cs\n                    MsmqChannel.cs\n                    SmtpChannel.cs\n                    ServiceFactory.cs\n                    TraceListener.cs]]></code>\n              <para>\n              You should have observed that:\n              </para>\n              <list type=\"bullet\">\n                <item>\n                    <description>\n                    although the patternset is used from the \"service\"\n                    build script, the path to the external file is resolved relative\n                    to the base directory of the \"main\" build script in\n                    which the patternset is defined.\n                    </description>\n                </item>\n                <item>\n                    <description>\n                    the \"TraceListener.cs\" file is included, even though \n                    the \"build.debug\" property was changed to <b>false</b>\n                    after the patternset was defined (but before it was passed to\n                    the nested build, and used).\n                    </description>\n                </item>\n              </list>\n            </example>\n            <seealso cref=\"T:NAnt.Core.Types.FileSet\"/>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.PatternSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.PatternSet.Append(NAnt.Core.Types.PatternSet)\">\n            <summary>\n            Adds a nested set of patterns, or references other standalone \n            patternset.\n            </summary>\n            <param name=\"patternSet\">The <see cref=\"T:NAnt.Core.Types.PatternSet\"/> to add.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternSet.Include\">\n            <summary>\n            Defines a single pattern for files to include.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternSet.IncludesFile\">\n            <summary>\n            Loads multiple patterns of files to include from a given file, set\n            using the <see cref=\"P:NAnt.Core.Types.Pattern.PatternName\"/> parameter.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternSet.Exclude\">\n            <summary>\n            Defines a single pattern for files to exclude.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.PatternSet.ExcludesFile\">\n            <summary>\n            Loads multiple patterns of files to exclude from a given file, set\n            using the <see cref=\"P:NAnt.Core.Types.Pattern.PatternName\"/> parameter.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.Proxy\">\n            <summary>\n            Contains HTTP proxy settings used to process requests to Internet \n            resources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Proxy.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.Proxy\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.Proxy.GetWebProxy\">\n            <summary>\n            Gets a <see cref=\"T:System.Net.WebProxy\"/> instance representing the current\n            <see cref=\"T:NAnt.Core.Types.Proxy\"/>.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.Net.WebProxy\"/> instance representing the current \n            <see cref=\"T:NAnt.Core.Types.Proxy\"/>, or <see langword=\"GlobalProxySelection.Select\"/> \n            if this proxy should not be used to connect to the external resource.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.Host\">\n            <summary>\n            The name of the proxy host. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.Port\">\n            <summary>\n            The port number on <see cref=\"P:NAnt.Core.Types.Proxy.Host\"/> to use. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.BypassOnLocal\">\n            <summary>\n            Specifies whether to bypass the proxy server for local addresses.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.Credentials\">\n            <summary>\n            The credentials to submit to the proxy server for authentication.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.IfDefined\">\n            <summary>\n            Indicates if the proxy should be used to connect to the external \n            resource. If <see langword=\"true\" /> then the proxy will be used; \n            otherwise, not. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Proxy.UnlessDefined\">\n            <summary>\n            Indicates if the proxy should not be used to connect to the external\n            resource. If <see langword=\"false\" /> then the proxy will be used;\n            otherwise, not. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.RawXml\">\n            <summary>\n            Represents an element of which the XML is processed by its parent task \n            or type.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.RawXml.Xml\">\n            <summary>\n            Gets the XML that this element represents.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.RawXml.CustomXmlProcessing\">\n            <summary>\n            Gets a value indicating whether the element is performing additional\n            processing using the <see cref=\"T:System.Xml.XmlNode\"/> that was use to \n            initialize the element.\n            </summary>\n            <value>\n            <see langword=\"true\"/>, as the XML that represents this build \n            element is processed by the containing task or type.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Types.Token\">\n            <summary>\n            ReplaceTokens filter token.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Token.Key\">\n            <summary>\n            Token to be replaced.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Token.Value\">\n            <summary>\n            New value of token.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Token.IfDefined\">\n            <summary>\n            Indicates if the token should be used to replace values. \n            If <see langword=\"true\" /> then the token will be used; \n            otherwise, not. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.Token.UnlessDefined\">\n            <summary>\n            Indicates if the token should not be used to replace values.\n            If <see langword=\"false\" /> then the token will be used;\n            otherwise, not. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XmlNamespace\">\n            <summary>\n            Represents an XML namespace.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespace.Prefix\">\n            <summary>\n            The prefix to associate with the namespace.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespace.Uri\">\n            <summary>\n            The associated XML namespace URI.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespace.IfDefined\">\n            <summary>\n            Indicates if the namespace should be added to the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            If <see langword=\"true\"/> then the namespace will be added; \n            otherwise, skipped. The default is <see langword=\"true\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespace.UnlessDefined\">\n            <summary>\n            Indicates if the namespace should not be added to the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            list. If <see langword=\"false\"/> then the parameter will be \n            added; otherwise, skipped. The default is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XmlNamespaceCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.#ctor(NAnt.Core.Types.XmlNamespaceCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.#ctor(NAnt.Core.Types.XmlNamespace[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.Add(NAnt.Core.Types.XmlNamespace)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.AddRange(NAnt.Core.Types.XmlNamespace[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.AddRange(NAnt.Core.Types.XmlNamespaceCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.Contains(NAnt.Core.Types.XmlNamespace)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> with \n            value <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.CopyTo(NAnt.Core.Types.XmlNamespace[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.IndexOf(NAnt.Core.Types.XmlNamespace)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/>. If the <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.Insert(System.Int32,NAnt.Core.Types.XmlNamespace)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.XmlNamespaceEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceCollection.Remove(NAnt.Core.Types.XmlNamespace)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespaceCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespaceCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> with the specified prefix.\n            </summary>\n            <param name=\"value\">The prefix of the <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XmlNamespaceEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.XmlNamespace\"/> elements of a <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceEnumerator.#ctor(NAnt.Core.Types.XmlNamespaceCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XmlNamespaceEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.XmlNamespaceCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XmlNamespaceEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XmlNamespaceEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltExtensionObject\">\n            <summary>\n            Represents an XSLT extension object. The object should have a default\n            parameterless constructor and the return value should be one of the \n            four basic XPath data types of number, string, Boolean or node set.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObject.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObject.NamespaceUri\">\n            <summary>\n            The namespace URI to associate with the extension object.\n            </summary>\n            <value>\n            The namespace URI to associate with the extension object, or \n            <see cref=\"F:System.String.Empty\"/> if not set.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObject.TypeName\">\n            <summary>\n            The full type name of the XSLT extension object.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObject.AssemblyPath\">\n            <summary>\n            The assembly which contains the XSLT extension object.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObject.IfDefined\">\n            <summary>\n            Indicates if the extension object should be added to the XSLT argument\n            list. If <see langword=\"true\" /> then the extension object will be\n            added; otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObject.UnlessDefined\">\n            <summary>\n            Indicates if the extension object should not be added to the XSLT argument\n            list. If <see langword=\"false\" /> then the extension object will be \n            added; otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.#ctor(NAnt.Core.Types.XsltExtensionObjectCollection)\">\n            <summary>\n            Initializes a new instance of the\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/> class with the\n            specified <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.#ctor(NAnt.Core.Types.XsltExtensionObject[])\">\n            <summary>\n            Initializes a new instance of the\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/> class with the\n            specified array of <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.Add(NAnt.Core.Types.XsltExtensionObject)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> to be added\n            to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.AddRange(NAnt.Core.Types.XsltExtensionObject[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> array to the\n            end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/>\n            elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.AddRange(NAnt.Core.Types.XsltExtensionObjectCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/>\n            to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/>\n            to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.Contains(NAnt.Core.Types.XsltExtensionObject)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> is in the\n            collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> to locate\n            in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> with the\n            specified value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the\n            collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/>\n            with value <paramref name=\"value\"/> is found in the collection;\n            otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.CopyTo(NAnt.Core.Types.XsltExtensionObject[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array,\n            starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the\n            destination of the elements copied from the collection. The array\n            must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/>\n            at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.IndexOf(NAnt.Core.Types.XsltExtensionObject)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/>\n            object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> object for\n            which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/>. If the\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> is not currently a member of the\n            collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.Insert(System.Int32,NAnt.Core.Types.XsltExtensionObject)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> into the collection at\n            the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which\n            <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> to\n            insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectEnumerator\"/> for the entire\n            collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectCollection.Remove(NAnt.Core.Types.XsltExtensionObject)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> to remove\n            from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObjectCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get\n            or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObjectCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> with the specified name.\n            </summary>\n            <param name=\"value\">The name of the <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/>\n            to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltExtensionObjectEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.XsltExtensionObject\"/> elements of a\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectEnumerator.#ctor(NAnt.Core.Types.XsltExtensionObjectCollection)\">\n            <summary>\n            Initializes a new instance of the\n            <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.XsltExtensionObjectCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be\n            enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltExtensionObjectEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltExtensionObjectEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltParameter\">\n            <summary>\n            Represents an XSLT parameter.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameter.ParameterName\">\n            <summary>\n            The name of the XSLT parameter.\n            </summary>\n            <value>\n            The name of the XSLT parameter, or <see cref=\"F:System.String.Empty\"/> if \n            not set.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameter.NamespaceUri\">\n            <summary>\n            The namespace URI to associate with the parameter.\n            </summary>\n            <value>\n            The namespace URI to associate with the parameter, or \n            <see cref=\"F:System.String.Empty\"/> if not set.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameter.Value\">\n            <summary>\n            The value of the XSLT parameter.\n            </summary>\n            <value>\n            The value of the XSLT parameter, or <see cref=\"F:System.String.Empty\"/> if \n            not set.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameter.IfDefined\">\n            <summary>\n            Indicates if the parameter should be added to the XSLT argument list.\n            If <see langword=\"true\" /> then the parameter will be added; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameter.UnlessDefined\">\n            <summary>\n            Indicates if the parameter should not be added to the XSLT argument\n            list. If <see langword=\"false\" /> then the parameter will be \n            added; otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltParameterCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.#ctor(NAnt.Core.Types.XsltParameterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.#ctor(NAnt.Core.Types.XsltParameter[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.Add(NAnt.Core.Types.XsltParameter)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.AddRange(NAnt.Core.Types.XsltParameter[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.AddRange(NAnt.Core.Types.XsltParameterCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.Contains(NAnt.Core.Types.XsltParameter)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> with \n            value <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.CopyTo(NAnt.Core.Types.XsltParameter[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.IndexOf(NAnt.Core.Types.XsltParameter)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Types.XsltParameter\"/>. If the <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.Insert(System.Int32,NAnt.Core.Types.XsltParameter)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Types.XsltParameterEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterCollection.Remove(NAnt.Core.Types.XsltParameter)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameterCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameterCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> with the specified name.\n            </summary>\n            <param name=\"value\">The name of the <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Types.XsltParameterEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Types.XsltParameter\"/> elements of a <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterEnumerator.#ctor(NAnt.Core.Types.XsltParameterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Types.XsltParameterEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Types.XsltParameterCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Types.XsltParameterEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Types.XsltParameterEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Util.AssemblyResolver\">\n            <summary> \n            Resolves assemblies by caching assemblies that were loaded.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.#ctor\">\n            <summary> \n            Initializes an instanse of the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.#ctor(NAnt.Core.Task)\">\n            <summary> \n            Initializes an instanse of the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/> \n            class in the context of the given <see cref=\"T:NAnt.Core.Task\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.Attach\">\n            <summary> \n            Installs the assembly resolver by hooking up to the \n            <see cref=\"F:System.AppDomain.AssemblyResolve\"/> event.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.Detach\">\n            <summary> \n            Uninstalls the assembly resolver.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.AssemblyResolve(System.Object,System.ResolveEventArgs)\">\n            <summary> \n            Resolves an assembly not found by the system using the assembly \n            cache.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"args\">A <see cref=\"T:System.ResolveEventArgs\"/> that contains the event data.</param>\n            <returns>\n            The loaded assembly, or <see langword=\"null\"/> if not found.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.AssemblyLoad(System.Object,System.AssemblyLoadEventArgs)\">\n            <summary>\n            Occurs when an assembly is loaded. The loaded assembly is added \n            to the assembly cache.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"args\">An <see cref=\"T:System.AssemblyLoadEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.AssemblyResolver.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            The actual logging is delegated to the <see cref=\"T:NAnt.Core.Task\"/> in which \n            the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/> is executing \n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Util.AssemblyResolver._assemblyCache\">\n            <summary>\n            Holds the loaded assemblies.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.AssemblyResolver._task\">\n            <summary>\n            Holds the <see cref=\"T:NAnt.Core.Task\"/> in which the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/> \n            is executing.\n            </summary>\n            <value>\n            The <see cref=\"T:NAnt.Core.Task\"/> in which the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/> \n            is executing or <see langword=\"null\"/> if the <see cref=\"T:NAnt.Core.Util.AssemblyResolver\"/>\n            is not executing in the context of a <see cref=\"T:NAnt.Core.Task\"/>.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgument\">\n            <summary>\n            Represents a valid command-line argument.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgument.Finish(System.Object)\">\n            <summary>\n            Sets the value of the argument on the specified object.\n            </summary>\n            <param name=\"destination\">The object on which the value of the argument should be set.</param>\n            <exception cref=\"T:NAnt.Core.Util.CommandLineArgumentException\">The argument is required and no value was specified.</exception>\n            <exception cref=\"T:System.NotSupportedException\">\n            <para>\n            The matching property is collection-based, but is not initialized \n            and cannot be written to.\n            </para>\n            <para>-or-</para>\n            <para>\n            The matching property is collection-based, but has no strongly-typed\n            Add method.\n            </para>\n            <para>-or-</para>\n            <para>\n            The matching property is collection-based, but the signature of the \n            Add method is not supported.\n            </para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgument.SetValue(System.String)\">\n            <summary>\n            Assigns the specified value to the argument.\n            </summary>\n            <param name=\"value\">The value that should be assigned to the argument.</param>\n            <exception cref=\"T:NAnt.Core.Util.CommandLineArgumentException\">\n            <para>Duplicate argument.</para>\n            <para>-or-</para>\n            <para>Invalid value.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgument.IsNameValueCollectionType(System.Type)\">\n            <summary>\n            Indicates whether the specified <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> is a \n            <see cref=\"T:System.Collections.Specialized.NameValueCollection\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> can be assigned\n            to <see cref=\"T:System.Collections.Specialized.NameValueCollection\"/>; otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgument.IsCollectionType(System.Type)\">\n            <summary>\n            Indicates whether the specified <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> is collection-based.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> can be assigned\n            to <see cref=\"T:System.Collections.ICollection\"/> and is not backed by a <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/>\n            that can be assigned to <see cref=\"T:System.Collections.Specialized.NameValueCollection\"/>; \n            otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgument.IsArrayType(System.Type)\">\n            <summary>\n            Indicates whether the specified <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> is an array.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> is an array;\n            otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.Property\">\n            <summary>\n            Gets the property that backs the argument.\n            </summary>\n            <value>\n            The property that backs the arguments.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.ValueType\">\n            <summary>\n            Gets the underlying <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> of the argument.\n            </summary>\n            <value>\n            The underlying <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> of the argument.\n            </value>\n            <remarks>\n            If the <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> of the argument is a collection type,\n            this property will returns the underlying type of that collection.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.LongName\">\n            <summary>\n            Gets the long name of the argument.\n            </summary>\n            <value>The long name of the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.ShortName\">\n            <summary>\n            Gets the short name of the argument.\n            </summary>\n            <value>The short name of the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.Description\">\n            <summary>\n            Gets the description of the argument.\n            </summary>\n            <value>The description of the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsRequired\">\n            <summary>\n            Gets a value indicating whether the argument is required.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument is required; otherwise, \n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.SeenValue\">\n            <summary>\n            Gets a value indicating whether a mathing command-line argument \n            was already found.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if a matching command-line argument was \n            already found; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.AllowMultiple\">\n            <summary>\n            Gets a value indicating whether the argument can be specified multiple\n            times.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument may be specified multiple \n            times; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.Unique\">\n            <summary>\n            Gets a value indicating whether the argument can only be specified once\n            with a certain value.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument should always have a unique \n            value; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.Type\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> of the property to which the argument\n            is applied.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> of the property to which the argument is\n            applied.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsCollection\">\n            <summary>\n            Gets a value indicating whether the argument is collection-based.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if the argument is backed by a <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> \n            that can be assigned to <see cref=\"T:System.Collections.ICollection\"/> and is not backed \n            by a <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/> that can be assigned to \n            <see cref=\"T:System.Collections.Specialized.NameValueCollection\"/>; otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsNameValueCollection\">\n            <summary>\n            Gets a value indicating whether the argument is a set of name/value\n            pairs.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if the argument is backed by a <see cref=\"P:NAnt.Core.Util.CommandLineArgument.Type\"/>\n            that can be assigned to <see cref=\"T:System.Collections.Specialized.NameValueCollection\"/>; otherwise, \n            <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsArray\">\n            <summary>\n            Gets a value indicating whether the argument is array-based.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument is backed by an array; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsDefault\">\n            <summary>\n            Gets a value indicating whether the argument is the default argument.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument is the default argument; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgument.IsExclusive\">\n            <summary>\n            Gets a value indicating whether the argument cannot be combined with\n            other arguments.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the argument cannot be combined with other \n            arguments; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\">\n            <summary>\n            Allows control of command line parsing.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentAttribute.#ctor(NAnt.Core.Util.CommandLineArgumentTypes)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\"/> class\n            with the specified argument type.\n            </summary>\n            <param name=\"argumentType\">Specifies the checking to be done on the argument.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentAttribute.Type\">\n            <summary>\n            Gets or sets the checking to be done on the argument.\n            </summary>\n            <value>The checking that should be done on the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentAttribute.Name\">\n            <summary>\n            Gets or sets the long name of the argument.\n            </summary>\n            <value>The long name of the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentAttribute.ShortName\">\n            <summary>\n            Gets or sets the short name of the argument.\n            </summary>\n            <value>The short name of the argument.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentAttribute.Description\">\n            <summary>\n            Gets or sets the description of the argument.\n            </summary>\n            <value>The description of the argument.</value>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgumentCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.#ctor(NAnt.Core.Util.CommandLineArgumentCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.#ctor(NAnt.Core.Util.CommandLineArgument[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.Add(NAnt.Core.Util.CommandLineArgument)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.AddRange(NAnt.Core.Util.CommandLineArgument[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.AddRange(NAnt.Core.Util.CommandLineArgumentCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.Contains(NAnt.Core.Util.CommandLineArgument)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.CopyTo(NAnt.Core.Util.CommandLineArgument[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.IndexOf(NAnt.Core.Util.CommandLineArgument)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/>. If the <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.Insert(System.Int32,NAnt.Core.Util.CommandLineArgument)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.Util.CommandLineArgumentEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentCollection.Remove(NAnt.Core.Util.CommandLineArgument)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> with the specified name.\n            </summary>\n            <param name=\"name\">The name of the <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgumentEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.Util.CommandLineArgument\"/> elements of a <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentEnumerator.#ctor(NAnt.Core.Util.CommandLineArgumentCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.Util.CommandLineArgumentCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineArgumentEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgumentException\">\n            <summary>\n            The exception that is thrown when one of the command-line arguments provided \n            is not valid.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentException.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentException\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentException.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentException\"/> class\n            with a descriptive message.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentException\"/> class\n            with a descriptive message and an inner exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"innerException\">A nested exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineArgumentException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentException\"/> class \n            with serialized data.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n            <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineArgumentTypes\">\n            <summary>\n            Used to control parsing of command-line arguments.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.Required\">\n            <summary>\n            Indicates that this field is required. An error will be displayed\n            if it is not present when parsing arguments.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.Unique\">\n            <summary>\n            Only valid in conjunction with Multiple.\n            Duplicate values will result in an error.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.Multiple\">\n            <summary>\n            Inidicates that the argument may be specified more than once.\n            Only valid if the argument is a collection\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.Exclusive\">\n            <summary>\n            Inidicates that if this argument is specified, no other arguments may be specified.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.AtMostOnce\">\n            <summary>\n            The default type for non-collection arguments.\n            The argument is not required, but an error will be reported if it is specified more than once.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.CommandLineArgumentTypes.MultipleUnique\">\n            <summary>\n            The default type for collection arguments.\n            The argument is permitted to occur multiple times, but duplicate \n            values will cause an error to be reported.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Util.CommandLineParser\">\n            <summary>\n            Commandline parser.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.#ctor(System.Type,System.Boolean)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineParser\"/> class\n            using possible arguments deducted from the specific <see cref=\"T:System.Type\"/>.\n            </summary>\n            <param name=\"argumentSpecification\">The <see cref=\"T:System.Type\"/> from which the possible command-line arguments should be retrieved.</param>\n            <param name=\"supportsResponseFile\">A <see cref=\"T:System.Boolean\"/> value indicating whether or not a response file is able to be used. </param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"argumentSpecification\"/> is a null reference.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.Parse(System.String[],System.Object)\">\n            <summary>\n            Parses an argument list.\n            </summary>\n            <param name=\"args\">The arguments to parse.</param>\n            <param name=\"destination\">The destination object on which properties will be set corresponding to the specified arguments.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"destination\"/> is a null reference.</exception>\n            <exception cref=\"T:System.ArgumentException\">The <see cref=\"T:System.Type\"/> of <paramref name=\"destination\"/> does not match the argument specification that was used to initialize the parser.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.ParseArguments(System.String,System.Char[])\">\n            <summary>\n            Splits a string and removes any empty strings from the \n            result. Same functionality as the \n            public string[] Split(char[] separator, StringSplitOptions options) \n            method in .Net 2.0. Replace with that call when 2.0 is standard.\n            </summary>\n            <param name=\"sourceString\"></param>\n            <param name=\"delimiters\"></param>\n            <returns>the array of strings</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.ProcessResponseFile(System.String)\">\n            <summary>\n            Read a response file and parse the arguments as usual.\n            </summary>\n            <param name=\"file\">The response file to load arguments</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.ParseArgumentList(System.String[])\">\n            <summary>\n            Parse the argument list using the \n            </summary>\n            <param name=\"args\"></param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.CommandLineParser.GetCommandLineAttribute(System.Reflection.PropertyInfo)\">\n            <summary>\n            Returns the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\"/> that's applied \n            on the specified property.\n            </summary>\n            <param name=\"propertyInfo\">The property of which applied <see cref=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\"/> should be returned.</param>\n            <returns>\n            The <see cref=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\"/> that's applied to the \n            <paramref name=\"propertyInfo\"/>, or a null reference if none was applied.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineParser.LogoBanner\">\n            <summary>\n            Gets a logo banner using version and copyright attributes defined on the \n            <see cref=\"M:System.Reflection.Assembly.GetEntryAssembly\"/> or the \n            <see cref=\"M:System.Reflection.Assembly.GetCallingAssembly\"/>.\n            </summary>\n            <value>\n            A logo banner.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineParser.Usage\">\n            <summary>\n            Gets the usage instructions.\n            </summary>\n            <value>The usage instructions.</value>\n        </member>\n        <member name=\"P:NAnt.Core.Util.CommandLineParser.NoArgs\">\n            <summary>\n            Gets a value indicating whether no arguments were specified on the\n            command line.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Util.DefaultCommandLineArgumentAttribute\">\n            <summary>\n            Marks a command-line option as being the default option.  When the name of \n            a command-line argument is not specified, this option will be assumed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.DefaultCommandLineArgumentAttribute.#ctor(NAnt.Core.Util.CommandLineArgumentTypes)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.CommandLineArgumentAttribute\"/> class\n            with the specified argument type.\n            </summary>\n            <param name=\"argumentType\">Specifies the checking to be done on the argument.</param>\n        </member>\n        <member name=\"T:NAnt.Core.Util.FileUtils\">\n            <summary>\n            Provides modified version for Copy and Move from the File class that \n            allow for filter chain processing.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.CopyFile(System.String,System.String,NAnt.Core.Filters.FilterChain,System.Text.Encoding,System.Text.Encoding)\">\n            <summary>\n            Copies a file filtering its content through the filter chain.\n            </summary>\n            <param name=\"sourceFileName\">The file to copy</param>\n            <param name=\"destFileName\">The file to copy to</param>\n            <param name=\"filterChain\">Chain of filters to apply when copying, or <see langword=\"null\" /> is no filters should be applied.</param>\n            <param name=\"inputEncoding\">The encoding used to read the soure file.</param>\n            <param name=\"outputEncoding\">The encoding used to write the destination file.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.MoveFile(System.String,System.String,NAnt.Core.Filters.FilterChain,System.Text.Encoding,System.Text.Encoding)\">\n            <summary>\n            Moves a file filtering its content through the filter chain.\n            </summary>\n            <param name=\"sourceFileName\">The file to move.</param>\n            <param name=\"destFileName\">The file to move move to.</param>\n            <param name=\"filterChain\">Chain of filters to apply when moving, or <see langword=\"null\" /> is no filters should be applied.</param>\n            <param name=\"inputEncoding\">The encoding used to read the soure file.</param>\n            <param name=\"outputEncoding\">The encoding used to write the destination file.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.ReadFile(System.String,NAnt.Core.Filters.FilterChain,System.Text.Encoding)\">\n            <summary>\n            Reads a file filtering its content through the filter chain.\n            </summary>\n            <param name=\"fileName\">The file to read.</param>\n            <param name=\"filterChain\">Chain of filters to apply when reading, or <see langword=\"null\" /> is no filters should be applied.</param>\n            <param name=\"inputEncoding\">The encoding used to read the file.</param>\n            <remarks>\n            If <paramref name=\"inputEncoding\" /> is <see langword=\"null\" />,\n            then the system's ANSI code page will be used to read the file.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.GetTempDirectory\">\n            <summary>\n            Returns a uniquely named empty temporary directory on disk.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.DirectoryInfo\"/> representing the temporary directory.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.CombinePaths(System.String,System.String)\">\n            <summary>\n            Combines two path strings.\n            </summary>\n            <param name=\"path1\">The first path.</param>\n            <param name=\"path2\">The second path.</param>\n            <returns>\n            A string containing the combined paths. If one of the specified \n            paths is a zero-length string, this method returns the other path. \n            If <paramref name=\"path2\"/> contains an absolute path, this method \n            returns <paramref name=\"path2\"/>.\n            </returns>\n            <remarks>\n              <para>\n              On *nix, processing is delegated to <see cref=\"M:System.IO.Path.Combine(System.String,System.String)\"/>.\n              </para>\n              <para>\n              On Windows, this method normalized the paths to avoid running into\n              the 260 character limit of a path and converts forward slashes in \n              both <paramref name=\"path1\"/> and <paramref name=\"path2\"/> to \n              the platform's directory separator character.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.GetFullPath(System.String)\">\n            <summary>\n            Returns Absolute Path (Fix for 260 Char Limit of Path.GetFullPath(...))\n            </summary>\n            <param name=\"path\">The file or directory for which to obtain absolute path information.</param>\n            <returns>Path Resolved</returns>\n            <exception cref=\"T:System.ArgumentException\">path is a zero-length string, contains only white space or contains one or more invalid characters as defined by <see cref=\"F:System.IO.Path.InvalidPathChars\"/>.</exception>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"path\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.GetHomeDirectory\">\n            <summary>\n            Returns the home directory of the current user.\n            </summary>\n            <returns>\n            The home directory of the current user.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.FileUtils.ResolveFile(System.String[],System.String,System.Boolean)\">\n            <summary>\n            Scans a list of directories for the specified filename.\n            </summary>\n            <param name=\"directories\">The list of directories to search.</param>\n            <param name=\"fileName\">The name of the file to look for.</param>\n            <param name=\"recursive\">Specifies whether the directory should be searched recursively.</param>\n            <remarks>\n            The directories are scanned in the order in which they are defined.\n            </remarks>\n            <returns>\n            The absolute path to the specified file, or null if the file was\n            not found.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Util.GacCache\">\n            <summary>\n            Helper class for determining whether assemblies are located in the \n            Global Assembly Cache.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.GacCache.#ctor(NAnt.Core.Project)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.GacCache\"/> class in \n            the context of the given <see cref=\"P:NAnt.Core.Util.GacCache.Project\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.GacCache.IsAssemblyInGac(System.String)\">\n            <summary>\n            Determines whether an assembly is installed in the Global\n            Assembly Cache given its file name or path.\n            </summary>\n            <param name=\"assemblyFile\">The name or path of the file that contains the manifest of the assembly.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"assemblyFile\"/> is \n            installed in the Global Assembly Cache; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            <para>\n            To determine whether the specified assembly is installed in the \n            Global Assembly Cache, the assembly is loaded into a separate\n            <see cref=\"T:System.AppDomain\"/>.\n            </para>\n            <para>\n            If the family of the current runtime framework does not match the\n            family of the current target framework, this method will return\n            <see langword=\"false\"/> for all assemblies as there's no way to\n            determine whether a given assembly is in the Global Assembly Cache\n            for another framework family than the family of the current runtime\n            framework.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Util.GacCache._domain\">\n            <summary>\n            Holds the <see cref=\"T:System.AppDomain\"/> in which assemblies will be loaded\n            to determine whether they are in the Global Assembly Cache.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.GacCache._project\">\n            <summary>\n            Holds the <see cref=\"P:NAnt.Core.Util.GacCache.Project\"/> context of the <see cref=\"T:NAnt.Core.Util.GacCache\"/>.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Util.GacCache._gacQueryCache\">\n            <summary>\n            Holds a list of assembly files for which already has been determined \n            whether they are located in the Global Assembly Cache.\n            </summary>\n            <remarks>\n            <para>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the full path to the \n            assembly file and the value is a <see cref=\"T:System.Boolean\"/> indicating \n            whether the assembly is located in the Global Assembly Cache.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Util.GacCache._disposed\">\n            <summary>\n            Holds a value indicating whether the object has been disposed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Util.GacCache.Project\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.Util.GacCache.Project\"/> context of the <see cref=\"T:NAnt.Core.Util.GacCache\"/>.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.Util.GacCache.Project\"/> context of the <see cref=\"T:NAnt.Core.Util.GacCache\"/>.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Util.GacCache.GacResolver.InitializeLifetimeService\">\n            <summary>\n            Obtains a lifetime service object to control the lifetime policy for \n            this instance.\n            </summary>\n            <returns>\n            An object of type <see cref=\"T:System.Runtime.Remoting.Lifetime.ILease\"/> used to control the lifetime \n            policy for this instance. This is the current lifetime service object \n            for this instance if one exists; otherwise, a new lifetime service \n            object initialized with a lease that will never time out.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.GacCache.GacResolver.IsAssemblyInGac(System.String)\">\n            <summary>\n            Determines whether an assembly is installed in the Global\n            Assembly Cache given its file name or path.\n            </summary>\n            <param name=\"assemblyFile\">The name or path of the file that contains the manifest of the assembly.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"assemblyFile\" /> is \n            installed in the Global Assembly Cache; otherwise, \n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Util.ReflectionUtils\">\n            <summary>\n            Provides a set of helper methods related to reflection.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ReflectionUtils.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.ReflectionUtils\"/> class.\n            </summary>\n            <remarks>\n            Uses a private access modifier to prevent instantiation of this class.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ReflectionUtils.GetTypeFromString(System.String,System.Boolean)\">\n            <summary>\n            Loads the type specified in the type string with assembly qualified name.\n            </summary>\n            <param name=\"typeName\">The assembly qualified name of the type to load.</param>\n            <param name=\"throwOnError\">Flag set to <see langword=\"true\"/> to throw an exception if the type cannot be loaded.</param>\n            <exception cref=\"T:System.TypeLoadException\">\n                <paramref name=\"throwOnError\"/> is <see langword=\"true\"/> and \n                an error is encountered while loading the <see cref=\"T:System.Type\"/>, or \n                <paramref name=\"typeName\"/> is not an assembly qualified name.\n            </exception>\n            <remarks>\n            If the <see cref=\"T:System.Type\"/> cannot be instantiated from the assembly\n            qualified type name, then we'll try to instantiate the type using its\n            simple type name from an already loaded assembly with an assembly \n            name mathing the assembly in the assembly qualified type name.\n            </remarks>\n            <returns>\n            The type loaded or <see langword=\"null\"/> if it could not be loaded.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.Util.ResourceUtils\">\n            <summary>\n            Provides resource support to NAnt assemblies. This class cannot\n            be inherited from.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.#ctor\">\n            <summary>\n            Prevents the <see cref=\"T:NAnt.Core.Util.ResourceUtils\"/> class from being \n            instantiated explicitly.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.RegisterSharedAssembly(System.Reflection.Assembly)\">\n            <summary>\n            Registers the assembly to be used as the fallback if resources\n            aren't found in the local satellite assembly.\n            </summary>\n            <param name=\"assembly\">\n            A <see cref=\"T:System.Reflection.Assembly\"/> that represents the\n            assembly to register.\n            </param>\n            <example>\n            The following example shows how to register a shared satellite\n            assembly.\n            <code>\n            <![CDATA[\n            Assembly sharedAssembly = Assembly.Load(\"MyResources.dll\");\n            ResourceUtils.RegisterSharedAssembly(sharedAssembly);\n            ]]>\n            </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.GetString(System.String)\">\n            <summary>\n            Returns the value of the specified string resource.\n            </summary>\n            <param name=\"name\">\n            A <see cref=\"T:System.String\"/> that contains the name of the\n            resource to get.\n            </param>\n            <returns>\n            A <see cref=\"T:System.String\"/> that contains the value of the\n            resource localized for the current culture.\n            </returns>\n            <remarks>\n            The returned resource is localized for the cultural settings of the\n            current <see cref=\"T:System.Threading.Thread\"/>.\n            <note>\n            The <c>GetString</c> method is thread-safe.\n            </note>\n            </remarks>\n            <example>\n            The following example demonstrates the <c>GetString</c> method using\n            the cultural settings of the current <see cref=\"T:System.Threading.Thread\"/>.\n            <code>\n            <![CDATA[\n            string localizedString = ResourceUtils.GetString(\"String_HelloWorld\");\n            ]]>\n            </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.GetString(System.String,System.Globalization.CultureInfo)\">\n             <summary>\n             Returns the value of the specified string resource localized for\n             the specified culture.\n             </summary>\n             <param name=\"name\"></param>\n             <param name=\"culture\"></param>\n             <returns>\n             A <see cref=\"T:System.String\"/> that contains the value of the\n             resource localized for the specified culture. \n            </returns>\n             <remarks>\n             <note>\n             The <c>GetString</c> method is thread-safe.\n             </note>\n             </remarks>\n             <example>\n             The following example demonstrates the <c>GetString</c> method using\n             a specific culture.\n             <code>\n             <![CDATA[\n             CultureInfo culture = CultureInfo.CreateSpecificCulture(\"en-US\");\n             string localizedString = ResourceUtils.GetString(\"String_HelloWorld\", culture);\n             ]]>\n             </code>\n             </example>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.GetString(System.String,System.Globalization.CultureInfo,System.Reflection.Assembly)\">\n            <summary>\n            Returns the value of the specified string resource localized for\n            the specified culture for the specified assembly.\n            </summary>\n            <param name=\"name\">\n            A <see cref=\"T:System.String\"/> that contains the name of the\n            resource to get.\n            </param>\n            <param name=\"culture\">\n            A <see cref=\"T:System.Globalization.CultureInfo\"/> that represents\n            the culture for which the resource is localized.\n            </param>\n            <param name=\"assembly\">\n            A <see cref=\"T:System.Reflection.Assembly\"/>\n            </param>\n            <returns>\n            A <see cref=\"T:System.String\"/> that contains the value of the\n            resource localized for the specified culture.\n            </returns>\n            <remarks>\n            <note>\n            The <c>GetString</c> method is thread-safe.\n            </note>\n            </remarks>\n            <example>\n            The following example demonstrates the <c>GetString</c> method using\n            specific culture and assembly.\n            <code>\n            <![CDATA[\n            CultureInfo culture = CultureInfo.CreateSpecificCulture(\"en-US\");\n            Assembly assembly = Assembly.GetCallingAssembly();\n            string localizedString = ResourceUtils.GetString(\"String_HelloWorld\", culture, assembly);\n            ]]>\n            </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.RegisterAssembly(System.Reflection.Assembly)\">\n            <summary>\n            Registers the specified assembly.\n            </summary>\n            <param name=\"assembly\">\n            A <see cref=\"T:System.Reflection.Assembly\"/> that represents the\n            assembly to register.\n            </param>\n        </member>\n        <member name=\"M:NAnt.Core.Util.ResourceUtils.GetResourceName(System.String)\">\n            <summary>\n            Determines the manifest resource name of the resource holding the\n            localized strings.\n            </summary>\n            <param name=\"assemblyName\">The name of the assembly.</param>\n            <returns>\n            The manifest resource name of the resource holding the localized\n            strings for the specified assembly.\n            </returns>\n            <remarks>\n            The manifest resource name of the resource holding the localized\n            strings should match the name of the assembly, minus <c>Tasks</c>\n            suffix.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.Util.StringUtils\">\n            <summary>\n            Groups a set of useful <see cref=\"T:System.String\"/> manipulation and validation \n            methods.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Util.StringUtils\"/> class.\n            </summary>\n            <remarks>\n            Prevents instantiation of the <see cref=\"T:NAnt.Core.Util.StringUtils\"/> class.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.EndsWith(System.String,System.Char)\">\n            <summary>\n            Determines whether the last character of the given <see cref=\"T:System.String\"/>\n            matches the specified character.\n            </summary>\n            <param name=\"value\">The string.</param>\n            <param name=\"c\">The character.</param>\n            <returns>\n            <see langword=\"true\"/> if the last character of <paramref name=\"value\"/>\n            matches <paramref name=\"c\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"value\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.IsNullOrEmpty(System.String)\">\n            <summary>\n            Indicates whether or not the specified <see cref=\"T:System.String\"/> is \n            <see langword=\"null\"/> or an <see cref=\"F:System.String.Empty\"/> string.\n            </summary>\n            <param name=\"value\">The value to check.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is <see langword=\"null\"/>\n            or an empty string (\"\"); otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.ConvertEmptyToNull(System.String)\">\n            <summary>\n            Converts an empty string (\"\") to <see langword=\"null\" />.\n            </summary>\n            <param name=\"value\">The value to convert.</param>\n            <returns>\n            <see langword=\"null\" /> if <paramref name=\"value\" /> is an empty \n            string (\"\") or <see langword=\"null\" />; otherwise, <paramref name=\"value\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.ConvertNullToEmpty(System.String)\">\n            <summary>\n            Converts <see langword=\"null\" /> to an empty string.\n            </summary>\n            <param name=\"value\">The value to convert.</param>\n            <returns>\n            An empty string if <paramref name=\"value\" /> is <see langword=\"null\" />;\n            otherwise, <paramref name=\"value\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.Join(System.String,System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Concatenates a specified separator <see cref=\"T:System.String\"/> between each \n            element of a specified <see cref=\"T:System.Collections.Specialized.StringCollection\"/>, yielding a \n            single concatenated string.\n            </summary>\n            <param name=\"separator\">A <see cref=\"T:System.String\"/>.</param>\n            <param name=\"value\">A <see cref=\"T:System.Collections.Specialized.StringCollection\"/>.</param>\n            <returns>\n            A <see cref=\"T:System.String\"/> consisting of the elements of <paramref name=\"value\"/> \n            interspersed with the separator string.\n            </returns>\n            <remarks>\n            <para>\n            For example if <paramref name=\"separator\"/> is \", \" and the elements \n            of <paramref name=\"value\"/> are \"apple\", \"orange\", \"grape\", and \"pear\", \n            <see cref=\"M:NAnt.Core.Util.StringUtils.Join(System.String,System.Collections.Specialized.StringCollection)\"/> returns \"apple, orange, \n            grape, pear\".\n            </para>\n            <para>\n            If <paramref name=\"separator\"/> is <see langword=\"null\"/>, an empty \n            string (<see cref=\"F:System.String.Empty\"/>) is used instead.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Util.StringUtils.Clone(System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Creates a shallow copy of the specified <see cref=\"T:System.Collections.Specialized.StringCollection\"/>.\n            </summary>\n            <param name=\"stringCollection\">The <see cref=\"T:System.Collections.Specialized.StringCollection\"/> that should be copied.</param>\n            <returns>\n            A shallow copy of the specified <see cref=\"T:System.Collections.Specialized.StringCollection\"/>.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.BuildException\">\n            <summary>\n            Thrown whenever an error occurs during the build.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.BuildException._location\">\n            <summary>\n            The location of the exception in the build document (xml file).\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class \n            with a descriptive message.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class\n            with the specified descriptive message and inner exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"innerException\">A nested exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor(System.String,NAnt.Core.Location)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class\n            with a descriptive message and the location in the build file that \n            caused the exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"location\">The location in the build file where the exception occured.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor(System.String,NAnt.Core.Location,System.Exception)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class\n            with a descriptive message, the location in the build file and an \n            instance of the exception that is the cause of the current exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"location\">The location in the build file where the exception occured.</param>\n            <param name=\"innerException\">A nested exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildException\"/> class \n            with serialized data.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n            <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Serializes this object into the <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> provided.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> to populate with data.</param>\n            <param name=\"context\">The destination for this serialization.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildException.ToString\">\n            <summary>\n            Creates and returns a string representation of the current \n            exception.\n            </summary>\n            <returns>\n            A string representation of the current exception.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.BuildException.RawMessage\">\n            <summary>\n            Gets the raw message as specified when the exception was \n            constructed.\n            </summary>\n            <value>\n            The raw message as specified when the exception was \n            constructed.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildException.Location\">\n            <summary>\n            Gets the location in the build file of the element from which the\n            exception originated.\n            </summary>\n            <value>\n            The location in the build file of the element from which the\n            exception originated.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildException.Message\">\n            <summary>\n            Gets a message that describes the current exception.\n            </summary>\n            <value>\n            The error message that explains the reason for the exception.\n            </value>\n            <remarks>\n            Adds location information to the message, if available.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.CommandLineOptions\">\n            <summary>\n            Represents the set of command-line options supported by NAnt.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.TargetFramework\">\n            <summary>\n            Gets or sets the target framework to use (overrides \n            NAnt.exe.config settings)\n            </summary>\n            <value>\n            The framework that should be used.\n            </value>\n            <remarks>\n            For a list of possible frameworks, see NAnt.exe.config, possible\n            values include \"net-1.0\", \"net-1.1\", etc.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.DefaultFramework\">\n            <summary>\n            Gets or sets the target framework to use (overrides \n            NAnt.exe.config settings)\n            </summary>\n            <value>\n            The framework that should be used.\n            </value>\n            <remarks>\n            For a list of possible frameworks, see NAnt.exe.config, possible\n            values include \"net-1.0\", \"net-1.1\", etc.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.BuildFile\">\n            <summary>\n            Gets or sets the buildfile that should be executed.\n            </summary>\n            <value>\n            The buildfile that should be executed.\n            </value>\n            <remarks>\n            Can be both a file or an URI.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Verbose\">\n            <summary>\n            Gets or sets a value indicating whether more information should be\n            displayed during the build process.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if more information should be displayed; \n            otherwise, <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Debug\">\n            <summary>\n            Gets or sets a value indicating whether debug information should be\n            displayed during the build process.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if debug information should be displayed; \n            otherwise, <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Quiet\">\n            <summary>\n            Gets or sets a value indicating whether only error and debug debug messages should be\n            displayed during the build process.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if only error or warning messages should be \n            displayed; otherwise, <see langword=\"false\" />. The default is\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.EmacsMode\">\n            <summary>\n            Gets or sets a value indicating whether to produce emacs (and other\n            editor) friendly output.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if output is to be unadorned so that emacs \n            and other editors can parse files names, etc. The default is\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.FindInParent\">\n            <summary>\n            Gets a value indicating whether parent directories should be searched\n            for a buildfile.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if parent directories should be searched for \n            a build file; otherwise, <see langword=\"false\" />. The default is\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.IndentationLevel\">\n            <summary>\n            Gets or sets the indentation level of the build output.\n            </summary>\n            <value>\n            The indentation level of the build output. The default is <c>0</c>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Properties\">\n            <summary>\n            Gets or sets the list of properties that should be set.\n            </summary>\n            <value>\n            The list of properties that should be set.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.LoggerType\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.Type\"/> of logger to add to the list\n            of listeners.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Type\"/> of logger to add to the list of\n            listeners.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.CommandLineOptions.LoggerType\"/> should derive from <see cref=\"T:NAnt.Core.IBuildLogger\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.LogFile\">\n            <summary>\n            Gets or sets the name of the file to log output to.\n            </summary>\n            <value>\n            The name of the file to log output to.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Listeners\">\n            <summary>\n            Gets a collection containing fully qualified type names of classes \n            implementating <see cref=\"T:NAnt.Core.IBuildListener\"/> that should be added \n            to the project as listeners.\n            </summary>\n            <value>\n            A collection of fully qualified type names that should be added as \n            listeners to the <see cref=\"T:NAnt.Core.Project\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.ExtensionAssemblies\">\n            <summary>\n            Gets a collection of assemblies to load extensions from.\n            </summary>\n            <value>\n            A collection of assemblies to load extensions from.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.ShowProjectHelp\">\n            <summary>\n            Gets or sets a value indicating whether <see cref=\"T:NAnt.Core.Project\"/> help \n            should be printed.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if <see cref=\"T:NAnt.Core.Project\"/> help should be \n            printed; otherwise, <see langword=\"false\"/>. The default is\n            <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.NoLogo\">\n            <summary>\n            Gets or sets a value indicating whether the logo banner should be\n            printed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the logo banner should be printed; otherwise, \n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.ShowHelp\">\n            <summary>\n            Gets or sets a value indicating whether the NAnt help should be\n            printed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if NAnt help should be printed; otherwise, \n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.CommandLineOptions.Targets\">\n            <summary>\n            Gets a collection containing the targets that should be executed.\n            </summary>\n            <value>\n            A collection that contains the targets that should be executed.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.ConfigurationSection\">\n            <summary>\n            Custom configuration section handler for the <nantsettings/> element.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ConfigurationSection.Create(System.Object,System.Object,System.Xml.XmlNode)\">\n            <summary>\n            This just passed things through. Return the node read from the config file.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.ConsoleDriver\">\n            <summary>\n            Main entry point to NAnt that is called by the ConsoleStub.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.Main(System.String[])\">\n            <summary>\n            Starts NAnt. This is the Main entry point.\n            </summary>\n            <param name=\"args\">Command Line args, or whatever you want to pass it. They will treated as Command Line args.</param>\n            <returns>\n            The exit code.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.ShowProjectHelp(System.Xml.XmlDocument)\">\n            <summary>\n            Prints the projecthelp to the console.\n            </summary>\n            <param name=\"buildDoc\">The build file to show help for.</param>\n            <remarks>\n            <paramref name=\"buildDoc\" /> is loaded and transformed with \n            <c>ProjectHelp.xslt</c>, which is an embedded resource.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.GetBuildFileName(System.String,System.String,System.Boolean)\">\n            <summary>\n            Gets the file name for the build file in the specified directory.\n            </summary>\n            <param name=\"directory\">The directory to look for a build file.  When in doubt use Environment.CurrentDirectory for directory.</param>\n            <param name=\"searchPattern\">Look for a build file with this pattern or name.  If null look for a file that matches the default build pattern (*.build).</param>\n            <param name=\"findInParent\">Whether or not to search the parent directories for a build file.</param>\n            <returns>The path to the build file or <c>null</c> if no build file could be found.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.LoadExtensionAssemblies(System.Collections.Specialized.StringCollection,NAnt.Core.Project)\">\n            <summary>\n            Loads the extension assemblies in the current <see cref=\"T:System.AppDomain\"/>\n            and scans them for extensions.\n            </summary>\n            <param name=\"extensionAssemblies\">The extension assemblies to load.</param>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> which will be used to output messages to the build log.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.CreateLogger(System.String)\">\n            <summary>\n            Dynamically constructs an <see cref=\"T:NAnt.Core.IBuildLogger\"/> instance of \n            the class specified.\n            </summary>\n            <remarks>\n            <para>\n            At this point, only looks in the assembly where <see cref=\"T:NAnt.Core.IBuildLogger\"/> \n            is defined.\n            </para>\n            </remarks>\n            <param name=\"typeName\">The fully qualified name of the logger that should be instantiated.</param>\n            <exception cref=\"T:System.TypeLoadException\">Type <paramref name=\"typeName\"/> could not be loaded.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"typeName\"/> does not implement <see cref=\"T:NAnt.Core.IBuildLogger\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.CreateListener(System.String)\">\n            <summary>\n            Dynamically constructs an <see cref=\"T:NAnt.Core.IBuildListener\"/> instance of \n            the class specified.\n            </summary>\n            <remarks>\n            <para>\n            At this point, only looks in the assembly where <see cref=\"T:NAnt.Core.IBuildListener\"/> \n            is defined.\n            </para>\n            </remarks>\n            <param name=\"typeName\">The fully qualified name of the listener that should be instantiated.</param>\n            <exception cref=\"T:System.TypeLoadException\">Type <paramref name=\"typeName\"/> could not be loaded.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"typeName\"/> does not implement <see cref=\"T:NAnt.Core.IBuildListener\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.AddBuildListeners(NAnt.Core.CommandLineOptions,NAnt.Core.Project)\">\n            <summary>\n            Add the listeners specified in the command line arguments,\n            along with the default listener, to the specified project.\n            </summary>\n            <param name=\"cmdlineOptions\">The command-line options.</param>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> to add listeners to.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.ShowHelp(NAnt.Core.Util.CommandLineParser)\">\n            <summary>\n            Spits out generic help info to the console.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ConsoleDriver.WriteException(System.Exception)\">\n            <summary>\n            Write the message of the specified <see cref=\"T:System.Exception\"/> and\n            the inner exceptions to <see cref=\"P:System.Console.Error\"/>.\n            </summary>\n            <param name=\"cause\">The <see cref=\"T:System.Exception\"/> to write to <see cref=\"P:System.Console.Error\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilder.#ctor(NAnt.Core.Extensibility.ExtensionAssembly,System.String)\">\n            <summary>\n            Creates a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> \n            class for the specified <see cref=\"T:NAnt.Core.DataTypeBase\"/> class in the \n            <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> specified.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:NAnt.Core.DataTypeBase\"/>.</param>\n            <param name=\"className\">The class representing the <see cref=\"T:NAnt.Core.DataTypeBase\"/>.</param>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBaseBuilder.ClassName\">\n            <summary>\n            Gets the name of the <see cref=\"T:NAnt.Core.DataTypeBase\"/> class that can be\n            created using this <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/>.\n            </summary>\n            <value>\n            The name of the <see cref=\"T:NAnt.Core.DataTypeBase\"/> class that can be created\n            using this <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBaseBuilder.DataTypeName\">\n            <summary>\n            Gets the name of the data type which the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/>\n            can create.\n            </summary>\n            <value>\n            The name of the data type which the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/>\n            can create.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.DataTypeBaseBuilderCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.#ctor(NAnt.Core.DataTypeBaseBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.#ctor(NAnt.Core.DataTypeBaseBuilder[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.Add(NAnt.Core.DataTypeBaseBuilder)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.AddRange(NAnt.Core.DataTypeBaseBuilder[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.AddRange(NAnt.Core.DataTypeBaseBuilderCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.Contains(NAnt.Core.DataTypeBaseBuilder)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> for the specified \n            task is in the collection.\n            </summary>\n            <param name=\"taskName\">The name of task for which the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> should be located in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> for \n            the specified task is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.CopyTo(NAnt.Core.DataTypeBaseBuilder[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.IndexOf(NAnt.Core.DataTypeBaseBuilder)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/>. If the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.Insert(System.Int32,NAnt.Core.DataTypeBaseBuilder)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.DataTypeBaseBuilderEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderCollection.Remove(NAnt.Core.DataTypeBaseBuilder)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBaseBuilderCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBaseBuilderCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> for the specified task.\n            </summary>\n            <param name=\"dataTypeName\">The name of task for which the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> should be located in the collection.</param> \n        </member>\n        <member name=\"T:NAnt.Core.DataTypeBaseBuilderEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> elements of a <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderEnumerator.#ctor(NAnt.Core.DataTypeBaseBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseBuilderEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.DataTypeBaseBuilderCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseBuilderEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DataTypeBaseBuilderEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseDictionary.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseDictionary\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseDictionary.#ctor(System.Int32)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DataTypeBaseDictionary\"/> class\n            with the specified capacity.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DataTypeBaseDictionary.Inherit(NAnt.Core.DataTypeBaseDictionary)\">\n            <summary>\n            Inherits Properties from an existing property\n            dictionary Instance\n            </summary>\n            <param name=\"source\">DataType list to inherit</param>       \n        </member>\n        <member name=\"T:NAnt.Core.DirectoryScanner\">\n            <summary>\n            Used for searching filesystem based on given include/exclude rules.\n            </summary>\n            <example>\n                <para>Simple client code for testing the class.</para>\n                <code>\n                    while (true) {\n                        DirectoryScanner scanner = new DirectoryScanner();\n                                    Console.Write(\"Scan Basedirectory : \");\n                        string s = Console.ReadLine();\n                        if (s.Length == 0) break;\n                        scanner.BaseDirectory = s;\n                                    while(true) {\n                            Console.Write(\"Include pattern : \");\n                            s = Console.ReadLine();\n                            if (s.Length == 0) break;\n                            scanner.Includes.Add(s);\n                        }\n                                    while(true) {\n                            Console.Write(\"Exclude pattern : \");\n                            s = Console.ReadLine();\n                            if (s.Length == 0) break;\n                            scanner.Excludes.Add(s);\n                        }\n                                    foreach (string name in scanner.FileNames)\n                            Console.WriteLine(\"file:\" + name);\n                        foreach (string name in scanner.DirectoryNames)\n                            Console.WriteLine(\"dir :\" + name);\n                                    Console.WriteLine(\"\");\n                    }\n                </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DirectoryScanner\"/>.\n            </summary>\n            <remarks>\n            On unix, patterns are matching case-sensitively; otherwise, they\n            are matched case-insensitively.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.#ctor(System.Boolean)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DirectoryScanner\"/>\n            specifying whether patterns are to be match case-sensitively.\n            </summary>\n            <param name=\"caseSensitive\">Specifies whether patterns are to be matched case-sensititely.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.DirectoryScanner\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.DirectoryScanner\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.Scan\">\n            <summary>\n            Uses <see cref=\"P:NAnt.Core.DirectoryScanner.Includes\"/> and <see cref=\"P:NAnt.Core.DirectoryScanner.Excludes\"/> search criteria (relative to \n            <see cref=\"P:NAnt.Core.DirectoryScanner.BaseDirectory\"/> or absolute), to search for filesystem objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.ConvertPatterns(System.Collections.Specialized.StringCollection,System.Collections.ArrayList,System.Collections.Specialized.StringCollection,System.Boolean)\">\n            <summary>\n            Parses specified NAnt search patterns for search directories and \n            corresponding regex patterns.\n            </summary>\n            <param name=\"nantPatterns\">In. NAnt patterns. Absolute or relative paths.</param>\n            <param name=\"regexPatterns\">Out. Regex patterns. Absolute canonical paths.</param>\n            <param name=\"nonRegexFiles\">Out. Non-regex files. Absolute canonical paths.</param>\n            <param name=\"addSearchDirectories\">In. Whether to allow a pattern to add search directories.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.ParseSearchDirectoryAndPattern(System.Boolean,System.String,System.String@,System.Boolean@,System.Boolean@,System.String@)\">\n            <summary>\n            Given a NAnt search pattern returns a search directory and an regex \n            search pattern.\n            </summary>\n            <param name=\"isInclude\">Whether this pattern is an include or exclude pattern</param>\n            <param name=\"originalNAntPattern\">NAnt searh pattern (relative to the Basedirectory OR absolute, relative paths refering to parent directories ( ../ ) also supported)</param>\n            <param name=\"searchDirectory\">Out. Absolute canonical path to the directory to be searched</param>\n            <param name=\"recursive\">Out. Whether the pattern is potentially recursive or not</param>\n            <param name=\"isRegex\">Out. Whether this is a regex pattern or not</param>\n            <param name=\"regexPattern\">Out. Regex search pattern (absolute canonical path)</param>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.ScanDirectory(System.String,System.Boolean)\">\n            <summary>\n            Searches a directory recursively for files and directories matching \n            the search criteria.\n            </summary>\n            <param name=\"path\">Directory in which to search (absolute canonical path)</param>\n            <param name=\"recursive\">Whether to scan recursively or not</param>\n        </member>\n        <member name=\"M:NAnt.Core.DirectoryScanner.ToRegexPattern(System.String)\">\n            <summary>\n            Converts search pattern to a regular expression pattern.\n            </summary>\n            <param name=\"nantPattern\">Search pattern relative to the search directory.</param>\n            <returns>Regular expresssion</returns>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.CaseSensitive\">\n            <summary>\n            Gets or set a value indicating whether or not to use case-sensitive\n            pattern matching.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.Includes\">\n            <summary>\n            Gets the collection of include patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.Excludes\">\n            <summary>\n            Gets the collection of exclude patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.BaseDirectory\">\n            <summary>\n            The base directory to scan. The default is the \n            <see cref=\"P:System.Environment.CurrentDirectory\">current directory</see>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.FileNames\">\n            <summary>\n            Gets the list of files that match the given patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.DirectoryNames\">\n            <summary>\n            Gets the list of directories that match the given patterns.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DirectoryScanner.ScannedDirectories\">\n            <summary>\n            Gets the list of directories that were scanned for files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.StringCollectionWithGoodToString.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.StringCollectionWithGoodToString\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.StringCollectionWithGoodToString\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.StringCollectionWithGoodToString.ToString\">\n            <summary>\n            Creates a string representing a list of the strings in the collection.\n            </summary>\n            <returns>\n            A string that represents the contents.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DirScannerStringCollection.#ctor(System.Boolean)\">\n            <summary>\n            Initialize a new instance of the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>\n            class specifying whether or not string comparison should be\n            case-sensitive.\n            </summary>\n            <param name=\"caseSensitive\">Specifies whether or not string comparison should be case-sensitive.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DirScannerStringCollection.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.DirScannerStringCollection.Contains(System.String)\">\n            <summary>\n            Determines whether the specified string is in the \n            <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>.\n            </summary>\n            <param name=\"value\">The string to locate in the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>. The value can be <see langword=\"null\"/>.</param>\n            <returns>\n            <seee langword=\"true\"/> if value is found in the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            String comparisons within the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>\n            are only case-sensitive if <see cref=\"P:NAnt.Core.DirScannerStringCollection.CaseSensitive\"/> is\n            <see langword=\"true\"/>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DirScannerStringCollection.IndexOf(System.String)\">\n            <summary>\n            Searches for the specified string and returns the zero-based index \n            of the first occurrence within the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>.\n            </summary>\n            <param name=\"value\">The string to locate. The value can be <see langword=\"null\"/>.</param>\n            <returns>\n            The zero-based index of the first occurrence of <paramref name=\"value\"/> \n            in the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>, if found; otherwise, -1.\n            </returns>\n            <remarks>\n            String comparisons within the <see cref=\"T:NAnt.Core.DirScannerStringCollection\"/>\n            are only case-sensitive if <see cref=\"P:NAnt.Core.DirScannerStringCollection.CaseSensitive\"/> is\n            <see langword=\"true\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.DirScannerStringCollection.CaseSensitive\">\n            <summary>\n            Gets a value indicating whether string comparison is case-sensitive.\n            </summary>\n            <value>\n            A value indicating whether string comparison is case-sensitive.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.ExpressionEvaluator.GetPropertyValue(System.String)\">\n            <summary>\n            Gets the value of the specified property.\n            </summary>\n            <param name=\"propertyName\">The name of the property to get the value of.</param>\n            <returns>\n            The value of the specified property.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.ExpressionTokenizer\">\n            <summary>\n            Splits an input string into a sequence of tokens used during parsing.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.ExpressionTokenizer.TokenType\">\n            <summary>\n            Available tokens\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.FrameworkInfo\">\n            <summary>\n            Encalsulates information about installed frameworks incuding version \n            information and directory locations for finding tools.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.FrameworkInfo.ResolveAssembly(System.String)\">\n            <summary>\n            Resolves the specified assembly to a full path by matching it\n            against the reference assemblies.\n            </summary>\n            <param name=\"fileName\">The file name of the assembly to resolve (without path information).</param>\n            <returns>\n            An absolute path to the assembly, or <see langword=\"null\" /> if the\n            assembly could not be found or no reference assemblies are configured\n            for the current framework.\n            </returns>\n            <remarks>\n            Whether the file name is matched case-sensitively depends on the\n            operating system.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.FrameworkInfo.GetToolPath(System.String)\">\n            <summary>\n            Searches the list of tool paths of the current framework for the\n            given file, and returns the absolute path if found.\n            </summary>\n            <param name=\"tool\">The file name of the tool to search for.</param>\n            <returns>\n            The absolute path to <paramref name=\"tool\"/> if found in one of the\n            configured tool paths; otherwise, <see langword=\"null\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"tool\"/> is <see langword=\"null\"/>.</exception>\n            <remarks>\n              <para>\n              The configured tool paths are scanned in the order in which they\n              are defined in the framework configuration.\n              </para>\n              <para>\n              The file name of the tool to search should include the extension.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.FrameworkInfo.GetXmlAttributeValue(System.Xml.XmlNode,System.String)\">\n            <summary>\n            Gets the value of the specified attribute from the specified node.\n            </summary>\n            <param name=\"xmlNode\">The node of which the attribute value should be retrieved.</param>\n            <param name=\"attributeName\">The attribute of which the value should be returned.</param>\n            <returns>\n            The value of the attribute with the specified name or <see langword=\"null\" />\n            if the attribute does not exist or has no value.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Name\">\n            <summary>\n            Gets the name of the framework.\n            </summary>\n            <value>\n            The name of the framework.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Family\">\n            <summary>\n            Gets the family of the framework.\n            </summary>\n            <value>\n            The family of the framework.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Description\">\n            <summary>\n            Gets the description of the framework.\n            </summary>\n            <value>\n            The description of the framework.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Vendor\">\n            <summary>\n            Gets the vendor of the framework.\n            </summary>\n            <value>\n            The vendor of the framework.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Version\">\n            <summary>\n            Gets the version of the framework.\n            </summary>\n            <value>\n            The version of the framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n            <remarks>\n            When <see cref=\"P:NAnt.Core.FrameworkInfo.Version\"/> is not configured, the framework is not\n            considered valid.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.ClrVersion\">\n            <summary>\n            Gets the Common Language Runtime version of the framework.\n            </summary>\n            <value>\n            The Common Language Runtime version of the framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n            <remarks>\n            When <see cref=\"P:NAnt.Core.FrameworkInfo.ClrVersion\"/> is <see langword=\"null\"/>, the\n            framework is not considered valid.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.ClrType\">\n            <summary>\n            Gets the CLR type of the framework.\n            </summary>\n            <value>\n            The CLR type of the framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.VisualStudioVersion\">\n            <summary>\n            Gets the Visual Studio version that corresponds with this\n            framework.\n            </summary>\n            <value>\n            The Visual Studio version that corresponds with this framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n            <exception cref=\"T:NAnt.Core.BuildException\">There is no version of Visual Studio that corresponds with this framework.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.FrameworkDirectory\">\n            <summary>\n            Gets the base directory of the framework tools for the framework.\n            </summary>\n            <value>\n            The base directory of the framework tools for the framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Runtime\">\n            <summary>\n            Gets the runtime information for this framework.\n            </summary>\n            <value>\n            The runtime information for the framework or <see langword=\"null\"/>\n            if no runtime information is configured for the framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.FrameworkAssemblyDirectory\">\n            <summary>\n            Gets the directory where the system assemblies for the framework\n            are located.\n            </summary>\n            <value>\n            The directory where the system assemblies for the framework are \n            located.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.SdkDirectory\">\n            <summary>\n            Gets the directory containing the SDK tools for the framework.\n            </summary>\n            <value>\n            The directory containing the SDK tools for the framework or a null \n            reference if the configured sdk directory does not exist, or is not\n            valid.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.Project\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.FrameworkInfo.Project\"/> used to initialize this framework.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.FrameworkInfo.Project\"/> used to initialize this framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.TaskAssemblies\">\n            <summary>\n            Gets the set of assemblies and directories that should scanned for\n            NAnt tasks, types or functions.\n            </summary>\n            <value>\n            The set of assemblies and directories that should be scanned for \n            NAnt tasks, types or functions.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.IsValid\">\n            <summary>\n            Returns a value indicating whether the current framework is valid.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the framework is installed and correctly\n            configured; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.ReferenceAssemblies\">\n            <summary>\n            Gets the reference assemblies for the current framework.\n            </summary>\n            <value>\n            The reference assemblies for the current framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.ToolPaths\">\n            <summary>\n            Gets the tool paths for the current framework.\n            </summary>\n            <value>\n            The tool paths for the current framework.\n            </value>\n            <exception cref=\"T:System.ArgumentException\">The framework is not valid.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.FrameworkInfo.NamespaceManager\">\n            <summary>\n            Gets the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.FrameworkInfo.NamespaceManager\"/> defines the current namespace \n            scope and provides methods for looking up namespace information.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.FrameworkInfoDictionary.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.FrameworkInfoDictionary\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.FrameworkInfoDictionary.#ctor(System.Int32)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.FrameworkInfoDictionary\"/> class\n            with the specified capacity.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.FrameworkTypes\">\n            <summary>\n            Defines the types of frameworks.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.NotInstalled\">\n            <summary>\n            Frameworks that are supported on the current platform, but are not\n            installed.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.Installed\">\n            <summary>\n            Frameworks that are installed on the current system.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.InstallStateMask\">\n            <summary>\n            Retrieves installation state attributes.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.Desktop\">\n            <summary>\n            Frameworks that typically target full desktop devices.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.Compact\">\n            <summary>\n            Frameworks that target compact devices.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.Browser\">\n            <summary>\n            Frameworks that run in a browser.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.DeviceMask\">\n            <summary>\n            Retrieves device attributes.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.Mono\">\n            <summary>\n            Frameworks released as part of the open-source <see href=\"http://www.mono-project.com\">Mono</see>\n            project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.MS\">\n            <summary>\n            Frameworks released by Microsoft.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.VendorMask\">\n            <summary>\n            Retrieves vendor attributes.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.FrameworkTypes.All\">\n            <summary>\n            All frameworks supported on the current platform, regarless of their\n            installation state, target device or vendor.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Location\">\n            <summary>\n            Stores the file name, line number and column number to record a position \n            in a text file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Location.#ctor(System.String,System.Int32,System.Int32)\">\n            <summary>\n            Creates a location consisting of a file name, line number and \n            column number.\n            </summary>\n            <remarks>\n            <paramref name=\"fileName\" /> can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Location.#ctor(System.String)\">\n            <summary>\n            Creates a location consisting of a file name.\n            </summary>\n            <remarks>\n            <paramref name=\"fileName\" /> can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Location.#ctor\">\n            <summary>\n            Creates an \"unknown\" location.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Location.Init(System.String,System.Int32,System.Int32)\">\n            <summary>Private Init function.</summary>\n        </member>\n        <member name=\"M:NAnt.Core.Location.ToString\">\n             <summary>\n             Returns the file name, line number and a trailing space. An error\n             message can be appended easily. For unknown locations, returns\n             an empty string.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Location.FileName\">\n            <summary>\n            Gets a string containing the file name for the location.\n            </summary>\n            <remarks>\n            The file name includes both the file path and the extension.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Location.LineNumber\">\n            <summary>\n            Gets the line number for the location.\n            </summary>\n            <remarks>\n            Lines start at 1.  Will be zero if not specified.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Location.ColumnNumber\">\n            <summary>\n            Gets the column number for the location.\n            </summary>\n            <remarks>\n            Columns start a 1.  Will be zero if not specified.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.LocationMap\">\n            <summary>\n            Maps XML nodes to the text positions from their original source.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LocationMap.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.LocationMap\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LocationMap.FileIsMapped(System.String)\">\n            <summary>\n            Determines if a file has been loaded by the current project. \n            </summary>\n            <param name=\"fileOrUri\">The file to check.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified file has already been loaded\n            by the current project; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.LocationMap.Add(System.Xml.XmlDocument)\">\n            <summary>\n            Adds an <see cref=\"T:System.Xml.XmlDocument\"/> to the map.\n            </summary>\n            <remarks>\n            An <see cref=\"T:System.Xml.XmlDocument\"/> can only be added to the map once.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.LocationMap.GetLocation(System.Xml.XmlNode)\">\n            <summary>\n            Returns the <see cref=\"T:NAnt.Core.Location\"/> in the XML file for the given node.\n            </summary>\n            <remarks>\n            The <paramref name=\"node\"/> must be from an <see cref=\"T:System.Xml.XmlDocument\"/> \n            that has been added to the map.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.LocationMap.TextPosition\">\n            <summary>\n            Represents a position in the build file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LocationMap.TextPosition.#ctor(System.Int32,System.Int32)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.LocationMap.TextPosition\"/>\n            with the speified line and column.\n            </summary>\n            <param name=\"line\">The line coordinate of the position.</param>\n            <param name=\"column\">The column coordinate of the position.</param>\n        </member>\n        <member name=\"F:NAnt.Core.LocationMap.TextPosition.Line\">\n            <summary>\n            The line coordinate of the position.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.LocationMap.TextPosition.Column\">\n            <summary>\n            The column coordinate of the position.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.Level\">\n            <summary>\n            Defines the set of levels recognised by the NAnt logging system.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.Debug\">\n            <summary>\n            Designates fine-grained informational events that are most useful \n            to debug a build process.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.Verbose\">\n            <summary>\n            Designates events that offer a more detailed view of the build \n            process.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.Info\">\n            <summary>\n            Designates informational events that are useful for getting a \n            high-level view of the build process.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.Warning\">\n            <summary>\n            Designates potentionally harmful events.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.Error\">\n            <summary>\n            Designates error events.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Level.None\">\n            <summary>\n            Can be used to suppress all messages.\n            </summary>\n            <remarks>\n            No events should be logged with this <see cref=\"T:NAnt.Core.Level\"/>.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Core.BuildEventArgs\">\n            <summary>\n            Class representing an event occurring during a build.\n            </summary>\n            <remarks>\n            <para>\n            An event is built by specifying either a project, a task or a target.\n            </para>\n            <para>\n            A <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> level event will only have a <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> \n            reference.\n            </para>\n            <para>\n            A <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> level event will have <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> and \n            <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> references.\n            </para>\n            <para>\n            A <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> level event will have <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/>, \n            <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> and <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> references.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.BuildEventArgs.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildEventArgs\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildEventArgs.#ctor(NAnt.Core.Project)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildEventArgs\"/>\n            class for a <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> level event.\n            </summary>\n            <param name=\"project\">The <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> that emitted the event.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildEventArgs.#ctor(NAnt.Core.Target)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildEventArgs\"/>\n            class for a <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> level event.\n            </summary>\n            <param name=\"target\">The <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> that emitted the event.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildEventArgs.#ctor(NAnt.Core.Task)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildEventArgs\"/>\n            class for a <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> level event.\n            </summary>\n            <param name=\"task\">The <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> that emitted the event.</param>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.Message\">\n            <summary>\n            Gets or sets the message associated with this event.\n            </summary>\n            <value>\n            The message associated with this event.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.MessageLevel\">\n            <summary>\n            Gets or sets the priority level associated with this event.\n            </summary>\n            <value>\n            The priority level associated with this event.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.Exception\">\n            <summary>\n            Gets or sets the <see cref=\"P:NAnt.Core.BuildEventArgs.Exception\"/> associated with this event.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.BuildEventArgs.Exception\"/> associated with this event.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.Project\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> that fired this event.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> that fired this event.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.Target\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> that fired this event.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> that fired this event, or a null reference \n            if this is a <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> level event.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.BuildEventArgs.Task\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> that fired this event.\n            </summary>\n            <value>\n            The <see cref=\"P:NAnt.Core.BuildEventArgs.Task\"/> that fired this event, or <see langword=\"null\"/>\n            if this is a <see cref=\"P:NAnt.Core.BuildEventArgs.Project\"/> or <see cref=\"P:NAnt.Core.BuildEventArgs.Target\"/> level \n            event.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.BuildEventHandler\">\n            <summary>\n            Represents the method that handles the build events.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"T:NAnt.Core.IBuildListener\">\n            <summary>\n            Instances of classes that implement this interface can register to be \n            notified when things happen during a build.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.BuildStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a build has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event is fired before any targets have started.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.BuildFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that the last target has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.TargetStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a target has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.TargetFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a target has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.TaskStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.TaskFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildListener.MessageLogged(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a message has been logged.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"T:NAnt.Core.IBuildLogger\">\n            <summary>\n            Interface used by NAnt to log the build output. \n            </summary>\n            <remarks>\n            Depending on the supplied command-line arguments, NAnt will set the\n            <see cref=\"P:NAnt.Core.IBuildLogger.OutputWriter\"/> to <see cref=\"P:System.Console.Out\"/> or a\n            <see cref=\"T:System.IO.StreamWriter\"/>  with a file as backend store.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.IBuildLogger.Flush\">\n            <summary>\n            Flushes buffered build events or messages to the underlying storage.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.IBuildLogger.Threshold\">\n            <summary>\n            Gets or sets the highest level of message this logger should respond \n            to.\n            </summary>\n            <value>The highest level of message this logger should respond to.</value>\n            <remarks>\n            Only messages with a message level higher than or equal to the given \n            level should actually be written to the log.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.IBuildLogger.EmacsMode\">\n            <summary>\n            Gets or sets a value indicating whether to produce emacs (and other\n            editor) friendly output.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if output is to be unadorned so that emacs \n            and other editors can parse files names, etc.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.IBuildLogger.OutputWriter\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.IO.TextWriter\"/> to which the logger is \n            to send its output.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.DefaultLogger\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.Flush\">\n            <summary>\n            Flushes buffered build events or messages to the underlying storage.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.BuildStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a build has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event is fired before any targets have started.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.BuildFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that the last target has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.TargetStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a target has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.TargetFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.TaskStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.TaskFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.MessageLogged(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a message has been logged.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            Only messages with a priority higher or equal to the threshold of \n            the logger will actually be output in the build log.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.Log(System.String)\">\n            <summary>\n            Empty implementation which allows derived classes to receive the\n            output that is generated in this logger.\n            </summary>\n            <param name=\"message\">The message being logged.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.OutputMessage(NAnt.Core.Level,System.String,System.Int32)\">\n            <summary>\n            Outputs an indented message to the build log if its priority is \n            greather than or equal to the <see cref=\"P:NAnt.Core.DefaultLogger.Threshold\"/> of the \n            logger.\n            </summary>\n            <param name=\"messageLevel\">The priority of the message to output.</param>\n            <param name=\"message\">The message to output.</param>\n            <param name=\"indentationLength\">The number of characters that the message should be indented.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.OutputMessage(NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Outputs an indented message to the build log if its priority is \n            greather than or equal to the <see cref=\"P:NAnt.Core.DefaultLogger.Threshold\"/> of the \n            logger.\n            </summary>\n            <param name=\"e\">The event to output.</param>\n        </member>\n        <member name=\"M:NAnt.Core.DefaultLogger.OutputMessage(NAnt.Core.BuildEventArgs,System.Int32)\">\n            <summary>\n            Outputs an indented message to the build log if its priority is \n            greather than or equal to the <see cref=\"P:NAnt.Core.DefaultLogger.Threshold\"/> of the \n            logger.\n            </summary>\n            <param name=\"e\">The event to output.</param>\n            <param name=\"indentationLength\">The number of characters that the message should be indented.</param>\n        </member>\n        <member name=\"F:NAnt.Core.DefaultLogger._buildReports\">\n            <summary>\n            Holds a stack of reports for all running builds.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.DefaultLogger.Threshold\">\n            <summary>\n            Gets or sets the highest level of message this logger should respond \n            to.\n            </summary>\n            <value>\n            The highest level of message this logger should respond to.\n            </value>\n            <remarks>\n            Only messages with a message level higher than or equal to the given \n            level should be written to the log.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.DefaultLogger.EmacsMode\">\n            <summary>\n            Gets or sets a value indicating whether to produce emacs (and other\n            editor) friendly output.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if output is to be unadorned so that emacs \n            and other editors can parse files names, etc. The default is\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.DefaultLogger.OutputWriter\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.IO.TextWriter\"/> to which the logger is \n            to send its output.\n            </summary>\n            <value>\n            The <see cref=\"T:System.IO.TextWriter\"/> to which the logger sends its output.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.BuildReport\">\n            <summary>\n            Used to store information about a build, to allow better reporting to \n            the user.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.BuildReport.Errors\">\n            <summary>\n            Errors encountered so far.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.BuildReport.Warnings\">\n            <summary>\n            Warnings encountered so far.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.BuildReport.StartTime\">\n            <summary>\n            The start time of the build process.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.MailLogger\">\n            <summary>\n            Buffers log messages from DefaultLogger, and sends an e-mail with the\n            results.\n            </summary>\n            <remarks>\n            The following properties are used to send the mail :\n            <list type=\"table\">\n                <listheader>\n                    <term>Property</term>\n                    <description>Description</description>\n                </listheader>\n                <item>\n                    <term>MailLogger.mailhost</term>\n                    <description>Mail server to use. [default: localhost]</description>\n                </item>\n                <item>\n                    <term>MailLogger.from</term>\n                    <description>The address of the e-mail sender.</description>\n                </item>\n                <item>\n                    <term>MailLogger.failure.notify</term>\n                    <description>Send build failure e-mails ? [default: true]</description>\n                </item>\n                <item>\n                    <term>MailLogger.success.notify</term>\n                    <description>Send build success e-mails ? [default: true]</description>\n                </item>\n                <item>\n                    <term>MailLogger.failure.to</term>\n                    <description>The address to send build failure messages to.</description>\n                </item>\n                <item>\n                    <term>MailLogger.success.to</term>\n                    <description>The address to send build success messages to.</description>\n                </item>\n                <item>\n                    <term>MailLogger.failure.subject</term>\n                    <description>The subject of build failure messages. [default: \"Build Failure\"]</description>\n                </item>\n                <item>\n                    <term>MailLogger.success.subject</term>\n                    <description>The subject of build success messages. [default: \"Build Success\"]</description>\n                </item>\n                <item>\n                    <term>MailLogger.success.attachments</term>\n                    <description>The ID of a fileset holdng set of files to attach when the build is successful.</description>\n                </item>\n                <item>\n                    <term>MailLogger.failure.attachments</term>\n                    <description>The ID of a fileset holdng set of files to attach when the build fails.</description>\n                </item>\n                <item>\n                    <term>MailLogger.body.encoding</term>\n                    <description>The encoding type of the body of the e-mail message. [default: system's ANSI code page]</description>\n                </item>\n                <item>\n                    <term>MailLogger.smtp.username</term>\n                    <description>The name of the user to login to the SMTP server.</description>\n                </item>\n                <item>\n                    <term>MailLogger.smtp.password</term>\n                    <description>The password of the specified user.</description>\n                </item>\n                <item>\n                    <term>MailLogger.smtp.enablessl</term>\n                    <description>Specifies whether to use SSL to encrypt the connection. [default: false]</description>\n                </item>\n                <item>\n                    <term>MailLogger.smtp.port</term>\n                    <description>The SMTP server port to connect to. [default: 25]</description>\n                </item>\n            </list>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.MailLogger.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.MailLogger\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.MailLogger.BuildStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a build has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event is fired before any targets have started.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.MailLogger.BuildFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that the last target has finished, and send an e-mail with \n            the build results.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.MailLogger.Log(System.String)\">\n            <summary>\n            Receives and buffers log messages.\n            </summary>\n            <param name=\"message\">The message being logged.</param>\n        </member>\n        <member name=\"M:NAnt.Core.MailLogger.GetPropertyValue(NAnt.Core.PropertyDictionary,System.String,System.String,System.Boolean)\">\n            <summary>\n            Gets the value of the specified property.\n            </summary>\n            <param name=\"properties\">Properties to obtain value from.</param>\n            <param name=\"name\">Suffix of property name.  \"MailLogger\" will be prepended internally.</param>\n            <param name=\"defaultValue\">Value returned if property is not present in <paramref name=\"properties\"/>.</param>\n            <param name=\"required\">Value indicating whether the property should exist, or have a default value set.</param>\n            <returns>\n            The value of the specified property; or the default value if the \n            property is not present in <paramref name=\"properties\"/>.\n            </returns>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"required\"/> is <see langword=\"true\"/>, and the specified property is not present and no default value has been given.</exception>\n        </member>\n        <member name=\"F:NAnt.Core.MailLogger._buffer\">\n            <summary>\n            Buffer in which the message is constructed prior to sending.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.MailLogger._projectStack\">\n            <summary>\n            Holds the stack of currently executing projects.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.BuildListenerCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.Core.IBuildListener\"/> \n            objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.#ctor(NAnt.Core.BuildListenerCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> \n            class with the specified <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.#ctor(NAnt.Core.IBuildListener[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> \n            class with the specified array of <see cref=\"T:NAnt.Core.IBuildListener\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.Add(NAnt.Core.IBuildListener)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.IBuildListener\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.AddRange(NAnt.Core.IBuildListener[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.IBuildListener\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.IBuildListener\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.AddRange(NAnt.Core.BuildListenerCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.BuildListenerCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.Contains(NAnt.Core.IBuildListener)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.IBuildListener\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.CopyTo(NAnt.Core.IBuildListener[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.IndexOf(NAnt.Core.IBuildListener)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.IBuildListener\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.IBuildListener\"/>. If the <see cref=\"T:NAnt.Core.IBuildListener\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.Insert(System.Int32,NAnt.Core.IBuildListener)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.IBuildListener\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.BuildListenerEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerCollection.Remove(NAnt.Core.IBuildListener)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.BuildListenerCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.Core.BuildListenerEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.IBuildListener\"/> elements of a <see cref=\"T:NAnt.Core.BuildListenerCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerEnumerator.#ctor(NAnt.Core.BuildListenerCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.BuildListenerEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.BuildListenerCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.BuildListenerEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.BuildListenerEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.LogWriter\">\n            <summary>\n            Implements a <see cref=\"T:System.IO.TextWriter\"/> for writing information to \n            the NAnt logging infrastructure.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.#ctor(NAnt.Core.Task,NAnt.Core.Level,System.IFormatProvider)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.LogWriter\"/> class \n            for the specified <see cref=\"T:NAnt.Core.Task\"/> with the specified output \n            level and format provider.\n            </summary>\n            <param name=\"task\">Determines the indentation level.</param>\n            <param name=\"outputLevel\">The <see cref=\"T:NAnt.Core.Level\"/> with which messages will be output to the build log.</param>\n            <param name=\"formatProvider\">An <see cref=\"T:System.IFormatProvider\"/> object that controls formatting.</param>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.Write(System.Char[])\">\n            <summary>\n            Writes a character array to the buffer.\n            </summary>\n            <param name=\"chars\">The character array to write to the text stream.</param>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.Write(System.String)\">\n            <summary>\n            Writes a string to the buffer.\n            </summary>\n            <param name=\"value\"></param>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.WriteLine\">\n            <summary>\n            Writes an empty string to the logging infrastructure.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.WriteLine(System.String)\">\n            <summary>\n            Writes a string to the logging infrastructure.\n            </summary>\n            <param name=\"value\">The string to write. If <paramref name=\"value\" /> is a null reference, only the line termination characters are written.</param>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.WriteLine(System.String,System.Object[])\">\n            <summary>\n            Writes out a formatted string using the same semantics as \n            <see cref=\"M:System.String.Format(System.String,System.Object[])\"/>.\n            </summary>\n            <param name=\"line\">The formatting string.</param>\n            <param name=\"args\">The object array to write into format string.</param>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.Flush\">\n            <summary>\n            Causes any buffered data to be written to the logging infrastructure.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.Close\">\n            <summary>\n            Closes the current writer and releases any system resources \n            associated with the writer.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.LogWriter.InitializeLifetimeService\">\n            <summary>\n            Obtains a lifetime service object to control the lifetime policy for \n            this instance.\n            </summary>\n            <returns>\n            An object of type <see cref=\"T:System.Runtime.Remoting.Lifetime.ILease\"/> used to control the lifetime \n            policy for this instance. This is the current lifetime service object \n            for this instance if one exists; otherwise, a new lifetime service \n            object initialized with a lease that will never time out.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.LogWriter.Encoding\">\n            <summary>\n            Gets the <see cref=\"P:NAnt.Core.LogWriter.Encoding\"/> in which the output is written.\n            </summary>\n            <value>\n            The <see cref=\"T:NAnt.Core.LogWriter\"/> always writes output in UTF8 \n            encoding.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.LogWriter.OutputLevel\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.Level\"/> with which messages will be output to\n            the build log.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.Core.PathScanner\">\n            <summary>\n            Used to search for files on the PATH. \n            </summary>\n            <remarks>\n            <para>\n            The local directory is not searched (since this would already be covered \n            by normal use of the includes element).\n            </para>\n            <para>\n            Also, advanced pattern matching isn't supported: you need to know the \n            exact name of the file.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.System#ICloneable#Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.PathScanner\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.PathScanner\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.PathScanner\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.PathScanner\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.Add(System.String)\">\n            <summary>\n            Adds a file to the list of files to be scanned for.\n            </summary>\n            <param name=\"fileName\">The filename or search pattern to add to the list.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.Scan\">\n            <summary>\n            Scans all direcetories in the PATH environment variable for files.\n            </summary>\n            <returns>\n            List of matching files found in the PATH.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.Scan(System.String)\">\n            <summary>\n            Scans all directories in the given environment variable for files.\n            </summary>\n            <param name=\"name\">The environment variable of which the directories should be scanned.</param>\n            <returns>\n            List of matching files found in the directory of the given \n            environment variable.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PathScanner.Clone(System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Creates a shallow copy of the specified <see cref=\"T:System.Collections.Specialized.StringCollection\"/>.\n            </summary>\n            <param name=\"stringCollection\">The <see cref=\"T:System.Collections.Specialized.StringCollection\"/> that should be copied.</param>\n            <returns>\n            A shallow copy of the specified <see cref=\"T:System.Collections.Specialized.StringCollection\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.PlatformHelper.Is64Bit\">\n            <summary>\n            Returns a value indicating whether NAnt is running in 64-bit mode.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if NAnt is running in 64-bit mode; otherwise,\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.PlatformHelper.Is32Bit\">\n            <summary>\n            Returns a value indicating whether NAnt is running in 32-bit mode.\n            </summary>\n            <remarks>\n            Note that even if the platform is 64-bit, NAnt may be running in\n            32-bit mode.\n            </remarks>\n            <value>\n            <see langword=\"true\" /> if NAnt is running in 32-bit mode; otherwise,\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.PlatformHelper.IsWindows\">\n            <summary>\n            Returns a value indicating whether NAnt is running on Windows.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if NAnt is running on Windows;\n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Project\">\n            <summary>\n            Central representation of a NAnt project.\n            </summary>\n            <example>\n              <para>\n              The <see cref=\"M:NAnt.Core.Project.Run\"/> method will initialize the project with the build\n              file specified in the constructor and execute the default target.\n              </para>\n              <code>\n                <![CDATA[\n            Project p = new Project(\"foo.build\", Level.Info);\n            p.Run();\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              If no target is given, the default target will be executed if specified \n              in the project.\n              </para>\n              <code>\n                <![CDATA[\n            Project p = new Project(\"foo.build\", Level.Info);\n            p.Execute(\"build\");\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.Core.Project.Visiting\">\n            <summary>\n            Constant for the \"visiting\" state, used when traversing a DFS of \n            target dependencies.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Project.Visited\">\n            <summary>\n            Constant for the \"visited\" state, used when traversing a DFS of \n            target dependencies.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Project.logger\">\n            <summary>\n            Holds the logger for this class.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Project._threshold\">\n            <summary>\n            Holds the default threshold for build loggers.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.Xml.XmlDocument,NAnt.Core.Level,System.Int32)\">\n            <summary>\n            Initializes a new <see cref=\"T:NAnt.Core.Project\"/> class with the given \n            document, message threshold and indentation level.\n            </summary>\n            <param name=\"doc\">Any valid build format will do.</param>\n            <param name=\"threshold\">The message threshold.</param>\n            <param name=\"indentLevel\">The project indentation level.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.Xml.XmlDocument,NAnt.Core.Level,System.Int32,System.Xml.XmlNode)\">\n            <summary>\n            Initializes a new <see cref=\"T:NAnt.Core.Project\"/> class with the given \n            document, message threshold and indentation level, and using \n            the specified <see cref=\"T:System.Xml.XmlNode\"/> to load internal configuration\n            settings.\n            </summary>\n            <param name=\"doc\">Any valid build format will do.</param>\n            <param name=\"threshold\">The message threshold.</param>\n            <param name=\"indentLevel\">The project indentation level.</param>\n            <param name=\"configurationNode\">The <see cref=\"T:System.Xml.XmlNode\"/> NAnt should use to initialize configuration settings.</param>\n            <remarks>\n            This constructor is useful for developers using NAnt as a class\n            library.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.String,NAnt.Core.Level,System.Int32)\">\n            <summary>\n            Initializes a new <see cref=\"T:NAnt.Core.Project\"/> class with the given \n            source, message threshold and indentation level.\n            </summary>\n            <param name=\"uriOrFilePath\">\n            <para>The full path to the build file.</para>\n            <para>This can be of any form that <see cref=\"M:System.Xml.XmlDocument.Load(System.String)\"/> accepts.</para>\n            </param>\n            <param name=\"threshold\">The message threshold.</param>\n            <param name=\"indentLevel\">The project indentation level.</param>\n            <remarks>\n            If the source is a uri of form 'file:///path' then use the path part.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.String,NAnt.Core.Level,System.Int32,System.Xml.XmlNode)\">\n            <summary>\n            Initializes a new <see cref=\"T:NAnt.Core.Project\"/> class with the given \n            source, message threshold and indentation level, and using \n            the specified <see cref=\"T:System.Xml.XmlNode\"/> to load internal configuration\n            settings.\n            </summary>\n            <param name=\"uriOrFilePath\">\n            <para>The full path to the build file.</para>\n            <para>This can be of any form that <see cref=\"M:System.Xml.XmlDocument.Load(System.String)\"/> accepts.</para>\n            </param>\n            <param name=\"threshold\">The message threshold.</param>\n            <param name=\"indentLevel\">The project indentation level.</param>\n            <param name=\"configurationNode\">The <see cref=\"T:System.Xml.XmlNode\"/> NAnt should use to initialize configuration settings.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"configurationNode\"/> is <see langword=\"null\"/>.</exception>\n            <remarks>\n            If the source is a uri of form 'file:///path' then use the path part.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.String,NAnt.Core.Project)\">\n            <summary>\n            Initializes a <see cref=\"T:NAnt.Core.Project\"/> as subproject of the specified\n            <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"uriOrFilePath\">\n            <para>The full path to the build file.</para>\n            <para>This can be of any form that <see cref=\"M:System.Xml.XmlDocument.Load(System.String)\"/> accepts.</para>\n            </param>\n            <param name=\"parent\">The parent <see cref=\"T:NAnt.Core.Project\"/>.</param>\n            <remarks>\n            Optimized for framework initialization projects, by skipping automatic\n            discovery of extension assemblies and framework configuration.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.#ctor(System.Xml.XmlDocument)\">\n            <summary>\n            Initializes a <see cref=\"T:NAnt.Core.Project\"/> with <see cref=\"P:NAnt.Core.Project.Threshold\"/>\n            set to <see cref=\"F:NAnt.Core.Level.None\"/>, and <see cref=\"P:NAnt.Core.Project.IndentationLevel\"/>\n            set to 0.\n            </summary>\n            <param name=\"doc\">An <see cref=\"T:System.Xml.XmlDocument\"/> containing the build script.</param>\n            <remarks>\n            Optimized for framework initialization projects, by skipping automatic\n            discovery of extension assemblies and framework configuration.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.GetFrameworks(NAnt.Core.FrameworkTypes)\">\n            <summary>\n            Gets the list of supported frameworks filtered by the specified\n            <see cref=\"T:NAnt.Core.FrameworkTypes\"/> parameter.\n            </summary>\n            <param name=\"types\">A bitwise combination of <see cref=\"T:NAnt.Core.FrameworkTypes\"/> values that filter the frameworks to retrieve.</param>\n            <returns>\n            An array of type <see cref=\"T:NAnt.Core.FrameworkInfo\"/> that contains the\n            frameworks specified by the <paramref name=\"types\"/> parameter,\n            sorted on name.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.GetLocation(System.Xml.XmlNode)\">\n            <summary>\n            Returns the <see cref=\"T:NAnt.Core.Location\"/> of the given node in an XML\n            file loaded by NAnt.\n            </summary>\n            <remarks>\n              <para>\n              The <paramref name=\"node\"/> must be from an <see cref=\"T:System.Xml.XmlDocument\"/>\n              that has been loaded by NAnt.\n              </para>\n              <para>\n              NAnt also does not process any of the following node types:\n              </para>\n              <list type=\"bullet\">\n                <item>\n                    <description><see cref=\"F:System.Xml.XmlNodeType.Whitespace\"/></description>\n                </item>\n                <item>\n                    <description><see cref=\"F:System.Xml.XmlNodeType.EndElement\"/></description>\n                </item>\n                <item>\n                    <description><see cref=\"F:System.Xml.XmlNodeType.ProcessingInstruction\"/></description>\n                </item>\n                <item>\n                    <description><see cref=\"F:System.Xml.XmlNodeType.XmlDeclaration\"/></description>\n                </item>\n                <item>\n                    <description><see cref=\"F:System.Xml.XmlNodeType.DocumentType\"/></description>\n                </item>\n              </list>\n              <para>\n              As a result, no location information is available for these nodes.\n              </para>\n            </remarks>\n            <param name=\"node\">The <see cref=\"T:System.Xml.XmlNode\"/> to get the <see cref=\"T:NAnt.Core.Location\"/> for.</param>\n            <returns>\n            <see cref=\"T:NAnt.Core.Location\"/> of the given node in an XML file loaded by NAnt, or\n            <see cref=\"F:NAnt.Core.Location.UnknownLocation\"/> if the node was not loaded from\n            an XML file.\n            </returns>\n            <exception cref=\"T:System.ArgumentException\">\n              <para><paramref name=\"node\"/> is from an XML file that was not loaded by NAnt.</para>\n              <para>-or</para>\n              <para><paramref name=\"node\"/> was not processed by NAnt (eg. an XML declaration).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnBuildStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.BuildStarted\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnBuildFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.BuildFinished\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnTargetStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.TargetStarted\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnTargetFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.TargetFinished\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnTaskStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.TaskStarted\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnTaskFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches the <see cref=\"F:NAnt.Core.Project.TaskFinished\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.OnMessageLogged(NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Dispatches a <see cref=\"F:NAnt.Core.Project.MessageLogged\"/> event to the build listeners \n            for this <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Writes a <see cref=\"T:NAnt.Core.Project\"/> level message to the build log with\n            the given <see cref=\"T:NAnt.Core.Level\"/>.\n            </summary>\n            <param name=\"messageLevel\">The <see cref=\"T:NAnt.Core.Level\"/> to log at.</param>\n            <param name=\"message\">The message to log.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Writes a <see cref=\"T:NAnt.Core.Project\"/> level formatted message to the build \n            log with the given <see cref=\"T:NAnt.Core.Level\"/>.\n            </summary>\n            <param name=\"messageLevel\">The <see cref=\"T:NAnt.Core.Level\"/> to log at.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Log(NAnt.Core.Task,NAnt.Core.Level,System.String)\">\n            <summary>\n            Writes a <see cref=\"T:NAnt.Core.Task\"/> task level message to the build log \n            with the given <see cref=\"T:NAnt.Core.Level\"/>.\n            </summary>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> from which the message originated.</param>\n            <param name=\"messageLevel\">The <see cref=\"T:NAnt.Core.Level\"/> to log at.</param>\n            <param name=\"message\">The message to log.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Log(NAnt.Core.Target,NAnt.Core.Level,System.String)\">\n            <summary>\n            Writes a <see cref=\"T:NAnt.Core.Target\"/> level message to the build log with \n            the given <see cref=\"T:NAnt.Core.Level\"/>.\n            </summary>\n            <param name=\"target\">The <see cref=\"T:NAnt.Core.Target\"/> from which the message orignated.</param>\n            <param name=\"messageLevel\">The level to log at.</param>\n            <param name=\"message\">The message to log.</param>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Execute\">\n            <summary>\n            Executes the default target.\n            </summary>\n            <remarks>\n            No top level error handling is done. Any <see cref=\"T:NAnt.Core.BuildException\"/> \n            will be passed onto the caller.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Execute(System.String)\">\n            <summary>\n            Executes a specific target, and its dependencies.\n            </summary>\n            <param name=\"targetName\">The name of the target to execute.</param>\n            <remarks>\n            Global tasks are not executed.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Execute(System.String,System.Boolean)\">\n            <summary>\n            Executes a specific target.\n            </summary>\n            <param name=\"targetName\">The name of the target to execute.</param>\n            <param name=\"forceDependencies\">Whether dependencies should be forced to execute</param>\n            <remarks>\n            Global tasks are not executed.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Run\">\n            <summary>\n            Executes the default target and wraps in error handling and time \n            stamping.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the build was successful; otherwise, \n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.CreateTask(System.Xml.XmlNode)\">\n            <summary>\n            Creates a new <see ref=\"Task\"/> from the given <see cref=\"T:System.Xml.XmlNode\"/>.\n            </summary>\n            <param name=\"taskNode\">The <see cref=\"T:NAnt.Core.Task\"/> definition.</param>\n            <returns>The new <see cref=\"T:NAnt.Core.Task\"/> instance.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.CreateTask(System.Xml.XmlNode,NAnt.Core.Target)\">\n            <summary>\n            Creates a new <see cref=\"T:NAnt.Core.Task\"/> from the given <see cref=\"T:System.Xml.XmlNode\"/> \n            within a <see cref=\"T:NAnt.Core.Target\"/>.\n            </summary>\n            <param name=\"taskNode\">The <see cref=\"T:NAnt.Core.Task\"/> definition.</param>\n            <param name=\"target\">The owner <see cref=\"T:NAnt.Core.Target\"/>.</param>\n            <returns>The new <see cref=\"T:NAnt.Core.Task\"/> instance.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.ExpandProperties(System.String,NAnt.Core.Location)\">\n            <summary>\n            Expands a <see cref=\"T:System.String\"/> from known properties.\n            </summary>\n            <param name=\"input\">The <see cref=\"T:System.String\"/> with replacement tokens.</param>\n            <param name=\"location\">The location in the build file. Used to throw more accurate exceptions.</param>\n            <returns>The expanded and replaced <see cref=\"T:System.String\"/>.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.GetFullPath(System.String)\">\n            <summary>\n            Combines the specified path with the <see cref=\"P:NAnt.Core.Project.BaseDirectory\"/> of \n            the <see cref=\"T:NAnt.Core.Project\"/> to form a full path to file or directory.\n            </summary>\n            <param name=\"path\">The relative or absolute path.</param>\n            <returns>\n            A rooted path, or the <see cref=\"P:NAnt.Core.Project.BaseDirectory\"/> of the <see cref=\"T:NAnt.Core.Project\"/> \n            if the <paramref name=\"path\"/> parameter is a null reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.CreateDefaultLogger\">\n            <summary>\n            Creates the default <see cref=\"T:NAnt.Core.IBuildLogger\"/> and attaches it to\n            the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Indent\">\n            <summary>\n            Increases the <see cref=\"P:NAnt.Core.Project.IndentationLevel\"/> of the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.Unindent\">\n            <summary>\n            Decreases the <see cref=\"P:NAnt.Core.Project.IndentationLevel\"/> of the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.DetachBuildListeners\">\n            <summary>\n            Detaches the currently attached <see cref=\"T:NAnt.Core.IBuildListener\"/> instances\n            from the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.AttachBuildListeners(NAnt.Core.BuildListenerCollection)\">\n            <summary>\n            Attaches the specified build listeners to the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"listeners\">The <see cref=\"T:NAnt.Core.IBuildListener\"/> instances to attach to the <see cref=\"T:NAnt.Core.Project\"/>.</param>\n            <remarks>\n            The currently attached <see cref=\"T:NAnt.Core.IBuildListener\"/> instances will \n            be detached before the new <see cref=\"T:NAnt.Core.IBuildListener\"/> instances \n            are attached.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.Project.CtorHelper(System.Xml.XmlDocument,NAnt.Core.Level,System.Int32,NAnt.Core.Optimizations)\">\n            <summary>\n            Inits stuff:\n                <para>TypeFactory: Calls Initialize and AddProject </para>\n                <para>Log.IndentSize set to 12</para>\n                <para>Project properties are initialized (\"nant.* stuff set\")</para>\n                <list type=\"nant.items\">\n                    <listheader>NAnt Props:</listheader>\n                    <item>nant.filename</item>\n                    <item>nant.version</item>\n                    <item>nant.location</item>\n                    <item>nant.project.name</item>\n                    <item>nant.project.buildfile (if doc has baseuri)</item>\n                    <item>nant.project.basedir</item>\n                    <item>nant.project.default = defaultTarget</item>\n                </list>\n            </summary>\n            <param name=\"doc\">An <see cref=\"T:System.Xml.XmlDocument\"/> representing the project definition.</param>\n            <param name=\"threshold\">The project message threshold.</param>\n            <param name=\"indentLevel\">The project indentation level.</param>\n            <param name=\"optimization\">Optimization flags.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"doc\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Project.InitializeProjectDocument(System.Xml.XmlDocument)\">\n            <summary>\n            This method is only meant to be used by the <see cref=\"T:NAnt.Core.Project\"/> \n            class and <see cref=\"T:NAnt.Core.Tasks.IncludeTask\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.LoadBuildFile(System.String)\">\n            <summary>\n            Creates a new <see cref=\"T:System.Xml.XmlDocument\"/> based on the project \n            definition.\n            </summary>\n            <param name=\"uriOrFilePath\">\n            <para>The full path to the build file.</para>\n            <para>This can be of any form that <see cref=\"M:System.Xml.XmlDocument.Load(System.String)\"/> accepts.</para>\n            </param>\n            <returns>\n            An <see cref=\"T:System.Xml.XmlDocument\"/> based on the specified project \n            definition.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Project.ConfigurePlatformProperties\">\n            <summary>\n            Configures the platform properties for the current platform.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">NAnt does not support the current platform.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Project.UpdateTargetFrameworkProperties\">\n            <summary>\n            Updates dependent properties when the <see cref=\"P:NAnt.Core.Project.TargetFramework\"/> \n            is set.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Project.TopologicalTargetSort(System.String,NAnt.Core.TargetCollection)\">\n            <summary>\n            Topologically sorts a set of targets.\n            </summary>\n            <param name=\"root\">The name of the root target. The sort is created in such a way that the sequence of targets up to the root target is the minimum possible such sequence. Must not be <see langword=\"null\"/>.</param>\n            <param name=\"targets\">A collection of <see cref=\"T:NAnt.Core.Target\"/> instances.</param>\n            <returns>\n            A collection of <see cref=\"T:NAnt.Core.Target\"/> instances in sorted order.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">There is a cyclic dependecy among the targets, or a named target does not exist.</exception>\n        </member>\n        <member name=\"M:NAnt.Core.Project.TopologicalTargetSort(System.String,NAnt.Core.TargetCollection,System.Collections.Hashtable,System.Collections.Stack,NAnt.Core.TargetCollection)\">\n            <summary>\n            <para>\n            Performs a single step in a recursive depth-first-search traversal \n            of the target dependency tree.\n            </para>\n            <para>\n            The current target is first set to the \"visiting\" state, and pushed\n            onto the \"visiting\" stack.\n            </para>\n            <para>\n            An exception is then thrown if any child of the current node is in \n            the visiting state, as that implies a circular dependency. The \n            exception contains details of the cycle, using elements of the \n            \"visiting\" stack.\n            </para>\n            <para>\n            If any child has not already been \"visited\", this method is called\n            recursively on it.\n            </para>\n            <para>\n            The current target is then added to the ordered list of targets. \n            Note that this is performed after the children have been visited in \n            order to get the correct order. The current target is set to the \n            \"visited\" state.\n            </para>\n            <para>\n            By the time this method returns, the ordered list contains the \n            sequence of targets up to and including the current target.\n            </para>\n            </summary>\n            <param name=\"root\">The current target to inspect. Must not be <see langword=\"null\"/>.</param>\n            <param name=\"targets\">A collection of <see cref=\"T:NAnt.Core.Target\"/> instances.</param>\n            <param name=\"state\">A mapping from targets to states The states in question are \"VISITING\" and \"VISITED\". Must not be <see langword=\"null\"/>.</param>\n            <param name=\"visiting\">A stack of targets which are currently being visited. Must not be <see langword=\"null\"/>.</param>\n            <param name=\"executeTargets\">The list to add target names to. This will end up containing the complete list of depenencies in dependency order. Must not be <see langword=\"null\"/>.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>A non-existent target is specified</para>\n              <para>-or-</para>\n              <para>A circular dependency is detected.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.Core.Project.CreateCircularException(System.String,System.Collections.Stack)\">\n            <summary>\n            Builds an appropriate exception detailing a specified circular\n            dependency.\n            </summary>\n            <param name=\"end\">The dependency to stop at. Must not be <see langword=\"null\"/>.</param>\n            <param name=\"stack\">A stack of dependencies. Must not be <see langword=\"null\"/>.</param>\n            <returns>\n            A <see cref=\"T:NAnt.Core.BuildException\"/> detailing the specified circular \n            dependency.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.Project.IndentationLevel\">\n            <summary>\n            Gets or sets the indendation level of the build output.\n            </summary>\n            <value>\n            The indentation level of the build output.\n            </value>\n            <remarks>\n            To change the <see cref=\"P:NAnt.Core.Project.IndentationLevel\"/>, the <see cref=\"M:NAnt.Core.Project.Indent\"/> \n            and <see cref=\"M:NAnt.Core.Project.Unindent\"/> methods should be used.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.IndentationSize\">\n            <summary>\n            Gets or sets the indentation size of the build output.\n            </summary>\n            <value>\n            The indendation size of the build output.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Threshold\">\n            <summary>\n            Gets or sets the default threshold level for build loggers.\n            </summary>\n            <value>\n            The default threshold level for build loggers.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.ProjectName\">\n            <summary>\n            Gets the name of the <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <value>\n            The name of the <see cref=\"T:NAnt.Core.Project\"/> or an empty <see cref=\"T:System.String\"/>\n            if no name is specified.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.BaseDirectory\">\n            <summary>\n            Gets or sets the base directory used for relative references.\n            </summary>\n            <value>\n            The base directory used for relative references.\n            </value>\n            <exception cref=\"T:NAnt.Core.BuildException\">The directory is not rooted.</exception>\n            <remarks>\n            <para>\n            The <see cref=\"P:NAnt.Core.Project.BaseDirectory\"/> gets and sets the built-in property \n            named \"nant.project.basedir\".\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.NamespaceManager\">\n            <summary>\n            Gets the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.Project.NamespaceManager\"/> defines the current namespace \n            scope and provides methods for looking up namespace information.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.BuildFileUri\">\n            <summary>\n            Gets the <see cref=\"T:System.Uri\"/> form of the current project definition.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Uri\"/> form of the current project definition.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Frameworks\">\n            <summary>\n            Gets a collection of available .NET frameworks.\n            </summary>\n            <value>\n            A collection of available .NET frameworks.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.RuntimeFramework\">\n            <summary>\n            Gets the framework in which NAnt is currently running.\n            </summary>\n            <value>\n            The framework in which NAnt is currently running.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.TargetFramework\">\n            <summary>\n            Gets or sets the framework to use for compilation.\n            </summary>\n            <value>\n            The framework to use for compilation.\n            </value>\n            <exception cref=\"T:System.ArgumentNullException\">The value specified is <see langword=\"null\"/>.</exception>\n            <exception cref=\"T:NAnt.Core.BuildException\">The specified framework is not installed, or not configured correctly.</exception>\n            <remarks>\n            We will use compiler tools and system assemblies for this framework \n            in framework-related tasks.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.PlatformName\">\n            <summary>\n            Gets the name of the platform on which NAnt is currently running.\n            </summary>\n            <value>\n            The name of the platform on which NAnt is currently running.\n            </value>\n            <remarks>\n            <para>\n            Possible values are:\n            </para>\n            <list type=\"bullet\">\n                <item>\n                    <description>win32</description>\n                </item>\n                <item>\n                    <description>unix</description>\n                </item>\n            </list>\n            </remarks>\n            <exception cref=\"T:NAnt.Core.BuildException\">NAnt does not support the current platform.</exception>\n        </member>\n        <member name=\"P:NAnt.Core.Project.CurrentTarget\">\n            <summary>\n            Gets the current target.\n            </summary>\n            <value>\n            The current target, or <see langword=\"null\" /> if no target is\n            executing.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.BuildFileLocalName\">\n            <summary>\n            Gets the path to the build file.\n            </summary>\n            <value>\n            The path to the build file, or <see langword=\"null\" /> if the build\n            document is not file backed.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Document\">\n            <summary>\n            Gets the active <see cref=\"T:NAnt.Core.Project\"/> definition.\n            </summary>\n            <value>\n            The active <see cref=\"T:NAnt.Core.Project\"/> definition.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.ConfigurationNode\">\n            <summary>\n            Gets the <see cref=\"T:System.Xml.XmlNode\"/> NAnt should use to initialize \n            configuration settings.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNode\"/> NAnt should use to initialize \n            configuration settings.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.DefaultTargetName\">\n            <remarks>\n            Gets the name of the target that will be executed when no other \n            build targets are specified.\n            </remarks>\n            <value>\n            The name of the target that will be executed when no other \n            build targets are specified, or <see langword=\"null\" /> if no\n            default target is specified in the build file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Verbose\">\n            <summary>\n            Gets a value indicating whether tasks should output more build log \n            messages.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if tasks should output more build log message; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.BuildTargets\">\n            <summary>\n            The list of targets to build.\n            </summary>\n            <remarks>\n            Targets are built in the order they appear in the collection.  If \n            the collection is empty the default target will be built.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Properties\">\n            <summary>\n            Gets the properties defined in this project.\n            </summary>\n            <value>The properties defined in this project.</value>\n            <remarks>\n            <para>\n            This is the collection of properties that are defined by the system \n            and property task statements.\n            </para>\n            <para>\n            These properties can be used in expansion.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.FrameworkNeutralProperties\">\n            <summary>\n            Gets the framework-neutral properties defined in the NAnt \n            configuration file.\n            </summary>\n            <value>\n            The framework-neutral properties defined in the NAnt configuration \n            file.\n            </value>\n            <remarks>\n            <para>\n            This is the collection of read-only properties that are defined in \n            the NAnt configuration file.\n            </para>\n            <para>\n            These properties can only be used for expansion in framework-specific\n            and framework-neutral configuration settings.  These properties are \n            not available for expansion in the build file.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.DataTypeReferences\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.DataTypeBase\"/> instances defined in this project.\n            </summary>\n            <value>\n            The <see cref=\"T:NAnt.Core.DataTypeBase\"/> instances defined in this project.\n            </value>\n            <remarks>\n            <para>\n            This is the collection of <see cref=\"T:NAnt.Core.DataTypeBase\"/> instances that\n            are defined by <see cref=\"T:NAnt.Core.DataTypeBase\"/> (eg fileset) declarations.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Project.Targets\">\n            <summary>\n            Gets the targets defined in this project.\n            </summary>\n            <value>\n            The targets defined in this project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Project.BuildListeners\">\n            <summary>\n            Gets the build listeners for this project. \n            </summary>\n            <value>\n            The build listeners for this project.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.Optimizations\">\n            <summary>\n            Allow the project construction to be optimized.\n            </summary>\n            <remarks>\n            Use this with care!\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.Optimizations.None\">\n            <summary>\n            Do not perform any optimizations.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Optimizations.SkipAutomaticDiscovery\">\n            <summary>\n            The project base directory must not be automatically scanned \n            for extension assemblies.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.Optimizations.SkipFrameworkConfiguration\">\n            <summary>\n            Do not scan the project configuration for frameworks, and \n            do not configure the runtime and target framework.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.ProjectSettingsLoader.ScannedTasks\">\n            <summary>\n            Holds a value indicating whether a scan for tasks, types and functions\n            has already been performed for the current runtime framework.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ProjectSettingsLoader.#ctor(NAnt.Core.Project)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ProjectSettingsLoader\"/>\n            class for the given <see cref=\"P:NAnt.Core.ProjectSettingsLoader.Project\"/>.\n            </summary>\n            <param name=\"project\">The <see cref=\"P:NAnt.Core.ProjectSettingsLoader.Project\"/> that should be configured.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ProjectSettingsLoader.ProcessSettings\">\n            <summary>\n            Loads and processes settings from the specified <see cref=\"T:System.Xml.XmlNode\"/> \n            of the configuration file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ProjectSettingsLoader.ProcessFrameworks(System.Xml.XmlNode)\">\n            <summary>\n            Processes the framework nodes of the given platform node.\n            </summary>\n            <param name=\"platformNode\">An <see cref=\"T:System.Xml.XmlNode\"/> representing the platform on which NAnt is running.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ProjectSettingsLoader.ProcessGlobalProperties(System.Xml.XmlNodeList)\">\n            <summary>\n            Reads the list of global properties specified in the NAnt configuration\n            file.\n            </summary>\n            <param name=\"propertyNodes\">An <see cref=\"T:System.Xml.XmlNodeList\"/> representing global properties.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ProjectSettingsLoader.GetXmlAttributeValue(System.Xml.XmlNode,System.String)\">\n            <summary>\n            Gets the value of the specified attribute from the specified node.\n            </summary>\n            <param name=\"xmlNode\">The node of which the attribute value should be retrieved.</param>\n            <param name=\"attributeName\">The attribute of which the value should be returned.</param>\n            <returns>\n            The value of the attribute with the specified name or <see langword=\"null\" />\n            if the attribute does not exist or has no value.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.ProjectSettingsLoader.Project\">\n            <summary>\n            Gets the underlying <see cref=\"P:NAnt.Core.ProjectSettingsLoader.Project\"/> instance.\n            </summary>\n            <value>\n            The underlying <see cref=\"P:NAnt.Core.ProjectSettingsLoader.Project\"/> instance.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.ProjectSettingsLoader.NamespaceManager\">\n            <summary>\n            Gets the <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Xml.XmlNamespaceManager\"/>.\n            </value>\n            <remarks>\n            The <see cref=\"P:NAnt.Core.ProjectSettingsLoader.NamespaceManager\"/> defines the current namespace \n            scope and provides methods for looking up namespace information.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.Core.PropertyDictionary.Visiting\">\n            <summary>\n            Constant for the \"visiting\" state, used when traversing a DFS of \n            property references.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.PropertyDictionary.Visited\">\n            <summary>\n            Constant for the \"visited\" state, used when travesing a DFS of \n            property references.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.#ctor(NAnt.Core.Project)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.PropertyDictionary\"/>\n            class holding properties for the given <see cref=\"P:NAnt.Core.PropertyDictionary.Project\"/> \n            instance.\n            </summary>\n            <param name=\"project\">The project for which the dictionary will hold properties.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.OnInsert(System.Object,System.Object)\">\n            <summary>\n            Performs additional custom processes before inserting a new element \n            into the <see cref=\"T:System.Collections.DictionaryBase\"/> instance.\n            </summary>\n            <param name=\"key\">The key of the element to insert.</param>\n            <param name=\"value\">The value of the element to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.OnRemove(System.Object,System.Object)\">\n            <summary>\n            Performs additional custom processes before removing an element\n            from the <see cref=\"T:System.Collections.DictionaryBase\"/> instance.\n            </summary>\n            <param name=\"key\">The key of the element to remove.</param>\n            <param name=\"value\">The value of the element to remove.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.OnValidate(System.Object,System.Object)\">\n            <summary>\n            Performs additional custom processes when validating the element \n            with the specified key and value.\n            </summary>\n            <param name=\"key\">The key of the element to validate.</param>\n            <param name=\"value\">The value of the element to validate.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.AddReadOnly(System.String,System.String)\">\n            <summary>\n            Adds a property that cannot be changed.\n            </summary>\n            <param name=\"name\">The name of the property.</param>\n            <param name=\"value\">The value to assign to the property.</param>\n            <remarks>\n            Properties added with this method can never be changed.  Note that\n            they are removed if the <see cref=\"M:System.Collections.DictionaryBase.Clear\"/> method is called.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.MarkDynamic(System.String)\">\n            <summary>\n            Marks a property as a property of which the value is expanded at \n            execution time.\n            </summary>\n            <param name=\"name\">The name of the property to mark as dynamic.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.Add(System.String,System.String)\">\n            <summary>\n            Adds a property to the collection.\n            </summary>\n            <param name=\"name\">The name of the property.</param>\n            <param name=\"value\">The value to assign to the property.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.IsReadOnlyProperty(System.String)\">\n            <summary>\n            Determines whether the specified property is listed as read-only.\n            </summary>\n            <param name=\"name\">The name of the property to check.</param>\n            <returns>\n            <see langword=\"true\" /> if the property is listed as read-only; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.IsDynamicProperty(System.String)\">\n            <summary>\n            Determines whether the specified property is listed as dynamic.\n            </summary>\n            <param name=\"name\">The name of the property to check.</param>\n            <returns>\n            <see langword=\"true\" /> if the property is listed as dynamic; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.Inherit(NAnt.Core.PropertyDictionary,System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Inherits properties from an existing property dictionary Instance.\n            </summary>\n            <param name=\"source\">Property list to inherit.</param>\n            <param name=\"excludes\">The list of properties to exclude during inheritance.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.ExpandProperties(System.String,NAnt.Core.Location)\">\n            <summary>\n            Expands a <see cref=\"T:System.String\"/> from known properties.\n            </summary>\n            <param name=\"input\">The replacement tokens.</param>\n            <param name=\"location\">The <see cref=\"T:NAnt.Core.Location\"/> to pass through for any exceptions.</param>\n            <returns>The expanded and replaced string.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.Contains(System.String)\">\n            <summary>\n            Determines whether a property already exists.\n            </summary>\n            <param name=\"name\">The name of the property to check.</param>\n            <returns>\n            <see langword=\"true\" /> if the specified property already exists; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.Remove(System.String)\">\n            <summary>\n            Removes the property with the specified name.\n            </summary>\n            <param name=\"name\">The name of the property to remove.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.ExpandProperties(System.String,NAnt.Core.Location,System.Collections.Hashtable,System.Collections.Stack)\">\n            <summary>\n            Expands a <see cref=\"T:System.String\"/> from known properties.\n            </summary>\n            <param name=\"input\">The replacement tokens.</param>\n            <param name=\"location\">The <see cref=\"T:NAnt.Core.Location\"/> to pass through for any exceptions.</param>\n            <param name=\"state\">A mapping from properties to states. The states in question are \"VISITING\" and \"VISITED\". Must not be <see langword=\"null\"/>.</param>\n            <param name=\"visiting\">A stack of properties which are currently being visited. Must not be <see langword=\"null\"/>.</param>\n            <returns>The expanded and replaced string.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.EvaluateEmbeddedExpressions(System.String,NAnt.Core.Location,System.Collections.Hashtable,System.Collections.Stack)\">\n            <summary>\n            Evaluates the given expression string and returns the result\n            </summary>\n            <param name=\"input\"></param>\n            <param name=\"location\"></param>\n            <param name=\"state\"></param>\n            <param name=\"visiting\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.CheckDeprecation(System.String)\">\n            <summary>\n            Checks whether the specified property is deprecated.\n            </summary>\n            <param name=\"name\">The property to check.</param>\n        </member>\n        <member name=\"M:NAnt.Core.PropertyDictionary.CreateCircularException(System.String,System.Collections.Stack)\">\n            <summary>\n            Builds an appropriate exception detailing a specified circular\n            reference.\n            </summary>\n            <param name=\"end\">The property reference to stop at. Must not be <see langword=\"null\"/>.</param>\n            <param name=\"stack\">A stack of property references. Must not be <see langword=\"null\"/>.</param>\n            <returns>\n            A <see cref=\"T:NAnt.Core.BuildException\"/> detailing the specified circular \n            dependency.\n            </returns>\n        </member>\n        <member name=\"F:NAnt.Core.PropertyDictionary._readOnlyProperties\">\n            <summary>\n            Maintains a list of the property names that are readonly.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.PropertyDictionary._dynamicProperties\">\n            <summary>\n            Maintains a list of the property names of which the value is expanded\n            on usage, not at initalization.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.PropertyDictionary._project\">\n            <summary>\n            The project for which the dictionary holds properties.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.PropertyDictionary.Item(System.String)\">\n            <summary>\n            Indexer property. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.PropertyDictionary.Project\">\n            <summary>\n            Gets the project for which the dictionary holds properties.\n            </summary>\n            <value>\n            The project for which the dictionary holds properties.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.Target.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.Target\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.Target.System#ICloneable#Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.Target\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.Target\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Target.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.Core.Target\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.Core.Target\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.Target.Execute\">\n            <summary>\n            Executes dependent targets first, then the target.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.Executed\">\n            <summary>\n            This indicates whether the target has already executed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.Name\">\n            <summary>\n            The name of the target.\n            </summary>\n            <remarks>\n              <para>\n              Hides <see cref=\"P:NAnt.Core.Element.Name\"/> to have <see cref=\"T:NAnt.Core.Target\"/> \n              return the name of target, not the name of XML element - which \n              would always be <c>target</c>.\n              </para>\n              <para>\n              Note: Properties are not allowed in the name.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.Target.IfCondition\">\n            <summary>\n            If <see langword=\"true\" /> then the target will be executed; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.IfDefined\">\n            <summary>\n            Gets a value indicating whether the target should be executed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the target should be executed; otherwise, \n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Target.UnlessCondition\">\n            <summary>\n            Opposite of <see cref=\"P:NAnt.Core.Target.IfDefined\"/>. If <see langword=\"false\"/> \n            then the target will be executed; otherwise, skipped. The default \n            is <see langword=\"false\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.UnlessDefined\">\n            <summary>\n            Gets a value indicating whether the target should NOT be executed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the target should NOT be executed;\n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.Target.Description\">\n            <summary>\n            The description of the target.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.DependsListString\">\n            <summary>\n            Space separated list of targets that this target depends on.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.Target.Dependencies\">\n            <summary>\n            A collection of target names that must be executed before this \n            target.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TargetCollection.Find(System.String)\">\n            <summary>\n            Finds a target by name.\n            </summary>\n            <param name=\"targetName\">The name of the target to find.</param>\n            <returns>\n            The <see cref=\"T:NAnt.Core.Target\"/> with the specified name, or \n            <see langword=\"null\"/> if no <see cref=\"T:NAnt.Core.Target\"/> exists with\n            the given name.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TargetCollection.ToString(System.String)\">\n            <summary>\n            Gets the names of the targets in the <see cref=\"T:NAnt.Core.TargetCollection\"/>\n            combined into one list separated by the given <see cref=\"T:System.String\"/>.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.String\"/> that contains a list of the names of the \n            targets in the <see cref=\"T:NAnt.Core.TargetCollection\"/>, separated by\n            the specified <paramref name=\"separator\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TargetCollection.ToString\">\n            <summary>\n            Gets the names of the targets in the <see cref=\"T:NAnt.Core.TargetCollection\"/>\n            combined into one comma-separated list.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.String\"/> that contains a comma-separated list of the\n            names of the targets in the <see cref=\"T:NAnt.Core.TargetCollection\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilder.#ctor(NAnt.Core.Extensibility.ExtensionAssembly,System.String)\">\n            <summary>\n            Creates a new instance of the <see cref=\"T:NAnt.Core.TaskBuilder\"/> class\n            for the specified <see cref=\"T:NAnt.Core.Task\"/> class in the specified\n            <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/>.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:NAnt.Core.Task\"/>.</param>\n            <param name=\"className\">The class representing the <see cref=\"T:NAnt.Core.Task\"/>.</param>\n        </member>\n        <member name=\"P:NAnt.Core.TaskBuilder.ClassName\">\n            <summary>\n            Gets the name of the <see cref=\"T:NAnt.Core.Task\"/> class that can be created\n            using this <see cref=\"T:NAnt.Core.TaskBuilder\"/>.\n            </summary>\n            <value>\n            The name of the <see cref=\"T:NAnt.Core.Task\"/> class that can be created using\n            this <see cref=\"T:NAnt.Core.TaskBuilder\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.TaskBuilder.TaskName\">\n            <summary>\n            Gets the name of the task which the <see cref=\"T:NAnt.Core.TaskBuilder\"/>\n            can create.\n            </summary>\n            <value>\n            The name of the task which the <see cref=\"T:NAnt.Core.TaskBuilder\"/> can \n            create.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Core.TaskBuilderCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.Core.TaskBuilder\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.#ctor(NAnt.Core.TaskBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> class\n            with the specified <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.#ctor(NAnt.Core.TaskBuilder[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.Core.TaskBuilder\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.Add(NAnt.Core.TaskBuilder)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.Core.TaskBuilder\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.TaskBuilder\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.AddRange(NAnt.Core.TaskBuilder[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.TaskBuilder\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.Core.TaskBuilder\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.AddRange(NAnt.Core.TaskBuilderCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.Contains(NAnt.Core.TaskBuilder)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.TaskBuilder\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.TaskBuilder\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.Core.TaskBuilder\"/> for the specified \n            task is in the collection.\n            </summary>\n            <param name=\"taskName\">The name of task for which the <see cref=\"T:NAnt.Core.TaskBuilder\"/> should be located in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.Core.TaskBuilder\"/> for the \n            specified task is found in the collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.CopyTo(NAnt.Core.TaskBuilder[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.IndexOf(NAnt.Core.TaskBuilder)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.Core.TaskBuilder\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.TaskBuilder\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.Core.TaskBuilder\"/>. If the <see cref=\"T:NAnt.Core.TaskBuilder\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.Insert(System.Int32,NAnt.Core.TaskBuilder)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.Core.TaskBuilder\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.TaskBuilder\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.Core.TaskBuilderEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderCollection.Remove(NAnt.Core.TaskBuilder)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.Core.TaskBuilder\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.Core.TaskBuilderCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.Core.TaskBuilderCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.Core.TaskBuilder\"/> for the specified task.\n            </summary>\n            <param name=\"taskName\">The name of task for which the <see cref=\"T:NAnt.Core.TaskBuilder\"/> should be located in the collection.</param> \n        </member>\n        <member name=\"T:NAnt.Core.TaskBuilderEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.Core.TaskBuilder\"/> elements of a <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderEnumerator.#ctor(NAnt.Core.TaskBuilderCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.TaskBuilderEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.Core.TaskBuilderCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TaskBuilderEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.TaskBuilderEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Core.TypeFactory\">\n            <summary>\n            Comprises all of the loaded, and available, tasks. \n            Use these static methods to register, initialize and create a task.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanAssembly(System.String,NAnt.Core.Task)\">\n            <summary>\n            Scans the given assembly for tasks, types, functions and filters.\n            </summary>\n            <param name=\"assemblyFile\">The assembly to scan for tasks, types, functions and filters.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanAssembly(System.Reflection.Assembly,NAnt.Core.Task)\">\n            <summary>\n            Scans the given assembly for tasks, types, functions and filters.\n            </summary>\n            <param name=\"assembly\">The assembly to scan for tasks, types, functions and filters.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"assembly\"/> contains at \n            least one \"extension\"; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanDir(System.String,NAnt.Core.Task,System.Boolean)\">\n            <summary>\n            Scans the path for any task assemblies and adds them.\n            </summary>\n            <param name=\"path\">The directory to scan in.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <param name=\"failOnError\"><see cref=\"T:System.Boolean\"/> indicating whether scanning of the directory should halt on first error.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.AddProject(NAnt.Core.Project)\">\n            <summary>\n            Adds any task assemblies in the project base directory\n            and its <c>tasks</c> subdirectory.\n            </summary>\n            <param name=\"project\">The project to work from.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.AddProject(NAnt.Core.Project,System.Boolean)\">\n            <summary>\n            Registers the project with <see cref=\"T:NAnt.Core.TypeFactory\"/>, and optionally\n            scan the <see cref=\"P:NAnt.Core.Project.BaseDirectory\"/> for extension assemblies.\n            </summary>\n            <param name=\"project\">The project to work from.</param>\n            <param name=\"scan\">Specified whether to scan the <see cref=\"P:NAnt.Core.Project.BaseDirectory\"/> for extension assemblies.</param>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.LookupFunction(System.String,NAnt.Core.Extensibility.FunctionArgument[],NAnt.Core.Project)\">\n            <summary>\n            Looks up a function by name and argument count.\n            </summary>\n            <param name=\"functionName\">The name of the function to lookup, including namespace prefix.</param>\n            <param name=\"args\">The argument of the function to lookup.</param>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> in which the function is invoked.</param>\n            <returns>\n            A <see cref=\"T:System.Reflection.MethodInfo\"/> representing the function, or \n            <see langword=\"null\"/> if a function with the given name and\n            arguments does not exist.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.CreateTask(System.Xml.XmlNode,NAnt.Core.Project)\">\n            <summary> \n            Creates a new <see cref=\"T:NAnt.Core.Task\"/> instance for the given XML and \n            <see cref=\"T:NAnt.Core.Project\"/>.\n            </summary>\n            <param name=\"taskNode\">The XML to initialize the task with.</param>\n            <param name=\"proj\">The <see cref=\"T:NAnt.Core.Project\"/> that the <see cref=\"T:NAnt.Core.Task\"/> belongs to.</param>\n            <returns>\n            The new <see cref=\"T:NAnt.Core.Task\"/> instance.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanTypeForTasks(NAnt.Core.Extensibility.ExtensionAssembly,System.Type,NAnt.Core.Task)\">\n            <summary>\n            Scans a given <see cref=\"T:System.Type\"/> for tasks.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> represents a\n            <see cref=\"T:NAnt.Core.Task\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanTypeForDataTypes(NAnt.Core.Extensibility.ExtensionAssembly,System.Type,NAnt.Core.Task)\">\n            <summary>\n            Scans a given <see cref=\"T:System.Type\"/> for data type.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> represents a\n            data type; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanTypeForFunctions(System.Type,NAnt.Core.Task)\">\n            <summary>\n            Scans a given <see cref=\"T:System.Type\"/> for functions.\n            </summary>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> represents a\n            valid set of funtions; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Core.TypeFactory.ScanTypeForFilters(NAnt.Core.Extensibility.ExtensionAssembly,System.Type,NAnt.Core.Task)\">\n            <summary>\n            Scans a given <see cref=\"T:System.Type\"/> for filters.\n            </summary>\n            <param name=\"extensionAssembly\">The <see cref=\"T:NAnt.Core.Extensibility.ExtensionAssembly\"/> containing the <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"type\">The <see cref=\"T:System.Type\"/> to scan.</param>\n            <param name=\"task\">The <see cref=\"T:NAnt.Core.Task\"/> which will be used to output messages to the build log.</param>\n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"type\"/> represents a\n            <see cref=\"T:NAnt.Core.Filters.Filter\"/>; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Core.TypeFactory.TaskBuilders\">\n            <summary>\n            Gets the list of loaded <see cref=\"T:NAnt.Core.TaskBuilder\"/> instances.\n            </summary>\n            <value>\n            List of loaded <see cref=\"T:NAnt.Core.TaskBuilder\"/> instances.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.TypeFactory.DataTypeBuilders\">\n            <summary>\n            Gets the list of loaded <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> instances.\n            </summary>\n            <value>\n            List of loaded <see cref=\"T:NAnt.Core.DataTypeBaseBuilder\"/> instances.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.TypeFactory.FilterBuilders\">\n            <summary>\n            Gets the list of loaded <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> instances.\n            </summary>\n            <value>\n            List of loaded <see cref=\"T:NAnt.Core.Filters.FilterBuilder\"/> instances.\n            </value>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class with a descriptive message.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor(System.String,System.Exception)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class with the specified descriptive message and inner exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"innerException\">A nested exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor(System.String,NAnt.Core.Location)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class with a descriptive message and the location in the build file \n            that caused the exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"location\">The location in the build file where the exception occured.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor(System.String,NAnt.Core.Location,System.Exception)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class with a descriptive message, the location in the build file and \n            an instance of the exception that is the cause of the current \n            exception.\n            </summary>\n            <param name=\"message\">A descriptive message to include with the exception.</param>\n            <param name=\"location\">The location in the build file where the exception occured.</param>\n            <param name=\"innerException\">A nested exception that is the cause of the current exception.</param>\n        </member>\n        <member name=\"M:NAnt.Core.ValidationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.ValidationException\"/> \n            class with serialized data.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data about the exception being thrown.</param>\n            <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        </member>\n        <member name=\"T:NAnt.Core.XmlLogger\">\n            <summary>\n            Used to wrap log messages in xml &lt;message/&gt; elements.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.Core.XmlLogger._projectStack\">\n            <summary>\n            Holds the stack of currently executing projects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.XmlLogger\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Core.XmlLogger\"/> class \n            with serialized data.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> that holds the serialized object data.</param>\n            <param name=\"context\">The <see cref=\"T:System.Runtime.Serialization.StreamingContext\"/> that contains contextual information about the source or destination.</param>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)\">\n            <summary>\n            Populates <paramref name=\"info\"/> with the data needed to serialize \n            the <see cref=\"T:NAnt.Core.XmlLogger\"/> instance.\n            </summary>\n            <param name=\"info\">The <see cref=\"T:System.Runtime.Serialization.SerializationInfo\"/> to populate with data.</param>\n            <param name=\"context\">The destination for this serialization.</param>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.ToString\">\n            <summary>\n            Returns the contents of log captured.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.BuildStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a build has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event is fired before any targets have started.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.BuildFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that the last target has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.TargetStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a target has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.TargetFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a target has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.TaskStarted(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has started.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.TaskFinished(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a task has finished.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            This event will still be fired if an error occurred during the build.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.MessageLogged(System.Object,NAnt.Core.BuildEventArgs)\">\n            <summary>\n            Signals that a message has been logged.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NAnt.Core.BuildEventArgs\"/> object that contains the event data.</param>\n            <remarks>\n            Only messages with a priority higher or equal to the threshold of \n            the logger will actually be output in the build log.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Core.XmlLogger.Flush\">\n            <summary>\n            Flushes buffered build events or messages to the underlying storage.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Core.XmlLogger.Threshold\">\n            <summary>\n            Gets or sets the highest level of message this logger should respond \n            to.\n            </summary>\n            <value>\n            The highest level of message this logger should respond to.\n            </value>\n            <remarks>\n            Only messages with a message level higher than or equal to the given \n            level should be written to the log.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Core.XmlLogger.EmacsMode\">\n            <summary>\n            Gets or sets a value indicating whether to produce emacs (and other\n            editor) friendly output.\n            </summary>\n            <value>\n            <see langword=\"false\" /> as it has no meaning in XML format.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Core.XmlLogger.OutputWriter\">\n            <summary>\n            Gets or sets the <see cref=\"T:System.IO.TextWriter\"/> to which the logger is \n            to send its output.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.DotNetTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.DotNetTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask\">\n            <summary>\n            Generates an AssemblyInfo file using the attributes given.\n            </summary>\n            <example>\n              <para>\n              Create a C# AssemblyInfo file containing the specified assembly-level \n              attributes.\n              </para>\n              <code>\n                <![CDATA[\n            <asminfo output=\"AssemblyInfo.cs\" language=\"CSharp\">\n                <imports>\n                    <import namespace=\"System\" />\n                    <import namespace=\"System.Reflection\" />\n                    <import namespace=\"System.EnterpriseServices\" />\n                    <import namespace=\"System.Runtime.InteropServices\" />\n                </imports>\n                <attributes>\n                    <attribute type=\"ComVisibleAttribute\" value=\"false\" />\n                    <attribute type=\"CLSCompliantAttribute\" value=\"true\" />\n                    <attribute type=\"AssemblyVersionAttribute\" value=\"1.0.0.0\" />\n                    <attribute type=\"AssemblyTitleAttribute\" value=\"My fun assembly\" />\n                    <attribute type=\"AssemblyDescriptionAttribute\" value=\"More fun than a barrel of monkeys\" />\n                    <attribute type=\"AssemblyCopyrightAttribute\" value=\"Copyright (c) 2002, Monkeyboy, Inc.\" />\n                    <attribute type=\"ApplicationNameAttribute\" value=\"FunAssembly\" />\n                </attributes>\n                <references>\n                    <include name=\"System.EnterpriseServices.dll\" />\n                </references>\n            </asminfo>\n                ]]>\n              </code>\n            </example>\n            <example>\n                <para>\n                Create a C# AssemblyInfo file containing an attribute with multiple\n                named properties by setting the <see cref=\"P:NAnt.DotNet.Types.AssemblyAttribute.AsIs\"/> \n                attribute on the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> element to \n                <see langword=\"true\"/>.\n                </para>\n              <code>\n                <![CDATA[\n            <asminfo output=\"AssemblyInfo.cs\" language=\"CSharp\">\n                <imports>\n                    <import namespace=\"log4net.Config\" />\n                </imports>\n                <attributes>\n                    <attribute type=\"DOMConfiguratorAttribute\" value=\"ConfigFile=&quot;config.log4net&quot;,Watch=true\" asis=\"true\" />\n                </attributes>\n                <references>\n                    <include name=\"log4net.dll\" />\n                </references>\n            </asminfo>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.ExecuteTask\">\n            <summary>\n            Generates an AssemblyInfo file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.NeedsPersisting(System.IO.Stream)\">\n            <summary>\n            Determines whether the specified AssemblyInfo file in the given\n            <see cref=\"T:System.IO.Stream\"/> needs to be persisted.\n            </summary>\n            <param name=\"generatedAsmInfoStream\"><see cref=\"T:System.IO.Stream\"/> holding the newly generated AssemblyInfo source.</param>\n            <returns>\n            <see langword=\"true\"/> if the generated AssemblyInfo source needs\n            to be persisted; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.Output\">\n            <summary>\n            Name of the AssemblyInfo file to generate.\n            </summary>\n            <value>\n            The name of the AssemblyInfo file to generate.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.Language\">\n            <summary>\n            The code language in which the AssemblyInfo file should be \n            generated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.AssemblyAttributes\">\n            <summary>\n            The assembly-level attributes to generate.\n            </summary>\n            <value>\n            The assembly-level attributes to generate.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.Imports\">\n            <summary>\n            The namespaces to import.\n            </summary>\n            <value>\n            The namespaces to import.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.References\">\n            <summary>\n            Assembly files used to locate the types of the specified attributes.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage\">\n            <summary>\n            Defines the supported code languages for generating an AssemblyInfo\n            file.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage.CSharp\">\n            <summary>\n            A value for generating C# code.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage.JScript\">\n            <summary>\n            A value for generating JScript code.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage.VB\">\n            <summary>\n            A value for generating Visual Basic code.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider\">\n            <summary> \n            Encapsulates functionality to generate a code file with imports\n            and assembly-level attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider.#ctor(NAnt.DotNet.Tasks.AssemblyInfoTask,NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider\"/>\n            for the specified <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage\"/>.\n            </summary>\n            <param name=\"assemblyInfoTask\">The <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask\"/> for which an instance of the <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider\"/> class should be initialized.</param>\n            <param name=\"codeLanguage\">The <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage\"/> for which an instance of the <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider\"/> class should be initialized.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider.GenerateImportCode(System.Collections.Specialized.StringCollection,System.IO.TextWriter)\">\n            <summary>\n            Generates code for the specified imports.\n            </summary>\n            <param name=\"imports\">The imports for which code should be generated.</param>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the generated code will be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider.GenerateAssemblyAttributesCode(NAnt.DotNet.Types.AssemblyAttributeCollection,System.Collections.Specialized.StringCollection,System.Collections.Specialized.StringCollection,System.IO.TextWriter)\">\n            <summary>\n            Generates code for the specified assembly attributes.\n            </summary>\n            <param name=\"assemblyAttributes\">The assembly attributes for which code should be generated.</param>\n            <param name=\"imports\">Imports used to resolve the assembly attribute names to fully qualified type names.</param>\n            <param name=\"assemblies\">Assembly that will be used to resolve the attribute names to <see cref=\"T:System.Type\"/> instances.</param>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the generated code will be written.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider.Language\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeLanguage\"/> in which the AssemblyInfo\n            code will be generated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyInfoTask.CodeProvider.Generator\">\n            <summary>\n            Gets the <see cref=\"T:System.CodeDom.Compiler.ICodeGenerator\"/> that will be used to \n            generate the AssemblyInfo code.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.AssemblyInfoTask.TypedValueGatherer\">\n            <summary>\n            Responsible for returning the specified value converted to a \n            <see cref=\"T:System.Type\"/> accepted by a constructor for a given\n            <see cref=\"T:System.Type\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.TypedValueGatherer.InitializeLifetimeService\">\n            <summary>\n            Obtains a lifetime service object to control the lifetime policy for \n            this instance.\n            </summary>\n            <returns>\n            An object of type <see cref=\"T:System.Runtime.Remoting.Lifetime.ILease\"/> used to control the lifetime \n            policy for this instance. This is the current lifetime service object \n            for this instance if one exists; otherwise, a new lifetime service \n            object initialized with a lease that will never time out.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyInfoTask.TypedValueGatherer.GetTypedValue(System.Collections.Specialized.StringCollection,System.Collections.Specialized.StringCollection,System.String,System.String)\">\n            <summary>\n            Retrieves the specified <see cref=\"T:System.Type\"/> corresponding with the specified \n            type name from a list of assemblies.\n            </summary>\n            <param name=\"assemblies\">The collection of assemblies that the type should tried to be instantiated from.</param>\n            <param name=\"imports\">The list of imports that can be used to resolve the typename to a full typename.</param>\n            <param name=\"typename\">The typename that should be used to determine the type to which the specified value should be converted.</param>\n            <param name=\"value\">The <see cref=\"T:System.String\"/> value that should be converted to a typed value.</param>\n            <returns></returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n            <para><paramref name=\"value\"/> is <see langword=\"null\"/> and the <see cref=\"T:System.Type\"/> identified by <paramref name=\"typename\"/> has no default public constructor.</para>\n            <para>-or-</para>\n            <para><paramref name=\"value\"/> cannot be converted to a value that's suitable for one of the constructors of the <see cref=\"T:System.Type\"/> identified by <paramref name=\"typename\"/>.</para>\n            <para>-or-</para>\n            <para>The <see cref=\"T:System.Type\"/> identified by <paramref name=\"typename\"/> has no suitable constructor.</para>\n            <para>-or-</para>\n            <para>A <see cref=\"T:System.Type\"/> identified by <paramref name=\"typename\"/> could not be located or loaded.</para>\n            </exception>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.AssemblyLinkerTask\">\n            <summary>\n            Wraps <c>al.exe</c>, the assembly linker for the .NET Framework.\n            </summary>\n            <remarks>\n              <para>\n              All specified sources will be embedded using the <c>/embed</c> flag.\n              Other source types are not supported.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Create a library containing all icon files in the current directory.\n              </para>\n              <code>\n                <![CDATA[\n            <al output=\"MyIcons.dll\" target=\"lib\">\n                <sources>\n                    <include name=\"*.ico\" />\n                </sources>\n            </al>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Create an executable assembly manifest from modules.\n              </para>\n              <code>\n                <![CDATA[\n            <al output=\"Client.exe\" target=\"exe\" main=\"Program.Main\">\n                <modules>\n                    <include name=\"Client.netmodule\" />\n                    <include name=\"Common.netmodule\" />\n                </modules>\n            </al>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyLinkerTask.ExecuteTask\">\n            <summary>\n            Generates an assembly manifest.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.AssemblyLinkerTask.NeedsCompiling\">\n            <summary>\n            Determines whether the assembly manifest needs compiling or is \n            uptodate.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the assembly manifest needs compiling; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.AlgorithmID\">\n            <summary>\n            Specifies an algorithm (in hexadecimal) to hash all files in a \n            multifile assembly except the file that contains the assembly \n            manifest. The default algorithm is CALG_SHA1.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Company\">\n            <summary>\n            Specifies a string for the <b>Company</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Company</b> field in the assembly.\n            </value>\n            <remarks>\n            If <see cref=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Company\"/> is an empty string (\"\"), the Win32 \n            <b>Company</b> resource appears as a single space.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Configuration\">\n            <summary>\n            Specifies a string for the <b>Configuration</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Configuration</b> field in the assembly.\n            </value>\n            <remarks>\n            If <see cref=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Configuration\"/> is an empty string (\"\"), the Win32\n            <b>Configuration</b> resource appears as a single space.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Copyright\">\n            <summary>\n            Specifies a string for the <b>Copyright</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Copyright</b> field in the assembly.\n            </value>\n            <remarks>\n            If <see cref=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Copyright\"/> is an empty string (\"\"), the Win32\n            <b>Copyright</b> resource appears as a single space.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Culture\">\n            <summary>\n            The culture string associated with the output assembly.\n            The string must be in RFC 1766 format, such as \"en-US\".\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/c[ulture]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.DelaySign\">\n            <summary>\n            Specifies whether the assembly should be partially signed. The default\n            is <see langword=\"NAnt.DotNet.Types.DelaySign.NotSet\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Description\">\n            <summary>\n            Specifies a string for the <b>Description</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Description</b> field in the assembly.\n            </value>\n            <remarks>\n            If <see cref=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Description\"/> is an empty string (\"\"), the Win32\n            <b>Description</b> resource appears as a single space.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.EvidenceFile\">\n            <summary>\n            Security evidence file to embed.\n            </summary>\n            <value>\n            The security evidence file to embed.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/e[vidence]</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.FileVersion\">\n            <summary>\n            Specifies a string for the <b>File Version</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>File Version</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Flags\">\n            <summary>\n            Specifies a value (in hexadecimal) for the <b>Flags</b> field in \n            the assembly.\n            </summary>\n            <value>\n            A value (in hexadecimal) for the <b>Flags</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.KeyContainer\">\n            <summary>\n            Specifies a container that holds a key pair.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.KeyFile\">\n            <summary>\n            Specifies a file (filename) that contains a key pair or\n            just a public key to sign an assembly.\n            </summary>\n            <value>\n            The complete path to the key file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/keyf[ile]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.MainMethod\">\n            <summary>\n            Specifies the fully-qualified name (class.method) of the method to \n            use as an entry point when converting a module to an executable file.\n            </summary>\n            <value>\n            The fully-qualified name (class.method) of the method to use as an \n            entry point when converting a module to an executable file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.ModuleSet\">\n            <summary>\n            One or more modules to be compiled into an assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.OutputFile\">\n            <summary>\n            The name of the output file for the assembly manifest.\n            </summary>\n            <value>\n            The complete output path for the assembly manifest.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/out</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.OutputTarget\">\n            <summary>\n            The target type (one of <c>lib</c>, <c>exe</c>, or <c>winexe</c>).\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/t[arget]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Product\">\n            <summary>\n            Specifies a string for the <b>Product</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Product</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.ProductVersion\">\n            <summary>\n            Specifies a string for the <b>Product Version</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Product Version</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Resources\">\n            <summary>\n            The set of resources to embed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.EmbeddedResources\">\n            <summary>\n            The set of compiled resources to embed.\n            </summary>\n            <remarks>\n            Do not yet expose this to build authors.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.SupportsTemplate\">\n            <summary>\n            Indicates whether the assembly linker for a given target framework\n            supports the \"template\" option, which takes an assembly from which\n            to get all options except the culture field.\n            The default is <see langword=\"true\" />.\n            </summary>\n            <remarks>\n            TODO: remove this once Mono bug #74814 is fixed.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.TemplateFile\">\n            <summary>\n            Specifies an assembly from which to get all options except the \n            culture field.\n            </summary>\n            <value>\n            The complete path to the assembly template.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/template:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Title\">\n            <summary>\n            Specifies a string for the <b>Title</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Title</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Trademark\">\n            <summary>\n            Specifies a string for the <b>Trademark</b> field in the assembly.\n            </summary>\n            <value>\n            A string for the <b>Trademark</b> field in the assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Version\">\n            <summary>\n            Specifies version information for the assembly. The format of the \n            version string is <c>major</c>.<c>minor</c>.<c>build</c>.<c>revision</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Win32Icon\">\n            <summary>\n            Icon to associate with the assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.Win32Res\">\n            <summary>\n            Inserts a Win32 resource (.res file) in the output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.AssemblyLinkerTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program or \n            <see langword=\"null\" /> if the task is not being executed.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.CompilerBase\">\n            <summary>\n            Provides the abstract base class for compiler tasks.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.CompilerBase.CodebehindExtensions\">\n            <summary>\n            Contains a list of extensions for all file types that should be treated as\n            'code-behind' when looking for resources.  Ultimately this will determine\n            if we use the \"namespace+filename\" or \"namespace+classname\" algorithm, since\n            code-behind will use the \"namespace+classname\" algorithm.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.CompilerBase.CultureNames\">\n            <summary>\n            Case-insensitive list of valid culture names for this platform.\n            </summary>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the culture name and \n            the value is <see langword=\"null\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.#cctor\">\n            <summary>\n            Class constructor for <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.ExecuteTask\">\n            <summary>\n            Compiles the sources and resources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.GetManifestResourceName(NAnt.DotNet.Types.ResourceFileSet,System.String,System.String,System.String)\">\n            <summary>\n            Determines the manifest resource name of the given resource file.\n            </summary>\n            <param name=\"resources\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> containing information that will used to assemble the manifest resource name.</param>\n            <param name=\"resourcePhysicalFile\">The resource file of which the manifest resource name should be determined.</param>\n            <param name=\"resourceLogicalFile\">The logical location of the resource file.</param>\n            <param name=\"dependentFile\">The source file on which the resource file depends.</param>\n            <returns>\n            The manifest resource name of the specified resource file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.GetManifestResourceName(NAnt.DotNet.Types.ResourceFileSet,System.String)\">\n            <summary>\n            Determines the manifest resource name of the given resource file.\n            </summary>\n            <param name=\"resources\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> containing information that will used to assemble the manifest resource name.</param>\n            <param name=\"resourceFile\">The resource file of which the manifest resource name should be determined.</param>\n            <returns>\n            The manifest resource name of the specified resource file.\n            </returns>\n            <remarks>\n            For .resx resources, the name of the dependent is determined by\n            replacing the extension of the file with the extension of the \n            source files for the compiler, and removing the culture name from\n            the file name for localized resources.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.PerformSearchForResourceLinkage(System.IO.TextReader)\">\n            <summary>\n            Extracts the associated namespace/classname linkage found in the \n            given stream.\n            </summary>\n            <param name=\"sr\">The read-only stream of the source file to search.</param>\n            <returns>\n            The namespace/classname of the source file matching the resource.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WritePackageReferences(System.IO.TextWriter)\">\n            <summary>\n            Writes package references to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the package references should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteWarningsAsError(System.IO.TextWriter)\">\n            <summary>\n            Writes list of warnings to (not) treat as errors to the specified \n            <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the list of warnings should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteNoWarnList(System.IO.TextWriter)\">\n            <summary>\n            Writes list of warnings to suppress to the specified \n            <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the list of warnings to suppress should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteConditionalCompilationConstants(System.IO.TextWriter)\">\n            <summary>\n            Writes conditional compilation constants to the specified\n            <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the conditional compilation constants should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteModuleReferences(System.IO.TextWriter)\">\n            <summary>\n            Writes module references to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the module references should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteOptions(System.IO.TextWriter)\">\n            <summary>\n            Allows derived classes to provide compiler-specific options.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteOption(System.IO.TextWriter,System.String)\">\n            <summary>\n            Writes an option using the default output format.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n            <param name=\"name\">The name of the option which should be passed to the compiler.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.WriteOption(System.IO.TextWriter,System.String,System.String)\">\n            <summary>\n            Writes an option and its value using the default output format.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n            <param name=\"name\">The name of the option which should be passed to the compiler.</param>\n            <param name=\"value\">The value of the option which should be passed to the compiler.</param>\n            <remarks>\n            The combination of <paramref name=\"option\"/> and \n            <paramref name=\"value\"/> (separated by a colon) is quoted\n            unless <paramref name=\"value\"/> is already surrounded by quotes.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.NeedsCompiling\">\n            <summary>\n            Determines whether compilation is needed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.GetResourceLinkage(System.String,System.Globalization.CultureInfo)\">\n            <summary>\n            Finds the correct namespace/classname for a resource file from the \n            given dependent source file.\n            </summary>\n            <param name=\"dependentFile\">The file from which the resource linkage of the resource file should be determined.</param>\n            <param name=\"resourceCulture\">The culture of the resource file for which the resource linkage should be determined.</param>\n            <returns>\n            The namespace/classname of the source file matching the resource or\n            <see langword=\"null\" /> if the dependent source file does not exist.\n            </returns>\n            <remarks>\n            This behaviour may be overidden by each particular compiler to \n            support the namespace/classname syntax for that language.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.LinkResourceAssembly(System.Collections.Hashtable,System.IO.FileInfo,System.String)\">\n            <summary>\n            Link a list of files into a resource assembly.\n            </summary>\n            <param name=\"resourceFiles\">The collection of resources.</param>\n            <param name=\"resourceAssemblyFile\">Resource assembly to generate</param>\n            <param name=\"culture\">Culture of the generated assembly.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.CompileResxResources(System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Compiles a set of resx files to a .resources files.\n            </summary>\n            <param name=\"resxFiles\">The set of resx files to compile.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.GetResourceCulture(System.String,System.String)\">\n            <summary>\n            Determines the culture associated with a given resource file by\n            scanning the filename for valid culture names.\n            </summary>\n            <param name=\"resourceFile\">The resource file path to check for culture info.</param>\n            <param name=\"dependentFile\">The file on which the resource file depends.</param>\n            <returns>\n            A valid <see cref=\"T:System.Globalization.CultureInfo\"/> instance if the resource is \n            associated with a specific culture; otherwise, <see langword=\"null\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Debug\">\n            <summary>\n            Generate debug output. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            Only used for &lt;jsc&gt; tasks, but retained for backward \n            compatibility (Clover.NET).\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.OutputFile\">\n            <summary>\n            The output file created by the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.OutputTarget\">\n            <summary>\n            Output type. Possible values are <c>exe</c>, <c>winexe</c>,\n            <c>library</c> or <c>module</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Define\">\n            <summary>\n            Define conditional compilation symbol(s).\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to <c>/d[efine]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Win32Icon\">\n            <summary>\n            Icon to associate with the application.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to <c>/win32icon:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Win32Res\">\n            <summary>\n            Specifies a Win32 resource file (.res).\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to <c>/win32res[ource]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.WarnAsError\">\n            <summary>\n            Instructs the compiler to treat all warnings as errors. The default\n            is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to the <c>/warnaserror[+|-]</c> flag of the compiler.\n            </para>\n            <para>\n            When this property is set to <see langword=\"true\" />, any messages\n            that would ordinarily be reported as warnings will instead be\n            reported as errors.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.WarningAsError\">\n            <summary>\n            Controls which warnings should be reported as errors.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.NoWarn\">\n            <summary>\n            Specifies a comma-separated list of warnings that should be suppressed\n            by the compiler.\n            </summary>\n            <value>\n            Comma-separated list of warnings that should be suppressed by the \n            compiler.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/nowarn</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SuppressWarnings\">\n            <summary>\n            Specifies a list of warnings that you want the compiler to suppress.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ForceRebuild\">\n            <summary>\n            Instructs NAnt to recompile the output file regardless of the file timestamps.\n            </summary>\n            <remarks>\n            When this parameter is to <see langword=\"true\" />, NAnt will always\n            run the compiler to rebuild the output file, regardless of the file timestamps.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.MainType\">\n            <summary>\n            Specifies which type contains the Main method that you want to use\n            as the entry point into the program.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to the <c>/m[ain]:</c> flag of the compiler.\n            </para>\n            <para>\n            Use this property when creating an executable file. If this property\n            is not set, the compiler searches for a valid Main method in all\n            public classes.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.KeyContainer\">\n            <summary>\n            Specifies the key pair container used to strongname the assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.KeyFile\">\n            <summary>\n            Specifies a strong name key file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.DelaySign\">\n            <summary>\n            Specifies whether to delay sign the assembly using only the public\n            portion of the strong name key. The default is \n            <see cref=\"F:NAnt.DotNet.Types.DelaySign.NotSet\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Lib\">\n            <summary>\n            Additional directories to search in for assembly references.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/lib[path]:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.References\">\n            <summary>\n            Reference metadata from the specified assembly files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Packages\">\n            <summary>\n            Specifies list of packages to reference.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourcesList\">\n            <summary>\n            Resources to embed.\n            </summary>\n            <remarks>\n            <para>\n            This can be a combination of resx files and file resources.\n            </para>\n            <para>\n            .resx files will be compiled by <see cref=\"T:NAnt.DotNet.Tasks.ResGenTask\"/> and then\n            embedded into the resulting executable.\n            </para>\n            <para>\n            The <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.Prefix\"/> property is used to make\n            up the resource name added to the assembly manifest for non-resx\n            files.\n            </para>\n            <para>\n            For .resx files the namespace from the matching source file is used\n            as prefix. This matches the behaviour of Visual Studio.\n            </para>\n            <para>\n            Multiple resources tags with different namespace prefixes may be\n            specified.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Modules\">\n            <summary>\n            Link the specified modules into this assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Sources\">\n            <summary>\n            The set of source files for compilation.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsPackageReferences\">\n            <summary>\n            Indicates whether package references are supported by compiler for \n            a given target framework. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsWarnAsErrorList\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"warnaserror\" option that takes a list of warnings. The default \n            is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsNoWarnList\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            a command line option that allows a list of warnings to be\n            suppressed. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsKeyContainer\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"keycontainer\" option. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsKeyFile\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"keyfile\" option. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.SupportsDelaySign\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"delaysign\" option. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.Extension\">\n            <summary>\n            Gets the file extension required by the current compiler.\n            </summary>\n            <value>\n            The file extension required by the current compiler.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ClassNameRegex\">\n            <summary>\n            Gets the class name regular expression for the language of the current compiler.\n            </summary>\n            <value> class name regular expression for the language of the current compiler</value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.NamespaceRegex\">\n            <summary>\n            Gets the namespace regular expression for the language of the current compiler.\n            </summary>\n            <value> namespace regular expression for the language of the current compiler</value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\">\n            <summary>\n            Holds class and namespace information for resource (*.resx) linkage.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.#ctor(System.String,System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/>\n            class.\n            </summary>\n            <param name=\"namespaceName\">The namespace the resource is under.</param>\n            <param name=\"className\">The class name the resource is associated with.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.ToString\">\n            <summary>\n            Returns the resource linkage as a string.\n            </summary>\n            <returns>\n            A string representation of the resource linkage.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.IsValid\">\n            <summary>\n            Gets a value indicating whether the <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/>\n            instances contains valid data.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if the <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/>\n            instance contains valid data; otherwise, <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.HasNamespaceName\">\n            <summary>\n            Gets a value indicating whether a namespace name is available\n            for this <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/> instance.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if a namespace name is available for \n            this <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/> instance; otherwise, \n            <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.HasClassName\">\n            <summary>\n            Gets a value indicating whether a class name is available\n            for this <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/> instance.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if a class name is available for \n            this <see cref=\"T:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage\"/> instance; otherwise, \n            <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.NamespaceName\">\n            <summary>\n            Gets the name of namespace the resource is under.  \n            </summary>\n            <value>\n            The name of namespace the resource is under.  \n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.ClassName\">\n            <summary>\n            Gets the name of the class (most likely a form) that the resource \n            is associated with.  \n            </summary>\n            <value>\n            The name of the class the resource is associated with.  \n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourceLinkage.Culture\">\n            <summary>\n            Gets the culture that the resource is associated with.\n            </summary>\n            <value>\n            The culture that the resource is associated with.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.CscTask\">\n            <summary>\n            Compiles C# programs.\n            </summary>\n            <remarks>\n            <note>\n            In order to have <see cref=\"T:NAnt.DotNet.Tasks.CscTask\"/> generate manifest resource names\n            that match those generated by Microsoft Visual Studio.NET, the value of\n            the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.Prefix\"/> attribute of the &lt;<see cref=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourcesList\"/>&gt;\n            element should match the \"Default Namespace\" of the C# project, and the \n            value of the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.DynamicPrefix\"/> attribute \n            should be set to \"<see langword=\"true\"/>\".\n            </note>\n            </remarks>\n            <example>\n              <para>Compile a \"HelloWorld\" application, including embedded resources.</para>\n              <code>\n                <![CDATA[\n            <csc target=\"exe\" output=\"HelloWorld.exe\" debug=\"true\">\n                <nowarn>\n                    <!-- do not report warnings for missing XML comments -->\n                    <warning number=\"0519\" />\n                </nowarn>\n                <sources>\n                    <include name=\"**/*.cs\" />\n                </sources>\n                <resources dynamicprefix=\"true\" prefix=\"HelloWorld\">\n                    <include name=\"**/*.resx\" />\n                </resources>\n                <references>\n                    <include name=\"System.dll\" />\n                    <include name=\"System.Data.dll\" />\n                </references>\n            </csc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CscTask.WriteOptions(System.IO.TextWriter)\">\n            <summary>\n            Writes the compiler options to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\"><see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.CscTask.NeedsCompiling\">\n            <summary>\n            Determines whether compilation is needed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.BaseAddress\">\n            <summary>\n            The preferred base address at which to load a DLL. The default base \n            address for a DLL is set by the .NET Framework common language \n            runtime.\n            </summary>\n            <value>\n            The preferred base address at which to load a DLL.\n            </value>\n            <remarks>\n            This address can be specified as a decimal, hexadecimal, or octal \n            number. \n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.DebugOutput\">\n            <summary>\n            Specifies the type of debugging information generated by the \n            compiler. The default is <see cref=\"F:NAnt.DotNet.Types.DebugOutput.None\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Debug\">\n            <summary>\n            No longer expose this to build authors. Use <see cref=\"P:NAnt.DotNet.Tasks.CscTask.DebugOutput\"/>\n            instead.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.DocFile\">\n            <summary>\n            The name of the XML documentation file to generate.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/doc:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.FileAlign\">\n            <summary>\n            Specifies the size of sections in the output file. Valid values are\n            512, 1024, 2048, 4096, and 8192.\n            </summary>\n            <value>\n            The size of sections in the output file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.NoStdLib\">\n            <summary>\n            Instructs the compiler not to import mscorlib.dll. The default is \n            <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/nostdlib[+|-]</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.NoConfig\">\n            <summary>\n            Instructs the compiler not to use implicit references to assemblies.\n            The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/noconfig</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Checked\">\n            <summary>\n            Specifies whether an integer arithmetic statement that is not in \n            the scope of the <c>checked</c> or <c>unchecked</c> keywords and \n            that results in a value outside the range of the data type should \n            cause a run-time exception. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/checked[+|-]</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Unsafe\">\n            <summary>\n            Instructs the compiler to allow code that uses the <c>unsafe</c> \n            keyword. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/unsafe[+|-]</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.LangVersion\">\n            <summary>\n            Causes the compiler to only accept syntax that is included in a\n            given specification.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/langversion</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Optimize\">\n            <summary>\n            Specifies whether the compiler should perform optimizations to the \n            make output files smaller, faster, and more effecient. The default \n            is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the compiler should perform optimizations; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/optimize[+|-]</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Platform\">\n            <summary>\n            Specifies which platform version of common language runtime (CLR)\n            can run the output file.\n            </summary>\n            <value>\n            The platform version of common language runtime (CLR) that can run\n            the output file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/platform</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.WarningLevel\">\n            <summary>\n            Specifies the warning level for the compiler to display. Valid values \n            are <c>0</c>-<c>4</c>. The default is <c>4</c>.\n            </summary>\n            <value>\n            The warning level for the compiler to display.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/warn</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Codepage\">\n            <summary>\n            Specifies the code page to use for all source code files in the \n            compilation.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/codepage</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.SupportsDocGeneration\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports generation of XML Documentation file. The default is \n            <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.SupportsPlatform\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports limiting the platform on which the compiled code can run.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.SupportsLangVersion\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports accepting only a specific language syntax.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.Extension\">\n            <summary>\n            Gets the file extension required by the current compiler.\n            </summary>\n            <value>\n            For the C# compiler, the file extension is always <c>cs</c>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.ClassNameRegex\">\n            <summary>\n            Gets the class name regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Class name regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.CscTask.NamespaceRegex\">\n            <summary>\n            Gets the namespace regular expression for the language of the current compiler.\n            </summary>\n            <value>\n            Namespace regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.DelaySignTask\">\n            <summary>\n            Signs delay-signed .NET Assemblies, or re-signs existing assemblies.\n            </summary>\n            <remarks>\n            <para>\n            The delay-signing mechanism takes a fileset (named targets)\n            and either a <see cref=\"P:NAnt.DotNet.Tasks.DelaySignTask.KeyFile\"/> attribute for a file containing the\n            public and private keys, or <see cref=\"P:NAnt.DotNet.Tasks.DelaySignTask.KeyContainer\"/> to name a key \n            container.\n            </para>\n            </remarks>\n            <example>\n              <para>Sign partially-signed <c>foo.dll</c> with <c>bar.snk</c>.</para>\n              <code>\n                <![CDATA[\n            <delay-sign keyfile=\"bar.snk\" verbose=\"false\">\n                <targets>\n                    <include name=\"foo.dll\" />\n                </targets>\n            </delay-sign>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.DelaySignTask.ExecuteTask\">\n            <summary>\n            Converts a single file or group of files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.DelaySignTask.Targets\">\n            <summary>\n            List of assemblies/executables to sign.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.DelaySignTask.KeyFile\">\n            <summary>\n            Specifies the filesystem path to the signing key.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.DelaySignTask.KeyContainer\">\n            <summary>\n            Specifies the key container.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.DelaySignTask.ProgramArguments\">\n            <summary>\n            Gets the command line arguments for the external program.\n            </summary>\n            <value>\n            The command line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.IlasmTask\">\n            <summary>\n            Compiles ILASM programs.\n            </summary>\n            <example>\n              <para>\n              Compiles <c>helloworld.il</c> to <c>helloworld.exe</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <ilasm target=\"exe\" output=\"helloworld.exe\" debug=\"true\">\n                <sources>\n                    <include name=\"helloworld.il\" />\n                </sources>\n            </ilasm>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.IlasmTask.ExecuteTask\">\n            <summary>\n            Compiles the sources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.IlasmTask.WriteOptions\">\n            <summary>\n            Writes the compiler options.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.IlasmTask.WriteOption(System.IO.StringWriter,System.String)\">\n             <summary>\n             Writes an option using the default output format.\n             </summary>\n             <param name=\"writer\">\n             The <see cref=\"T:System.IO.StringWriter\"/> to which the compiler options should\n             be written.\n            </param>\n             <param name=\"name\">\n             A <see cref=\"T:System.String\"/> that contains the name of the\n             option which should be passed to the compiler.\n             </param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.IlasmTask.WriteOption(System.IO.StringWriter,System.String,System.String)\">\n            <summary>\n            Writes an option and its value using the default output format.\n            </summary>\n            <param name=\"writer\">\n            The <see cref=\"T:System.IO.StringWriter\"/> to which the compiler options should\n            be written.\n            </param>\n            <param name=\"name\">\n            A <see cref=\"T:System.String\"/> that contains the name of the\n            option which should be passed to the compiler.\n            </param>\n            <param name=\"arg\">\n            A <see cref=\"T:System.String\"/> that contains the value of the\n            option which should be passed to the compiler.\n            </param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.IlasmTask.NeedsCompiling\">\n            <summary>\n            Determines whether or not compilation is needed.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if compilation is needed; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Clock\">\n            <summary>\n            Specifies whether or not the compiler should measure and report\n            the compilation times.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the compilation times should be\n            measured and reported; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/CLOCK</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Debug\">\n            <summary>\n            Specifies whether or not the compiler should generate debug\n            information.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if debug information should be generated;\n            otherwise, <see langword=\"false\" />. The default is\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/DEBUG</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Error\">\n            <summary>\n            Specifies whether or not the compiler should attempt to create a\n            PE file even if compilation errors have been reported.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if a PE file has to be created even if\n            compilation errors have been reported; otherwise,\n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/ERROR</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.ForceRebuild\">\n            <summary>\n            Instructs NAnt to recompile the output file regardless of the file\n            timestamps.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output file should be recompiled\n            regardless of its timestamps; otherwise <see langword=\"false\" />.\n            The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Listing\">\n            <summary>\n            Specifies whether or not the compiler should type a formatted\n            listing of the compilation result.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if a formatted listing of the compilation\n            result should be typed; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/LISTING</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Alignment\">\n            <summary>\n            Instructs the compiler to set the <i>FileAlignment</i> value in\n            the PE header.\n            </summary>\n            <value>\n            An <see cref=\"T:System.Int32\"/> that represents the <i>FileAlignment</i>\n            value to set in the PE header. The value must be a power of 2, in\n            range from 512 to 65536.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/ALIGNMENT</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Base\">\n            <summary>\n            Instructs the compiler to set the <i>ImageBase</i> value in\n            the PE header.\n            </summary>\n            <value>\n            A <see cref=\"T:System.Int32\"/> that represents the <i>ImageBase</i>\n            value to set in the PE header.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/BASE</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Flags\">\n            <summary>\n            Instructs the compiler to set the <i>Flags</i> value in the CLR\n            header.\n            </summary>\n            <value>\n            An <see cref=\"T:System.Int32\"/> that represents the <i>Flags</i>\n            value to set in the CLR header. The most frequently value are 1\n            (pre-IL code) and 2 (mixed code). The third bit indicating that\n            the PE file is strong signed, is ignored.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/FLAGS</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Subsystem\">\n            <summary>\n            Instructs the compiler to set the <i>Subsystem</i> value in the PE\n            header.\n            </summary>\n            <value>\n            An <see cref=\"T:System.Int32\"/> that represents the <i>Subsystem</i>\n            value to set in the PE header. The most frequently value are 3\n            (console application) and 2 (GUI application).\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/SUBSYSTEM</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Target\">\n            <summary>\n            Specifies which output type should be generated.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that contains the target type.\n            Possible values are <c>dll</c> and <c>exe</c>.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/OUTPUT</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.KeySource\">\n            <summary>\n            Instructs the compiler to generate a strong signature of the PE\n            file.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that contains the private\n            encryption key.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/KEY=<![CDATA[@<]]>keysource<![CDATA[>]]></c>\n            flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.KeyFile\">\n            <summary>\n            Instructs the compiler to generate a strong signature of the PE\n            file.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the file\n            containing the private encryption key.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/KEY=<![CDATA[<]]>keyfile<![CDATA[>]]></c>\n            flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.OutputFile\">\n            <summary>\n            Specifies the name of the output file created by the compiler.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the name of\n            the output file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/OUTPUT</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.ResourceFile\">\n            <summary>\n            Instructs the compiler to link the specified unmanaged resource\n            file into the resulting PE file.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the unmanaged\n            resource file to link.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/RESOURCE</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.Sources\">\n            <summary>\n            Specifies the set of source files to compile.\n            </summary>\n            <value>\n            A <see cref=\"T:NAnt.Core.Types.FileSet\"/> that represents the set\n            of source files to compile.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.IlasmTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that contains the command-line\n            arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.JscTask\">\n            <summary>\n            Compiles JScript.NET programs.\n            </summary>\n            <example>\n              <para>Compile <c>helloworld.js</c> to <c>helloworld.exe</c>.</para>\n              <code>\n                <![CDATA[\n            <jsc target=\"exe\" output=\"helloworld.exe\" debug=\"true\">\n                <sources>\n                    <include name=\"helloworld.js\" />\n                </sources>\n            </jsc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.JscTask.WriteModuleReferences(System.IO.TextWriter)\">\n            <summary>\n            Writes module references to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the module references should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.JscTask.WriteOptions(System.IO.TextWriter)\">\n            <summary>\n            Writes the compiler options to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\"><see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.AutoRef\">\n            <summary>\n            Automatically references assemblies if they have the same name as \n            an imported namespace or as a type annotation when declaring a \n            variable. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/autoref</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.NoStdLib\">\n            <summary>\n            Instructs the compiler not to import standard library, and changes\n            <see cref=\"P:NAnt.DotNet.Tasks.JscTask.AutoRef\"/> to <see langword=\"false\"/>. The default is\n            <see langword=\"false\"/>.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/noconfig</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.Platform\">\n            <summary>\n            Specifies which platform version of common language runtime (CLR)\n            can run the output file.\n            </summary>\n            <value>\n            The platform version of common language runtime (CLR) that can run\n            the output file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/platform</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.VersionSafe\">\n            <summary>\n            Causes the compiler to generate errors for implicit method \n            overrides. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/versionsafe</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.WarningLevel\">\n            <summary>\n            Specifies the warning level for the compiler to display. Valid \n            values are <c>0</c>-<c>4</c>. The default is <c>4</c>.\n            </summary>\n            <value>\n            The warning level for the compiler to display.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/warn</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.WarningAsError\">\n            <summary>\n            Controls which warnings should be reported as errors.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            compiler does not allow control over which warnings should be\n            reported as errors.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.NoWarn\">\n            <summary>\n            Specifies a comma-separated list of warnings that should be suppressed\n            by the compiler.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            compiler does not support package references.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.SuppressWarnings\">\n            <summary>\n            Specifies a list of warnings that you want the compiler to suppress.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            compiler does not support suppressing warnings.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.Codepage\">\n            <summary>\n            Specifies the code page to use for all source code files in the \n            compilation.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/codepage</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.KeyContainer\">\n            <summary>\n            Specifies the key pair container used to strongname the assembly.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.KeyFile\">\n            <summary>\n            Specifies a strong name key file.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.DelaySign\">\n            <summary>\n            Specifies whether to delay sign the assembly using only the public\n            portion of the strong name key.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.SupportsKeyContainer\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"keycontainer\" option. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.SupportsKeyFile\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"keyfile\" option. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.SupportsDelaySign\">\n            <summary>\n            Indicates whether the compiler for a given target framework supports\n            the \"delaysign\" option. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            does not support this.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.SupportsPlatform\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports limiting the platform on which the compiled code can run.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.Modules\">\n            <summary>\n            Link the specified modules into this assembly.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the JScript.NET\n            compiler does not support linking modules.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.Extension\">\n            <summary>\n            Gets the file extension required by the current compiler.\n            </summary>\n            <value>\n            For the JScript.NET compiler, the file extension is always <c>js</c>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.ClassNameRegex\">\n            <summary>\n            Gets the class name regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Class name regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.JscTask.NamespaceRegex\">\n            <summary>\n            Gets the namespace regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Namespace regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.LicenseTask\">\n            <summary>\n            Generates a <c>.licence</c> file from a <c>.licx</c> file.\n            </summary>\n            <remarks>\n            <para>\n            If no output file is specified, the default filename is the name of the\n            target file with the extension <c>.licenses</c> appended.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Generate the file <c>component.exe.licenses</c> file from <c>component.licx</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <license input=\"component.licx\" licensetarget=\"component.exe\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.Initialize\">\n            <summary>\n            Initializes the <see cref=\"T:NAnt.DotNet.Tasks.LicenseTask\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Updates the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> of the specified \n            <see cref=\"T:System.Diagnostics.Process\"/>.\n            </summary>\n            <param name=\"process\">The <see cref=\"T:System.Diagnostics.Process\"/> of which the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> should be updated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.ExecuteTask\">\n            <summary>\n            Generates the license file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.NeedsCompiling(System.IO.FileInfo)\">\n            <summary>\n            Determines whether the <c>.licenses</c> file needs to be recompiled\n            or is uptodate.\n            </summary>\n            <param name=\"licensesFile\">The <c>.licenses</c> file.</param>\n            <returns>\n            <see langword=\"true\" /> if the <c>.licenses</c> file needs compiling; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.InputFile\">\n            <summary>\n            Input file to process.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.OutputFile\">\n            <summary>\n            Name of the license file to output.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.Assemblies\">\n            <summary>\n            Names of the references to scan for the licensed component.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.LicenseTarget\">\n            <summary>\n            Specifies the executable for which the .licenses file is generated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.Target\">\n            <summary>\n            Specifies the executable for which the .licenses file is generated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.SupportsAssemblyReferences\">\n            <summary>\n            Indicates whether assembly references are supported by the current\n            target framework. The default is <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            Applies only to frameworks having a command line tool for compiling\n            licenses files.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.HasCommandLineCompiler\">\n            <summary>\n            Indicates whether the current target framework has a command line\n            tool for compiling licenses files. The default is \n            <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.BaseDirectory\">\n            <summary>\n            Gets the working directory for the application.\n            </summary>\n            <value>\n            The working directory for the application.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.Arguments\">\n            <summary>\n            The command-line arguments for the external program.\n            </summary>\n            <remarks>\n            Override to avoid exposing these elements in build file.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.LicenseTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n            <remarks>\n            Override in derived classes to explicitly set the location of the \n            external tool.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.LicenseTask.LicenseGatherer\">\n            <summary>\n            Responsible for reading the license and writing them to a license \n            file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.LicenseGatherer.InitializeLifetimeService\">\n            <summary>\n            Obtains a lifetime service object to control the lifetime policy for \n            this instance.\n            </summary>\n            <returns>\n            An object of type <see cref=\"T:System.Runtime.Remoting.Lifetime.ILease\"/> used to control the lifetime \n            policy for this instance. This is the current lifetime service object \n            for this instance if one exists; otherwise, a new lifetime service \n            object initialized with a lease that will never time out.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.LicenseGatherer.CreateLicenseFile(NAnt.DotNet.Tasks.LicenseTask,System.String)\">\n            <summary>\n            Creates the whole license file.\n            </summary>\n            <param name=\"licenseTask\">The <see cref=\"T:NAnt.DotNet.Tasks.LicenseTask\"/> instance for which the license file should be created.</param>\n            <param name=\"licensesFile\">The .licenses file to create.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.LicenseTask.LicenseGatherer.IsSerializable(System.Object)\">\n            <summary>\n            Determines whether the given object is serializable in binary\n            format.\n            </summary>\n            <param name=\"value\">The object to check.</param>\n            <returns>\n            <see langword=\"true\" /> if <paramref name=\"value\" /> is \n            serializable in binary format; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.NDocTask\">\n            <summary>\n            Runs NDoc V1.3.1 to create documentation.\n            </summary>\n            <remarks>\n              <para>\n              See the <see href=\"http://ndoc.sourceforge.net/\">NDoc home page</see> for more \n              information.\n              </para>\n              <note>\n              By default, only the NDoc MSDN documenter ships as part of the NAnt \n              distribution. To make another NDoc documenter from the NDoc V1.3.1 \n              distribution available to the <see cref=\"T:NAnt.DotNet.Tasks.NDocTask\"/>, copy the \n              documenter assembly (and possible dependencies) to the \"lib\" \n              directory corresponding with the CLR you're running NAnt on \n              (eg. &lt;nant root&gt;/bin/lib/net/1.1).\n              </note>\n            </remarks>\n            <example>\n              <para>\n              Document two assemblies using the MSDN documenter. The namespaces are \n              documented in <c>NamespaceSummary.xml</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <ndoc>\n                <assemblies basedir=\"${build.dir}\">\n                    <include name=\"NAnt.exe\" />\n                    <include name=\"NAnt.Core.dll\" />\n                </assemblies>\n                <summaries basedir=\"${build.dir}\">\n                    <include name=\"NamespaceSummary.xml\" />\n                </summaries>\n                <documenters>\n                    <documenter name=\"MSDN\">\n                        <property name=\"OutputDirectory\" value=\"doc\\MSDN\" />\n                        <property name=\"HtmlHelpName\" value=\"NAnt\" />\n                        <property name=\"HtmlHelpCompilerFilename\" value=\"hhc.exe\" />\n                        <property name=\"IncludeFavorites\" value=\"False\" />\n                        <property name=\"Title\" value=\"An NDoc Documented Class Library\" />\n                        <property name=\"SplitTOCs\" value=\"False\" />\n                        <property name=\"DefaulTOC\" value=\"\" />\n                        <property name=\"ShowVisualBasic\" value=\"True\" />\n                        <property name=\"ShowMissingSummaries\" value=\"True\" />\n                        <property name=\"ShowMissingRemarks\" value=\"True\" />\n                        <property name=\"ShowMissingParams\" value=\"True\" />\n                        <property name=\"ShowMissingReturns\" value=\"True\" />\n                        <property name=\"ShowMissingValues\" value=\"True\" />\n                        <property name=\"DocumentInternals\" value=\"False\" />\n                        <property name=\"DocumentProtected\" value=\"True\" />\n                        <property name=\"DocumentPrivates\" value=\"False\" />\n                        <property name=\"DocumentEmptyNamespaces\" value=\"False\" />\n                        <property name=\"IncludeAssemblyVersion\" value=\"False\" />\n                        <property name=\"CopyrightText\" value=\"\" />\n                        <property name=\"CopyrightHref\" value=\"\" />\n                     </documenter>\n                </documenters> \n            </ndoc>\n                ]]>\n              </code>\n              <para>Content of <c>NamespaceSummary.xml</c> :</para>\n              <code>\n                <![CDATA[\n            <namespaces>\n                <namespace name=\"Foo.Bar\">\n                    The <b>Foo.Bar</b> namespace reinvents the wheel.\n                </namespace>\n                <namespace name=\"Foo.Bar.Tests\">\n                    The <b>Foo.Bar.Tests</b> namespace ensures that the Foo.Bar namespace reinvents the wheel correctly.\n                </namespace>\n            </namespaces>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.Initialize\">\n            <summary>\n            Initializes the taks and verifies the parameters.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.ExecuteTask\">\n            <summary>\n            Generates an NDoc project and builds the documentation.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.OnDocBuildingStep(System.Object,NDoc.Core.ProgressArgs)\">\n            <summary>\n            Represents the method that will be called to update the overall \n            percent complete value and the current step name.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NDoc.Core.ProgressArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.OnDocBuildingProgress(System.Object,NDoc.Core.ProgressArgs)\">\n            <summary>\n            Represents the method that will be called to update the current\n            step's precent complete value.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"e\">A <see cref=\"T:NDoc.Core.ProgressArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.CheckAndGetDocumenter(NDoc.Core.Project,System.String)\">\n            <summary>\n            Returns the documenter for the given project.\n            </summary>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n            Documenter <paramref name=\"documenterName\"/> is not found.\n            </exception>\n            <exception cref=\"T:System.ArgumentNullException\">\n            <paramref name=\"project\"/> is <see langword=\"null\"/>.\n            </exception>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.NDocTask.ExpandPropertiesInNodes(System.Xml.XmlNodeList)\">\n            <summary>\n            Performs macro expansion for the given nodes.\n            </summary>\n            <param name=\"nodes\"><see cref=\"T:System.Xml.XmlNodeList\"/> for which expansion should be performed.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.NDocTask.Assemblies\">\n            <summary>\n            The set of assemblies to document.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.NDocTask.Summaries\">\n            <summary>\n            The set of namespace summary files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.NDocTask.Documenters\">\n            <summary>\n            Specifies the formats in which the documentation should be generated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.NDocTask.ReferencePaths\">\n            <summary>\n            Collection of additional directories to search for referenced \n            assemblies.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.RegsvcsTask\">\n            <summary>\n            Installs or removes .NET Services.\n            </summary>\n            <remarks>\n            <para>\n            This tasks provides the same functionality as the <c>regsvcs</c> tool \n            provided in the .NET SDK.\n            </para>\n            <para>\n            It performs the following actions: \n            </para>\n            <list type=\"bullet\">\n              <item>\n                <description>Loads and registers an assembly.</description>\n              </item>\n              <item>\n                <description>Generates, registers, and installs a type library into a specified COM+ application.</description>\n              </item>\n              <item>\n                <description>Configures services that are added programmatically to your class.</description>\n              </item>\n            </list>\n            <para>\n            Refer to the <see href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrfnetservicesinstallationutilityregsvcsexe.htm\">.NET Services Installation Tool (Regsvcs.exe)</see> for more information.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Adds all public classes contained in <c>myTest.dll</c> to a COM+ \n              application and produces the <c>myTest.tlb</c> type library. If the \n              application already exists, it is overwritten.\n              </para>\n              <code>\n                <![CDATA[\n            <regsvcs action=\"FindOrCreate\" assembly=\"myTest.dll\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Adds all public classes contained in <c>myTest.dll</c> to <c>myTargetApp</c> \n              and produces the <c>myTest.tlb</c> type library. If the application already \n              exists, it is overwritten.\n              </para>\n              <code>\n                <![CDATA[\n            <regsvcs action=\"FindOrCreate\" assembly=\"myTest.dll\" application=\"myTargetApp\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Adds all public classes contained in <c>myTest.dll</c> to a COM+ \n              application and produces the <c>myTest.tlb</c> type library. A new \n              application is always created.\n              </para>\n              <code>\n                <![CDATA[\n            <regsvcs action=\"Create\" assembly=\"myTest.dll\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Uninstalls the COM+ application contained in <c>myTest.dll</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <regsvcs action=\"Uninstall\" assembly=\"myTest.dll\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.RegsvcsTask.ExecuteTask\">\n            <summary>\n            Performs the specified action.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.Action\">\n            <summary>\n            Defines the action to take with the assembly. The default is \n            <see cref=\"F:NAnt.DotNet.Tasks.RegsvcsTask.ActionType.FindOrCreate\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.AssemblyFile\">\n            <summary>\n            The source assembly file.\n            </summary>\n            <remarks>\n            The assembly must be signed with a strong name.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.TypeLibrary\">\n            <summary>\n            Specifies the type library file to install.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.ExistingTypeLibrary\">\n            <summary>\n            Uses an existing type library. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.NoReconfig\">\n            <summary>\n            Do not reconfigure an existing target application. \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.ComponentsOnly\">\n            <summary>\n            Configures components only; ignores methods and interfaces.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.ExistingApplication\">\n            <summary>\n            Expect an existing application. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.ApplicationName\">\n            <summary>\n            Specifies the name of the COM+ application to either find or create.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.PartitionName\">\n            <summary>\n            Specifies the name or id of the COM+ application to either find or \n            create.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.RegsvcsTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.RegsvcsTask.ActionType\">\n            <summary>\n            Defines the possible actions for a .NET Service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.RegsvcsTask.ActionType.FindOrCreate\">\n            <summary>\n            Finds or creates the target application.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.RegsvcsTask.ActionType.Create\">\n            <summary>\n            Creates the target application.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Tasks.RegsvcsTask.ActionType.Uninstall\">\n            <summary>\n            Uninstalls the target application.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.ResGenTask\">\n            <summary>\n            Converts files from one resource format to another.\n            </summary>\n            <remarks>\n            <note>\n            If no <see cref=\"P:NAnt.DotNet.Tasks.ResGenTask.ToDirectory\"/> is specified, the resource file will \n            be created next to the input file.\n            </note>\n            </remarks>\n            <example>\n              <para>\n              Convert a resource file from the <c>.resx</c> to the <c>.resources</c> \n              format.\n              </para>\n              <code>\n                <![CDATA[\n            <resgen input=\"translations.resx\" output=\"translations.resources\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Convert a set of <c>.resx</c> files to the <c>.resources</c> format.\n              </para>\n              <code>\n                <![CDATA[\n            <resgen todir=\".\">\n                <resources>\n                    <include name=\"*.resx\" />\n                </resources>\n            </resgen>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Updates the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> of the specified \n            <see cref=\"T:System.Diagnostics.Process\"/>.\n            </summary>\n            <param name=\"process\">The <see cref=\"T:System.Diagnostics.Process\"/> of which the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> should be updated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.ExecuteTask\">\n            <summary>\n            Converts a single file or group of files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.RemoveOutputs\">\n            <summary>\n            Cleans up generated files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.NeedsCompiling(System.IO.FileInfo,System.IO.FileInfo)\">\n            <summary>\n            Determines whether the specified input file needs to be compiled.\n            </summary>\n            <param name=\"inputFile\">The input file.</param>\n            <param name=\"outputFile\">The output file.</param>\n            <returns>\n            <see langword=\"true\" /> if the input file need to be compiled; \n            otherwise <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.GetOutputFile(System.IO.FileInfo)\">\n            <summary>\n            Determines the full path and extension for the output file.\n            </summary>\n            <param name=\"file\">The output file for which the full path and extension should be determined.</param>\n            <returns>\n            The full path (with extensions) for the specified file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.ReferencesThirdPartyAssemblies(System.String)\">\n            <summary>\n            Determines whether the specified resource file references third\n            party assemblies by checking whether a &lt;data&gt; element exists\n            with a &quot;type&quot; attribute that does not start with \n            &quot;System.&quot;.\n            </summary>\n            <param name=\"resourceFile\">The resource file to check.</param>\n            <returns>\n            <see langword=\"true\" /> if the resource file references third party\n            assemblies, or an error occurred; otherwise, <see langword=\"false\" />.\n            </returns>\n            <remarks>\n            This check will only be accurate for 1.0 resource file, but the\n            2.0 resx files can only be compiled with a resgen tool that supports\n            assembly references, so this method will not be used anyway.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ResGenTask.GetExternalFileReferences(System.IO.FileInfo)\">\n            <summary>\n            Returns a list of external file references for the specified file.\n            </summary>\n            <param name=\"resxFile\">The resx file for which a list of external file references should be returned.</param>\n            <returns>\n            A list of external file references for the specified file, or\n            <see langword=\"null\" /> if <paramref name=\"resxFile\" /> does not \n            exist or does not support external file references.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.InputFile\">\n            <summary>\n            Input file to process.\n            </summary>\n            <value>\n            The full path to the input file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.OutputFile\">\n            <summary>\n            The resource file to output.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.TargetExt\">\n            <summary>\n            The target type. The default is <c>resources</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.ToDirectory\">\n            <summary>\n            The directory to which outputs will be stored.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.UseSourcePath\">\n            <summary>\n            Use each source file's directory as the current directory for \n            resolving relative file paths. The default is <see langword=\"false\" />.\n            Only supported when targeting .NET 2.0 (or higher).\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.Resources\">\n            <summary>\n            Takes a list of <c>.resx</c> or <c>.txt</c> files to convert to <c>.resources</c> files.      \n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.Assemblies\">\n            <summary>\n            Reference metadata from the specified assembly files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.SupportsAssemblyReferences\">\n            <summary>\n            Indicates whether assembly references are supported by the \n            <c>resgen</c> tool for the current target framework. The default \n            is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.SupportsExternalFileReferences\">\n            <summary>\n            Indicates whether external file references are supported by the \n            <c>resgen</c> tool for the current target framework. The default \n            is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.QualifiedResources\">\n            <summary>\n            For internal use only !\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.BaseDirectory\">\n            <summary>\n            Gets the working directory for the application.\n            </summary>\n            <value>\n            The working directory for the application.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.ProgramArguments\">\n            <summary>\n            Gets the command line arguments for the external program.\n            </summary>\n            <value>\n            The command line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ResGenTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n            <remarks>\n            Override in derived classes to explicitly set the location of the \n            external tool.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.QualifiedResource\">\n            <summary>\n            For internal use only !\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.QualifiedResource.#ctor(System.IO.FileInfo,System.IO.FileInfo)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Tasks.QualifiedResource\"/>\n            class for a given input and output file.\n            </summary>\n            <param name=\"input\">The resource to compile.</param>\n            <param name=\"output\">The compiled resource.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.QualifiedResource.Input\">\n            <summary>\n            Gets the resource file to compile.\n            </summary>\n            <value>\n            The resource file to compile.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.QualifiedResource.Output\">\n            <summary>\n            Gets the compiled resource file.\n            </summary>\n            <value>\n            The compiled resource file.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.ScriptTask\">\n            <summary>\n            Executes the code contained within the task.\n            </summary>\n            <remarks>\n                <h5>Code</h5>\n                <para>\n                The <see cref=\"T:NAnt.DotNet.Tasks.ScriptTask\"/> must contain a single <c>code</c> \n                element, which in turn contains the script code.\n                </para>\n                <para>\n                This code can include extensions such as functions, or tasks. Once\n                the script task has executed those extensions will be available for\n                use in the buildfile.\n                </para>\n                <para>\n                If no extensions have been defined, a static entry point named\n                <c>ScriptMain</c> - which must have a single <see cref=\"T:NAnt.Core.Project\"/>\n                argument - is required.\n                </para>\n                <h5>Namespaces</h5>\n                <para>\n                The following namespaces are imported by default:\n                </para>\n                <list type=\"bullet\">\n                    <item>\n                        <description>System</description>\n                    </item>\n                    <item>\n                        <description>System.Collections</description>\n                    </item>\n                    <item>\n                        <description>System.IO</description>\n                    </item>\n                    <item>\n                        <description>System.Text</description>\n                    </item>\n                    <item>\n                        <description>NAnt.Core</description>\n                    </item>\n                    <item>\n                        <description>NAnt.Core.Attributes</description>\n                    </item>\n                </list>\n                <h5>Assembly References</h5>\n                <para>\n                The assembly references that are specified will be used to compile\n                the script, and will be loaded into the NAnt appdomain.\n                </para>\n                <para>\n                By default, only the <c>NAnt.Core</c> and <c>mscorlib</c> assemblies\n                are referenced.\n                </para>\n            </remarks>\n            <example>\n              <para>Run C# code that writes a message to the build log.</para>\n              <code>\n                    &lt;script language=\"C#\"&gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                            public static void ScriptMain(Project project) {\n                                project.Log(Level.Info, \"Hello World from a script task using C#\");\n                            }\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n              </code>\n            </example>\n            <example>\n              <para>Define a custom function and call it using C#.</para>\n              <code>\n                    &lt;script language=\"C#\" prefix=\"test\" &gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                            [Function(\"test-func\")]\n                            public static string Testfunc(  ) {\n                                return \"some result !!!!!!!!\";\n                            }\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n                    &lt;echo message='${test::test-func()}'/&gt;\n              </code>\n            </example>\n            <example>\n              <para>Use a custom namespace in C# to create a database</para>\n              <code>\n                    &lt;script language=\"C#\" &gt;\n                        &lt;references&gt;\n                            &lt;include name=\"System.Data.dll\" /&gt;\n                        &lt;/references&gt;\n                        &lt;imports&gt;\n                            &lt;import namespace=\"System.Data.SqlClient\" /&gt;\n                        &lt;/imports&gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                            public static void ScriptMain(Project project) {\n                                string dbUserName = \"nant\";\n                                string dbPassword = \"nant\";\n                                string dbServer = \"(local)\";\n                                string dbDatabaseName = \"NAntSample\";\n                                string connectionString = String.Format(\"Server={0};uid={1};pwd={2};\", dbServer, dbUserName, dbPassword);\n                                \n                                SqlConnection connection = new SqlConnection(connectionString);\n                                string createDbQuery = \"CREATE DATABASE \" + dbDatabaseName;\n                                SqlCommand createDatabaseCommand = new SqlCommand(createDbQuery);\n                                createDatabaseCommand.Connection = connection;\n                                \n                                connection.Open();\n                                \n                                try {\n                                    createDatabaseCommand.ExecuteNonQuery();\n                                    project.Log(Level.Info, \"Database added successfully: \" + dbDatabaseName);\n                                } catch (Exception e) {\n                                    project.Log(Level.Error, e.ToString());\n                                } finally {\n                                    connection.Close();\n                                }\n                            }\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n              </code>\n            </example>\n            <example>\n              <para>\n              Run Visual Basic.NET code that writes a message to the build log.\n              </para>\n              <code>\n                    &lt;script language=\"VB\"&gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                            Public Shared Sub ScriptMain(project As Project)\n                                project.Log(Level.Info, \"Hello World from a script task using Visual Basic.NET\")\n                            End Sub\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n              </code>\n            </example>\n            <example>\n              <para>Define a custom task and call it using C#.</para>\n              <code>\n                    &lt;script language=\"C#\" prefix=\"test\" &gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                            [TaskName(\"usertask\")]\n                            public class TestTask : Task {\n                              #region Private Instance Fields\n                                          private string _message;\n                                          #endregion Private Instance Fields\n                                          #region Public Instance Properties\n                                          [TaskAttribute(\"message\", Required=true)]\n                              public string FileName {\n                                  get { return _message; }\n                                  set { _message = value; }\n                              }\n                                          #endregion Public Instance Properties\n                                          #region Override implementation of Task\n                                          protected override void ExecuteTask() {\n                                  Log(Level.Info, _message.ToUpper());\n                              }\n                              #endregion Override implementation of Task\n                            }\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n                    &lt;usertask message='Hello from UserTask'/&gt;\n              </code>\n            </example>\n            <example>\n              <para>\n              Define a custom function and call it using <see href=\"http://boo.codehaus.org/\">Boo</see>.\n              </para>\n              <code>\n                    &lt;script language=\"Boo.CodeDom.BooCodeProvider, Boo.CodeDom, Version=1.0.0.0, Culture=neutral, PublicKeyToken=32c39770e9a21a67\"\n                        failonerror=\"true\"&gt;\n                        &lt;code&gt;\n                          &lt;![CDATA[\n                           \n                            [Function(\"test-func\")]\n                            def MyFunc():\n                                return \"Hello from Boo !!!!!!\"\n                          ]]&gt;\n                        &lt;/code&gt;\n                    &lt;/script&gt;\n                    &lt;echo message='${script::test-func()}'/&gt;\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ScriptTask.Initialize\">\n            <summary>\n            Initializes the task.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.ScriptTask.ExecuteTask\">\n            <summary>\n            Executes the script block.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.Language\">\n            <summary>\n            The language of the script block. Possible values are \"VB\", \"vb\", \"VISUALBASIC\", \"C#\", \"c#\", \"CSHARP\".\n            \"JS\", \"js\", \"JSCRIPT\" \"VJS\", \"vjs\", \"JSHARP\" or a fully-qualified name for a class implementing \n            <see cref=\"T:System.CodeDom.Compiler.CodeDomProvider\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.References\">\n            <summary>\n            Any required references.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.MainClass\">\n            <summary>\n            The name of the main class containing the static <c>ScriptMain</c> \n            entry point. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.Prefix\">\n            <summary>\n            The namespace prefix for any custom functions defined in the script. \n            If ommitted the prefix will default to 'script'\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.Imports\">\n            <summary>\n            The namespaces to import.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.ScriptTask.Code\">\n            <summary>\n            The code to execute.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.VbcTask\">\n            <summary>\n            Compiles Visual Basic.NET programs.\n            </summary>\n            <remarks>\n            <note>\n            In order to have <see cref=\"T:NAnt.DotNet.Tasks.VbcTask\"/> generate manifest resource names\n            that match those generated by Microsoft Visual Studio.NET, the value of\n            the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.Prefix\"/> attribute of the &lt;<see cref=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourcesList\"/>&gt;\n            element should match the \"Root namespace\" of the VB.NET project, and the \n            value of the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.DynamicPrefix\"/> attribute \n            should be set to \"<see langword=\"false\"/>\".\n            </note>\n            </remarks>\n            <example>\n              <para>Example build file using this task.</para>\n              <code>\n                <![CDATA[\n            <project name=\"Hello World\" default=\"build\" basedir=\".\">\n              <property name=\"basename\" value=\"HelloWorld\" />\n              <target name=\"clean\">\n                 <delete file=\"${basename}-vb.exe\" failonerror=\"false\" />\n                 <delete file=\"${basename}-vb.pdb\" failonerror=\"false\" />\n              </target>\n              <target name=\"build\">\n                 <vbc target=\"exe\" output=\"${basename}-vb.exe\" rootnamespace=\"${basename}\">\n                    <imports>\n                        <import namespace=\"System\" />\n                        <import namespace=\"System.Data\" />\n                    </imports>\n                    <sources>\n                       <include name=\"${basename}.vb\" />\n                    </sources>\n                    <resources prefix=\"${basename}\" dynamicprefix=\"true\">\n                        <include name=\"**/*.resx\" />\n                    </resources>\n                    <references>\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Data.dll\" />\n                    </references>\n                 </vbc>\n              </target>\n              <target name=\"rebuild\" depends=\"clean, build\" />\n            </project>\n               ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VbcTask.GetResourceLinkage(System.String,System.Globalization.CultureInfo)\">\n            <summary>\n            Finds the correct namespace/classname for a resource file from the \n            given dependent source file, and ensure the <see cref=\"P:NAnt.DotNet.Tasks.VbcTask.RootNamespace\"/>\n            is prefixed.\n            </summary>\n            <param name=\"dependentFile\">The file from which the resource linkage of the resource file should be determined.</param>\n            <param name=\"resourceCulture\">The culture of the resource file for which the resource linkage should be determined.</param>\n            <returns>\n            The namespace/classname of the source file matching the resource or\n            <see langword=\"null\"/> if the dependent source file does not exist.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VbcTask.WriteConditionalCompilationConstants(System.IO.TextWriter)\">\n            <summary>\n            Writes conditional compilation constants to the specified\n            <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the conditional compilation constants should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VbcTask.WriteOptions(System.IO.TextWriter)\">\n            <summary>\n            Writes the compiler options to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\"><see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VbcTask.NeedsCompiling\">\n            <summary>\n            Determines whether compilation is needed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.BaseAddress\">\n            <summary>\n            The preferred base address at which to load a DLL. The default base \n            address for a DLL is set by the .NET Framework common language \n            runtime.\n            </summary>\n            <value>\n            The preferred base address at which to load a DLL.\n            </value>\n            <remarks>\n            This address must be specified as a hexadecimal number.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.DebugOutput\">\n            <summary>\n            Specifies the type of debugging information generated by the \n            compiler. The default is <see cref=\"F:NAnt.DotNet.Types.DebugOutput.None\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.Debug\">\n            <summary>\n            No longer expose this to build authors. Use <see cref=\"P:NAnt.DotNet.Tasks.VbcTask.DebugOutput\"/>\n            instead.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.DocFile\">\n            <summary>\n            The name of the XML documentation file to generate. Only supported\n            when targeting .NET 2.0 (or higher).\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/doc:</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.ImportsString\">\n            <summary>\n            Specifies whether the <c>/imports</c> option gets passed to the \n            compiler.\n            </summary>\n            <value>\n            The value of this attribute is a string that contains one or more \n            namespaces separated by commas.\n            </value>\n            <remarks>\n            <a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfImportImportNamespaceFromSpecifiedAssembly.htm\">See the Microsoft.NET Framework SDK documentation for details.</a>\n            </remarks>\n            <example>Example of an imports attribute\n            <code><![CDATA[imports=\"Microsoft.VisualBasic, System, System.Collections, System.Data, System.Diagnostics\"]]></code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.Imports\">\n            <summary>\n            The namespaces to import.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.NoStdLib\">\n            <summary>\n            Instructs the compiler not to reference standard libraries\n            (system.dll and VBC.RSP). The default is <see langword=\"false\" />.\n            Only supported when targeting .NET 2.0 (or higher).\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/nostdlib</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.OptionCompare\">\n            <summary>\n            Specifies whether <c>/optioncompare</c> option gets passed to the \n            compiler.\n            </summary>\n            <value>\n            <c>text</c>, <c>binary</c>, or an empty string.  If the value is \n            <see langword=\"false\" /> or an empty string, the option will not be \n            passed to the compiler.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfOptioncompareSpecifyHowStringsAreCompared.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.OptionExplicit\">\n            <summary>\n            Specifies whether the <c>/optionexplicit</c> option gets passed to \n            the compiler. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the option should be passed to the compiler; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfOptionexplicitRequireExplicitDeclarationOfVariables.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.OptionOptimize\">\n            <summary>\n            Specifies whether the <c>/optimize</c> option gets passed to the \n            compiler. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the option should be passed to the compiler; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfoptimizeenabledisableoptimizations.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.OptionStrict\">\n            <summary>\n            Specifies whether the <c>/optionstrict</c> option gets passed to \n            the compiler. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the option should be passed to the compiler; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfOptionstrictEnforceStrictTypeSemantics.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.Platform\">\n            <summary>\n            Specifies which platform version of common language runtime (CLR)\n            can run the output file.\n            </summary>\n            <value>\n            The platform version of common language runtime (CLR) that can run\n            the output file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/platform</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.RemoveIntChecks\">\n            <summary>\n            Specifies whether the <c>/removeintchecks</c> option gets passed to \n            the compiler. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the option should be passed to the compiler; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfRemoveintchecksRemoveInteger-OverflowChecks.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.RootNamespace\">\n            <summary>\n            Specifies whether the <c>/rootnamespace</c> option gets passed to \n            the compiler.\n            </summary>\n            <value>\n            The value of this attribute is a string that contains the root \n            namespace of the project.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/vblr7net/html/valrfRootnamespace.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.SupportsDocGeneration\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports generation of XML Documentation file. The default is \n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.SupportsNoStdLib\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports NOT referencing standard libraries (system.dll and VBC.RSP).\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.SupportsPlatform\">\n            <summary>\n            Specifies whether the compiler for the active target framework\n            supports limiting the platform on which the compiled code can run.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.Extension\">\n            <summary>\n            Gets the file extension required by the current compiler.\n            </summary>\n            <value>\n            For the VB.NET compiler, the file extension is always <c>vb</c>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.ClassNameRegex\">\n            <summary>\n            Gets the class name regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Class name regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VbcTask.NamespaceRegex\">\n            <summary>\n            Gets the namespace regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Namespace regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Tasks.VjcTask\">\n            <summary>\n            Compiles Visual J# programs using vjc, Microsoft's J# compiler.\n            </summary>\n            <remarks>\n            <note>\n            In order to have <see cref=\"T:NAnt.DotNet.Tasks.VjcTask\"/> generate manifest resource names\n            that match those generated by Microsoft Visual Studio.NET, the value of\n            the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.Prefix\"/> attribute of the &lt;<see cref=\"P:NAnt.DotNet.Tasks.CompilerBase.ResourcesList\"/>&gt;\n            element should match the \"Default Package\" of the J#.NET project, and \n            the value of the <see cref=\"P:NAnt.DotNet.Types.ResourceFileSet.DynamicPrefix\"/> attribute\n            should be set to \"<see langword=\"true\"/>\".\n            </note>\n            </remarks>\n            <example>\n              <para>Compile a \"HelloWorld\" application, including embedded resources.</para>\n              <code>\n                <![CDATA[\n            <vjc target=\"exe\" output=\"helloworld.exe\" debug=\"true\">\n                <sources>\n                    <include name=\"helloworld.jsl\" />\n                </sources>\n                <resources prefix=\"HelloWorld\" dynamicprefix=\"true\">\n                    <include name=\"**/*.resx\" />\n                </resources>\n                <references>\n                    <include name=\"System.dll\" />\n                    <include name=\"System.Data.dll\" />\n                    <include name=\"System.Drawing.dll\" />\n                    <include name=\"System.Windows.Forms.dll\" />\n                    <include name=\"System.Xml.dll\" />\n                </references>\n            </vjc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VjcTask.WriteModuleReferences(System.IO.TextWriter)\">\n            <summary>\n            Writes module references to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\">The <see cref=\"T:System.IO.TextWriter\"/> to which the module references should be written.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Tasks.VjcTask.WriteOptions(System.IO.TextWriter)\">\n            <summary>\n            Writes the compiler options to the specified <see cref=\"T:System.IO.TextWriter\"/>.\n            </summary>\n            <param name=\"writer\"><see cref=\"T:System.IO.TextWriter\"/> to which the compiler options should be written.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.BaseAddress\">\n            <summary>\n            The preferred base address at which to load a DLL. The default base \n            address for a DLL is set by the .NET Framework common language \n            runtime.\n            </summary>\n            <value>\n            The preferred base address at which to load a DLL.\n            </value>\n            <remarks>\n            This address can be specified as a decimal, hexadecimal, or octal \n            number. \n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.DebugOutput\">\n            <summary>\n            Specifies the type of debugging information generated by the \n            compiler. The default is <see cref=\"F:NAnt.DotNet.Types.DebugOutput.None\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Debug\">\n            <summary>\n            No longer expose this to build authors. Use <see cref=\"P:NAnt.DotNet.Tasks.VjcTask.DebugOutput\"/>\n            instead.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.SecureScoping\">\n            <summary>\n            Specifies whether package-scoped members are accessible outside of \n            the assembly. In other words, package scope is treated as assembly \n            scope when emitting metadata. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the option should be passed to the compiler; \n            otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/securescoping</c> flag.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.VSCC/MS.VJSharp/dv_vjsharp/html/vjgrfsecurescopingmakepackage-scopedmembersinaccessibleoutsideassembly.htm\">See the Visual J# Reference for details.</a>\n            </para>\n            </remarks>\n            <example>\n            <code><![CDATA[<vjc securescoping='true'/>]]></code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.X\">\n            <summary>\n            Specifies whether to disable language extensions.\n            </summary>\n            <value>\n            The value of this property must be either <c>all</c>, <c>net</c>, \n            or an empty string.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/x</c> flag.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.VSCC/MS.VJSharp/dv_vjsharp/html/vjgrfxdisablelanguageextensions.htm\">See the Visual J# Reference for details.</a>\n            </para>\n            </remarks>\n            <example>\n            <para>To disable only the .NET Framework extensions:<c><![CDATA[\n            <vjc x='net'/>\n            ]]></c></para>\n            <para>To disable the .NET Framework extensions and the VJ++ 6.0 extensions:<c><![CDATA[\n            <vjc x='all'/>\n            ]]></c></para>\n            </example>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.LibPath\">\n            <summary>\n            Specifies the location of assemblies referenced by way of the <c>/reference</c> flag.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds to the <c>/libpath:dir[;dir2]</c> flag.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.VSCC/MS.VJSharp/dv_vjsharp/html/vjgrflibpathspecifyassemblyreferencelocations.htm\">See the Visual J# Reference for details.</a>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Jcpa\">\n            <summary>\n            Associate Java-language/COM package names.\n            </summary>\n            <value>\n            The value of this propery. must be <c>package=namespace</c>, <c>@filename</c>, \n            or an empty string.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/jcpa:package=namespace</c> and <c>/jcpa:@filename</c> flags.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.VSCC/MS.VJSharp/dv_vjsharp/html/vjgrfjcpaassociatejava-compackages.htm\">See the Visual J# Reference for details.</a>\n            </para>\n            </remarks>\n            <example>\n            <para>Map package 'x' to namespace 'y':<c><![CDATA[\n            <vjc jcpa='x=y'/>\n            ]]></c></para>\n            </example>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Codepage\">\n            <summary>\n            Specifies the code page to use for all source code files in the \n            compilation.\n            </summary>\n            <remarks>\n            <para>\n            Corresponds with the <c>/codepage</c> flag.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.VSCC/MS.VJSharp/dv_vjsharp/html/vjlrfcodepagespecifycodepageforsourcecodefiles.htm\">See the Visual J# Reference for details.</a>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.WarningLevel\">\n            <summary>\n            Specifies the warning level for the compiler to display. Valid values \n            are <c>0</c>-<c>4</c>. The default is <c>4</c>.\n            </summary>\n            <value>\n            The warning level for the compiler to display.\n            </value>\n            <remarks>\n            <para>\n            Corresponds with the <c>/warn</c> option.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.WarningAsError\">\n            <summary>\n            Controls which warnings should be reported as errors.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the Visual J#\n            compiler does not allow control over which warnings should be\n            reported as errors.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Packages\">\n            <summary>\n            Reference packages \n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the Visual J#\n            compiler does not support package references.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Modules\">\n            <summary>\n            Link the specified modules into this assembly.\n            </summary>\n            <remarks>\n            Override to avoid exposing this to build authors, as the Visual J#\n            compiler does not support linking modules.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.Extension\">\n            <summary>\n            Gets the file extension required by the current compiler.\n            </summary>\n            <value>\n            For the J# compiler, the file extension is always <c>jsl</c>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.ClassNameRegex\">\n            <summary>\n            Gets the class name regular expression for the language of the \n            current compiler.\n            </summary>\n            <value>\n            Class name regular expression for the language of the current \n            compiler.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.NamespaceRegex\">\n             <summary>\n             Gets the namespace regular expression for the language of the \n             current compiler.\n            </summary>\n             <value>\n             Namespace regular expression for the language of the current \n             compiler.\n             </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Tasks.VjcTask.SupportsPackageReferences\">\n            <summary>\n            Override to avoid exposing the configuration setting for this\n            task as Visual J# will never support package references.\n            </summary>\n            <value>\n            <see langword=\"false\" />, as the Visual J# compiler will never\n            support package references.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.AssemblyAttribute\">\n            <summary>\n            Represents an assembly-level attribute.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttribute.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttribute.TypeName\">\n            <summary>\n            Typename of the assembly-level attribute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttribute.Value\">\n            <summary>\n            Value of the attribute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttribute.AsIs\">\n            <summary>\n            If <see langword=\"true\" /> then the value of the attribute will be \n            set as is, without actually looking for a matching constructor or \n            named properties. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the value of the attribute should be set \n            as is; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttribute.IfDefined\">\n            <summary>\n            Indicates if the attribute should be generated. \n            </summary>\n            <value>\n            <see langword=\"true\" /> if the attribute should be generated; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttribute.UnlessDefined\">\n            <summary>\n            Indicates if the attribute should be not generated. \n            </summary>\n            <value>\n            <see langword=\"true\" /> if the attribute should be not generated; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> \n            objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.#ctor(NAnt.DotNet.Types.AssemblyAttributeCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.#ctor(NAnt.DotNet.Types.AssemblyAttribute[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.Add(NAnt.DotNet.Types.AssemblyAttribute)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.AddRange(NAnt.DotNet.Types.AssemblyAttribute[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.AddRange(NAnt.DotNet.Types.AssemblyAttributeCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.Contains(NAnt.DotNet.Types.AssemblyAttribute)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> with \n            value <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.CopyTo(NAnt.DotNet.Types.AssemblyAttribute[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.IndexOf(NAnt.DotNet.Types.AssemblyAttribute)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/>. If the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.Insert(System.Int32,NAnt.DotNet.Types.AssemblyAttribute)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeCollection.Remove(NAnt.DotNet.Types.AssemblyAttribute)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttributeCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttributeCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> with the specified value.\n            </summary>\n            <param name=\"value\">The value of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.AssemblyAttributeEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttribute\"/> elements of a <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeEnumerator.#ctor(NAnt.DotNet.Types.AssemblyAttributeCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.AssemblyAttributeCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyAttributeEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyAttributeEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.LibDirectorySet\">\n            <summary>\n            A specialized <see cref=\"T:NAnt.Core.Types.FileSet\"/> used for setting the lib directories.\n            </summary>\n            <remarks>\n            The primary reason for this class is to allow the <see cref=\"P:NAnt.DotNet.Types.LibDirectorySet.BaseDirectory\"/>\n            to always be the same value as the parent <see cref=\"T:NAnt.DotNet.Types.AssemblyFileSet\"/>\n            </remarks>\n            <seealso cref=\"T:NAnt.Core.Types.FileSet\"/>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.LibDirectorySet.#ctor(NAnt.DotNet.Types.AssemblyFileSet)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.LibDirectorySet\"/> class.\n            </summary>\n            <param name=\"parent\"></param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.LibDirectorySet.BaseDirectory\">\n            <summary>\n            override this. We will always use the base directory of the parent.\n            overriding without the TaskAttribute attribute prevents it being set \n            in the source xml\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.AssemblyFileSet\">\n            <summary>\n            Specialized <see cref=\"T:NAnt.Core.Types.FileSet\"/> class for managing assembly files.\n            </summary>\n            <remarks>\n              <para>\n              If an include pattern does not contain any wildcard characters then \n              the assembly will be searched for in following locations (in the order listed):\n              </para>\n              <list type=\"bullet\">\n                <item>\n                  <description>\n                  The base directory of the fileset.\n                  </description>\n                </item>\n                <item>\n                  <description>\n                  The directories specified using the nested &lt;lib&gt; element.\n                  </description>\n                </item>\n                <item>\n                  <description>\n                  The list of reference assemblies of the current target framework.\n                  </description>\n                </item>\n              </list>\n              <para>\n              The reference assemblies of a given target framework are defined using\n              &lt;reference-assemblies&gt; filesets in the &lt;framework&gt; node\n              of the NAnt configuration file.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Define a reference with name \"sys.assemblies\", holding\n              a set of system assemblies.\n              </para>\n              <code>\n                <![CDATA[\n            <assemblyfileset id=\"sys.assemblies\">\n                <include name=\"System.dll\" />\n                <include name=\"System.Data.dll\" />\n                <include name=\"System.Xml.dll\" />\n            </assemblyfileset>\n                ]]>\n              </code>\n              <para>\n              Use the predefined set of assemblies to compile a C# assembly.\n              </para>\n              <code>\n                <![CDATA[\n            <csc target=\"exe\" output=\"HelloWorld.exe\">\n                <sources>\n                    <include name=\"**/*.cs\" />\n                </sources>\n                <references refid=\"sys.assemblies\" />\n            </csc>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compile a C# assembly using assembly references that are searched for\n              in the \"Third Party Assemblies\" and \"Company Assemblies\"\n              directories.\n              </para>\n              <code>\n                <![CDATA[\n            <csc target=\"exe\" output=\"HelloWorld.exe\">\n                <sources>\n                    <include name=\"**/*.cs\" />\n                </sources>\n                <references>\n                    <lib>\n                        <include name=\"Third Party Assemblies\" />\n                        <include name=\"Company Assemblies\" />\n                    </lib>\n                    <include name=\"log4net.dll\" />\n                    <include name=\"Company.Business.dll\" />\n                </references>\n            </csc>\n                ]]>\n              </code>\n            </example>\n            <seealso cref=\"T:NAnt.Core.Types.FileSet\"/>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyFileSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.AssemblyFileSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyFileSet.#ctor(NAnt.Core.Types.FileSet)\">\n            <summary>\n            copy constructor for FileSet. Required in order to \n            assign references of FileSet type where \n            AssemblyFileSets are used\n            </summary>\n            <param name=\"fs\"></param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyFileSet.Scan\">\n            <summary>\n            Do a normal scan and then resolve assemblies.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.AssemblyFileSet.ResolveReferences\">\n            <summary>\n            Resolves references to system assemblies and assemblies that can be \n            resolved using directories specified in <see cref=\"P:NAnt.DotNet.Types.AssemblyFileSet.Lib\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.AssemblyFileSet.Lib\">\n            <summary>\n            Additional directories to search in for assembly references.\n            </summary>\n            <remarks>\n            <para>\n            loosely Corresponds with the <c>/lib[path]:</c> flag of the various compiler tasks.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.CompilerWarning\">\n            <summary>\n            Represents a compiler warning.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.CompilerWarning.Number\">\n            <summary>\n            A warning number, or comma-separated list of warnings, that you want \n            the compiler to suppress or report.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.CompilerWarning.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be processed;\n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.CompilerWarning.UnlessDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be skipped;\n            otherwise, processed. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.CompilerWarningCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.#ctor(NAnt.DotNet.Types.CompilerWarningCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.#ctor(NAnt.DotNet.Types.CompilerWarning[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.Add(NAnt.DotNet.Types.CompilerWarning)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.AddRange(NAnt.DotNet.Types.CompilerWarning[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.AddRange(NAnt.DotNet.Types.CompilerWarningCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.Contains(NAnt.DotNet.Types.CompilerWarning)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.CopyTo(NAnt.DotNet.Types.CompilerWarning[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.IndexOf(NAnt.DotNet.Types.CompilerWarning)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/>. If the <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.Insert(System.Int32,NAnt.DotNet.Types.CompilerWarning)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.CompilerWarningEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningCollection.Remove(NAnt.DotNet.Types.CompilerWarning)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.CompilerWarningCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.CompilerWarningEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.CompilerWarning\"/> elements of a <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningEnumerator.#ctor(NAnt.DotNet.Types.CompilerWarningCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.CompilerWarningEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.CompilerWarningCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.CompilerWarningEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.CompilerWarningEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.DebugOutput\">\n            <summary>\n            Specifies the type of debugging information generated by the compiler.\n            </summary>\n            <remarks>\n              <para>\n              For backward compatibility, the following string values can also be\n              used in build files:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Value</term>\n                  <description>Corresponding field</description>\n                </listheader>\n                <item>\n                  <term>\"true\"</term>\n                  <description><see cref=\"F:NAnt.DotNet.Types.DebugOutput.Enable\"/></description>\n                </item>\n                <item>\n                  <term>\"false\"</term>\n                  <description><see cref=\"F:NAnt.DotNet.Types.DebugOutput.None\"/></description>\n                </item>\n              </list>\n              <para>\n              When set to <see langword=\"Enabled\"/> then the following conditional \n              compilation symbols will also be defined:\n              </para>\n              <list type=\"bullet\">\n                <item>\n                  <description>DEBUG</description>\n                </item>\n                <item>\n                  <description>TRACE</description>\n                </item>\n              </list>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DebugOutput.None\">\n            <summary>\n            Create no debug information.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DebugOutput.Enable\">\n            <summary>\n            Enable attaching a debugger to the running program.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DebugOutput.Full\">\n            <summary>\n            Enable attaching a debugger to the running program.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DebugOutput.PdbOnly\">\n            <summary>\n            Only display assembler when the running program is attached to the \n            debugger.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.DebugOutputConverter\">\n            <summary>\n            Specialized <see cref=\"T:System.ComponentModel.EnumConverter\"/> that also supports \n            case-insensitive conversion of \"true\" to \n            <see cref=\"F:NAnt.DotNet.Types.DebugOutput.Enable\"/> and \"false\" to\n            <see cref=\"F:NAnt.DotNet.Types.DebugOutput.None\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DebugOutputConverter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.DebugOutputConverter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DebugOutputConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)\">\n            <summary>\n            Converts the given object to the type of this converter, using the \n            specified context and culture information.\n            </summary>\n            <param name=\"context\">An <see cref=\"T:System.ComponentModel.ITypeDescriptorContext\"/> that provides a format context.</param>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/> object. If a <see langword=\"null\"/> is passed, the current culture is assumed.</param>\n            <param name=\"value\">The <see cref=\"T:System.Object\"/> to convert.</param>\n            <returns>\n            An <see cref=\"T:System.Object\"/> that represents the converted value.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.DelaySign\">\n            <summary>\n            Specifies whether the generated assembly is strongly named and will\n            be signed later.\n            </summary>\n            <remarks>\n              <para>\n              For backward compatibility, the following string values can also be\n              used in build files:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Value</term>\n                  <description>Corresponding field</description>\n                </listheader>\n                <item>\n                  <term>\"true\"</term>\n                  <description><see cref=\"F:NAnt.DotNet.Types.DelaySign.Yes\"/></description>\n                </item>\n                <item>\n                  <term>\"false\"</term>\n                  <description><see cref=\"F:NAnt.DotNet.Types.DelaySign.No\"/></description>\n                </item>\n              </list>\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DelaySign.NotSet\">\n            <summary>\n            Not specified.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DelaySign.No\">\n            <summary>\n            Fully sign the assembly.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.DotNet.Types.DelaySign.Yes\">\n            <summary>\n            Only place the public key in the assembly, allowing the signature\n            to be added later.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.DelaySignConverter\">\n            <summary>\n            Specialized <see cref=\"T:System.ComponentModel.EnumConverter\"/> that also supports \n            case-insensitive conversion of \"true\" to \n            <see cref=\"F:NAnt.DotNet.Types.DelaySign.Yes\"/> and \"false\" to\n            <see cref=\"F:NAnt.DotNet.Types.DelaySign.No\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DelaySignConverter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.DelaySignConverter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DelaySignConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)\">\n            <summary>\n            Converts the given object to the type of this converter, using the \n            specified context and culture information.\n            </summary>\n            <param name=\"context\">An <see cref=\"T:System.ComponentModel.ITypeDescriptorContext\"/> that provides a format context.</param>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/> object. If a <see langword=\"null\"/> is passed, the current culture is assumed.</param>\n            <param name=\"value\">The <see cref=\"T:System.Object\"/> to convert.</param>\n            <returns>\n            An <see cref=\"T:System.Object\"/> that represents the converted value.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.EmbeddedResource\">\n            <summary>\n            Represents an embedded resource.\n            </summary>\n            <remarks>\n            Do not yet expose this to build authors.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResource.#ctor(System.String,System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/>\n            with the specified file name and manifest resource name.\n            </summary>\n            <param name=\"file\">The path of the compiled resource.</param>\n            <param name=\"manifestResourceName\">The manifest resource name of the embedded resource.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResource.File\">\n            <summary>\n            Gets the physical location of the resource to embed.\n            </summary>\n            <value>\n            The physical location of the resource to embed.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResource.ManifestResourceName\">\n            <summary>\n            Gets the manifest resource name to use when embedding the resource.\n            </summary>\n            <value>\n            The manifest resource name to use when embedding the resource.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.EmbeddedResourceCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> items.\n            </summary>\n            <remarks>\n            Do not yet expose this to build authors.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.DataTypeCollectionBase\">\n            <summary>\n            Base class for collections that needs to be globally referencable.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.DataTypeCollectionBase\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.CopyTo(System.Array,System.Int32)\">\n            <summary>\n            Copies the items of the collection to an <see cref=\"T:System.Array\"/>,\n            starting at a particular index.\n            </summary>\n            <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the items copied from the collection. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param>\n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.System#Collections#IEnumerable#GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through a collection.\n            </summary>\n            <returns>\n            An <see cref=\"T:System.Collections.IEnumerator\"/> that can be used to iterate through \n            the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.RemoveAt(System.Int32)\">\n            <summary>\n            Removes an item at a specific index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to remove.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.Clear\">\n            <summary>\n            Removes all items from the collection.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.ValidateType(System.Object)\">\n            <summary>\n            Used by methods that take <see cref=\"T:System.Object\"/> instances as argument\n            to verify whether the instance is valid for the collection class.\n            </summary>\n            <param name=\"value\">The instance to verify.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.DataTypeCollectionBase.RangeCheck(System.Int32)\">\n            <summary>\n            Checks whether the specified index is within the range of this\n            collection.\n            </summary>\n            <param name=\"index\">The index to check.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.System#Collections#ICollection#IsSynchronized\">\n            <summary>\n            Gets a value indicating whether access to the collection is \n            synchronized (thread-safe).\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.Count\">\n            <summary>\n            Gets the number of items in the collection.\n            </summary>\n            <value>\n            The number of items in the collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.System#Collections#ICollection#SyncRoot\">\n            <summary>\n            Gets an object that can be used to synchronize access to the \n            collection.\n            </summary>\n            <value>\n            An object that can be used to synchronize access to the collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.IsFixedSize\">\n            <summary>\n            Gets a value indicating whether the collection has a fixed size.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.IsReadOnly\">\n            <summary>\n            Gets a value indicating whether the collection has a fixed size.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.List\">\n            <summary>\n            Gets the list of elements contained in the \n            <see cref=\"T:NAnt.DotNet.Types.DataTypeCollectionBase\"/> instance.\n            </summary>\n            <value>\n            An <see cref=\"T:System.Collections.ArrayList\"/> containing the elements of the \n            collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.DataTypeCollectionBase.ItemType\">\n            <summary>\n            Gets the <see cref=\"T:System.Type\"/> of the items in this collection.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Type\"/> of the items in this collection.\n            </value>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#Insert(System.Int32,System.Object)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#Remove(System.Object)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#Contains(System.Object)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#IndexOf(System.Object)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#Add(System.Object)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.AddRange(NAnt.DotNet.Types.EmbeddedResourceCollection)\">\n            <summary>\n            Adds the items of a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.Add(NAnt.DotNet.Types.EmbeddedResource)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.Insert(System.Int32,NAnt.DotNet.Types.EmbeddedResource)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.Remove(NAnt.DotNet.Types.EmbeddedResource)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.Contains(NAnt.DotNet.Types.EmbeddedResource)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceCollection.IndexOf(NAnt.DotNet.Types.EmbeddedResource)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> with the specified manifest\n            resource name.\n            </summary>\n            <param name=\"value\">The manifest resource name of the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> to get.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceCollection.ItemType\">\n            <summary>\n            Gets the <see cref=\"T:System.Type\"/> of the items in this collection.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Type\"/> of the items in this collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceCollection.System#Collections#IList#$Item$(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.EmbeddedResourceEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResource\"/> items of a <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceEnumerator.#ctor(NAnt.DotNet.Types.EmbeddedResourceCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.EmbeddedResourceCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next item of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next item; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.EmbeddedResourceEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first item in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceEnumerator.Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.EmbeddedResourceEnumerator.System#Collections#IEnumerator#Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.Module\">\n            <summary>\n            Represents a metadata file without assembly manifest.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.Module.ToString\">\n            <summary>\n            Returns a textual representation of the module, which can be used as\n            argument for command-line tools.\n            </summary>\n            <returns>\n            A textual representation of the path, file[,target].\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Module.File\">\n            <summary>\n            The path of the module.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Module.Target\">\n            <summary>\n            File name where the module should be copied to before it is compiled\n            into an assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Module.ModuleSet\">\n            <summary>\n            Gets or sets the <see cref=\"P:NAnt.DotNet.Types.Module.ModuleSet\"/> that contains the module.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ModuleCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.DotNet.Types.Module\"/> items.\n            </summary>\n            <remarks>\n            Do not yet expose this to build authors.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.#ctor(NAnt.DotNet.Types.ModuleSet)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>\n            for the specified <see cref=\"T:NAnt.DotNet.Types.ModuleSet\"/>.\n            </summary>\n            <param name=\"moduleSet\">The <see cref=\"T:NAnt.DotNet.Types.ModuleSet\"/> containing the collection.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"moduleSet\"/> is <see langword=\"true\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IEnumerable#GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.ModuleEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.CopyTo(System.Array,System.Int32)\">\n            <summary>\n            Copies the items of the collection to an <see cref=\"T:System.Array\"/>,\n            starting at a particular index.\n            </summary>\n            <param name=\"array\">The one-dimensional <see cref=\"T:System.Array\"/> that is the destination of the items copied from the collection. The <see cref=\"T:System.Array\"/> must have zero-based indexing.</param>\n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.Clear\">\n            <summary>\n            Removes all items from the collection.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#Insert(System.Int32,System.Object)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.Module\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#Remove(System.Object)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.Module\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.RemoveAt(System.Int32)\">\n            <summary>\n            Removes an item at a specific index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to remove.</param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">The <paramref name=\"index\"/> parameter is less than 0 or greater than or equal to the value of the <see cref=\"P:NAnt.DotNet.Types.ModuleCollection.Count\"/> property of the <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>.</exception>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#Contains(System.Object)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.Module\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#IndexOf(System.Object)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.Module\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.Module\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.Module\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#Add(System.Object)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.Module\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.AddRange(NAnt.DotNet.Types.ModuleCollection)\">\n            <summary>\n            Adds the items of a <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.Add(NAnt.DotNet.Types.Module)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.Module\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.ModuleEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.Insert(System.Int32,NAnt.DotNet.Types.Module)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.Module\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.Remove(NAnt.DotNet.Types.Module)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.Module\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.Contains(NAnt.DotNet.Types.Module)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.Module\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleCollection.IndexOf(NAnt.DotNet.Types.Module)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.Module\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.Module\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.Module\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.Module\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">The <paramref name=\"index\"/> parameter is less than 0 or greater than or equal to the value of the <see cref=\"P:NAnt.DotNet.Types.ModuleCollection.Count\"/> property of the <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.List\">\n            <summary>\n            Gets the list of elements contained in the \n            <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/> instance.\n            </summary>\n            <value>\n            An <see cref=\"T:System.Collections.ArrayList\"/> containing the elements of the \n            collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.System#Collections#ICollection#IsSynchronized\">\n            <summary>\n            Gets a value indicating whether access to the collection is \n            synchronized (thread-safe).\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.Count\">\n            <summary>\n            Gets the number of items in the collection.\n            </summary>\n            <value>\n            The number of items in the collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.System#Collections#ICollection#SyncRoot\">\n            <summary>\n            Gets an object that can be used to synchronize access to the \n            collection.\n            </summary>\n            <value>\n            An object that can be used to synchronize access to the collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.IsFixedSize\">\n            <summary>\n            Gets a value indicating whether the collection has a fixed size.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.IsReadOnly\">\n            <summary>\n            Gets a value indicating whether the collection has a fixed size.\n            </summary>\n            <value>\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleCollection.System#Collections#IList#$Item$(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n            <exception cref=\"T:System.ArgumentOutOfRangeException\">The <paramref name=\"index\"/> parameter is less than 0 or greater than or equal to the value of the <see cref=\"P:NAnt.DotNet.Types.ModuleCollection.Count\"/> property of the <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>.</exception>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ModuleEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.Module\"/> items of a <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleEnumerator.#ctor(NAnt.DotNet.Types.ModuleCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ModuleEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.ModuleCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next item of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next item; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first item in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleEnumerator.Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleEnumerator.System#Collections#IEnumerator#Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ModuleSet\">\n            <summary>\n            <para>\n            One or more modules to compile into an assembly.\n            </para>\n            </summary>\n            <example>\n              <para>\n              Define a global <c>&lt;moduleset&gt;</c> that can be referenced by\n              other tasks or types.\n              </para>\n              <code>\n                <![CDATA[\n                    <moduleset id=\"client-modules\" dir=\"${build}\">\n                        <module file=\"Client.netmodule\" />\n                        <module file=\"Common.netmodule\" />\n                    </moduleset>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ModuleSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ModuleSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleSet.Dir\">\n            <summary>\n            The base of the directory of this <see cref=\"T:NAnt.DotNet.Types.ModuleSet\"/>. \n            The default is the project base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ModuleSet.Modules\">\n            <summary>\n            The modules to add to this <see cref=\"T:NAnt.DotNet.Types.ModuleSet\"/>.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.NamespaceImport\">\n            <summary>\n            Represents a namespace to import.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImport.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImport.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> \n            class for the specified namespace.\n            </summary>\n            <param name=\"nameSpace\">The namespace.</param>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"nameSpace\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImport.TempName\">\n            <summary>\n            The name of the namespace to import.\n            </summary>\n            <value>\n            The name of the namespace to import.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImport.Namespace\">\n            <summary>\n            The name of the namespace to import.\n            </summary>\n            <value>\n            The name of the namespace to import.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImport.IfDefined\">\n            <summary>\n            Indicates if the import should be generated. \n            </summary>\n            <value>\n            <see langword=\"true\" /> if the import should be generated; otherwise,\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImport.UnlessDefined\">\n            <summary>\n            Indicates if the import should be not generated. \n            </summary>\n            <value>\n            <see langword=\"true\" /> if the import should be not generated; \n            otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.NamespaceImportCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> items.\n            </summary>\n            <example>\n              <para>Define a reference with name \"system.imports\".</para>\n              <code>\n                <![CDATA[\n            <namespaceimports id=\"system.imports\">\n                <import namespace=\"System\" />\n                <import namespace=\"System.Data\" />\n            </namespaceimports>\n                ]]>\n              </code>\n              <para>Use the predefined set of imports to compile a VB.NET assembly.</para>\n              <code>\n                <![CDATA[\n            <vbc target=\"exe\" output=\"HelloWorld.exe\" rootnamespace=\"HelloWorld\">\n                <imports refid=\"system.imports\" />\n                <sources>\n                    <include name=\"**/*.vb\" />\n                </sources>\n                <references>\n                    <include name=\"System.dll\" />\n                    <include name=\"System.Data.dll\" />\n                </references>\n            </vbc>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.NamespaceImportEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.ToString\">\n            <summary>\n            Returns a comma-delimited list of namespace imports.\n            </summary>\n            <returns>\n            A comma-delimited list of namespace imports, or an empty \n            <see cref=\"T:System.String\"/> if there are no namespace imports.\n            </returns>\n            <remarks>\n            Each namespace import is quoted individually.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#Insert(System.Int32,System.Object)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#Remove(System.Object)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#Contains(System.Object)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#IndexOf(System.Object)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#Add(System.Object)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.AddRange(NAnt.DotNet.Types.NamespaceImportCollection)\">\n            <summary>\n            Adds the items of a <see cref=\"T:NAnt.DotNet.Types.NamespaceImportCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImportCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.Add(NAnt.DotNet.Types.NamespaceImport)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to the end of the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new item was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.Insert(System.Int32,NAnt.DotNet.Types.NamespaceImport)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> into the collection at the\n            specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.Remove(NAnt.DotNet.Types.NamespaceImport)\">\n            <summary>\n            Removes the specified <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> from the\n            collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.Contains(NAnt.DotNet.Types.NamespaceImport)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> is in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"value\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportCollection.IndexOf(NAnt.DotNet.Types.NamespaceImport)\">\n            <summary>\n            Gets the location of a <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> in the collection.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> object to locate.</param> \n            <returns>\n            The zero-based location of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> in the\n            collection.\n            </returns>\n            <remarks>\n            If the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> is not currently a member of \n            the collection, -1 is returned.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> with the specified namespace.\n            </summary>\n            <param name=\"value\">The namespace of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> to get.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportCollection.ItemType\">\n            <summary>\n            Gets the <see cref=\"T:System.Type\"/> of the items in this collection.\n            </summary>\n            <value>\n            The <see cref=\"T:System.Type\"/> of the items in this collection.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportCollection.System#Collections#IList#$Item$(System.Int32)\">\n            <summary>\n            Gets or sets the item at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the item to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.NamespaceImportEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.NamespaceImport\"/> items of a <see cref=\"T:NAnt.DotNet.Types.NamespaceImportCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportEnumerator.#ctor(NAnt.DotNet.Types.NamespaceImportCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.NamespaceImportEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.NamespaceImportCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next item of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next item; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.NamespaceImportEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first item in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportEnumerator.Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.NamespaceImportEnumerator.System#Collections#IEnumerator#Current\">\n            <summary>\n            Gets the current item in the collection.\n            </summary>\n            <returns>\n            The current item in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.Package\">\n            <summary>\n            Represents a package.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Package.PackageName\">\n            <summary>\n            Name of the package to reference. Multiple package can be specified\n            with a single element as a semi-colon separated list of \n            package names.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Package.IfDefined\">\n            <summary>\n            Indicates if the package should be passed to the task. \n            If <see langword=\"true\" /> then the package will be passed; \n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.Package.UnlessDefined\">\n            <summary>\n            Indicates if the package should not be passed to the task.\n            If <see langword=\"false\" /> then the package will be passed; \n            otherwise, skipped. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.PackageCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.DotNet.Types.Package\"/> \n            objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.#ctor(NAnt.DotNet.Types.PackageCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.#ctor(NAnt.DotNet.Types.Package[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.DotNet.Types.Package\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.Add(NAnt.DotNet.Types.Package)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.Package\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.Package\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.AddRange(NAnt.DotNet.Types.Package[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.Package\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.DotNet.Types.Package\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.AddRange(NAnt.DotNet.Types.PackageCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.Contains(NAnt.DotNet.Types.Package)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.Package\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.Package\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.CopyTo(NAnt.DotNet.Types.Package[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.IndexOf(NAnt.DotNet.Types.Package)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.DotNet.Types.Package\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.Package\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.DotNet.Types.Package\"/>. If the <see cref=\"T:NAnt.DotNet.Types.Package\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.Insert(System.Int32,NAnt.DotNet.Types.Package)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.Package\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.Package\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.PackageEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageCollection.Remove(NAnt.DotNet.Types.Package)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.Package\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.PackageCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.PackageEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.Package\"/> elements of a <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageEnumerator.#ctor(NAnt.DotNet.Types.PackageCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.PackageEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.PackageCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.PackageEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.PackageEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ResourceFileSet\">\n            <summary>\n            Specialized <see cref=\"T:NAnt.Core.Types.FileSet\"/> class for managing resource files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSet.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSet.#ctor(NAnt.Core.Types.FileSet)\">\n            <summary>\n            copy constructor for FileSet. Required in order to \n            assign references of FileSet type where \n            ResourceFileSet are used\n            </summary>\n            <param name=\"fs\"></param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSet.Clone\">\n            <summary>\n            Creates a shallow copy of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/>.\n            </summary>\n            <returns>\n            A shallow copy of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSet.GetManifestResourceName(System.String)\">\n            <summary>\n            Gets the manifest resource name for the specified resource file.\n            </summary>\n            <param name=\"resourceFile\">The physical path of the resource file.</param>\n            <returns>\n            The manifest resource name to be sent to the compiler.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSet.GetManifestResourceName(System.String,System.String)\">\n            <summary>\n            Gets the manifest resource name for the file using both its physical\n            and logical path.\n            </summary>\n            <param name=\"physicalPath\">The physical path of the resource file.</param>\n            <param name=\"logicalPath\">The logical location of the resource file.</param>\n            <returns>\n            The manifest resource name to be sent to the compiler.\n            </returns>\n            <remarks>\n            We use the relative path of the logical path, but the filename and\n            and the extension of the physical path to match VS.NET\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSet.Prefix\">\n            <summary>\n            Indicates the prefix to prepend to the actual resource. \n            This is usually the default namspace of the assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSet.DynamicPrefix\">\n            <summary>\n            Indicates whether prefixes should be dynamically generated by taking \n            the path of the resource relative to the basedir and appending it \n            to the specified prefix. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSet.ResxFiles\">\n            <summary>\n            Gets a <see cref=\"T:NAnt.Core.Types.FileSet\"/> containing all matching resx files.\n            </summary>\n            <value>\n            A <see cref=\"T:NAnt.Core.Types.FileSet\"/> containing all matching resx files.\n            </value>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSet.NonResxFiles\">\n            <summary>\n            Gets a <see cref=\"T:NAnt.Core.Types.FileSet\"/> containing all matching non-resx \n            files.\n            </summary>\n            <value>\n            A <see cref=\"T:NAnt.Core.Types.FileSet\"/> containing all matching non-resx files.\n            </value>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.#ctor(NAnt.DotNet.Types.ResourceFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.#ctor(NAnt.DotNet.Types.ResourceFileSet[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.Add(NAnt.DotNet.Types.ResourceFileSet)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.AddRange(NAnt.DotNet.Types.ResourceFileSet[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.AddRange(NAnt.DotNet.Types.ResourceFileSetCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.Contains(NAnt.DotNet.Types.ResourceFileSet)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.CopyTo(NAnt.DotNet.Types.ResourceFileSet[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.IndexOf(NAnt.DotNet.Types.ResourceFileSet)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/>. If the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.Insert(System.Int32,NAnt.DotNet.Types.ResourceFileSet)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetCollection.Remove(NAnt.DotNet.Types.ResourceFileSet)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSetCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.ResourceFileSetEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSet\"/> elements of a <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetEnumerator.#ctor(NAnt.DotNet.Types.ResourceFileSetCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.DotNet.Types.ResourceFileSetCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.DotNet.Types.ResourceFileSetEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.ResourceFileSetEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.DotNet.Types.WarningAsError\">\n            <summary>\n            Controls the behaviour of a compiler with regards to the reporting of\n            warnings.\n            </summary>\n            <example>\n              <para>\n              Instruct a compiler to report warning 0519 as an error.\n              </para>\n              <code>\n                <![CDATA[\n            <warnaserror>\n                <include number=\"0519\" />\n            </warnaserror>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Instruct a compiler not to report warning 0519 as an error, if the\n              <c>release</c> property is <see langword=\"true\" />.\n              </para>\n              <code>\n                <![CDATA[\n            <warnaserror>\n                <exclude number=\"0519\" if=\"${release}\" />\n            </warnaserror>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.WarningAsError.Includes\">\n            <summary>\n            Specifies a list of warnings that the compiler should treat as \n            errors. This overrides the <see cref=\"P:NAnt.DotNet.Tasks.CompilerBase.WarnAsError\"/> \n            attribute. Only supported when targeting .NET 2.0 or higher.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.DotNet.Types.WarningAsError.Excludes\">\n            <summary>\n            Specifies a list of warnings that the compiler should NOT treat as \n            errors. This is only useful if <see cref=\"P:NAnt.DotNet.Tasks.CompilerBase.WarnAsError\"/> \n            is <see langword=\"true\"/>. Only supported when targeting .NET 2.0\n            or higher.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.MSNetTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.MSNetTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.MSNet.Tasks.IldasmTask\">\n            <summary>\n            Disassembles any portable executable (PE) file that contains\n            intermediate language (IL) code.\n            </summary>\n            <remarks>\n              <para>\n              Files are only disassembled if the input file is newer than the output\n              file, or if the output file does not exist.  However, you can \n              explicitly force files to be disassembled with the \n              <see cref=\"P:NAnt.MSNet.Tasks.IldasmTask.ForceRebuild\"/> attribute.\n              </para>\n              <para>\n              A <see cref=\"T:NAnt.Core.Types.FileSet\"/> can be used to select files to disassemble. \n              To use a <see cref=\"T:NAnt.Core.Types.FileSet\"/>, the <see cref=\"P:NAnt.MSNet.Tasks.IldasmTask.ToDirectory\"/> \n              attribute must be set. The file name of the output file will be equal \n              to the file name of the input file, but with extension \".il\".\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Disassembles <c>helloworld.exe</c> to <c>helloworld.il</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <ildasm input=\"helloworld.exe\" output=\"helloworld.il\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Disassembles a set of PE files into the specified directory.\n              </para>\n              <code>\n                <![CDATA[\n            <ildasm todir=\".\">\n                <assemblies>\n                    <include name=\"*.exe\" />\n                    <include name=\"*.dll\" />\n                </assemblies>\n            </ildasm>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.Initialize\">\n            <summary>\n            Checks whether the task is initialized with valid attributes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.ExecuteTask\">\n            <summary>\n            Disassembles the PE file(s).\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.DisassemblyFile(System.IO.FileInfo)\">\n            <summary>\n            Disassembles the specified PE file.\n            </summary>\n            <param name=\"inputFile\">The PE file to disassemble.</param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.GetOutputFile(System.IO.FileInfo)\">\n            <summary>\n            Determines the full path and extension for the output file.\n            </summary>\n            <param name=\"inputFile\">\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the PE file\n            file for which the corresponding output file should be determined.\n            </param>\n            <returns>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the full path\n            for the output file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">The path of the output file could not be determined.</exception>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.WriteOptions(System.IO.FileInfo,System.IO.FileInfo)\">\n            <summary>\n            Writes the disassembler options.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.WriteOption(System.IO.StringWriter,System.String)\">\n             <summary>\n             Writes an option using the default output format.\n             </summary>\n             <param name=\"writer\">\n             The <see cref=\"T:System.IO.StringWriter\"/> to which the disassembler options\n             should be written.\n            </param>\n             <param name=\"name\">\n             A <see cref=\"T:System.String\"/> that contains the name of the\n             option which should be passed to the disassembler.\n             </param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.WriteOption(System.IO.StringWriter,System.String,System.String)\">\n            <summary>\n            Writes an option and its value using the default output format.\n            </summary>\n            <param name=\"writer\">\n            The <see cref=\"T:System.IO.StringWriter\"/> to which the disassembler options\n            should be written.\n            </param>\n            <param name=\"name\">\n            A <see cref=\"T:System.String\"/> that contains the name of the\n            option which should be passed to the disassembler.\n            </param>\n            <param name=\"arg\">\n            A <see cref=\"T:System.String\"/> that contains the value of the\n            option which should be passed to the disassembler.\n            </param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.IldasmTask.NeedsDisassembling(System.IO.FileInfo,System.IO.FileInfo)\">\n            <summary>\n            Determines whether or not disassembling is needed.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if disassembling is needed; otherwise,\n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.All\">\n            <summary>\n            Specifies whether or not the disassembler should combine the\n            <c>/HEADER</c>, <c>/BYTE</c>, and <c>/TOKENS</c> options. The default \n            is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the disassembler should combine the\n            <c>/HEADER</c>, <c>/BYTE</c>, and <c>/TOKENS</c> options;\n            otherwise, <see langword=\"false\" />. The default is\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/ALL</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Bytes\">\n            <summary>\n            Specifies whether or not the disassembler should generate the\n            IL stream bytes (in hexadecimal notation) as instruction comments.\n            The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the IL stream bytes should be generated\n            as instruction comments; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/BYTE</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.ForceRebuild\">\n            <summary>\n            Instructs NAnt to rebuild the output file regardless of the file\n            timestamps. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output file should be rebuilt\n            regardless of its timestamps; otherwise <see langword=\"false\" />.\n            The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Header\">\n            <summary>\n            Specifies whether or not the disassembler should include PE header\n            information and runtime header information in the output. The default \n            is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if PE header information and runtime header\n            information should be included in the output; otherwise,\n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/HEADER</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.InputFile\">\n            <summary>\n            Specifies the PE file to disassemble.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the PE file\n            to disassemble.\n            </value>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.LineNumbers\">\n            <summary>\n            Specifies whether or not the disassembler should include\n            references to original source lines. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if references to original source lines\n            should be included; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/LINENUM</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.NoIL\">\n            <summary>\n            Specifies whether or not the disassembler should suppress ILASM\n            code output. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if ILASM code output should be suppresses;\n            otherwise, <see langword=\"false\" />. The default is\n            <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/NOIL</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.PublicOnly\">\n            <summary>\n            Specifies whether or not the disassembler should disassemble\n            public items only. This is a shortcut for <see cref=\"P:NAnt.MSNet.Tasks.IldasmTask.Visibility\"/>=\"pub\".\n            The default is <see langword=\"false\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if only public items should be\n            disassembled; otherwise, <see langword=\"false\"/>. The default is\n            <see langword=\"false\"/>.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/PUBONLY</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.QuoteAllNames\">\n            <summary>\n            Specifies whether or not the disassembler should enclose all names\n            in single quotation marks. By default, only names that don't match\n            the ILASM definition of a simple name are quoted. The default is \n            <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if all names should be enclosed in single\n            quotation marks; otherwise, <see langword=\"false\" />. The default\n            is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/QUOTEALLNAMES</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.RawExceptionHandling\">\n            <summary>\n            Specifies whether or not the disassembler should generate\n            structured exception handling clauses in canonical (label) form.\n            The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if structured exception handling clauses\n            should be generated in canonical form; otherwise,\n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/RAWEH</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Source\">\n            <summary>\n            Specifies whether or not the disassembler should generate\n            original source lines as comments. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if original source lines should be\n            generated as comments; otherwise, <see langword=\"false\" />.\n            The default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/SOURCE</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Tokens\">\n            <summary>\n            Specifies whether or not the disassembler should generate metadata\n            token values as comments. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if metadata token values should be\n            generated as comments; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/TOKENS</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Unicode\">\n            <summary>\n            Specifies whether or not the disassembler should use the UNICODE\n            encoding when generating the output. The default is ANSI.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output should be generated using\n            the UNICODE encoding; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/UNICODE</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Utf8\">\n            <summary>\n            Specifies whether or not the disassembler should use the UTF-8\n            encoding when generating the output. The default is ANSI.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output should be generated using\n            the UTF-8 encoding; otherwise, <see langword=\"false\" />. The\n            default is <see langword=\"false\" />.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/UTF8</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Item\">\n            <summary>\n            Instructs the disassembler to disassemble the specified item only.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that specifies the item to\n            disassemble.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/ITEM</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Visibility\">\n            <summary>\n            Instructs the disassembler to disassemble only the items with the\n            specified visibility. Possible values are <c>PUB</c>, <c>PRI</c>,\n            <c>FAM</c>, <c>ASM</c>, <c>FAA</c>, <c>FOA</c>, <c>PSC</c>,\n            or any combination of them separated by <c>+</c>.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that contains the visibility\n            suboptions.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/VISIBILITY</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.OutputFile\">\n            <summary>\n            Specifies the name of the output file created by the disassembler.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> that represents the name of\n            the output file.\n            </value>\n            <remarks>\n            <para>\n            Corresponds to the <c>/OUT</c> flag.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.ToDirectory\">\n            <summary>\n            Specifies the directory to which outputs will be stored.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.DirectoryInfo\"/> that represents the\n            directory to which outputs will be stored.\n            </value>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Assemblies\">\n            <summary>\n            Specifies a list of PE files to disassemble. To use a <see cref=\"T:NAnt.Core.Types.FileSet\"/>, \n            the <see cref=\"P:NAnt.MSNet.Tasks.IldasmTask.ToDirectory\"/> attribute must be specified.\n            </summary>\n            <value>\n            A <see cref=\"T:NAnt.Core.Types.FileSet\"/> that represents the set\n            of PE files to disassemble.\n            </value>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.Arguments\">\n            <summary>\n            The command-line arguments for the external program.\n            </summary>\n            <remarks>\n            Overridden to ensure the &lt;arg&gt; elements would not be exposed\n            to build authors.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.IldasmTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            A <see cref=\"T:System.String\"/> that contains the command-line\n            arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.MSNet.Tasks.ServiceControllerTask\">\n            <summary>\n            Allows a Windows service to be controlled.\n            </summary>\n            <example>\n              <para>Starts the World Wide Web Publishing Service on the local computer.</para>\n              <code>\n                <![CDATA[\n            <servicecontroller action=\"Start\" service=\"w3svc\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Stops the Alerter service on computer 'MOTHER'.</para>\n              <code>\n                <![CDATA[\n            <servicecontroller action=\"Stop\" service=\"Alerter\" machine=\"MOTHER\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.MSNet.Tasks.ServiceControllerTask\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.ExecuteTask\">\n            <summary>\n            Peforms actions on the service in order to reach the desired status.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.DetermineDesiredStatus\">\n            <summary>\n            Determines the desired status of the service based on the action\n            that should be performed on it.\n            </summary>\n            <returns>\n            The <see cref=\"T:System.ServiceProcess.ServiceControllerStatus\"/> that should be reached\n            in order for the <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.Action\"/> to be considered successful.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.StartService(System.ServiceProcess.ServiceController)\">\n            <summary>\n            Starts the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and\n            <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.\n            </summary>\n            <param name=\"serviceController\"><see cref=\"T:System.ServiceProcess.ServiceController\"/> instance for controlling the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.StopService(System.ServiceProcess.ServiceController)\">\n            <summary>\n            Stops the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and\n            <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.\n            </summary>\n            <param name=\"serviceController\"><see cref=\"T:System.ServiceProcess.ServiceController\"/> instance for controlling the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.RestartService(System.ServiceProcess.ServiceController)\">\n            <summary>\n            Restarts the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and\n            <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.\n            </summary>\n            <param name=\"serviceController\"><see cref=\"T:System.ServiceProcess.ServiceController\"/> instance for controlling the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.PauseService(System.ServiceProcess.ServiceController)\">\n            <summary>\n            Pauses the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and\n            <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.\n            </summary>\n            <param name=\"serviceController\"><see cref=\"T:System.ServiceProcess.ServiceController\"/> instance for controlling the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.MSNet.Tasks.ServiceControllerTask.ContinueService(System.ServiceProcess.ServiceController)\">\n            <summary>\n            Continues the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and\n            <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.\n            </summary>\n            <param name=\"serviceController\"><see cref=\"T:System.ServiceProcess.ServiceController\"/> instance for controlling the service identified by <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\"/> and <see cref=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\"/>.</param>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask._serviceName\">\n            <summary>\n            Holds the name of the service that should be controlled.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask._machineName\">\n            <summary>\n            Holds the name of the computer on which the service resides.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask._action\">\n            <summary>\n            Holds the action that should be performed on the service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask._timeout\">\n            <summary>\n            Holds the time, in milliseconds, the task will wait for a service\n            to reach the desired status.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.ServiceName\">\n            <summary>\n            The name of the service that should be controlled.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.MachineName\">\n            <summary>\n            The name of the computer on which the service resides. The default\n            is the local computer.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.Action\">\n            <summary>\n            The action that should be performed on the service.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.MSNet.Tasks.ServiceControllerTask.Timeout\">\n            <summary>\n            The time, in milliseconds, the task will wait for the service to\n            reach the desired status. The default is 5000 milliseconds.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType\">\n            <summary>\n            Defines the actions that can be performed on a service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType.Start\">\n            <summary>\n            Starts a service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType.Stop\">\n            <summary>\n            Stops a service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType.Restart\">\n            <summary>\n            Restarts a service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType.Pause\">\n            <summary>\n            Pauses a running service.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.MSNet.Tasks.ServiceControllerTask.ActionType.Continue\">\n            <summary>\n            Continues a paused service.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.NUnit.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.NUnit</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.NUnit.Types.FormatterData\">\n            <summary>\n            Carries data specified through the formatter element.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterData.Type\">\n            <summary>\n            Gets or sets the type of the formatter.\n            </summary>\n            <value>The type of the formatter.</value>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterData.UseFile\">\n            <summary>\n            Gets or sets a value indicating whether output should be persisted \n            to a file. \n            </summary>\n            <value>\n            <see langword=\"true\" /> if output should be written to a file; otherwise, \n            <see langword=\"false\" />. The default is <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterData.Extension\">\n            <summary>\n            Gets or sets the extension to append to the output filename.\n            </summary>\n            <value>The extension to append to the output filename.</value>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterData.OutputDirectory\">\n            <summary>\n            Gets or sets the directory where the output file should be written \n            to, if <see cref=\"P:NAnt.NUnit.Types.FormatterData.UseFile\"/> is <see langword=\"true\"/>.\n            </summary> \n            <value>\n            The directory where the output file should be written to.\n            </value>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterDataCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.#ctor(NAnt.NUnit.Types.FormatterDataCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.#ctor(NAnt.NUnit.Types.FormatterData[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.Add(NAnt.NUnit.Types.FormatterData)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.AddRange(NAnt.NUnit.Types.FormatterData[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.AddRange(NAnt.NUnit.Types.FormatterDataCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.Contains(NAnt.NUnit.Types.FormatterData)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.CopyTo(NAnt.NUnit.Types.FormatterData[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.IndexOf(NAnt.NUnit.Types.FormatterData)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/>. If the <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.Insert(System.Int32,NAnt.NUnit.Types.FormatterData)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit.Types.FormatterDataEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataCollection.Remove(NAnt.NUnit.Types.FormatterData)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterDataCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterDataEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataEnumerator.#ctor(NAnt.NUnit.Types.FormatterDataCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterDataEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit.Types.FormatterDataCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterDataEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterDataEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterType\">\n            <summary>\n            The built-in formatter types.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.NUnit.Types.FormatterType.Plain\">\n            <summary>\n            A plaintext formatter.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.NUnit.Types.FormatterType.Xml\">\n            <summary>\n            An XML formatter.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterElement\">\n            <summary>\n            Represents the FormatterElement of the NUnit task.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElement.Type\">\n            <summary>\n            Type of formatter.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElement.Extension\">\n            <summary>\n            Extension to append to the output filename.\n            </summary> \n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElement.UseFile\">\n            <summary>\n            Determines whether output should be persisted to a file. The default \n            is <see langword=\"false\" />.\n            </summary> \n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElement.OutputDirectory\">\n            <summary>\n            Specifies the directory where the output file should be written to,\n            if <see cref=\"P:NAnt.NUnit.Types.FormatterElement.UseFile\"/> is <see langword=\"true\"/>.  If not \n            specified, the output file will be written to the directory where\n            the test module is located.\n            </summary> \n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElement.Data\">\n            <summary>\n            Gets the underlying <see cref=\"T:NAnt.NUnit.Types.FormatterData\"/> for the element.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterElementCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.#ctor(NAnt.NUnit.Types.FormatterElementCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.#ctor(NAnt.NUnit.Types.FormatterElement[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.Add(NAnt.NUnit.Types.FormatterElement)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.AddRange(NAnt.NUnit.Types.FormatterElement[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.AddRange(NAnt.NUnit.Types.FormatterElementCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.Contains(NAnt.NUnit.Types.FormatterElement)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.CopyTo(NAnt.NUnit.Types.FormatterElement[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.IndexOf(NAnt.NUnit.Types.FormatterElement)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/>. If the <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.Insert(System.Int32,NAnt.NUnit.Types.FormatterElement)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit.Types.FormatterElementEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementCollection.Remove(NAnt.NUnit.Types.FormatterElement)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElementCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit.Types.FormatterElementEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit.Types.FormatterElement\"/> elements of a <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementEnumerator.#ctor(NAnt.NUnit.Types.FormatterElementCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit.Types.FormatterElementEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit.Types.FormatterElementCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit.Types.FormatterElementEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit.Types.FormatterElementEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.NUnit1Tasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.NUnit1Tasks</name>\n    </assembly>\n    <members>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatter.StartTestSuite(NAnt.NUnit1.Types.NUnitTestData)\">\n            <summary>\n            The whole test suite started.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatter.EndTestSuite(NAnt.NUnit1.Types.TestResultExtra)\">\n            <summary>\n            The whole test suite ended.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatter.SetOutput(System.IO.TextWriter)\">\n            <summary>\n            Sets the <see cref=\"T:System.IO.TextWriter\"/> the formatter is supposed to write \n            its results to.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.#ctor(NAnt.NUnit1.Types.IResultFormatterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.#ctor(NAnt.NUnit1.Types.IResultFormatter[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.Add(NAnt.NUnit1.Types.IResultFormatter)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.AddRange(NAnt.NUnit1.Types.IResultFormatter[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.AddRange(NAnt.NUnit1.Types.IResultFormatterCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.Contains(NAnt.NUnit1.Types.IResultFormatter)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.CopyTo(NAnt.NUnit1.Types.IResultFormatter[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.IndexOf(NAnt.NUnit1.Types.IResultFormatter)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/>. If the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.Insert(System.Int32,NAnt.NUnit1.Types.IResultFormatter)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterCollection.Remove(NAnt.NUnit1.Types.IResultFormatter)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.IResultFormatterCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.IResultFormatterEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatter\"/> elements of a <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterEnumerator.#ctor(NAnt.NUnit1.Types.IResultFormatterCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit1.Types.IResultFormatterCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.IResultFormatterEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.IResultFormatterEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.LogFormatter\">\n            <summary>\n            Prints information about running tests directly to the build log.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.LogFormatter.SetOutput(System.IO.TextWriter)\">\n            <summary>Not used, all output goes to Log class.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.LogFormatter.StartTestSuite(NAnt.NUnit1.Types.NUnitTestData)\">\n            <summary>Called when the whole test suite has started.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.LogFormatter.EndTestSuite(NAnt.NUnit1.Types.TestResultExtra)\">\n            <summary>Called when the whole test suite has ended.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.LogFormatter.FormatError(System.String,System.String)\">\n            <summary>Convert a stack trace line into something that can be clicked on in an IDE output window.</summary>\n            <param name=\"trace\">The StackTrace string, see <see cref=\"P:System.Exception.StackTrace\"/>.</param>\n            <param name=\"message\">The string that gets appended to the end of file(line): portion.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Tasks.NUnitTask\">\n            <summary>\n            Runs tests using the NUnit V1.0 framework.\n            </summary>\n            <remarks>\n              <para>\n              See the <see href=\"http://nunit.sf.net\">NUnit home page</see> for more \n              information.\n              </para>\n              <para>\n              The <see cref=\"P:NAnt.NUnit1.Tasks.NUnitTask.HaltOnFailure\"/> or <see cref=\"P:NAnt.NUnit1.Tasks.NUnitTask.HaltOnError\"/> \n              attributes are only used to stop more than one test suite to stop \n              running.  If any test suite fails a build error will be thrown.  \n              Set <see cref=\"P:NAnt.Core.Task.FailOnError\"/> to <see langword=\"false\"/> to \n              ignore test errors and continue build.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Run tests in the <c>MyProject.Tests.dll</c> assembly.\n              </para>\n              <para>\n              The test results are logged in <c>results.xml</c> and <c>results.txt</c> \n              using the <see cref=\"F:NAnt.NUnit.Types.FormatterType.Xml\"/> and <see cref=\"F:NAnt.NUnit.Types.FormatterType.Plain\"/> \n              formatters, respectively.\n              </para>\n              <code>\n                <![CDATA[\n            <nunit basedir=\"build\" verbose=\"false\" haltonerror=\"true\" haltonfailure=\"true\">\n                <formatter type=\"Xml\" />\n                <formatter type=\"Plain\" />\n                <test name=\"MyProject.Tests.AllTests\" assembly=\"MyProject.Tests.dll\" outfile=\"results\"/>\n            </nunit>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTask.HaltOnError\">\n            <summary>\n            Stops running tests when a test causes an error. The default is \n            <see langword=\"false\" />.\n            </summary>\n            <remarks>\n            Implies haltonfailure.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTask.HaltOnFailure\">\n            <summary>\n            Stops running tests if a test fails (errors are considered failures \n            as well). The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTask.Timeout\">\n            <summary>\n            Cancel the individual tests if they do not finish in the specified \n            time (measured in milliseconds). Ignored if fork is disabled.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTask.Tests\">\n            <summary>\n            Tests to run.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTask.FormatterElements\">\n            <summary>\n            Formatters to output results of unit tests.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.NUnitTest\">\n            <summary>\n            Represents a test element of an <see cref=\"T:NAnt.NUnit1.Tasks.NUnitTask\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.OutFile\">\n            <summary>\n            Base name of the test result. The full filename is determined by this \n            attribute and the extension of formatter.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.ToDir\">\n            <summary>\n            Directory to write the reports to.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.Class\">\n            <summary>\n            Class name of the test.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.Assembly\">\n            <summary>\n            Assembly to load the test from.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.Fork\">\n            <summary>\n            Run the tests in a separate <see cref=\"T:System.AppDomain\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.HaltOnError\">\n            <summary>\n            Stop the build process if an error occurs during the test run.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.HaltOnFailure\">\n            <summary>\n            Stop the build process if a test fails (errors are considered failures \n            as well).\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTest.AppConfigFile\">\n            <summary>\n            The application configuration file to use for the NUnit test domain.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.NUnitTestCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.#ctor(NAnt.NUnit1.Types.NUnitTestCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.#ctor(NAnt.NUnit1.Types.NUnitTest[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.Add(NAnt.NUnit1.Types.NUnitTest)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.AddRange(NAnt.NUnit1.Types.NUnitTest[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.AddRange(NAnt.NUnit1.Types.NUnitTestCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.Contains(NAnt.NUnit1.Types.NUnitTest)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.CopyTo(NAnt.NUnit1.Types.NUnitTest[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.IndexOf(NAnt.NUnit1.Types.NUnitTest)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/>. If the <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.Insert(System.Int32,NAnt.NUnit1.Types.NUnitTest)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit1.Types.NUnitTestEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestCollection.Remove(NAnt.NUnit1.Types.NUnitTest)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTestCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.NUnitTestEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit1.Types.NUnitTest\"/> elements of a <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestEnumerator.#ctor(NAnt.NUnit1.Types.NUnitTestCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.NUnitTestEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit1.Types.NUnitTestCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.NUnitTestEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.NUnitTestEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.NUnitTestData\">\n            <summary>\n            Carries data specified through the test element.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Tasks.NUnitTestRunner.NeedsRunning\">\n            <summary>\n            Determines if the unit test needs running.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if unit test needs running, otherwise,\n            <see langword=\"false\" />.\n            </returns>\n            <remarks>\n              <para>\n              Determines if the test needs running by looking at the date stamp \n              of the test assembly and the test results log.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Tasks.NUnitTestRunner.Run(System.String,System.Boolean)\">\n            <summary>\n            Runs a Suite extracted from a TestCase subclass.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Tasks.NUnitTestRunner.CreateFormatters(NAnt.NUnit1.Types.NUnitTestData,System.String,System.Boolean)\">\n            <summary>\n            Creates the formatters to be used when running this test.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Tasks.NUnitTestRunner.GetOutput(NAnt.NUnit.Types.FormatterData,NAnt.NUnit1.Types.NUnitTestData)\">\n            <summary>\n            Returns the output file or null if does not use a file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Tasks.NUnitTestRunner.GetSuite(System.String)\">\n            <summary>\n            Returns the test suite from a given class.\n            </summary>\n            <remarks>\n            The assemblyQualifiedName parameter needs to be in form:\n            \"full.qualified.class.name,Assembly\"\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTestRunner.Formatters\">\n            <summary>\n            Gets the collection of registered formatters.\n            </summary>\n            <value>Collection of registered formatters.</value>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Tasks.NUnitTestRunner.ResultCode\">\n            <summary>\n            Gets the result of the test.\n            </summary>\n            <value>The result of the test.</value>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.PlainTextFormatter\">\n            <summary>\n            Prints information about running tests in plain text.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.PlainTextFormatter.SetOutput(System.IO.TextWriter)\">\n            <summary>Sets the Writer the formatter is supposed to write its results to.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.PlainTextFormatter.StartTestSuite(NAnt.NUnit1.Types.NUnitTestData)\">\n            <summary>Called when the whole test suite has started.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.PlainTextFormatter.EndTestSuite(NAnt.NUnit1.Types.TestResultExtra)\">\n            <summary>Called when the whole test suite has ended.</summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.PlainTextFormatter.FormatError(System.String,System.String)\">\n            <summary>Convert a stack trace line into something that can be clicked on in an IDE output window.</summary>\n            <param name=\"trace\">The StackTrace string, see <see cref=\"P:System.Exception.StackTrace\"/>.</param>\n            <param name=\"message\">The string that gets appended to the end of file(line): portion.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.TestResultExtra\">\n             <summary>\n             Decorates NUnits <see cref=\"T:NUnit.Framework.TestResult\"/> with extra information such as \n             run-time.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.TestResultExtra.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.TestResultExtra\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit1.Types.TestResultExtra.RunTime\">\n            <summary>\n            Gets or sets the total run-time of a test.\n            </summary>\n            <value>The total run-time of a test.</value>\n        </member>\n        <member name=\"T:NAnt.NUnit1.Types.XmlResultFormatter\">\n            <summary>\n            Prints detailed information about running tests in XML format.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.XmlResultFormatter.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit1.Types.XmlResultFormatter\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.XmlResultFormatter.SetOutput(System.IO.TextWriter)\">\n            <summary>\n            Sets the <see cref=\"T:System.IO.TextWriter\"/> the formatter is supposed to \n            write its results to.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.XmlResultFormatter.StartTestSuite(NAnt.NUnit1.Types.NUnitTestData)\">\n            <summary>\n            Called when the whole test suite has started.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit1.Types.XmlResultFormatter.EndTestSuite(NAnt.NUnit1.Types.TestResultExtra)\">\n            <summary>\n            Called when the whole test suite has ended.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.NUnit2Tasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.NUnit2Tasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.NUnit2.Types.Categories\">\n            <summary>\n            Controls the categories of tests to execute using the <see cref=\"T:NAnt.NUnit2.Tasks.NUnit2Task\"/>.\n            </summary>\n            <example>\n              <para>\n              Only include test cases and fixtures that require no internet access.\n              </para>\n              <code>\n                <![CDATA[\n            <categories>\n                <include name=\"NoInternetAccess\" />\n            </categories>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Exclude test cases and fixtures that are known to fail.\n              </para>\n              <code>\n                <![CDATA[\n            <categories>\n                <exclude name=\"NotWorking\" />\n            </categories>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.Categories.Includes\">\n            <summary>\n            Specifies a list of categories to include.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.Categories.Excludes\">\n            <summary>\n            Specifies a list of categories to exclude.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.Category\">\n            <summary>\n            Represents a certain group of test cases or fixtures.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.Category.CategoryName\">\n            <summary>\n            A name of a category, or comma-separated list of names.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.Category.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the category will be processed;\n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.Category.UnlessDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the category will be skipped;\n            otherwise, processed. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.CategoryCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.NUnit2.Types.Category\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.#ctor(NAnt.NUnit2.Types.CategoryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.#ctor(NAnt.NUnit2.Types.Category[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit2.Types.Category\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.ToString\">\n            <summary>\n            Returns a comma-delimited list of categories.\n            </summary>\n            <returns>\n            A comma-delimited list of categories, or an empty \n            <see cref=\"T:System.String\"/> if there are no categories.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.Add(NAnt.NUnit2.Types.Category)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.AddRange(NAnt.NUnit2.Types.Category[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit2.Types.Category\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.AddRange(NAnt.NUnit2.Types.CategoryCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.Contains(NAnt.NUnit2.Types.Category)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> with value \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.CopyTo(NAnt.NUnit2.Types.Category[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.IndexOf(NAnt.NUnit2.Types.Category)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit2.Types.Category\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.Category\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit2.Types.Category\"/>. If the <see cref=\"T:NAnt.NUnit2.Types.Category\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.Insert(System.Int32,NAnt.NUnit2.Types.Category)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit2.Types.Category\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit2.Types.CategoryEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryCollection.Remove(NAnt.NUnit2.Types.Category)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.CategoryCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.CategoryCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.NUnit2.Types.Category\"/> with the specified name.\n            </summary>\n            <param name=\"value\">The name of the <see cref=\"T:NAnt.NUnit2.Types.Category\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.CategoryEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit2.Types.Category\"/> elements of a <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryEnumerator.#ctor(NAnt.NUnit2.Types.CategoryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.CategoryEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit2.Types.CategoryCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.CategoryEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.CategoryEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.#ctor(NAnt.NUnit2.Types.NUnit2TestCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.#ctor(NAnt.NUnit2.Types.NUnit2Test[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.Add(NAnt.NUnit2.Types.NUnit2Test)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.AddRange(NAnt.NUnit2.Types.NUnit2Test[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.AddRange(NAnt.NUnit2.Types.NUnit2TestCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.Contains(NAnt.NUnit2.Types.NUnit2Test)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.CopyTo(NAnt.NUnit2.Types.NUnit2Test[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.IndexOf(NAnt.NUnit2.Types.NUnit2Test)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/>. If the <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.Insert(System.Int32,NAnt.NUnit2.Types.NUnit2Test)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestCollection.Remove(NAnt.NUnit2.Types.NUnit2Test)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2TestCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.NUnit2TestEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.NUnit2.Types.NUnit2Test\"/> elements of a <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestEnumerator.#ctor(NAnt.NUnit2.Types.NUnit2TestCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.NUnit2.Types.NUnit2TestCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Types.NUnit2TestEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2TestEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Tasks.NUnit2Task\">\n            <summary>\n            Runs tests using the NUnit V2.2 framework.\n            </summary>\n            <remarks>\n              <para>\n              The <see cref=\"P:NAnt.NUnit2.Tasks.NUnit2Task.HaltOnFailure\"/> attribute is only useful when more \n              than one test suite is used, and you want to continue running other \n              test suites although a test failed.\n              </para>\n              <para>\n              Set <see cref=\"P:NAnt.Core.Task.FailOnError\"/> to <see langword=\"false\"/> to \n              ignore any errors and continue the build.\n              </para>\n              <para>\n              In order to run a test assembly built with NUnit 2.0 or 2.1 using \n              <see cref=\"T:NAnt.NUnit2.Tasks.NUnit2Task\"/>, you must add the following node to your\n              test config file :\n              </para>\n              <code>\n                <![CDATA[\n            <configuration>\n                ...\n                <runtime>\n                    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n                        <dependentAssembly>\n                            <assemblyIdentity name=\"nunit.framework\" publicKeyToken=\"96d09a1eb7f44a77\" culture=\"Neutral\" /> \n                            <bindingRedirect oldVersion=\"2.0.6.0\" newVersion=\"2.2.8.0\" /> \n                            <bindingRedirect oldVersion=\"2.1.4.0\" newVersion=\"2.2.8.0\" /> \n                        </dependentAssembly>\n                    </assemblyBinding>\n                </runtime>\n                ...\n            </configuration>\n                ]]>\n              </code>\n              <para>\n              See the <see href=\"http://nunit.sf.net\">NUnit home page</see> for more \n              information.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Run tests in the <c>MyProject.Tests.dll</c> assembly.\n              </para>\n              <code>\n                <![CDATA[\n            <nunit2>\n                <formatter type=\"Plain\" />\n                <test assemblyname=\"MyProject.Tests.dll\" appconfig=\"MyProject.Tests.dll.config\" />\n            </nunit2>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Only run tests that are not known to fail in files listed in the <c>tests.txt</c>\n              file.\n              </para>\n              <code>\n                <![CDATA[\n            <nunit2>\n                <formatter type=\"Xml\" usefile=\"true\" extension=\".xml\" outputdir=\"${build.dir}/results\" />\n                <test>\n                    <assemblies>\n                        <includesfile name=\"tests.txt\" />\n                    </assemblies>\n                    <categories>\n                        <exclude name=\"NotWorking\" />\n                    </categories>\n                    <references basedir=\"build\">\n                        <include name=\"Cegeka.Income.Services.dll\" />\n                        <include name=\"Cegeka.Util.dll\" />\n                    </references>\n                </test>\n            </nunit2>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2Task.ExecuteTask\">\n            <summary>\n            Runs the tests and sets up the formatters.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Tasks.NUnit2Task.HaltOnFailure\">\n            <summary>\n            Stop the test run if a test fails. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Tasks.NUnit2Task.Tests\">\n            <summary>\n            Tests to run.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Tasks.NUnit2Task.FormatterElements\">\n            <summary>\n            Formatters to output results of unit tests.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Types.NUnit2Test\">\n            <summary>\n            Represents a <c>test</c> element of an <see cref=\"T:NAnt.NUnit2.Tasks.NUnit2Task\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.AssemblyFile\">\n            <summary>\n            Name of the assembly to search for tests.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.TestName\">\n            <summary>\n            Name of a specific testfixture to run. If not specified then all \n            testfixtures are run.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.Assemblies\">\n            <summary>\n            Assemblies to include in test.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.References\">\n            <summary>\n            Assemblies to scan for missing assembly references.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.Categories\">\n            <summary>\n            Categories of test cases to include or exclude.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.HaltOnFailure\">\n            <summary>\n            Build fails on failure. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.XsltFile\">\n            <summary>\n            XSLT transform file to use when using the <see cref=\"F:NAnt.NUnit.Types.FormatterType.Plain\"/> \n            formatter.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.AppConfigFile\">\n            <summary>\n            The application configuration file to use for the NUnit test domain.\n            If not specified, NAnt will try to use a configuration name matching\n            the file name of the assembly with extension \".config\".\n            </summary>\n        </member>\n        <member name=\"P:NAnt.NUnit2.Types.NUnit2Test.TestAssemblies\">\n            <summary>\n            Gets all assemblies specified for these tests.\n            </summary>\n            <returns>\n            All assemblies specified for these tests.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Tasks.NUnit2TestDomain\">\n            <summary>\n            Custom TestDomain, similar to the one included with NUnit, in order \n            to workaround some limitations in it.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2TestDomain.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.NUnit2.Tasks.NUnit2TestDomain\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2TestDomain.CreateRunner(System.IO.FileInfo,System.IO.FileInfo,System.Collections.Specialized.StringCollection)\">\n            <summary>\n            Runs a single testcase.\n            </summary>\n            <param name=\"assemblyFile\">The test assembly.</param>\n            <param name=\"configFile\">The application configuration file for the test domain.</param>\n            <param name=\"referenceAssemblies\">List of files to scan for missing assembly references.</param>\n            <returns>\n            The result of the test.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler\">\n            <summary>\n            Helper class called when an assembly resolve event is raised.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler.#ctor(System.String[],System.String[])\">\n            <summary> \n            Initializes an instanse of the <see cref=\"T:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler.ResolveAssembly(System.Object,System.ResolveEventArgs)\">\n            <summary>\n            Called back when the CLR cannot resolve a given assembly.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"args\">A <see cref=\"T:System.ResolveEventArgs\"/> that contains the event data.</param>\n            <returns>\n            The <c>nunit.framework</c> we know to be in NAnts bin directory, if \n            that is the assembly that needs to be resolved; otherwise, \n            <see langword=\"null\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler.AssemblyLoad(System.Object,System.AssemblyLoadEventArgs)\">\n            <summary>\n            Occurs when an assembly is loaded. The loaded assembly is added \n            to the assembly cache.\n            </summary>\n            <param name=\"sender\">The source of the event.</param>\n            <param name=\"args\">An <see cref=\"T:System.AssemblyLoadEventArgs\"/> that contains the event data.</param>\n        </member>\n        <member name=\"F:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler._probePaths\">\n            <summary>\n            Holds the list of directories that will be scanned for missing\n            assembly references.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler._referenceAssemblies\">\n            <summary>\n            Holds the list of assemblies that can be scanned for missing\n            assembly references.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.NUnit2.Tasks.NUnit2TestDomain.AssemblyResolveHandler._assemblyCache\">\n            <summary>\n            Holds the loaded assemblies.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.SourceControlTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.SourceControlTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.SourceControl.Tasks.AbstractCvsTask\">\n            <summary>\n            A base class for creating tasks for executing CVS client commands on a \n            CVS repository.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.AbstractSourceControlTask\">\n            <summary>\n            A base class for creating tasks for executing CVS client commands on a \n            CVS repository.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractSourceControlTask.EnvHome\">\n            <summary>\n            Name of the environmental variable specifying a users' home\n                in a *nix environment.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractSourceControlTask.AppData\">\n            <summary>\n            Used on windows to specify the location of application data.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractSourceControlTask.PathVariable\">\n            <summary>\n            The environment variable that holds path information.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractSourceControlTask.CvsPassFileVariable\">\n            <summary>\n            The environment variable that holds the location of the\n            .cvspass file.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractSourceControlTask.PropExeName\">\n            <summary>\n            Property name used to specify the source control executable.  This is \n                used as a readonly property.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.AbstractCvsTask\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Build up the command line arguments, determine which executable is being\n            used and find the path to that executable and set the working \n            directory.\n            </summary>\n            <param name=\"process\">The process to prepare.</param>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.SetGlobalOption(System.String,System.String,System.Boolean)\">\n            <summary>\n            Adds a new global option if none exists.  If one does exist then\n            the use switch is toggled on or of.\n            </summary>\n            <param name=\"name\">The common name of the option.</param>\n            <param name=\"value\">The option value or command line switch\n                of the option.</param>\n            <param name=\"on\"><code>true</code> if the option should be\n                appended to the commandline, otherwise <code>false</code>.</param>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.SetCommandOption(System.String,System.String,System.Boolean)\">\n            <summary>\n            Adds a new command option if none exists.  If one does exist then\n                the use switch is toggled on or of.\n            </summary>\n            <param name=\"name\">The common name of the option.</param>\n            <param name=\"value\">The option value or command line switch\n                of the option.</param>\n            <param name=\"on\"><code>true</code> if the option should be\n                appended to the commandline, otherwise <code>false</code>.</param>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.SetEnvironment(System.Diagnostics.Process)\">\n            <summary>\n            Set up the environment variables for a process.\n            </summary>\n            <param name=\"process\">A process to setup.</param>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.AppendFiles\">\n            <summary>\n            Append the files specified in the fileset to the command line argument.\n            Files are changed to use a relative path from the working directory\n            that the task is spawned in.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractSourceControlTask.DeriveVcsFromEnvironment\">\n            <summary>\n            Derive the location of the version control system from the environment\n                variable <code>PATH</code>.\n            </summary>\n            <returns>The file information of the version control system, \n                or <code>null</code> if this cannot be found.</returns>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.PassFileName\">\n            <summary>\n            The name of the passfile, overriden for each version control system (VCS).\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.VcsHome\">\n            <summary>\n            The path to the specific home directory of the version control system,\n                this can be where the binary files are kept, or other app\n                information.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.VcsHomeEnv\">\n            <summary>\n            The environment variable that defines where the version control system\n                (VCS) home variable is kept.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.VcsExeName\">\n            <summary>\n            The name of the version control system (VCS) executable file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.Root\">\n            <summary>\n            <para>\n            The root variable contains information on how to locate a repository.  \n                Although this information is in different formats it typically must\n                define the following:\n                <list type=\"table\">\n                    <item>server location</item>\n                    <item>protocol used to communicate with the repository</item>\n                    <item>repository location on the server</item>\n                    <item>project location in the repository</item>\n                </list>\n            </para>\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.DestinationDirectory\">\n            <summary>\n            Destination directory for the local sandbox.  If destination is not specified\n            then the current directory is used.\n            </summary>\n            <value>\n            Root path of the local sandbox.\n            </value>\n            <remarks>\n            <para>\n            Root path of the local sandbox.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.Password\">\n            <summary>\n            The password for logging in to the repository.\n            </summary>\n            <value>\n            The password for logging in to the repository.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.PassFile\">\n            <summary>\n            The full path to the cached password file.  If not specified then the\n            environment variables are used to try and locate the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.GlobalOptions\">\n            <summary>\n            Holds a collection of globally available options.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.CommandOptions\">\n            <summary>\n            A collection of options that can be used to modify the default behavoir\n            of the version control commands.  See the sub-tasks for implementation\n            specifics.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.CommandLineArguments\">\n            <summary>\n            Command-line arguments for the program.  The command line arguments are used to specify\n            any cvs command options that are not available as attributes.  These are appended\n            after the command itself and are additive to whatever attributes are currently specified.\n            </summary>\n            <example>\n                &lt;cvs-checkout    cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                                    module=\"nant\"\n                                    destination=\"e:\\test\\merillcornish\\working\"\n                                    readonly=\"true\"\n                                    quiet=\"true\"\n                                    commandline=\"-n\"\n                                    cvsfullpath=\"C:\\Program Files\\TortoiseCVS\\cvs.exe\"\n                /&gt;\n                <br />\n                Produces the cvs command:\n                <code>c:\\Program Files\\TortoiseCVS\\cvs.exe -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant -q checkout -n nant</code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.CommandName\">\n            <summary>\n            The name of the command that is going to be executed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.VcsFileSet\">\n            <summary>\n            Used to specify the version control system (VCS) files that are going\n            to be acted on.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.Ssh\">\n            <summary>\n            The executable to use for ssh communication.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.SshEnv\">\n            <summary>\n            The environment name for the ssh variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.ExeName\">\n            <summary>\n            The name of the version control system executable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.ProgramArguments\">\n            <summary>\n            Get the command line arguments for the task.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.DefaultRecursive\">\n            <summary>\n            Default value for the recursive directive.  The default is \n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.DefaultQuiet\">\n            <summary>\n            Default value for the quiet command.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.DefaultReallyQuiet\">\n            <summary>\n            Default value for the really quiet command.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsHome\">\n            <summary>\n            An environment variable that holds path information about where\n                cvs is located.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsPassfile\">\n            <summary>\n            Name of the password file that cvs stores pserver \n                cvsroot/ password pairings.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.DefaultCompressionLevel\">\n            <summary>\n            The default compression level to use for cvs commands.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.DefaultUseSharpCvsLib\">\n            <summary>\n            The default use of binaries, defaults to use sharpcvs.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsExe\">\n            <summary>\n            The name of the cvs executable.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.SharpCvsExe\">\n            <summary>\n            The temporary name of the sharpcvslib binary file, to avoid \n            conflicts in the path variable.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsRsh\">\n            <summary>\n            Environment variable that holds the executable name that is used for\n            ssh communication.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.AbstractCvsTask.UseSharpCvsLibProp\">\n            <summary>\n            Property name used to specify on a project level whether sharpcvs is\n            used or not.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractCvsTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.AbstractCvsTask\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractCvsTask.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Build up the command line arguments, determine which executable is being\n                used and find the path to that executable and set the working \n                directory.\n            </summary>\n            <param name=\"process\">The process to prepare.</param>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractCvsTask.AppendSubCommandArgs\">\n            <summary>\n            Override to append any commands before the modele and files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractCvsTask.AppendCommandOptions\">\n            <summary>\n            Append the command line options or commen names for the options\n                to the generic options collection.  This is then piped to the\n                command line as a switch.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.AbstractCvsTask.AddArg(System.String)\">\n            <summary>\n            Add the given argument to the command line options.  Note that are not explicitly\n            quoted are split into seperate arguments.  This is to resolve a recent issue\n            with quoting command line arguments.\n            </summary>\n            <param name=\"arg\"></param>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.SshEnv\">\n            <summary>\n            The environment name for the ssh variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.VcsExeName\">\n            <summary>\n            The name of the cvs binary, or <c>cvs.exe</c> at the time this \n            was written.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.PassFileName\">\n            <summary>\n            The name of the pass file, or <c>.cvspass</c> at the time\n            of this writing.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.VcsHomeEnv\">\n            <summary>\n            The name of the version control system specific home environment \n            variable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.IsModuleNeeded\">\n            <summary>\n            Specify if the module is needed for this cvs command.  It is\n            only needed if there is no module information on the local file\n            system.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsFileSet\">\n            <summary>\n            Used to specify the version control system (VCS) files that are going\n            to be acted on.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.VcsFileSet\">\n            <summary>\n            Get the cvs file set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.ExeName\">\n            <summary>\n            The name of the cvs executable.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.CvsFullPath\">\n            <summary>\n            The full path to the cvs binary used.  The cvs tasks will attempt to\n            \"guess\" the location of your cvs binary based on your path.  If the\n            task is unable to resolve the location, or resolves it incorrectly\n            this can be used to manually specify the path.\n            </summary>\n            <value>\n            A full path (i.e. including file name) of your cvs binary:\n                On Windows: c:\\vcs\\cvs\\cvs.exe \n                On *nix: /usr/bin/cvs\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.Root\">\n            <summary>\n            <para>\n            The cvs root variable has the following components:\n            </para>\n            <para>\n                <code>[protocol]:[username]@[servername]:[server path]</code>\n                <ul>\n                    <li>protocol:       ext, pserver, ssh (sharpcvslib); if you are not using sharpcvslib consult your cvs documentation.</li>\n                    <li>username:       [username]</li>\n                    <li>servername:     cvs.sourceforge.net</li>\n                    <li>server path:    /cvsroot/nant</li>\n                </ul>\n            </para>\n            </summary>\n            <example>\n              <para>NAnt anonymous cvsroot:</para>\n              <code>\n              :pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.Module\">\n            <summary>\n            The module to perform an operation on.\n            </summary>\n            <value>\n            The module to perform an operation on.  This is a normal file/folder\n            name without path information.\n            </value>\n            <example>\n              <para>In NAnt the module name would be:</para>\n              <code>nant</code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.UseSharpCvsLib\">\n            <summary>\n            <para>\n            <see langword=\"true\" /> if the SharpCvsLib binaries that come bundled \n            with NAnt should be used to perform the cvs commands, <see langword=\"false\" />\n            otherwise.\n            </para>\n            <para>\n            You may also specify an override value for all cvs tasks instead\n            of specifying a value for each.  To do this set the property\n            <c>sourcecontrol.usesharpcvslib</c> to <see langword=\"false\" />.\n            </para>\n            <warn>\n            If you choose not to use SharpCvsLib to checkout from cvs you will \n            need to include a cvs.exe binary in your path.\n            </warn>\n            </summary>\n            <example>\n                To use a cvs client in your path instead of sharpcvslib specify\n                    the property:\n                &gt;property name=\"sourcecontrol.usesharpcvslib\" value=\"false\"&lt;\n                \n                The default settings is to use sharpcvslib and the setting closest\n                to the task execution is used to determine which value is used\n                to execute the process.\n                \n                For instance if the attribute usesharpcvslib was set to false \n                and the global property was set to true, the usesharpcvslib is \n                closes to the point of execution and would be used and is false. \n                Therefore the sharpcvslib binary would NOT be used.\n            </example>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.Ssh\">\n            <summary>\n            The executable to use for ssh communication.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.Quiet\">\n            <summary>\n            Indicates if the output from the cvs command should be supressed.  \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.ReallyQuiet\">\n            <summary>\n            Indicates if the output from the cvs command should be stopped.  \n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.ReadOnly\">\n            <summary>\n            <see langword=\"true\" /> if the sandbox files should be checked out in\n            read only mode. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.ReadWrite\">\n            <summary>\n            <see langword=\"true\" /> if the sandbox files should be checked out in \n            read/write mode. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.AbstractCvsTask.CompressionLevel\">\n            <summary>\n            Compression level to use for all net traffic.  This should be a value from 1-9.\n            <br />\n            <br />\n            <bold>NOTE: This is not available on sharpcvslib.</bold>\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.ChangeLogTask\">\n            <summary>\n            Produces an XML report that represents the cvs changes from the given \n            start day, to a given end date.\n            </summary>\n            <example>\n              <para>Report changes in NAnt from 1st of June 2004 until 25th of July 2004.</para>\n              <code>\n                <![CDATA[\n            <cvs-changelog\n                destination=\"e:/test/nant/sourcecontrol/\"\n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\"\n                module=\"nant\"\n                start=\"2004/06/01\"\n                end=\"2004/07/25\"\n                xmlfile=\"e:/test/nant/sourcecontrol/changelog-nant.xml\"\n            />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.ChangeLogTask.CvsCommandName\">\n            <summary>\n            The command being executed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.DestFile\">\n            <summary>\n            Name of the xml file that will contain the cvs log information.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.StartDate\">\n            <summary>\n            The earliest change to use in the cvs log command.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.EndDate\">\n            <summary>\n            The latest date to use in the cvs log command.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.CommandName\">\n            <summary>\n            The cvs command to execute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.UseSharpCvsLib\">\n            <summary>\n            Override use of sharpcvslib, needs to be true.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ChangeLogTask.Root\">\n            <summary>\n            <para>\n            The cvs root variable has the following components:\n            </para>\n            <para>\n                <code>[protocol]:[username]@[servername]:[server path]</code>\n                <ul>\n                    <li>protocol:       ext, pserver, ssh (sharpcvslib); if you are not using sharpcvslib consult your cvs documentation.</li>\n                    <li>username:       [username]</li>\n                    <li>servername:     cvs.sourceforge.net</li>\n                    <li>server path:    /cvsroot/nant</li>\n                </ul>\n            </para>\n            <para>\n            If the cvsroot is not specified then the directory specified by the \n            <see cref=\"P:NAnt.SourceControl.Tasks.AbstractSourceControlTask.DestinationDirectory\"/> attribute \n            is searched for CVS\\Root.\n            </para>\n            </summary>\n            <example>\n              <para>NAnt anonymous cvsroot:</para>\n              <code>\n              :pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\n              </code>\n            </example>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.CheckoutTask\">\n            <summary>\n            Checks out a CVS module to the required directory.\n            </summary>\n            <example>\n              <para>Checkout NAnt.</para>\n              <code>\n                <![CDATA[\n            <cvs-checkout \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                module=\"nant\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Checkout NAnt revision named <c>0_85</c> to the \n              folder <c>c:\\src\\nant\\v0.85</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <cvs-checkout \n                destination=\"c:\\src\\nant\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                module=\"nant\"\n                revision=\"0_85\"\n                overridedir=\"v0.85\" />\n                ]]>\n              </code>\n              <para>So the nant module tagged with revision 0_85 will be checked \n              out in the folder v0.85 under the working/ destination directory.\n              <br/>This could be used to work on different \n              branches of a repository at the same time.</para>\n            </example>\n            <example>\n              <para>\n              Checkout NAnt with specified revision date to the \n              folder <c>c:\\src\\nant\\2003_08_16</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <cvs-checkout \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                module=\"nant\"\n                date=\"2003/08/16\"\n                overridedir=\"2003_08_16\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.CheckoutTask.CvsCommandName\">\n            <summary>\n            The command being executed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.CheckoutTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.CheckoutTask\"/> class.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.Revision\">\n            <summary>\n            Specify the revision to checkout.  This corresponds to the \"sticky-tag\"\n            of the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.StickyTag\">\n            <summary>\n            Sticky tag or revision to checkout.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.Date\">\n            <summary>\n            Specify the revision date to checkout.  The date specified is validated\n            and then passed to the cvs binary in a standard format recognized by\n            cvs.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.OverrideDir\">\n            <summary>\n            Specify a directory name to replace the module name.  Valid names\n            include any valid filename, excluding path information.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.OverrideDirectory\">\n            <summary>\n            Specify a directory name to replace the module name.  Valid names\n            include any valid filename, excluding path information.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CheckoutTask.CommandName\">\n            <summary>\n            The name of the cvs command that is going to be executed.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.CvsPass\">\n            <summary>\n            Executes the cvs login command which appends or updates an entry to the\n            specified .cvspass file.\n            </summary>\n            <example>\n              <para>Update .cvspass file to include the NAnt anonymous login.</para>\n              <code>\n                <![CDATA[\n            <cvs-pass cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                 password=\"anonymous\"\n                 passfile=\"C:\\.cvspass\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.CvsPass.Initialize\">\n            <summary>\n            Ensures all information is available to execute the <see cref=\"T:NAnt.Core.Task\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.CvsPass.ExecuteTask\">\n            <summary>\n            Update the .cvspass file with the given password.  If the passfile\n            is not specified then the default search locations are used:\n            <list type=\"list\">\n                <item>CVS_PASSFILE/.cvspass</item>\n                <item>HOME/.cvspass</item>\n                <item>USERPROFILE/.cvspass  TODO: Confirm that this is valid\n                    behavior or if it is going to give problems with the\n                    cvsnt implementation.</item>\n            </list>\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsPass.Password\">\n            <summary>\n            Password to append or update to the .cvspass file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsPass.PassFile\">\n            <summary>\n            The full path to the .cvspass file.  The default is ~/.cvspass.\n            </summary>\n            <value></value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsPass.DestinationDirectory\">\n            <summary>\n            The current working directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsPass.Root\">\n            <summary>\n            The repository root string.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.CvsTask\">\n            <summary>\n            Executes the cvs command specified by the command attribute.\n            </summary>\n            <example>\n              <para>Checkout NAnt.</para>\n              <code>\n                <![CDATA[\n            <cvs command=\"checkout\" \n                 destination=\"c:\\src\\nant\\\" \n                 cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                 module=\"nant\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsTask.CommandName\">\n            <summary>\n            The cvs command to execute.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.CvsTask.IsModuleNeeded\">\n            <summary>\n            Specify if the module is needed for this cvs command.  \n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.ExportTask\">\n            <summary>\n            Exports a cvs module in preperation for a release (i.e. the CVS version\n            folders are not exported).\n            </summary>\n            <example>\n              <para>Export the most recent NAnt sources from cvs.</para>\n              <code>\n                <![CDATA[\n            <cvs-export \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\"  \n                module=\"nant\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Export NAnt revision named <c>your_favorite_revision_here</c> to the \n              folder <c>c:\\src\\nant\\replacement_for_module_directory_name</c>.\n              \n              <warn>**NOTE**</warn>: filesets names for the export task must be \n              prefixed with the module name.  This is different than other tasks.\n              </para>\n              <code>\n                <![CDATA[\n            <cvs-export \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                module=\"nant\"\n                revision=\"your_favorite_revision_here\"\n                overridedir=\"replacement_for_module_directory_name\"\n                recursive=\"false\">\n                <fileset>\n                    <include name=\"nant/bin/NAnt.exe\"/>\n                    <include name=\"nant/bin/NAnt.exe.config\"/>\n                </fileset>\n            </cvs-export>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.ExportTask.CvsCommandName\">\n            <summary>\n            The command being executed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.ExportTask.#ctor\">\n            <summary>\n            Create a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.ExportTask\"/>.\n            </summary>\n            <value>\n            The following values are set by default:\n                <ul>\n                    <li>Recursive: <see langword=\"true\"/></li>\n                </ul>\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.NoShortening\">\n            <summary>\n            No shortening.  Do not shorten module paths if -d specified.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.ForceHead\">\n            <summary>\n            Indicates whether the head revision should be used if the revison specified by\n            <see cref=\"P:NAnt.SourceControl.Tasks.ExportTask.Revision\"/> or the <see cref=\"P:NAnt.SourceControl.Tasks.ExportTask.Date\"/> tags are not\n            found. The default is <see langword=\"false\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.Recursive\">\n            <summary>\n            If a directory is specified indicates whether sub-directories should\n            also be processed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the sub-directories should be tagged;\n            otherwise, <see langword=\"false\" />.  The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.Revision\">\n            <summary>\n            Specify the revision to update the file to.  This corresponds to the \"sticky-tag\"\n            of the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.Date\">\n            <summary>\n            Specify the revision date to update to.  The version of the file that\n            existed at the date specified is retrieved.\n            </summary>\n            <value>\n            A valid date time value, which is then converted to a format that\n            cvs can parse.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.OverrideDir\">\n            <summary>\n            Specify a directory name to replace the module name.  Valid names\n                include any valid filename, excluding path information.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.ExportTask.CommandName\">\n            <summary>\n            The export command name for the cvs client.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.RTagTask\">\n            <summary>\n            Tags all sources in the remote repository with a given tag.\n            </summary>\n            <remarks>\n            <para>\n            Unlike tag, the rtag command acts only on sources that are in the repository.  \n            Any modified sources on the local file system will NOT be tagged with this\n            command, so a commit should be performed before an rtag is done.\n            </para>\n            <para>\n            NOTE: Although a working directory is not necessary to perform the command \n            one must be specified in order to remain in compliance with the cvs library.\n            </para>\n            </remarks>\n            <example>\n              <para>Tag NAnt sources remotely.</para>\n              <code>\n                <![CDATA[\n            <cvs-rtag \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                destination=\".\"\n                tag=\"v0_8_4\"\n                 />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Remove a tag from the remote repository.</para>\n              <code>\n                <![CDATA[\n            <cvs-rtag \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                destination=\".\"\n                tag=\"v0_8_4\"\n                remove=\"true\"\n                 />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.RTagTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.RTagTask\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.RTagTask.AppendSubCommandArgs\">\n            <summary>\n            Append the tag information to the commandline.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.Tag\">\n            <summary>\n            The name of the tag to assign or remove.\n            </summary>\n            <value>\n            The name of the tag to assign or remove.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.Remove\">\n            <summary>\n            Indicates whether the tag specified in <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.Tag\"/> should\n            be removed or not. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be removed; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.MoveIfExists\">\n            <summary>\n            Indicates whether the tag specified in <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.Tag\"/> should\n            be moved to the current file revision.  If the tag does not exist\n            then it is created. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.Recursive\">\n            <summary>\n            If a directory is specified indicates whether sub-directories should\n            also be processed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the sub-directories should be tagged;\n            otherwise, <see langword=\"false\" />.  The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.ActOnTag\">\n            <summary>\n            Indicates the repository <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.Tag\"/> that is acted on\n            for the tag command.  Note if <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.MoveIfExists\"/> is \n            <see langword=\"true\"/> then the tag specified is moved to the revision\n            of the file on the HEAD of the branch specified.\n            </summary>\n            <value>\n            The tag (or more likely) branch that should be used to apply the new tag.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.ActOnDate\">\n            <summary>\n            Indicates the revision date of the file that the tag should be \n            applied to.\n            </summary>\n            <value>\n            A valid date which specifies the revision point that the tag will\n            be applied to.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.ForceHead\">\n            <summary>\n            Indicates whether the head revision should be used if the \n            <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.ActOnTag\"/> or the <see cref=\"P:NAnt.SourceControl.Tasks.RTagTask.ActOnDate\"/> tags are not\n            found. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.RTagTask.CommandName\">\n            <summary>\n            The name of the cvs command that is going to be executed.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.TagTask\">\n            <summary>\n            Tags all local sources with the specified tag.  \n            </summary>\n            <remarks>\n            <para>\n            This differs from the\n            <see cref=\"T:NAnt.SourceControl.Tasks.RTagTask\"/> in that it acts on references to the cvs files\n            contained in your local filesystem.  As such the sticky tags and local\n            revisions can be considered in commits.  It also allows you to verify that\n            all local files have been checked in before a tag is performed.    \n            </para>\n            </remarks>\n            <example>\n              <para>Tag NAnt sources remotely.</para>\n              <code>\n                <![CDATA[\n            <cvs-tag \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                destination=\".\"\n                tag=\"v0_8_4\"\n                 />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>Remove a tag from the remote repository.</para>\n              <code>\n                <![CDATA[\n            <cvs-tag \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                destination=\".\"\n                tag=\"v0_8_4\"\n                remove=\"true\"\n                fail-if-modified=\"true\"\n                 />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.TagTask.CvsCommandName\">\n            <summary>\n            Cvs command to be executed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.TagTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.TagTask\"/> \n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.TagTask.AppendSubCommandArgs\">\n            <summary>\n            Append the tag information to the commandline.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.Tag\">\n            <summary>\n            The name of the tag to assign or remove.\n            </summary>\n            <value>\n            The name of the tag to assign or remove.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.Remove\">\n            <summary>\n            Indicates whether the tag specified in <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.Tag\"/> should\n            be removed or not. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be removed; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.MoveIfExists\">\n            <summary>\n            Indicates whether the tag specified in <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.Tag\"/> should\n            be moved to the current file revision.  If the tag does not exist\n            then it is created. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.Recursive\">\n            <summary>\n            If a directory is specified indicates whether sub-directories should\n            also be processed.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the sub-directories should be tagged;\n            otherwise, <see langword=\"false\" />.  The default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnTag\">\n            <summary>\n            Indicates the repository <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.Tag\"/> that is acted on\n            for the tag command.  Note if <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.MoveIfExists\"/> is \n            <see langword=\"true\"/> then the tag specified is moved to the revision\n            of the file on the HEAD of the branch specified.\n            </summary>\n            <value>\n            The tag (or more likely) branch that should be used to apply the new tag.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnDate\">\n            <summary>\n            Indicates the revision date of the file that the tag should be \n            applied to.\n            </summary>\n            <value>\n            A valid date which specifies the revision point that the tag will\n            be applied to.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.ForceHead\">\n            <summary>\n            Indicates whether the head revision should be used if the revision specified by\n            <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnTag\"/> or the <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnDate\"/> tags are not\n            found. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.FailIfModified\">\n            <summary>\n            Indicates whether the head revision should be used if the \n            <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnTag\"/> or the <see cref=\"P:NAnt.SourceControl.Tasks.TagTask.ActOnDate\"/> tags are not\n            found. \n            </summary>\n            <value>\n            <see langword=\"true\"/> if the specified tag should be moved; \n            otherwise, <see langword=\"false\"/>.  The default is <see langword=\"false\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.CommandName\">\n            <summary>\n            The name of the cvs command that is going to be executed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.Module\">\n            <summary>\n            Not used\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.TagTask.IsModuleNeeded\">\n            <summary>\n            Specify if the module is needed for this cvs command.  It is\n            only needed if there is no module information on the local file\n            system.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Tasks.UpdateTask\">\n            <summary>\n            Updates a CVS module in a local working directory.\n            </summary>\n            <example>\n              <para>Update nant.</para>\n              <code>\n                <![CDATA[\n            <cvs-update \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                password=\"\" \n                module=\"nant\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Update your NAnt revision named <c>your_favorite_revision_here</c> in \n              the folder <c>c:\\src\\nant\\replacement_for_module_directory_name</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <cvs-update \n                destination=\"c:\\src\\nant\\\" \n                cvsroot=\":pserver:anonymous@cvs.sourceforge.net:/cvsroot/nant\" \n                module=\"nant\"\n                revision=\"your_favorite_revision_here\"\n                overridedir=\"replacement_for_module_directory_name\"\n                usesharpcvslib=\"false\">\n                <fileset>\n                    <include name=\"build.number\"/>\n                </fileset>\n            </cvs-update>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"F:NAnt.SourceControl.Tasks.UpdateTask.CvsCommandName\">\n            <summary>\n            The command being executed.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Tasks.UpdateTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.SourceControl.Tasks.UpdateTask\"/> \n            class.\n            </summary>\n            <remarks>\n            Sets the build directory and prune empty directory properties to\n            <see langword=\"true\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.BuildDirs\">\n            <summary>\n            If <see langword=\"true\" />. new directories will be created on the local\n            sandbox. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.PruneEmpty\">\n            <summary>\n            If <see langword=\"true\" /> empty directories copied down from the \n            remote repository will be removed from the local sandbox.\n            The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.OverwriteLocal\">\n            <summary>\n            If <see langword=\"true\" /> the local copy of the file will be \n            overwritten with the copy from the remote repository. The default\n            is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.Recursive\">\n            <summary>\n            Specifies if the command should be executed recursively. The \n            default is <see langword=\"true\" />.\n            </summary>\n            <remarks>\n            The <c>-R</c> option is on by default in cvs.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.Revision\">\n            <summary>\n            Specify the revision to update the file to.  This corresponds to the \n            \"sticky-tag\" of the file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.StickyTag\">\n            <summary>\n            Sticky tag or revision to update the local file to.\n            </summary>\n            <value>\n            A valid cvs tag.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.Date\">\n            <summary>\n            Specify the revision date to update to.  The version of the file that\n            existed at the date specified is retrieved.\n            </summary>\n            <value>\n            A valid date time value, which is then converted to a format that\n            cvs can parse.\n            </value>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.IsModuleNeeded\">\n            <summary>\n            Specify if the module is needed for this cvs command.  It is\n            only needed if there is no module information on the local file\n            system.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Tasks.UpdateTask.CommandName\">\n            <summary>\n            The name of the cvs command that is going to be executed.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.SourceControl.Types.CvsFileSet\">\n            <summary>\n            A <see cref=\"T:NAnt.SourceControl.Types.CvsFileSet\"/> is a <see cref=\"T:NAnt.Core.Types.FileSet\"/> with extra \n            attributes useful in the context of the <see cref=\"T:NAnt.SourceControl.Tasks.CvsTask\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.SourceControl.Types.CvsFileSet.Initialize\">\n            <summary>\n            Initialize the <see cref=\"T:NAnt.SourceControl.Types.CvsFileSet\"/> object and locate the .cvsignore\n            files to add to the exclude list.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.SourceControl.Types.CvsFileSet.UseCvsIgnore\">\n            <summary>\n            Indicates whether the entires in the .cvsignore should be used to limit the \n            file list; <see langword=\"true\"/> to exclude files in .cvsignore, otherwise\n            <see langword=\"false\"/>.  The default is <see langword=\"true\"/>.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.VSNetTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.VSNetTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.VSNet.Everett.Solution\">\n            <summary>\n            Analyses Microsoft Visual Studio .NET 2003 (Everett) solution files.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.GetProjectFileFromGuid(System.String)\">\n            <summary>\n            Gets the project file of the project with the given unique identifier.\n            </summary>\n            <param name=\"projectGuid\">The unique identifier of the project for which the project file should be retrieves.</param>\n            <returns>\n            The project file of the project with the given unique identifier.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">No project with unique identifier <paramref name=\"projectGuid\"/> could be located.</exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to be logged.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.LoadProjects(NAnt.Core.Util.GacCache,NAnt.VSNet.ReferencesResolver,System.Collections.Hashtable)\">\n            <summary>\n            Loads the projects from the file system and stores them in an \n            instance variable.\n            </summary>\n            <param name=\"gacCache\"><see cref=\"T:NAnt.Core.Util.GacCache\"/> instance to use to determine whether an assembly is located in the Global Assembly Cache.</param>\n            <param name=\"refResolver\"><see cref=\"T:NAnt.VSNet.ReferencesResolver\"/> instance to use to determine location and references of assemblies.</param>\n            <param name=\"explicitProjectDependencies\">TODO</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">A project GUID in the solution file does not match the actual GUID of the project in the project file.</exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.TranslateProjectPath(System.String,System.String)\">\n            <summary>\n            Translates a project path, in the form of a relative file path or\n            a URL, to an absolute file path.\n            </summary>\n            <param name=\"solutionDir\">The directory of the solution.</param>\n            <param name=\"projectPath\">The project path to translate to an absolute file path.</param>\n            <returns>\n            The project path translated to an absolute file path.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.FixProjectReferences(NAnt.VSNet.ProjectBase,NAnt.VSNet.Configuration,System.Collections.Hashtable,System.Collections.Hashtable)\">\n            <summary>\n            Converts assembly references to projects to project references, adding\n            a build dependency.c\n            </summary>\n            <param name=\"project\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to analyze.</param>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"builtProjects\"><see cref=\"T:System.Collections.Hashtable\"/> containing list of projects that have been built.</param>\n            <param name=\"failedProjects\"><see cref=\"T:System.Collections.Hashtable\"/> containing list of projects that failed to build.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionBase.HasDirtyProjectDependency(NAnt.VSNet.ProjectBase,System.Collections.Hashtable)\">\n            <summary>\n            Determines whether any of the project dependencies of the specified\n            project still needs to be built.\n            </summary>\n            <param name=\"project\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to analyze.</param>\n            <param name=\"builtProjects\"><see cref=\"T:System.Collections.Hashtable\"/> containing list of projects that have been built.</param>\n            <returns>\n            <see langword=\"true\"/> if one of the project dependencies has not\n            yet been built; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Extensibility.IProjectBuildProvider.IsSupported(System.String,System.Xml.XmlElement)\">\n            <summary>\n            Returns a number representing how much this file fits this project type.\n            </summary>\n            <param name=\"projectExt\"></param>\n            <param name=\"xmlDefinition\"></param>\n            <returns></returns>\n            <remarks>\n            This enables the override in other providers. Do not return big numbers, mainly when compring only on filename.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.Rainier.Solution\">\n            <summary>\n            Analyses Microsoft Visual Studio .NET 2002 (Rainier) solution files.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.Tasks.SolutionTask\">\n            <summary>\n            Compiles VS.NET solutions (or sets of projects), automatically determining \n            project dependencies from inter-project references.\n            </summary>\n            <remarks>\n            <para>\n            This task support the following projects:\n            </para>\n            <list type=\"bullet\">\n                <item>\n                    <description>Visual Basic .NET</description>\n                </item>\n                <item>\n                    <description>Visual C# .NET</description>\n                </item>\n                <item>\n                    <description>Visual J# .NET</description>\n                </item>\n                <item>\n                    <description>Visual C++ .NET</description>\n                </item>\n            </list>\n            <note>\n            Right now, only Microsoft Visual Studio .NET 2002 and 2003 solutions\n            and projects are supported.  Support for .NET Compact Framework projects\n            is also not available at this time.\n            </note>\n            <para>\n            The <see cref=\"T:NAnt.VSNet.Tasks.SolutionTask\"/> also supports the model of referencing \n            projects by their output filenames, rather than referencing them inside \n            the solution.  It will automatically detect the existance of a file \n            reference and convert it to a project reference.  For example, if project\n            \"A\" references the file in the release output directory of \n            project \"B\", the <see cref=\"T:NAnt.VSNet.Tasks.SolutionTask\"/> will automatically \n            convert this to a project dependency on project \"B\" and will \n            reference the appropriate configuration output directory at the final \n            build time (ie: reference the debug version of \"B\" if the \n            solution is built as debug).\n            </para>\n            <note>\n            The <see cref=\"T:NAnt.VSNet.Tasks.SolutionTask\"/>  expects all project files to be valid\n            XML files.\n            </note>\n            <h3>Resx Files</h3>\n            <para>\n            When building a project for a down-level target framework, special care\n            should be given to resx files. Resx files (can) contain references to \n            a specific version of CLR types, and as such are only upward compatible.\n            </para>\n            <para>\n            For example: if you want to be able to build a project both as a .NET 1.0 \n            and .NET 1.1 assembly, the resx files should only contain references to \n            .NET 1.0 CLR types. Failure to do this may result in a <see cref=\"T:System.InvalidCastException\"/>\n            failure at runtime on machines with only the .NET Framework 1.0 installed.\n            </para>\n            </remarks>\n            <example>\n              <para>\n              Compiles all of the projects in <c>test.sln</c>, in release mode, in \n              the proper order.\n              </para>\n              <code>\n                <![CDATA[\n            <solution configuration=\"release\" solutionfile=\"test.sln\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compiles all of the projects in <c>projects.txt</c>, in the proper \n              order.\n              </para>\n              <code>\n                <![CDATA[\n            <solution configuration=\"release\">\n                <projects>\n                    <includesfile name=\"projects.txt\" />\n               </projects>\n            </solution>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compiles projects A, B and C, using the output of project X as a \n              reference.\n              </para>\n              <code>\n                <![CDATA[\n            <solution configuration=\"release\">\n                <projects>\n                    <include name=\"A\\A.csproj\" />\n                    <include name=\"B\\b.vbproj\" />\n                    <include name=\"C\\c.csproj\" />\n                </projects>\n                <referenceprojects>\n                    <include name=\"X\\x.csproj\" />\n                </referenceprojects>\n            </solution>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compiles all of the projects in the solution except for project A.\n              </para>\n              <code>\n                <![CDATA[\n            <solution solutionfile=\"test.sln\" configuration=\"release\">\n                <excludeprojects>\n                    <include name=\"A\\A.csproj\" />\n                </excludeprojects>\n            </solution>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compiles all of the projects in the solution mapping the specific project at\n              http://localhost/A/A.csproj to c:\\inetpub\\wwwroot\\A\\A.csproj and any URLs under\n              http://localhost/B/[remainder] to c:\\other\\B\\[remainder].  This allows the build \n              to work without WebDAV.\n              </para>\n              <code>\n                <![CDATA[\n            <solution solutionfile=\"test.sln\" configuration=\"release\">\n                <webmap>\n                    <map url=\"http://localhost/A/A.csproj\" path=\"c:\\inetpub\\wwwroot\\A\\A.csproj\" />\n                    <map url=\"http://localhost/B\" path=\"c:\\other\\B\" />\n                </webmap>\n            </solution>\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compiles all of the projects in the solution placing compiled outputs \n              in <c>c:\\temp</c>.</para>\n              <code>\n                <![CDATA[\n            <solution solutionfile=\"test.sln\" configuration=\"release\" outputdir=\"c:\\temp\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VSNet.Tasks.SolutionTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.Tasks.SolutionTask\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Tasks.SolutionTask.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro or <see langword=\"null\"/> if the macro is not\n            supported.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">The macro cannot be expanded.</exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.Tasks.SolutionTask.BuildAssemblyFolders\">\n            <summary>\n            Builds the list of folders that should be scanned for assembly \n            references.\n            </summary>\n            <returns>\n            The list of folders that should be scanned for assembly references.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.Projects\">\n            <summary>\n            The projects to build.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.ReferenceProjects\">\n            <summary>\n            The projects to scan, but not build.\n            </summary>\n            <remarks>\n            These projects are used to resolve project references and are \n            generally external to the solution being built. References to \n            these project's output files are converted to use the appropriate \n            solution configuration at build time.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.SolutionFile\">\n            <summary>\n            The name of the VS.NET solution file to build.\n            </summary>\n            <remarks>\n            <para>\n            The <see cref=\"P:NAnt.VSNet.Tasks.SolutionTask.Projects\"/> can be used instead to supply a list \n            of Visual Studio.NET projects that should be built.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.Configuration\">\n            <summary>\n            The name of the solution configuration to build.\n            </summary>\n            <remarks>\n            <para>\n            Generally <c>release</c> or <c>debug</c>.  Not case-sensitive.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.Platform\">\n            <summary>\n            The name of platform to build the solution for.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.SolutionConfig\">\n            <summary>\n            Gets the solution configuration to build.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.OutputDir\">\n            <summary>\n            The directory where compiled targets will be placed.  This\n            overrides path settings contained in the solution/project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.WebMaps\">\n            <summary>\n            WebMap of URL's to project references.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.ExcludeProjects\">\n            <summary>\n            Fileset of projects to exclude.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.AssemblyFolders\">\n            <summary>\n            Set of folders where references are searched when not found in path \n            from project file (HintPath).\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.IncludeVSFolders\">\n            <summary>\n            Includes Visual Studio search folders in reference search path.\n            The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.EnableWebDav\">\n            <summary>\n            Allow the task to use WebDAV for retrieving/compiling the projects within solution.  Use of \n            <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> is preferred over WebDAV.  The default is <see langword=\"false\"/>.\n            </summary>\n            <remarks>\n                <para>WebDAV support requires permission changes to be made on your project server.  These changes may affect          \n                the security of the server and should not be applied to a public installation.</para>\n                <para>Consult your web server or the NAnt Wiki documentation for more information.</para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Tasks.SolutionTask.AssemblyFolderList\">\n            <summary>\n            Gets the list of folders to scan for assembly references.\n            </summary>\n            <value>\n            The list of folders to scan for assembly references.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.UseOfATL\">\n            <summary>\n            Defines how the project is using the ATL library.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfATL.NotUsing\">\n            <summary>\n            Don't use ATL.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfATL.Static\">\n            <summary>\n            Use ATL in a Static Library.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfATL.Shared\">\n            <summary>\n            Use ATL in a Shared DLL.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.UseOfMFC\">\n            <summary>\n            Defines how the project is using the MFC library.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfMFC.NotUsing\">\n            <summary>\n            Don't use MFC.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfMFC.Static\">\n            <summary>\n            Use MFC in a Static Library.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UseOfMFC.Shared\">\n            <summary>\n            Use MFC in a Shared DLL.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.UsePrecompiledHeader\">\n            <summary>\n            Indicates the possible ways in which precompiled header file use is \n            specified in a Visual C++ project.\n            </summary>\n            <remarks>\n            The integer values assigned match those specified in the Visual C++ \n            project file for each setting.\n            </remarks>>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UsePrecompiledHeader.Unspecified\">\n            <summary>\n            Precompiled header file use not specified.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UsePrecompiledHeader.No\">\n            <summary>\n            Don't use a precompiled header file.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yc.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UsePrecompiledHeader.Create\">\n            <summary>\n            Create precompiled header file.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yc.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UsePrecompiledHeader.AutoCreate\">\n            <summary>\n            Automatically create precompiled header file if necessary.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yc.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.Types.UsePrecompiledHeader.Use\">\n            <summary>\n            Use a precompiled header file.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yu.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.WebMap\">\n            <summary>\n            Represents a single mapping from URL project path to physical project \n            path.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMap.Url\">\n            <summary>\n            Specifies the URL of the project file, or a URL fragment to match.\n            </summary>\n            <value>\n            The URL of the project file or the URL fragment to match.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMap.Path\">\n            <summary>\n            Specifies the actual path to the project file, or the path fragment \n            to replace.\n            </summary>\n            <value>\n            The actual path to the project file or the path fragment to replace \n            the URL fragment with.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMap.CaseSensitive\">\n            <summary>\n            Specifies whether the mapping is case-sensitive or not.\n            </summary>\n            <value>\n            A boolean flag representing the case-sensitivity of the mapping.  Default is <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMap.IfDefined\">\n            <summary>\n            Indicates if the URL of the project file should be mapped.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the URL of the project file should be \n            mapped; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMap.UnlessDefined\">\n            <summary>\n            Indicates if the URL of the project file should not be mapped.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the URL of the project file should not \n            be mapped; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.WebMapCollection\">\n            <summary>\n            Contains a strongly typed collection of <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> \n            objects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.#ctor(NAnt.VSNet.Types.WebMapCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.#ctor(NAnt.VSNet.Types.WebMap[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.FindBestMatch(System.String)\">\n            <summary>\n            Find the best matching <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> for the given Uri.\n            </summary>\n            <param name=\"uri\">The value to match against the <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> objects in the collection.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.Add(NAnt.VSNet.Types.WebMap)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.AddRange(NAnt.VSNet.Types.WebMap[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.AddRange(NAnt.VSNet.Types.WebMapCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.Contains(NAnt.VSNet.Types.WebMap)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> with the specified\n            value is in the collection.\n            </summary>\n            <param name=\"value\">The argument value to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> with value \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.CopyTo(NAnt.VSNet.Types.WebMap[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.IndexOf(NAnt.VSNet.Types.WebMap)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.VSNet.Types.WebMap\"/>. If the <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.Insert(System.Int32,NAnt.VSNet.Types.WebMap)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.VSNet.Types.WebMapEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapCollection.Remove(NAnt.VSNet.Types.WebMap)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMapCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMapCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> with the specified value.\n            </summary>\n            <param name=\"value\">The value of the <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> to get.</param>\n        </member>\n        <member name=\"T:NAnt.VSNet.Types.WebMapEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.VSNet.Types.WebMap\"/> elements of a <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapEnumerator.#ctor(NAnt.VSNet.Types.WebMapCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.Types.WebMapEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.Types.WebMapCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Types.WebMapEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Types.WebMapEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.GetPrimaryOutputFile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the output path of the reference, without taking the \"copy local\"\n            setting into consideration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The full output path of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files of the reference for the \n            specified configuration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.GetAssemblyReferences(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the complete set of assemblies that need to be referenced when\n            a project references this component.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The complete set of assemblies that need to be referenced when a \n            project references this component.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.GetTimestamp(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the timestamp of the reference.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The timestamp of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether the reference is managed for the\n            specified configuration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            <see langword=\"true\" /> if the reference is managed for the\n            specified configuration; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.GetFileTimestamp(System.String)\">\n            <summary>\n            Returns the date and time the specified file was last written to.\n            </summary>\n            <param name=\"fileName\">The file for which to obtain write date and time information.</param>\n            <returns>\n            A <see cref=\"T:System.DateTime\"/> structure set to the date and time that \n            the specified file was last written to, or \n            <see cref=\"F:System.DateTime.MaxValue\"/> if the specified file does not\n            exist.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to be logged.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferenceBase.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ReferenceBase.CopyLocal\">\n            <summary>\n            Gets a value indicating whether the output file(s) of this reference \n            should be copied locally.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output file(s) of this reference \n            should be copied locally; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ReferenceBase.IsSystem\">\n            <summary>\n            Gets a value indicating whether this reference represents a system \n            assembly.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if this reference represents a system \n            assembly; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ReferenceBase.Parent\">\n            <summary>\n            Gets the project in which the reference is defined.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.FileReferenceBase.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether the reference is managed for the\n            specified configuration.\n            </summary>\n            <param name=\"config\">The build configuration of the reference.</param>\n            <returns>\n            <see langword=\"true\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.FileReferenceBase.GetAssemblyOutputFiles(System.String,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the specified assembly \n            and adds them to <paremref name=\"outputFiles\"/> collection.\n            </summary>\n            <param name=\"assemblyFile\">The path of the assembly to get the output files for.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.GetPrimaryOutputFile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the path of the reference, without taking the \"copy local\"\n            setting into consideration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The output path of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the referenced project.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.GetAssemblyReferences(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the complete set of assemblies that need to be referenced when\n            a project references this component.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The complete set of assemblies that need to be referenced when a \n            project references this component.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.GetTimestamp(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the timestamp of the reference.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The timestamp of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.ResolveAssemblyReference\">\n            <summary>\n            Resolves an assembly reference.\n            </summary>\n            <returns>\n            The full path to the resolved assembly, or <see langword=\"null\" />\n            if the assembly reference could not be resolved.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.ResolveFromFolderList(System.Collections.Specialized.StringCollection,System.String)\">\n            <summary>\n            Searches for the given file in all paths in <paramref name=\"folderList\" />.\n            </summary>\n            <param name=\"folderList\">The folders to search.</param>\n            <param name=\"fileName\">The file to search for.</param>\n            <returns>\n            The path of the assembly if <paramref name=\"fileName\" /> was found\n            in <paramref name=\"folderList\" />; otherwise, <see langword=\"null\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.ResolveFromFramework(System.String)\">\n            <summary>\n            Resolves an assembly reference in the framework assembly directory\n            of the target framework.\n            </summary>\n            <param name=\"fileName\">The file to search for.</param>\n            <returns>\n            The full path of the assembly file if the assembly could be located \n            in the framework assembly directory; otherwise, <see langword=\"null\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.AssemblyReferenceBase.ResolveFromRelativePath(System.String)\">\n            <summary>\n            Resolves an assembly reference using a path relative to the project \n            directory.\n            </summary>\n            <returns>\n            The full path of the assembly, or <see langword=\"null\"/> if \n            <paramref name=\"relativePath\"/> is <see langword=\"null\"/> or an\n            empty <see cref=\"T:System.String\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.AssemblyReferenceBase.CopyLocal\">\n            <summary>\n            Gets a value indicating whether the output file(s) of this reference \n            should be copied locally.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output file(s) of this reference \n            should be copied locally; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.AssemblyReferenceBase.IsSystem\">\n            <summary>\n            Gets a value indicating whether this reference represents a system \n            assembly.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if this reference represents a system \n            assembly; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectBase\">\n            <summary>\n            Base class for all project classes.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.#ctor(System.Xml.XmlElement,NAnt.VSNet.Tasks.SolutionTask,System.CodeDom.Compiler.TempFileCollection,NAnt.Core.Util.GacCache,NAnt.VSNet.ReferencesResolver,System.IO.DirectoryInfo)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the project configuration\n            matching the specified solution configuration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n              <para>\n              The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n              full path of the output file and the value is the path relative to\n              the output directory.\n              </para>\n              <para>\n              If the project is not configured to be built for the specified\n              solution configuration, then no output files are added.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether building the project for the specified\n            build configuration results in managed output.\n            </summary>\n            <param name=\"configuration\">The build configuration.</param>\n            <returns>\n            <see langword=\"true\" /> if the project output for the given build\n            configuration is managed; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro or <see langword=\"null\" /> if the macro is not\n            supported.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.DetermineProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.VerifyProjectXml(System.Xml.XmlElement)\">\n            <summary>\n            Verifies whether the specified XML fragment represents a valid project\n            that is supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The XML fragment is not supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.</para>\n              <para>-or-</para>\n              <para>The XML fragment does not represent a valid project (for this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.Prepare(NAnt.VSNet.Configuration)\">\n            <summary>\n            Prepares the project for being built.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <remarks>\n            The default implementation will ensure that none of the output files \n            are marked read-only.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.CopyFile(System.IO.FileInfo,System.IO.FileInfo,NAnt.Core.Task)\">\n            <summary>\n            Copies the specified file if the destination file does not exist, or\n            the source file has been modified since it was previously copied.\n            </summary>\n            <param name=\"srcFile\">The file to copy.</param>\n            <param name=\"destFile\">The destination file.</param>\n            <param name=\"parent\">The <see cref=\"T:NAnt.Core.Task\"/> in which context the operation will be performed.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.Log(NAnt.Core.Level,System.String)\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to be logged.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBase.Log(NAnt.Core.Level,System.String,System.Object[])\">\n            <summary>\n            Logs a message with the given priority.\n            </summary>\n            <param name=\"messageLevel\">The message priority at which the specified message is to be logged.</param>\n            <param name=\"message\">The message to log, containing zero or more format items.</param>\n            <param name=\"args\">An <see cref=\"T:System.Object\"/> array containing zero or more objects to format.</param>\n            <remarks>\n            The actual logging is delegated to the underlying task.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProductVersion\">\n            <summary>\n            Gets the Visual Studio product version of the project.\n            </summary>\n            <value>\n            The Visual Studio product version of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.Name\">\n            <summary>\n            Gets the name of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.Type\">\n            <summary>\n            Gets the type of the project.\n            </summary>\n            <value>\n            The type of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProjectPath\">\n            <summary>\n            Gets the path of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProjectDirectory\">\n            <summary>\n            Gets the directory containing the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProjectLocation\">\n            <summary>\n            Get the location of the project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ObjectDir\">\n            <summary>\n            Get the directory in which intermediate build output that is not \n            specific to the build configuration will be stored.\n            </summary>\n            <remarks>\n              <para>\n              For <see cref=\"F:NAnt.VSNet.ProjectLocation.Local\"/> projects, this is defined\n              as <c>&lt;Project Directory&lt;\\obj</c>.\n              </para>\n              <para>\n              For <see cref=\"F:NAnt.VSNet.ProjectLocation.Web\"/> projects, this is defined\n              as <c>%HOMEPATH%\\VSWebCache\\&lt;Machine Name&gt;\\&lt;Project Directory&gt;\\obj</c>.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.Guid\">\n            <summary>\n            Gets or sets the unique identifier of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProjectConfigurations\">\n            <summary>\n            Gets a list of all configurations defined in the project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.BuildConfigurations\">\n            <summary>\n            Gets a list of project configurations that can be build.\n            </summary>\n            <remarks>\n            <para>\n            Project configurations that are not in this list do not need to be\n            compiled.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ExtraOutputFiles\">\n            <summary>\n            Gets the extra set of output files for the project.\n            </summary>\n            <value>\n            The extra set of output files for the project.\n            </value>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProjectDependencies\">\n            <summary>\n            Gets the set of projects that the project depends on.\n            </summary>\n            <value>\n            The set of projects that the project depends on.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBase.ProductVersionNumber\">\n            <summary>\n            TODO: refactor this !!!\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether building the project for the specified\n            build configuration results in managed output.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            <see langword=\"true\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.Prepare(NAnt.VSNet.Configuration)\">\n            <summary>\n            Prepares the project for being built.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <remarks>\n            Ensures the configuration-level object directory exists and ensures \n            that none of the output files are marked read-only.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the project configuration\n            matching the specified solution configuration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n              <para>\n              The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n              full path of the output file and the value is the path relative to\n              the output directory.\n              </para>\n              <para>\n              If the project is not configured to be built for the specified\n              solution configuration, then no output files are added.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetProcessStartInfo(NAnt.VSNet.ConfigurationBase,System.String)\">\n            <summary>\n            Returns a <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler\n            for this project.\n            </summary>\n            <param name=\"config\">The configuration to build.</param>\n            <param name=\"responseFile\">The response file for the compiler.</param>\n            <returns>\n            A <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler for \n            this project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.DetermineProjectLocation(System.Xml.XmlElement)\">\n            <summary>\n            Returns the project location from the specified project XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <returns>\n            The project location of the specified project XML file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The project location could not be determined.</para>\n              <para>-or-</para>\n              <para>The project location is invalid.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetTypeLibraryPath(NAnt.VSNet.ConfigurationSettings)\">\n            <summary>\n            Gets the absolute path of the type library for the project \n            output.\n            </summary>\n            <param name=\"config\">The configuration to build.</param>\n            <returns>\n            The absolute path of the type library for the project output.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.RegisterForComInterop(NAnt.VSNet.ConfigurationSettings,NAnt.VSNet.Configuration,System.String)\">\n            <summary>\n            Generates a type library for the specified assembly, registers it.\n            </summary>\n            <param name=\"config\">The project configuration that is built.</param>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"typelibPath\">The path of the type library to generate.</param>\n            <remarks>\n            The <c>regasm</c> tool is used to generate the type library.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.UnregisterForComInterop(NAnt.VSNet.ConfigurationSettings,NAnt.VSNet.Configuration)\">\n            <summary>\n            Unregister a type library for the specified assembly, and the types\n            in that assembly.\n            </summary>\n            <param name=\"config\">The project configuration that is built.</param>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <remarks>\n            The <c>regasm</c> tool is used to unregister the type library, and\n            remove the COM registration for types in the specified assembly.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetLocalizedResources\">\n            <summary>\n            Returns <see cref=\"T:System.Collections.Hashtable\"/> containing culture-specific resources.\n            </summary>\n            <returns>\n            A <see cref=\"T:System.Collections.Hashtable\"/> containing culture-specific resources.\n            </returns>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is <see cref=\"T:System.Globalization.CultureInfo\"/>\n            and the value is an <see cref=\"T:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet\"/> instance\n            for that culture.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.CreateRegAsmTask\">\n            <summary>\n            Creates and initializes a <see cref=\"T:NAnt.Win32.Tasks.RegAsmTask\"/> instance.\n            </summary>\n            <returns>\n            An initialized <see cref=\"T:NAnt.Win32.Tasks.RegAsmTask\"/> instance.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetProductVersion(System.Xml.XmlNode)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"projectNode\">XML fragment representing the project to check.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.GetProjectLocation(System.Xml.XmlNode)\">\n            <summary>\n            Returns the <see cref=\"P:NAnt.VSNet.ManagedProjectBase.ProjectLocation\"/> of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"projectNode\">XML fragment representing the project to check.</param>\n            <returns>\n            The <see cref=\"P:NAnt.VSNet.ManagedProjectBase.ProjectLocation\"/> of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The project location could not be determined.</para>\n              <para>-or-</para>\n              <para>The project location is invalid.</para>\n            </exception>\n        </member>\n        <member name=\"F:NAnt.VSNet.ManagedProjectBase._sourceFiles\">\n            <summary>\n            Holds a case-insensitive list of source files.\n            </summary>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the full path of the \n            source file and the value is <see langword=\"null\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.FileExtension\">\n            <summary>\n            Gets the default file extension of sources for this project.\n            </summary>\n            <value>\n            The default file extension of sources for this project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.IsWebProject\">\n            <summary>\n            Gets a value indicating if this is a web project.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if this is a web project; otherwise,\n            <see langword=\"false\"/>.\n            </value>\n            <remarks>\n            If the url of a web project has been mapped to a local path\n            (using the &lt;webmap&gt; element), then this property will return\n            <see langword=\"false\"/> for a <see cref=\"F:NAnt.VSNet.ProjectLocation.Web\"/>\n            project.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.Name\">\n            <summary>\n            Gets the name of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.ProjectPath\">\n            <summary>\n            Gets the path of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.ProjectDirectory\">\n            <summary>\n            Gets the directory containing the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.ProjectLocation\">\n            <summary>\n            Get the location of the project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.Guid\">\n            <summary>\n            Gets or sets the unique identifier of the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet\">\n            <summary>\n            Groups a set of <see cref=\"T:NAnt.VSNet.Resource\"/> instances for a specific\n            culture.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.#ctor(System.Globalization.CultureInfo)\">\n            <summary>\n            Initializes a new <see cref=\"T:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet\"/> instance\n            for the specified culture.\n            </summary>\n            <param name=\"culture\">A <see cref=\"T:System.Globalization.CultureInfo\"/>.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.GetBuildDirectory(NAnt.VSNet.ConfigurationSettings)\">\n            <summary>\n            Gets the intermediate build directory in which the satellite\n            assembly is built.\n            </summary>\n            <param name=\"projectConfig\">The project build configuration.</param>\n            <returns>\n            The intermediate build directory in which the satellite assembly\n            is built.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.GetSatelliteAssemblyPath(NAnt.VSNet.ConfigurationSettings,NAnt.VSNet.ProjectSettings)\">\n            <summary>\n            Gets a <see cref=\"T:System.IO.FileInfo\"/> representing the path to the \n            intermediate file location of the satellite assembly.\n            </summary>\n            <param name=\"projectConfig\">The project build configuration.</param>\n            <param name=\"projectSettings\">The project settings.</param>\n            <returns>\n            A <see cref=\"T:System.IO.FileInfo\"/> representing the path to the \n            intermediate file location of the satellite assembly.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.GetRelativePath(NAnt.VSNet.ProjectSettings)\">\n            <summary>\n            Gets path of the satellite assembly, relative to the output\n            directory.\n            </summary>\n            <param name=\"projectSettings\">The project settings.</param>\n            <returns>\n            The path of the satellite assembly, relative to the output\n            directory.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.Culture\">\n            <summary>\n            Gets the <see cref=\"T:System.Globalization.CultureInfo\"/> of the \n            <see cref=\"T:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedProjectBase.LocalizedResourceSet.Resources\">\n            <summary>\n            Gets the set of localized resources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.CSharpProject.VerifyProjectXml(System.Xml.XmlElement)\">\n            <summary>\n            Verifies whether the specified XML fragment represents a valid project\n            that is supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The XML fragment is not supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.</para>\n              <para>-or-</para>\n              <para>The XML fragment does not represent a valid project (for this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.CSharpProject.DetermineProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">The document element of the project.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.CSharpProject.GetProcessStartInfo(NAnt.VSNet.ConfigurationBase,System.String)\">\n            <summary>\n            Returns a <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler\n            for this project.\n            </summary>\n            <param name=\"config\">The configuration to build.</param>\n            <param name=\"responseFile\">The response file for the compiler.</param>\n            <returns>\n            A <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler for \n            this project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.CSharpProject.DetermineProjectLocation(System.Xml.XmlElement)\">\n            <summary>\n            Returns the project location from the specified project XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <returns>\n            The project location of the specified project XML file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The project location could not be determined.</para>\n              <para>-or-</para>\n              <para>The project location is invalid.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.CSharpProject.IsSupported(System.Xml.XmlElement)\">\n            <summary>\n            Returns a value indicating whether the project represented by the\n            specified XML fragment is supported by <see cref=\"T:NAnt.VSNet.CSharpProject\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project to check.</param>\n            <returns>\n            <see langword=\"true\"/> if <see cref=\"T:NAnt.VSNet.CSharpProject\"/> supports \n            the specified project; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            <para>\n            A project is identified as as C# project, if the XML fragment at \n            least has the following information:\n            </para>\n            <code>\n              <![CDATA[\n            <VisualStudioProject>\n                <CSHARP\n                    ProductVersion=\"...\"\n                    ....\n                >\n                    ...\n                </CSHARP>\n            </VisualStudioProject>\n              ]]>\n            </code>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.CSharpProject.Type\">\n            <summary>\n            Gets the type of the project.\n            </summary>\n            <value>\n            The type of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.CSharpProject.FileExtension\">\n            <summary>\n            Gets the default file extension of sources for this project.\n            </summary>\n            <value>\n            For C# projects, the default file extension is &quot;.cs&quot;.\n            </value>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationBase.#ctor(NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ConfigurationBase\"/> \n            class with the given <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"project\">The project of the configuration.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationBase.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The macro is not supported.</para>\n              <para>-or-</para>\n              <para>The macro is not implemented.</para>\n              <para>-or-</para>\n              <para>The macro cannot be expanded.</para>\n            </exception>\n            <exception cref=\"T:System.NotImplementedException\">\n              <para>Expansion of a given macro is not yet implemented.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationBase.EvaluateMacro(System.Text.RegularExpressions.Match)\">\n            <summary>\n            Is called each time a regular expression match is found during a \n            <see cref=\"M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator)\"/> operation.\n            </summary>\n            <param name=\"m\">The <see cref=\"T:System.Text.RegularExpressions.Match\"/> resulting from a single regular expression match during a <see cref=\"M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator)\"/>.</param>\n            <returns>\n            The expanded <see cref=\"T:System.Text.RegularExpressions.Match\"/>.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.Project\">\n            <summary>\n            Gets the project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.Name\">\n            <summary>\n            Gets the name of the configuration.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.ObjectDir\">\n            <summary>\n            Get the directory in which intermediate build output will be stored \n            for this configuration.\n            </summary>\n            <remarks>\n            <para>\n            This is a directory relative to the project directory named \n            <c>obj\\&lt;configuration name&gt;</c>.\n            </para>\n            <para>\n            <c>.resx</c> and <c>.licx</c> files will only be recompiled if the\n            compiled resource files in the <see cref=\"P:NAnt.VSNet.ConfigurationBase.ObjectDir\"/> are not \n            uptodate.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.OutputDir\">\n            <summary>\n            Gets the output directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.OutputPath\">\n            <summary>\n            Gets the path for the output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.BuildPath\">\n            <summary>\n            Gets the path in which the output file will be created before its\n            copied to the actual output path.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.RelativeOutputDir\">\n            <summary>\n            Get the path of the output directory relative to the project\n            directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.PlatformName\">\n            <summary>\n            Gets the platform that the configuration targets.\n            </summary>\n            <value>\n            The platform targeted by the configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationBase.ExtraOutputFiles\">\n            <summary>\n            Gets the set of output files that is specific to the project\n            configuration.\n            </summary>\n            <value>\n            The set of output files that is specific to the project\n            configuration.\n            </value>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationDictionary.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ConfigurationDictionary\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationMap.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ConfigurationMap\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ConfigurationMap.#ctor(System.Int32)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ConfigurationMap\"/>\n            class with the specified initial capacity. \n            </summary>\n            <param name=\"capacity\">The appropriate number of entries that the <see cref=\"T:NAnt.VSNet.ConfigurationMap\"/> can initially contain.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationSettings.PlatformName\">\n            <summary>\n            Gets the platform that the configuration targets.\n            </summary>\n            <value>\n            The platform targeted by the configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationSettings.BuildPath\">\n            <summary>\n            Gets the path in which the output file will be created before its\n            copied to the actual output path.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ConfigurationSettings.RegisterForComInterop\">\n            <summary>\n            Gets a value indicating whether to register the project output for\n            use with COM components.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the project output should be registered\n            for use with COM components; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.GenericSolution\">\n            <summary>\n            Supports grouping of individual projects, and treating them as a solution.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.VerifyProjectXml(System.Xml.XmlElement)\">\n            <summary>\n            Verifies whether the specified XML fragment represents a valid project\n            that is supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The XML fragment is not supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.</para>\n              <para>-or-</para>\n              <para>The XML fragment does not represent a valid project (for this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.DetermineProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">The document element of the project.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.Prepare(NAnt.VSNet.Configuration)\">\n            <summary>\n            Prepares the project for being built.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <remarks>\n            Ensures the configuration-level object directory exists and ensures\n            that none of the output files are marked read-only.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.GetProcessStartInfo(NAnt.VSNet.ConfigurationBase,System.String)\">\n            <summary>\n            Returns a <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler\n            for this project.\n            </summary>\n            <param name=\"config\">The configuration to build.</param>\n            <param name=\"responseFile\">The response file for the compiler.</param>\n            <returns>\n            A <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler for\n            this project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.DetermineProjectLocation(System.Xml.XmlElement)\">\n            <summary>\n            Returns the project location from the specified project XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <returns>\n            The project location of the specified project XML file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The project location could not be determined.</para>\n              <para>-or-</para>\n              <para>The project location is invalid.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.JSharpProject.IsSupported(System.Xml.XmlElement)\">\n            <summary>\n            Returns a value indicating whether the project represented by the\n            specified XML fragment is supported by <see cref=\"T:NAnt.VSNet.JSharpProject\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project to check.</param>\n            <returns>\n            <see langword=\"true\"/> if <see cref=\"T:NAnt.VSNet.CSharpProject\"/> supports\n            the specified project; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            <para>\n            A project is identified as as J# project, if the XML fragment at\n            least has the following information:\n            </para>\n            <code>\n              <![CDATA[\n            <VisualStudioProject>\n                <JSHARP\n                    ProductVersion=\"...\"\n                    ....\n                >\n                    ...\n                </JSHARP>\n            </VisualStudioProject>\n              ]]>\n            </code>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.JSharpProject.Type\">\n            <summary>\n            Gets the type of the project.\n            </summary>\n            <value>\n            The type of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.JSharpProject.FileExtension\">\n            <summary>\n            Gets the default file extension of sources for this project.\n            </summary>\n            <value>\n            For J# projects, the default file extension is &quot;.jsl&quot;.\n            </value>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedAssemblyReference.ResolveAssemblyReference\">\n            <summary>\n            Resolves an assembly reference.\n            </summary>\n            <returns>\n            The full path to the resolved assembly, or <see langword=\"null\" />\n            if the assembly reference could not be resolved.\n            </returns>\n            <remarks>\n            <para>\n            Visual Studio .NET uses the following search mechanism :\n            </para>\n            <list type=\"number\">\n                <item>\n                    <term>\n                        The project directory.\n                    </term>\n                </item>\n                <item>\n                    <term>\n                        The directories specified in the \"ReferencePath\" property, \n                        which is stored in the .USER file.\n                    </term>\n                </item>\n                <item>\n                    <term>\n                        The .NET Framework directory (see KB306149) \n                    </term>\n                </item>\n                <item>\n                    <term>\n                        <para>\n                            The directories specified under the following registry \n                            keys:\n                        </para>\n                        <list type=\"bullet\">\n                            <item>\n                                <term>\n                                    HKLM\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders\n                                </term>\n                            </item>\n                            <item>\n                                <term>\n                                    HKCU\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders\n                                </term>\n                            </item>\n                            <item>\n                                <term>\n                                    HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\&lt;major version&gt;.&lt;minor version&gt;\\AssemblyFolders\n                                </term>\n                            </item>\n                            <item>\n                                <term>\n                                    HKCU\\SOFTWARE\\Microsoft\\VisualStudio\\&lt;major version&gt;.&lt;minor version&gt;\\AssemblyFolders\n                                </term>\n                            </item>\n                        </list>\n                        <para>\n                            Future versions of Visual Studio .NET will also check \n                            in:\n                        </para>\n                        <list type=\"bullet\">\n                            <item>\n                                <term>\n                                    HKLM\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFoldersEx\n                                </term>\n                            </item>\n                            <item>\n                                <term>\n                                    HKCU\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFoldersEx\n                                </term>\n                            </item>\n                        </list>\n                    </term>\n                </item>\n                <item>\n                    <term>  \n                        The HintPath.\n                    </term>\n                </item>\n            </list>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedAssemblyReference.Name\">\n            <summary>\n            Gets the name of the referenced assembly.\n            </summary>\n            <value>\n            The name of the referenced assembly, or <see langword=\"null\" /> if\n            the name could not be determined.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedAssemblyReference.AssemblyFoldersKey\">\n            <summary>\n            Gets the Visual Studio .NET AssemblyFolders registry key matching\n            the current target framework.\n            </summary>\n            <value>\n            The Visual Studio .NET AssemblyFolders registry key matching the \n            current target framework.\n            </value>\n            <exception cref=\"T:NAnt.Core.BuildException\">The current target framework is not supported.</exception>\n            <remarks>\n            We use the target framework instead of the product version of the \n            containing project file to determine what registry key to scan, as\n            we don't want to use assemblies meant for uplevel framework versions.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.ManagedOutputType\">\n            <summary>\n            Indentifies the different output types of a managed project.\n            </summary>\n            <remarks>\n            Visual Studio .NET does not support modules.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.ManagedOutputType.Library\">\n            <summary>\n            A class library. \n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ManagedOutputType.Executable\">\n            <summary>\n            A console application.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ManagedOutputType.WindowsExecutable\">\n            <summary>\n            A Windows program.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectReferenceBase.GetPrimaryOutputFile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the output path of the reference, without taking the \"copy local\"\n            setting into consideration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The output path of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectReferenceBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the referenced project.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <returns>\n            The complete set of output files for the referenced project.\n            </returns>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectReferenceBase.GetAssemblyReferences(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the complete set of assemblies that need to be referenced when\n            a project references this project.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The complete set of assemblies that need to be referenced when a \n            project references this project.\n            </returns>\n            <remarks>\n            <para>\n            Apparently, there's some hack in VB.NET that allows a type to be used\n            that derives from a type in an assembly that is not referenced by the\n            project.\n            </para>\n            <para>\n            When building from the command line (using vbc), the following error\n            is reported \"error BC30007: Reference required to assembly 'X' \n            containing the base class 'X'. Add one to your project\".\n            </para>\n            <para>\n            Somehow VB.NET can workaround this issue, without actually adding a\n            reference to that assembly. I verified this with both VS.NET 2003 and\n            VS.NET 2005.\n            </para>\n            <para>\n            For now, we have no other option than to return all assembly \n            references of the referenced project if the parent is a VB.NET \n            project.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectReferenceBase.GetTimestamp(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the timestamp of the reference.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The timestamp of the reference.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectReferenceBase.CopyLocal\">\n            <summary>\n            Gets a value indicating whether the output file(s) of this reference \n            should be copied locally.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the output file(s) of this reference \n            should be copied locally; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectReferenceBase.IsSystem\">\n            <summary>\n            Gets a value indicating whether this reference represents a system \n            assembly.\n            </summary>\n            <value>\n            <see langword=\"false\" /> as a project by itself can never be a\n            system assembly.\n            </value>\n        </member>\n        <member name=\"M:NAnt.VSNet.ManagedProjectReference.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether the reference is managed for the\n            specified configuration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            <see langword=\"true\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.WrapperReferenceBase.GetPrimaryOutputFile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the path of the reference, without taking the \"copy local\"\n            setting into consideration.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The output path of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.WrapperReferenceBase.GetOutputFiles(NAnt.VSNet.Configuration,System.Collections.Hashtable)\">\n            <summary>\n            Gets the complete set of output files for the referenced project.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <param name=\"outputFiles\">The set of output files to be updated.</param>\n            <remarks>\n            The key of the case-insensitive <see cref=\"T:System.Collections.Hashtable\"/> is the \n            full path of the output file and the value is the path relative to\n            the output directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.WrapperReferenceBase.GetAssemblyReferences(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the complete set of assemblies that need to be referenced when\n            a project references this component.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The complete set of assemblies that need to be referenced when a \n            project references this component.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.WrapperReferenceBase.GetTimestamp(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets the timestamp of the reference.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            The timestamp of the reference.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.WrapperReferenceBase.Sync(NAnt.VSNet.ConfigurationBase)\">\n            <summary>\n            Removes wrapper assembly from build directory, if wrapper assembly \n            no longer exists in output directory or is not in sync with build \n            directory, to force rebuild.\n            </summary>\n            <param name=\"config\">The project configuration.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.CopyLocal\">\n            <summary>\n            Gets a value indicating whether the output file(s) of this reference \n            should be copied locally.\n            </summary>\n            <value>\n            <see langword=\"false\" /> if the reference wraps a Primary Interop \n            Assembly; otherwise, <see langword=\"true\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.IsSystem\">\n            <summary>\n            Gets a value indicating whether this reference represents a system \n            assembly.\n            </summary>\n            <value>\n            <see langword=\"false\" /> as none of the system assemblies are wrappers\n            or Primary Interop Assemblies anyway.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.WrapperTool\">\n            <summary>\n            Gets the name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.WrapperReferenceBase.WrapperAssembly\"/>.\n            </summary>\n            <value>\n            The name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.WrapperReferenceBase.WrapperAssembly\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.WrapperAssembly\">\n            <summary>\n            Gets the path of the wrapper assembly.\n            </summary>\n            <value>\n            The path of the wrapper assembly.\n            </value>\n            <remarks>\n            The wrapper assembly is stored in the object directory of the \n            project.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.IsCreated\">\n            <summary>\n            Gets a value indicating whether the wrapper assembly has already been\n            created.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.PrimaryInteropAssembly\">\n            <summary>\n            Gets the path of the Primary Interop Assembly.\n            </summary>\n            <value>\n            The path of the Primary Interop Assembly, or <see langword=\"null\" />\n            if not available.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.TypeLibVersion\">\n            <summary>\n            Gets the hex version of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The hex version of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.TypeLibGuid\">\n            <summary>\n            Gets the GUID of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The GUID of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.TypeLibLocale\">\n            <summary>\n            Gets the locale of the type library in hex notation.\n            </summary>\n            <value>\n            The locale of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.WrapperReferenceBase.TypeLibraryName\">\n            <summary>\n            Gets the name of the type library.\n            </summary>\n            <value>\n            The name of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.Name\">\n            <summary>\n            Gets the name of the referenced assembly.\n            </summary>\n            <value>\n            The name of the referenced assembly, or <see langword=\"null\" /> if\n            the name could not be determined.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.WrapperTool\">\n            <summary>\n            Gets the name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.ManagedWrapperReference.WrapperAssembly\"/>.\n            </summary>\n            <value>\n            The name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.ManagedWrapperReference.WrapperAssembly\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.WrapperAssembly\">\n            <summary>\n            Gets the path of the wrapper assembly.\n            </summary>\n            <value>\n            The path of the wrapper assembly.\n            </value>\n            <remarks>\n            The wrapper assembly is stored in the object directory of the \n            project.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.PrimaryInteropAssembly\">\n            <summary>\n            Gets the path of the Primary Interop Assembly.\n            </summary>\n            <value>\n            The path of the Primary Interop Assembly, or <see langword=\"null\" />\n            if not available.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.TypeLibVersion\">\n            <summary>\n            Gets the hex version of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The hex version of the type library.\n            </value>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>\n              The definition of the reference does not contain a \"VersionMajor\" attribute.\n              </para>\n              <para>-or</para>\n              <para>\n              The definition of the reference does not contain a \"VersionMinor\" attribute.\n              </para>\n              </exception>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.TypeLibGuid\">\n            <summary>\n            Gets the GUID of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The GUID of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ManagedWrapperReference.TypeLibLocale\">\n            <summary>\n            Gets the locale of the type library in hex notation.\n            </summary>\n            <value>\n            The locale of the type library.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectType\">\n            <summary>\n            Specifies the type of the project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectType.VB\">\n            <summary>\n            A Visual Basic.NET project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectType.CSharp\">\n            <summary>\n            A Visual C# project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectType.VisualC\">\n            <summary>\n            A Visual C++ project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectType.JSharp\">\n            <summary>\n            A Visual J# project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectType.MSBuild\">\n            <summary>\n            MSBuild project.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.BuildResult\">\n            <summary>\n            Specifies the result of the build.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.BuildResult.Failed\">\n            <summary>\n            The build failed.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.BuildResult.Success\">\n            <summary>\n            The build succeeded.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.BuildResult.SuccessOutputUpdated\">\n            <summary>\n            The build succeeded and the output was updated.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProductVersion.Rainier\">\n            <summary>\n            Visual Studio.NET 2002\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProductVersion.Everett\">\n            <summary>\n            Visual Studio.NET 2003\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProductVersion.Whidbey\">\n            <summary>\n            Visual Studio 2005\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectLocation\">\n            <summary>\n            Indentifies the physical location of a managed project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectLocation.Local\">\n            <summary>\n            A local project.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectLocation.Web\">\n            <summary>\n            A web project.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectBaseCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.VSNet.ProjectBase\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.#ctor(NAnt.VSNet.ProjectBaseCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.#ctor(NAnt.VSNet.ProjectBase[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.VSNet.ProjectBase\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Add(NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.AddRange(NAnt.VSNet.ProjectBase[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.VSNet.ProjectBase\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.AddRange(NAnt.VSNet.ProjectBaseCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Contains(NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> with the specified\n            GUID is in the collection, using a case-insensitive lookup.\n            </summary>\n            <param name=\"value\">The GUID to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> with GUID \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.CopyTo(NAnt.VSNet.ProjectBase[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.IndexOf(NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.VSNet.ProjectBase\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.VSNet.ProjectBase\"/>. If the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Insert(System.Int32,NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.VSNet.ProjectBase\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.VSNet.ProjectBaseEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Remove(NAnt.VSNet.ProjectBase)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseCollection.Remove(System.String)\">\n            <summary>\n            Remove items with the specified guid from the collection.\n            </summary>\n            <param name=\"guid\">The guid of the project to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBaseCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBaseCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> with the specified GUID.\n            </summary>\n            <param name=\"guid\">The GUID of the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> to get.</param>\n            <remarks>\n            Performs a case-insensitive lookup.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectBaseEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> elements of a <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseEnumerator.#ctor(NAnt.VSNet.ProjectBaseCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectBaseEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.ProjectBaseCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectBaseEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectBaseEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectEntry.Project\">\n            <summary>\n            Gets or sets the in memory representation of the project.\n            </summary>\n            <value>\n            The in memory representation of the project, or <see langword=\"null\" />\n            if the project is not (yet) loaded.\n            </value>\n            <remarks>\n            This property will always be <see langword=\"null\" /> for\n            projects that are not supported.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectEntry.BuildConfigurations\">\n            <summary>\n            Return a mapping between the configurations defined in the\n            solution file and the project build configurations.\n            </summary>\n            <value>\n            Mapping between configurations defined in the solution file\n            and the project build configurations, or <see langword=\"null\" />\n            if the project is not defined in a solution file.\n            </value>\n            <remarks>\n            This mapping only includes project build configurations that\n            are configured to be built for a given solution configuration.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectEntryCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.#ctor(NAnt.VSNet.ProjectEntryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.#ctor(NAnt.VSNet.ProjectEntry[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.Add(NAnt.VSNet.ProjectEntry)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to be added to the end of the collection.</param> \n            <returns>\n            The position into which the new element was inserted.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.AddRange(NAnt.VSNet.ProjectEntry[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.AddRange(NAnt.VSNet.ProjectEntryCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.Contains(NAnt.VSNet.ProjectEntry)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.Contains(System.String)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> with the specified\n            GUID is in the collection, using a case-insensitive lookup.\n            </summary>\n            <param name=\"value\">The GUID to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> with GUID \n            <paramref name=\"value\"/> is found in the collection; otherwise, \n            <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.CopyTo(NAnt.VSNet.ProjectEntry[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.IndexOf(NAnt.VSNet.ProjectEntry)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.VSNet.ProjectEntry\"/>. If the <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.Insert(System.Int32,NAnt.VSNet.ProjectEntry)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.VSNet.ProjectEntryEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryCollection.Remove(NAnt.VSNet.ProjectEntry)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectEntryCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectEntryCollection.Item(System.String)\">\n            <summary>\n            Gets the <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> with the specified GUID.\n            </summary>\n            <param name=\"guid\">The GUID of the <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> to get.</param>\n            <remarks>\n            Performs a case-insensitive lookup.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectEntryEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.VSNet.ProjectEntry\"/> elements of a <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryEnumerator.#ctor(NAnt.VSNet.ProjectEntryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectEntryEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.VSNet.ProjectEntryCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectEntryEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectEntryEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.VSNet.ProjectFactory\">\n            <summary>\n            Factory class for VS.NET projects.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectFactory.#ctor(NAnt.VSNet.Tasks.SolutionTask)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.ProjectFactory\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectFactory._cachedProjects\">\n            <summary>\n            Holds a case-insensitive list of cached projects.\n            </summary>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the path of the project\n            file (for web projects this can be a URL) and the value is a \n            <see cref=\"T:NAnt.Core.Project\"/> instance.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectFactory._cachedProjectGuids\">\n            <summary>\n            Holds a case-insensitive list of cached project GUIDs.\n            </summary>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the path of the project\n            file (for web projects this can be a URL) and the value is the GUID\n            of the project.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.ProjectFactory._cachedProjectXml\">\n            <summary>\n            Holds a case-insensitive list of cached project GUIDs.\n            </summary>\n            <remarks>\n            The key of the <see cref=\"T:System.Collections.Hashtable\"/> is the path of the project\n            file (for web projects this can be a URL) and the value is the Xml\n            of the project.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectSettings.GetOutputType(System.Xml.XmlElement)\">\n            <summary>\n            Determines the output type of the project from its XML definition.\n            </summary>\n            <param name=\"settingsXml\">The XML definition of the project settings.</param>\n            <returns>\n            The output type of the project.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>\n              The output type of the project is not set in the specified XML \n              definition.\n              </para>\n              <para>-or-</para>\n              <para>\n              The output type of the project is not supported.\n              </para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.ProjectSettings.GetProjectGuid(System.String,System.Xml.XmlElement)\">\n            <summary>\n            Gets the project GUID from the given <see cref=\"T:System.Xml.XmlElement\"/> \n            holding a <c>&lt;VisualStudioProject&gt;</c> node.\n            </summary>\n            <param name=\"projectFile\">The path of the project file.</param>\n            <param name=\"elemRoot\">The <c>&lt;VisualStudioProject&gt;</c> node from which the project GUID should be retrieved.</param>\n            <returns>\n            The project GUID from specified <c>&lt;VisualStudioProject&gt;</c> node.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.ApplicationIcon\">\n            <summary>\n            Gets the .ico file to use as application icon.\n            </summary>\n            <value>\n            The .ico file to use as application icon, or <see langword=\"null\" /> \n            if no application icon should be used.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.AssemblyOriginatorKeyFile\">\n            <summary>\n            Gets the key file to use to sign ActiveX/COM wrappers.\n            </summary>\n            <value>\n            The path of the key file to use to sign ActiveX/COM wrappers, \n            relative to the project root directory, or <see langword=\"null\" />\n            if the wrapper assembly should not be signed using a key file.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.AssemblyKeyContainerName\">\n            <summary>\n            Gets the key name to use to sign ActiveX/COM wrappers.\n            </summary>\n            <value>\n            The name of the key container to use to sign ActiveX/COM wrappers,\n            or <see langword=\"null\" /> if the wrapper assembly should not be\n            signed using a key container.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.OutputType\">\n            <summary>\n            Gets the output type of this project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.RunPostBuildEvent\">\n            <summary>\n            Designates when the <see cref=\"P:NAnt.VSNet.ProjectSettings.PostBuildEvent\"/> command line should\n            be run. Possible values are \"OnBuildSuccess\", \"Always\" or \n            \"OnOutputUpdated\".\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.PreBuildEvent\">\n            <summary>\n            Contains commands to be run before a build takes place.\n            </summary>\n            <remarks>\n            Valid commands are those in a .bat file. For more info see MSDN.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.ProjectSettings.PostBuildEvent\">\n            <summary>\n            Contains commands to be ran after a build has taken place.\n            </summary>\n            <remarks>\n            Valid commands are those in a .bat file. For more info see MSDN.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferencesResolver.InitializeLifetimeService\">\n            <summary>\n            Obtains a lifetime service object to control the lifetime policy for \n            this instance.\n            </summary>\n            <returns>\n            An object of type <see cref=\"T:System.Runtime.Remoting.Lifetime.ILease\"/> used to control the lifetime \n            policy for this instance. This is the current lifetime service object \n            for this instance if one exists; otherwise, a new lifetime service \n            object initialized with a lease that will never time out.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.ReferencesResolver.GetAssemblyFileName(System.String)\">\n            <summary>\n            Gets the file name of the assembly with the given assembly name.\n            </summary>\n            <param name=\"assemblyName\">The assembly name of the assembly of which the file name should be returned.</param>\n            <returns>\n            The file name of the assembly with the given assembly name.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Resource.Compile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Compiles the resource file.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            A <see cref=\"T:System.IO.FileInfo\"/> representing the compiled resource file.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.Resource.GetCompiledResourceFile(NAnt.VSNet.Configuration)\">\n            <summary>\n            Returns a <see cref=\"T:System.IO.FileInfo\"/> representing the compiled resource\n            file.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            A <see cref=\"T:System.IO.FileInfo\"/> representing the compiled resource file.\n            </returns>\n            <remarks>\n            Calling this method does not force compilation of the resource file.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Resource.InputFile\">\n            <summary>\n            Gets a <see cref=\"T:System.IO.FileInfo\"/> representing the physical location\n            of the resource file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.Resource.LogicalFile\">\n            <summary>\n            Gets a <see cref=\"T:System.IO.FileInfo\"/> representing the logical location\n            of the resource file in the project.\n            </summary>\n            <remarks>\n            When the resource file is not linked, this matches the\n            <see cref=\"P:NAnt.VSNet.Resource.InputFile\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.Resource.IsResX\">\n            <summary>\n            Gets a value indicating whether the resource is in fact a ResX file.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the resource is a ResX file; otherwise,\n            <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.SolutionFactory\">\n            <summary>\n            Factory class for VS.NET solutions.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.SolutionFactory.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.SolutionFactory\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VBProject.VerifyProjectXml(System.Xml.XmlElement)\">\n            <summary>\n            Verifies whether the specified XML fragment represents a valid project\n            that is supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The XML fragment is not supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.</para>\n              <para>-or-</para>\n              <para>The XML fragment does not represent a valid project (for this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VBProject.DetermineProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">The document element of the project.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n            <remarks>\n            This method is called from the <see cref=\"T:NAnt.VSNet.ProjectBase\"/> ctor, and\n            at that time we're not sure the XML that is passed in, is indeed a\n            valid Visual Basic project.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VBProject.DetermineProjectLocation(System.Xml.XmlElement)\">\n            <summary>\n            Returns the project location from the specified project XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <returns>\n            The project location of the specified project XML file.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The project location could not be determined.</para>\n              <para>-or-</para>\n              <para>The project location is invalid.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VBProject.GetProcessStartInfo(NAnt.VSNet.ConfigurationBase,System.String)\">\n            <summary>\n            Returns a <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler\n            for this project.\n            </summary>\n            <param name=\"config\">The configuration to build.</param>\n            <param name=\"responseFile\">The response file for the compiler.</param>\n            <returns>\n            A <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> for launching the compiler for \n            this project.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.VBProject.IsSupported(System.Xml.XmlElement)\">\n            <summary>\n            Returns a value indicating whether the project represented by the\n            specified XML fragment is supported by <see cref=\"T:NAnt.VSNet.VBProject\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project to check.</param>\n            <returns>\n            <see langword=\"true\"/> if <see cref=\"T:NAnt.VSNet.VBProject\"/> supports the \n            specified project; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            <para>\n            A project is identified as as Visual Basic project, if the XML \n            fragment at least has the following information:\n            </para>\n            <code>\n              <![CDATA[\n            <VisualStudioProject>\n                <VisualBasic\n                    ProductVersion=\"...\"\n                    ....\n                >\n                    ...\n                </VisualBasic>\n            </VisualStudioProject>\n              ]]>\n            </code>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VBProject.Type\">\n            <summary>\n            Gets the type of the project.\n            </summary>\n            <value>\n            The type of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VBProject.FileExtension\">\n            <summary>\n            Gets the default file extension of sources for this project.\n            </summary>\n            <value>\n            For VB projects, the default file extension is &quot;.vb&quot;.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcArgumentMap\">\n            <summary>\n            A mapping from properties in the .vcproj file to command line arguments.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcArgumentMap.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VSNet.VcArgumentMap\"/>\n            class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcArgumentMap.GetArgument(System.String,System.String,NAnt.VSNet.VcArgumentMap.ArgGroup)\">\n            <summary>\n            Gets the argument string corresponding with a configuration property \n            named <paramref name=\"propName\" /> with value <paramref name=\"propValue\" />.\n            An ignore mask can be used to eliminate some arguments from the search.\n            </summary>\n            <param name=\"propName\">The name of the configuration property.</param>\n            <param name=\"propValue\">The value of the configuration property.</param>\n            <param name=\"useIgnoreGroup\">Specify any groups that needs to be ignored.</param>\n            <returns>\n            The argument string corresponding with a configuration property \n            named <paramref name=\"propName\" /> with value <paramref name=\"propValue\" />,\n            or <see langword=\"null\" /> if no corresponding argument exists.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcArgumentMap.CreateCLArgumentMap\">\n            <summary>\n            Creates a mapping between configuration properties for the Visual\n            C++ compiler and corresponding command-line arguments.\n            </summary>\n            <returns>\n            A mapping between configuration properties for the Visual C++\n            compiler and corresponding command-line arguments.\n            </returns>\n            <remarks>\n              <para>\n              The following configuration properties are processed by\n              <see cref=\"T:NAnt.VSNet.VcProject\"/>:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Category</term>\n                  <description>Property</description>\n                </listheader>\n                <item>\n                  <term>General</term>\n                  <description>Addtional Include Directories (/I[path])</description>\n                </item>\n                <item>\n                  <term>General</term>\n                  <description>Resolve #using References (/AI[path])</description>\n                </item>\n                <item>\n                  <term>Preprocessor</term>\n                  <description>Preprocessor Definitions (/D[macro])</description>\n                </item>\n                <item>\n                  <term>Code Generation</term>\n                  <description>Enable C++ Exceptions (/EHsc)</description>\n                </item>\n                <item>\n                  <term>Precompiled Headers</term>\n                  <description>Create/Use Precompiled Header</description>\n                </item>\n                <item>\n                  <term>Precompiled Headers</term>\n                  <description>Create/Use PCH Through File</description>\n                </item>\n                <item>\n                  <term>Precompiled Headers</term>\n                  <description>Precompiled Header File</description>\n                </item>\n                <item>\n                  <term>Output Files</term>\n                  <description>Assembler Output</description>\n                </item>\n                <item>\n                  <term>Output Files</term>\n                  <description>ASM List Location</description>\n                </item>\n                <item>\n                  <term>Browse Information</term>\n                  <description>Enable Browse Information</description>\n                </item>\n                <item>\n                  <term>Browse Information</term>\n                  <description>Browse File</description>\n                </item>\n                <item>\n                  <term>Advanced</term>\n                  <description>Force Includes (/FI[name])</description>\n                </item>\n                <item>\n                  <term>Advanced</term>\n                  <description>Force #using (/FU[name])</description>\n                </item>\n                <item>\n                  <term>Advanced</term>\n                  <description>Undefine Preprocessor Definitions (/U[macro])</description>\n                </item>\n              </list>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcArgumentMap.CreateLinkerArgumentMap\">\n            <summary>\n            Creates a mapping between configuration properties for the Visual\n            C++ linker and corresponding command-line arguments.\n            </summary>\n            <returns>\n            A mapping between configuration properties for the Visual C++\n            linker and corresponding command-line arguments.\n            </returns>\n            <remarks>\n              <para>\n              The following configuration properties are processed by\n              <see cref=\"T:NAnt.VSNet.VcProject\"/>:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Category</term>\n                  <description>Property</description>\n                </listheader>\n                <item>\n                  <term>General</term>\n                  <description>Output File (/OUT:[file])</description>\n                </item>\n                <item>\n                  <term>General</term>\n                  <description>Additional Library Directories (/LIBPATH:[dir])</description>\n                </item>\n                <item>\n                  <term>Input</term>\n                  <description>Additional Dependencies</description>\n                </item>\n                <item>\n                  <term>Input</term>\n                  <description>Add Module to Assembly (/ASSEMBLYMODULE:file)</description>\n                </item>\n                <item>\n                  <term>Input</term>\n                  <description>Embed Managed Resource File (/ASSEMBLYRESOURCE:file)</description>\n                </item>\n                <item>\n                  <term>Debugging</term>\n                  <description>Generate Debug Info (/DEBUG)</description>\n                </item>\n                <item>\n                  <term>Debugging</term>\n                  <description>Generate Program Database File (/PDB:name)</description>\n                </item>\n                <item>\n                  <term>Debugging</term>\n                  <description>Generate Map File (/MAP)</description>\n                </item>\n                <item>\n                  <term>Debugging</term>\n                  <description>Map File Name (/MAP:[filename])</description>\n                </item>\n                <item>\n                  <term>System</term>\n                  <description>Heap Reserve Size (/HEAP:reserve)</description>\n                </item>\n                <item>\n                  <term>System</term>\n                  <description>Heap Commit Size (/HEAP:reserve, commit)</description>\n                </item>\n                <item>\n                  <term>System</term>\n                  <description>Stack Reserve Size (/STACK:reserve)</description>\n                </item>\n                <item>\n                  <term>System</term>\n                  <description>Stack Commit Size (/STACK:reserve, commit)</description>\n                </item>\n              </list>\n              <para>\n              The following configuration properties are ignored:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Category</term>\n                  <description>Property</description>\n                </listheader>\n                <item>\n                  <term>General</term>\n                  <description>Show Progress (/VERBOSE, /VERBOSE:LIB)</description>\n                </item>\n                <item>\n                  <term>General</term>\n                  <description>Suppress Startup Banner (/NOLOGO)</description>\n                </item>\n              </list>\n              <para>\n              Support for the following configuration properties still needs to\n              be implemented:\n              </para>\n              <list type=\"table\">\n                <listheader>\n                  <term>Category</term>\n                  <description>Property</description>\n                </listheader>\n                <item>\n                  <term>General</term>\n                  <description>Ignore Import Library</description>\n                </item>\n                <item>\n                  <term>General</term>\n                  <description>Register Output</description>\n                </item>\n                <item>\n                  <term>Input</term>\n                  <description>Delay Loaded DLLs (/DELAYLOAD:[dll_name])</description>\n                </item>\n                <item>\n                  <term>Embedded IDL</term>\n                  <description>MIDL Commands (/MIDL:[file])</description>\n                </item>\n              </list>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcArgumentMap.VcArgument.Name\">\n            <summary>\n            Gets the name of the command-line argument.\n            </summary>\n            <value>\n            The name of the command-line argument.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcArgumentMap.LinkerStringArgument\">\n            <summary>\n            Represents a command-line arguments of which the trailing backslashes\n            in the value should be duplicated.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcArgumentMap.QuotedLinkerStringArgument\">\n            <summary>\n            Represents a command-line argument of which the value should be\n            quoted, and of which trailing backslahes should be duplicated.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcArgumentMap.VcBoolArgument.Match\">\n            <summary>\n            Gets the string that the configuration setting should match in \n            order for the command line argument to be set.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcArgumentMap.ArgGroup\">\n            <summary>\n            Allow us to assign an argument to a specific group.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcArgumentMap.ArgGroup.Unassigned\">\n            <summary>\n            The argument is not assigned to any group.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcArgumentMap.ArgGroup.OptiIgnoreGroup\">\n            <summary>\n            The argument is ignored when the optimization level is set to \n            <b>Minimum Size</b> (1) or <b>Maximum Size</b> (2).\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcAssemblyReference.ResolveAssemblyReference\">\n            <summary>\n            Resolves an assembly reference.\n            </summary>\n            <returns>\n            The full path to the resolved assembly, or <see langword=\"null\" />\n            if the assembly reference could not be resolved.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcAssemblyReference.EvaluateMacro(System.Text.RegularExpressions.Match)\">\n            <summary>\n            Is called each time a regular expression match is found during a \n            <see cref=\"M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator)\"/> operation.\n            </summary>\n            <param name=\"m\">The <see cref=\"T:System.Text.RegularExpressions.Match\"/> resulting from a single regular expression match during a <see cref=\"M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator)\"/>.</param>\n            <returns>\n            The expanded <see cref=\"T:System.Text.RegularExpressions.Match\"/>.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">The macro is not supported.</exception>\n            <exception cref=\"T:System.NotImplementedException\">Expansion of a given macro is not yet implemented.</exception>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcAssemblyReference.Name\">\n            <summary>\n            Gets the name of the referenced assembly.\n            </summary>\n            <value>\n            The name of the referenced assembly, or <see langword=\"null\" /> if\n            the name could not be determined.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcConfigurationBase\">\n            <summary>\n            A single build configuration for a Visual C++ project or for a specific\n            file in the project.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcConfigurationBase.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The macro is not supported.</para>\n              <para>-or-</para>\n              <para>The macro is not implemented.</para>\n              <para>-or-</para>\n              <para>The macro cannot be expanded.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcConfigurationBase.GetToolSetting(System.String,System.String)\">\n            <summary>\n            Gets the value of a given setting for a specified tool.\n            </summary>\n            <param name=\"toolName\">The name of the tool.</param>\n            <param name=\"settingName\">The name of the setting.</param>\n            <returns>\n            The value of a setting for the specified tool, or <see langword=\"null\"/>\n            if the setting is not defined for the specified tool.\n            </returns>\n            <remarks>\n            An empty setting value, which is used as a means to override the\n            project default, will be returned as a empty <see cref=\"T:System.String\"/>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcConfigurationBase.GetToolSetting(System.String,System.String,System.String)\">\n            <summary>\n            Gets the value of a given setting for a specified tool.\n            </summary>\n            <param name=\"toolName\">The name of the tool.</param>\n            <param name=\"settingName\">The name of the setting.</param>\n            <param name=\"defaultValue\">The value to return if setting is not defined.</param>\n            <returns>\n            The value of a setting for the specified tool, or \n            <paramref name=\"defaultValue\"/> if the setting is not defined for\n            the specified tool.\n            </returns>\n            <remarks>\n            An empty setting value, which is used as a means to override the\n            project default, will be returned as a empty <see cref=\"T:System.String\"/>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.IntermediateDir\">\n            <summary>\n            Gets the intermediate directory, specified relative to project \n            directory.\n            </summary>\n            <value>\n            The intermediate directory, specified relative to project directory.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.ReferencesPath\">\n            <summary>\n            Gets a comma-separated list of directories to scan for assembly\n            references.\n            </summary>\n            <value>\n            A comma-separated list of directories to scan for assembly\n            references, or <see langword=\"null\" /> if no additional directories\n            should scanned.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.FullName\">\n            <summary>\n            Gets the name of the configuration, including the platform it\n            targets.\n            </summary>\n            <value>\n            Tthe name of the configuration, including the platform it targets.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.OutputDir\">\n            <summary>\n            Gets the output directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.BuildPath\">\n            <summary>\n            Gets the path in which the output file will be created before its\n            copied to the actual output path.\n            </summary>\n            <remarks>\n            For Visual C++ projects, the output file will be immediately\n            created in the output path.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.Name\">\n            <summary>\n            Gets the name of the configuration.\n            </summary>\n            <value>\n            The name of the configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcConfigurationBase.PlatformName\">\n            <summary>\n            Gets the platform that the configuration targets.\n            </summary>\n            <value>\n            The platform targeted by the configuration.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcFileConfiguration\">\n            <summary>\n            Represents the configuration of a file.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcFileConfiguration.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The macro is not supported.</para>\n              <para>-or-</para>\n              <para>The macro is not implemented.</para>\n              <para>-or-</para>\n              <para>The macro cannot be expanded.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcFileConfiguration.GetToolSetting(System.String,System.String,System.String)\">\n            <summary>\n            Gets the value of a given setting for a specified tool.\n            </summary>\n            <param name=\"toolName\">The name of the tool.</param>\n            <param name=\"settingName\">The name of the setting.</param>\n            <param name=\"projectDefault\">The value to return if setting is not defined in both the file and project configuration.</param>\n            <returns>\n            The value of a setting for the specified tool, or \n            <paramref name=\"defaultValue\"/> if the setting is not defined in\n            both the file and project configuration.\n            </returns>\n            <remarks>\n              <para>\n              If the setting is not defined in the file configuration, then\n              the project level setting will be used.\n              </para>\n              <para>\n              An empty setting value, which is used as a means to override the\n              project default, will be returned as a empty <see cref=\"T:System.String\"/>.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.ExcludeFromBuild\">\n            <summary>\n            Gets a value indication whether the file should be excluded from \n            the build for this configuration.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the file should be excluded from the \n            build for this configuration; otherwise, <see langword=\"false\" />.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.RelativePath\">\n            <summary>\n            Gets the relative path of the file.\n            </summary>\n            <value>\n            The path of the file relative to the project directory.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.RelativeOutputDir\">\n            <summary>\n            Get the path of the output directory relative to the project\n            directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.IntermediateDir\">\n            <summary>\n            Gets the intermediate directory, specified relative to project \n            directory.\n            </summary>\n            <value>\n            The intermediate directory, specified relative to project directory.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.OutputPath\">\n            <summary>\n            Gets the path for the output file.\n            </summary>\n            <value>\n            The path for the output file, or <see langword=\"null\" /> if there's\n            no output file for this configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcFileConfiguration.ReferencesPath\">\n            <summary>\n            Gets a comma-separated list of directories to scan for assembly\n            references.\n            </summary>\n            <value>\n            A comma-separated list of directories to scan for assembly\n            references, or <see langword=\"null\" /> if no additional directories\n            should scanned.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcProject\">\n            <summary>\n            Visual C++ project.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether building the project for the specified\n            build configuration results in managed output.\n            </summary>\n            <param name=\"solutionConfiguration\">The solution configuration that is built.</param>\n            <returns>\n            <see langword=\"true\" /> if the project output for the specified build\n            configuration is either a Dynamic Library (dll) or an Application\n            (exe), and Managed Extensions are enabled; otherwise, \n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.VerifyProjectXml(System.Xml.XmlElement)\">\n            <summary>\n            Verifies whether the specified XML fragment represents a valid project\n            that is supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project file.</param>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The XML fragment is not supported by this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>.</para>\n              <para>-or-</para>\n              <para>The XML fragment does not represent a valid project (for this <see cref=\"T:NAnt.VSNet.ProjectBase\"/>).</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.DetermineProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">The document element of the project.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro or <see langword=\"null\" /> if the macro is not\n            supported.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.BuildResourceFiles(System.Collections.ArrayList,NAnt.VSNet.VcProjectConfiguration,NAnt.VSNet.VcConfigurationBase)\">\n            <summary>\n            Build resource files for the given configuration.\n            </summary>\n            <param name=\"fileNames\">The resource files to build.</param>\n            <param name=\"projectConfig\">The project configuration.</param>\n            <param name=\"fileConfig\">The build configuration.</param>\n            <remarks>\n            TODO: refactor this as we should always get only one element in the\n            <paramref name=\"fileNames\" /> list. Each res file should be built\n            with its own file configuration.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.BuildIDLFiles(System.Collections.ArrayList,NAnt.VSNet.VcProjectConfiguration,NAnt.VSNet.VcConfigurationBase)\">\n            <summary>\n            Build Interface Definition Language files for the given\n            configuration.\n            </summary>\n            <param name=\"fileNames\">The IDL files to build.</param>\n            <param name=\"projectConfig\">The project configuration.</param>\n            <param name=\"fileConfig\">The build configuration.</param>\n            <remarks>\n            TODO: refactor this as we should always get only one element in the\n            <paramref name=\"fileNames\" /> list. Each IDL file should be built\n            with its own file configuration.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.MergeToolSetting(NAnt.VSNet.VcProjectConfiguration,NAnt.VSNet.VcConfigurationBase,System.String,System.String)\">\n            <summary>\n            Merges the specified tool setting of <paramref name=\"projectConfig\" /> \n            with <paramref name=\"fileConfig\" />.\n            </summary>\n            <remarks>\n            The merge is suppressed when the flag $(noinherit) is defined in\n            <paramref name=\"fileConfig\" />.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.GetObjectFile(NAnt.VSNet.VcConfigurationBase)\">\n            <summary>\n            Gets the absolute path to the object file or directory.\n            </summary>\n            <param name=\"fileConfig\">The build configuration</param>\n            <returns>\n            The absolute path to the object file or directory, or \n            </returns>\n            <remarks>\n            We use an absolute path for the object file, otherwise \n            <c>&lt;cl&gt;</c> assumes a location relative to the output \n            directory - not the project directory.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.IsSupported(System.Xml.XmlElement)\">\n            <summary>\n            Returns a value indicating whether the project represented by the\n            specified XML fragment is supported by <see cref=\"T:NAnt.VSNet.VcProject\"/>.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project to check.</param>\n            <returns>\n            <see langword=\"true\"/> if <see cref=\"T:NAnt.VSNet.VcProject\"/> supports the \n            specified project; otherwise, <see langword=\"false\"/>.\n            </returns>\n            <remarks>\n            <para>\n            A project is identified as as Visual C++ project, if the XML \n            fragment at least has the following information:\n            </para>\n            <code>\n              <![CDATA[\n            <VisualStudioProject\n                ProjectType=\"Visual C++\"\n                Version=\"...\"\n                ...\n                >\n            </VisualStudioProject>\n              ]]>\n            </code>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.CleanPath(System.String)\">\n            <summary>\n            Removes leading and trailing quotes from the specified path.\n            </summary>\n            <param name=\"path\">The path to clean.</param>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProject.GetProductVersion(System.Xml.XmlElement)\">\n            <summary>\n            Returns the Visual Studio product version of the specified project\n            XML fragment.\n            </summary>\n            <param name=\"docElement\">XML fragment representing the project to check.</param>\n            <returns>\n            The Visual Studio product version of the specified project XML \n            fragment.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The product version could not be determined.</para>\n              <para>-or-</para>\n              <para>The product version is not supported.</para>\n            </exception>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProject._projectFiles\">\n            <summary>\n            Holds the files included in the project.\n            </summary>\n            <remarks>\n              <para>\n              For project files with no specific file configuration, the relative\n              path is added to the list.\n              </para>\n              <para>\n              For project files that have a specific file configuration, a\n              <see cref=\"T:System.Collections.Hashtable\"/> containing the <see cref=\"T:NAnt.VSNet.VcFileConfiguration\"/>\n              instance representing the file configurations is added.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.Name\">\n            <summary>\n            Gets the name of the Visual C++ project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.Type\">\n            <summary>\n            Gets the type of the project.\n            </summary>\n            <value>\n            The type of the project.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.ProjectPath\">\n            <summary>\n            Gets the path of the Visual C++ project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.ProjectDirectory\">\n            <summary>\n            Gets the directory containing the VS.NET project.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.ProjectLocation\">\n            <summary>\n            Get the location of the project.\n            </summary>\n            <value>\n            <see cref=\"F:NAnt.VSNet.ProjectLocation.Local\"/>.\n            </value>\n            <remarks>\n            For now, we only support local Visual C++ projects.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.ObjectDir\">\n            <summary>\n            Get the directory in which intermediate build output that is not \n            specific to the build configuration will be stored.\n            </summary>\n            <remarks>\n            This is a directory relative to the project directory, \n            named <c>temp\\</c>.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProject.Guid\">\n            <summary>\n            Gets or sets the unique identifier of the Visual C++ project.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcProjectConfiguration\">\n            <summary>\n            Represents a Visual C++ project configuration.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProjectConfiguration.ExpandMacro(System.String)\">\n            <summary>\n            Expands the given macro.\n            </summary>\n            <param name=\"macro\">The macro to expand.</param>\n            <returns>\n            The expanded macro.\n            </returns>\n            <exception cref=\"T:NAnt.Core.BuildException\">\n              <para>The macro is not supported.</para>\n              <para>-or-</para>\n              <para>The macro is not implemented.</para>\n              <para>-or-</para>\n              <para>The macro cannot be expanded.</para>\n            </exception>\n            <exception cref=\"T:System.NotImplementedException\">\n              <para>Expansion of a given macro is not yet implemented.</para>\n            </exception>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProjectConfiguration.GetXmlAttributeValue(System.Xml.XmlNode,System.String)\">\n            <summary>\n            Gets the value of the specified attribute from the specified node.\n            </summary>\n            <param name=\"xmlNode\">The node of which the attribute value should be retrieved.</param>\n            <param name=\"attributeName\">The attribute of which the value should be returned.</param>\n            <returns>\n            The value of the attribute with the specified name or <see langword=\"null\" />\n            if the attribute does not exist or has no value.\n            </returns>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration._outputPath\">\n            <summary>\n            Holds the output path for this build configuration.\n            </summary>\n            <remarks>\n            Lazy initialized by <see cref=\"M:NAnt.VSNet.VcProjectConfiguration.Initialize\"/>.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration._objFiles\">\n            <summary>\n            Holds list of files to link in the order in which they are defined\n            in the project file.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration._sourceConfigs\">\n            <summary>\n            Holds the C++ sources for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the C++ source files for that\n            build configuration.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration._rcConfigs\">\n            <summary>\n            Holds the resources for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the resources files for that\n            build configuration.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration._idlConfigs\">\n            <summary>\n            Holds the IDL files for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the IDL files for that build \n            configuration.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.CharacterSet\">\n            <summary>\n            Tells the compiler which character set to use.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.ManagedExtensions\">\n            <summary>\n            Gets a value indicating whether Managed Extensions for C++ are \n            enabled.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.UseOfMFC\">\n            <summary>\n            Gets a value indicating how MFC is used by the configuration.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.UseOfATL\">\n            <summary>\n            Gets a value indicating how ATL is used by the configuration.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.ObjFiles\">\n            <summary>\n            Gets the list of files to link in the order in which they are \n            defined in the project file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.SourceConfigs\">\n            <summary>\n            Holds the C++ sources for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the C++ source files for that\n            build configuration.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.RcConfigs\">\n            <summary>\n            Gets the resources for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the resources files for that\n            build configuration.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.IdlConfigs\">\n            <summary>\n            Get the IDL files for each build configuration.\n            </summary>\n            <remarks>\n            The key of the hashtable is a build configuration, and the\n            value is an ArrayList holding the IDL files for that build \n            configuration.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.TargetPath\">\n            <summary>\n            Gets the target path for usage in macro expansion.\n            </summary>\n            <value>\n            The target path, or a zero-length string if there's no output file \n            for this configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.ObjectDir\">\n            <summary>\n            Get the directory in which intermediate build output will be stored \n            for this configuration.\n            </summary>\n            <remarks>\n            <para>\n            This is a directory relative to the project directory named \n            <c>obj\\&lt;configuration name&gt;</c>.\n            </para>\n            <para>\n            <c>.resx</c> and <c>.licx</c> files will only be recompiled if the\n            compiled resource files in the <see cref=\"P:NAnt.VSNet.VcProjectConfiguration.ObjectDir\"/> are not \n            uptodate.\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.RelativeOutputDir\">\n            <summary>\n            Get the path of the output directory relative to the project\n            directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.IntermediateDir\">\n            <summary>\n            Gets the intermediate directory, specified relative to project \n            directory.\n            </summary>\n            <value>\n            The intermediate directory, specified relative to project directory.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.OutputPath\">\n            <summary>\n            Gets the absolute path for the output file.\n            </summary>\n            <value>\n            The absolute path for the output file, or <see langword=\"null\" /> \n            if there's no output file for this configuration.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.ReferencesPath\">\n            <summary>\n            Gets a comma-separated list of directories to scan for assembly\n            references.\n            </summary>\n            <value>\n            A comma-separated list of directories to scan for assembly\n            references, or <see langword=\"null\" /> if no additional directories\n            should scanned.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VSNet.VcProjectConfiguration.ConfigurationType\">\n            <summary>\n            The type of output for a given configuration.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration.ConfigurationType.Makefile\">\n            <summary>\n            A Makefile.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration.ConfigurationType.Application\">\n            <summary>\n            Application (.exe).\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration.ConfigurationType.DynamicLibrary\">\n            <summary>\n            Dynamic Library (.dll).\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration.ConfigurationType.StaticLibrary\">\n            <summary>\n            Static Library (.lib).\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VSNet.VcProjectConfiguration.ConfigurationType.Utility\">\n            <summary>\n            Utility.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcProjectConfiguration.LinkerConfig.ImportLibrary\">\n            <summary>\n            Gets a <see cref=\"T:System.IO.FileInfo\"/> instance representing the \n            absolute path to the import library to generate.\n            </summary>\n            <value>\n            A <see cref=\"T:System.IO.FileInfo\"/> representing the absolute path to the\n            import library to generate, or <see langword=\"null\"/> if no \n            import library must be generated.\n            </value>\n        </member>\n        <member name=\"M:NAnt.VSNet.VcProjectReference.IsManaged(NAnt.VSNet.Configuration)\">\n            <summary>\n            Gets a value indicating whether the reference is managed for the\n            specified configuration.\n            </summary>\n            <param name=\"config\">The build configuration of the reference.</param>\n            <returns>\n            <see langword=\"true\" /> if the reference is managed for the\n            specified configuration; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.Name\">\n            <summary>\n            Gets the name of the referenced assembly.\n            </summary>\n            <value>\n            The name of the referenced assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.WrapperTool\">\n            <summary>\n            Gets the name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.VcWrapperReference.WrapperAssembly\"/>.\n            </summary>\n            <value>\n            The name of the tool that should be used to create the \n            <see cref=\"P:NAnt.VSNet.VcWrapperReference.WrapperAssembly\"/>.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.WrapperAssembly\">\n            <summary>\n            Gets the path of the wrapper assembly.\n            </summary>\n            <value>\n            The path of the wrapper assembly.\n            </value>\n            <remarks>\n            The wrapper assembly is stored in the object directory of the \n            project.\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.PrimaryInteropAssembly\">\n            <summary>\n            Gets the path of the Primary Interop Assembly.\n            </summary>\n            <value>\n            The path of the Primary Interop Assembly, or <see langword=\"null\" />\n            if not available.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.TypeLibVersion\">\n            <summary>\n            Gets the hex version of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The hex version of the type library.\n            </value>\n            <exception cref=\"T:NAnt.Core.BuildException\">The definition of the reference does not contain a \"ControlVersion\" attribute.</exception>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.TypeLibGuid\">\n            <summary>\n            Gets the GUID of the type library as defined in the definition\n            of the reference.\n            </summary>\n            <value>\n            The GUID of the type library.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VSNet.VcWrapperReference.TypeLibLocale\">\n            <summary>\n            Gets the locale of the type library in hex notation.\n            </summary>\n            <value>\n            The locale of the type library.\n            </value>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.VisualCppTasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.VisualCppTasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.VisualCpp.Tasks.ClTask\">\n            <summary>\n            Compiles C/C++ programs using <c>cl.exe</c>, Microsoft's C/C++ compiler.\n            </summary>\n            <remarks>\n              <para>This task is intended for version 13.00.9466 of <c>cl.exe</c>.</para>\n            </remarks>\n            <example>\n              <para>Compiles <c>helloworld.cpp</c> for the Common Language Runtime.</para>\n              <code>\n                <![CDATA[\n            <cl outputdir=\"build\" options=\"/clr\">\n                <sources>\n                    <include name=\"helloworld.cpp\" />\n                </sources>\n            </cl>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Tasks.ClTask\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.ExecuteTask\">\n            <summary>\n            Compiles the sources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.NeedsCompiling\">\n            <summary>\n            Determines if the sources need to be compiled.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.IsPchfileUpToDate\">\n            <summary>\n            Determines whether the precompiled header file is up-to-date.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if no precompiled header file was specified;\n            otherwise, <see langword=\"false\" />.\n            </returns>\n            <remarks>\n            In order to determine accurately whether the precompile header file\n            is up-to-date, we'd need scan all the header files that are pulled \n            in. As this is not implemented right now, its safer to always\n            recompile.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.FindUpdatedInclude(System.String,System.DateTime)\">\n            <summary>\n            Determines whether any file that are includes in the specified\n            source file has been updated after the obj was compiled.\n            </summary>\n            <param name=\"srcFileName\">The source file to check.</param>\n            <param name=\"objLastWriteTime\">The last write time of the compiled obj.</param>\n            <returns>\n            The full path to the include file that was modified after the obj\n            was compiled, or <see langword=\"null\" /> if no include files were\n            modified since the obj was compiled.\n            </returns>\n            <remarks>\n              <para>\n              To determine what includes are defined in a source file, conditional\n              directives are not honored.\n              </para>\n              <para>\n              If a given include cannot be resolved to an existing file, then\n              it will be considered stable.\n              </para>\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.QuoteArgumentValue(System.String)\">\n            <summary>\n            Quotes an argument value and duplicates trailing backslahes.\n            </summary>\n            <param name=\"value\">The argument value to quote.</param>\n            <returns>\n            The quotes argument value.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.ClTask.GetObjOutputFile(System.String,System.String)\">\n            <summary>\n            Determines the file name of the OBJ file for the specified source\n            file.\n            </summary>\n            <param name=\"srcFile\">The source file for which the OBJ file should be determined.</param>\n            <param name=\"objectPath\">The path of the object file.</param>\n            <returns>\n            The file name of the OBJ file for the specified source file.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.OutputDir\">\n            <summary>\n            Directory where all output files are placed.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.PchFile\">\n            <summary>\n            Specifies the path and/or name of the generated precompiled header \n            file - given either relative to <see cref=\"P:NAnt.VisualCpp.Tasks.ClTask.OutputDir\"/> or as an \n            absolute path. \n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.PchThroughFile\">\n            <summary>\n            The path of the boundary file when generating/using the \n            specified <see cref=\"P:NAnt.VisualCpp.Tasks.ClTask.PchFile\"/>.  If a precompiled header file is\n            not specified then this attribute is ignored.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.PchMode\">\n            <summary>\n            The mode in which the specified <see cref=\"P:NAnt.VisualCpp.Tasks.ClTask.PchFile\"/> (if any) is\n            used. The default is <see cref=\"F:NAnt.VisualCpp.Tasks.ClTask.PrecompiledHeaderMode.Use\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ManagedExtensions\">\n            <summary>\n            Specifies whether Managed Extensions for C++ should be enabled.\n            The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.CharacterSet\">\n            <summary>\n            Tells the compiler to use the specified character set.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.Options\">\n            <summary>\n            Options to pass to the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.Sources\">\n            <summary>\n            The list of files to compile.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.IncludeDirs\">\n            <summary>\n            The list of directories in which to search for include files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.MetaDataIncludeDirs\">\n            <summary>\n            Directories that the compiler will search to resolve file references \n            passed to the <c>#using</c> directive.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ForcedUsingFiles\">\n            <summary>\n            Specifies metadata files to reference in this compilation as an\n            alternative to passing a file name to <c>#using</c> in source code.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.Defines\">\n            <summary>\n            Macro definitions to pass to cl.exe.\n            Each entry will generate a /D\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.Undefines\">\n            <summary>\n            Macro undefines (/U) to pass to cl.exe.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ObjectFile\">\n            <summary>\n            A name to override the default object file name; can be either a file\n            or directory name. The default is the output directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ProgramDatabaseFile\">\n            <summary>\n            A name for the compiler-generated PDB file; can be either a file or \n            directory name. The default is the output directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>The filename of the external program.</value>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.ClTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.ClTask.PrecompiledHeaderMode\">\n            <summary>\n            Defines the supported modes for the use of precompiled header files.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Tasks.ClTask.PrecompiledHeaderMode.Create\">\n            <summary>\n            Create a precompiled header file.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yc.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Tasks.ClTask.PrecompiledHeaderMode.AutoCreate\">\n            <summary>\n            Automatically create a precompiled header file if necessary.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /YX.\n            </remarks>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Tasks.ClTask.PrecompiledHeaderMode.Use\">\n            <summary>\n            Use a (previously generated) precompiled header file.\n            </summary>\n            <remarks>\n            For further information on the use of this option\n            see the Microsoft documentation on the C++ compiler flag /Yu.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.LibTask\">\n            <summary>\n            Run <c>lib.exe</c>, Microsoft's Library Manager.\n            </summary>\n            <example>\n              <para>Create a library.</para>\n              <code>\n                <![CDATA[\n            <lib output=\"library.lib\">\n                <sources>\n                    <include name=\"library.obj\" />\n                </sources>\n            </lib>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.LibTask.ExecuteTask\">\n            <summary>\n            Creates the library.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.LibTask.NeedsCompiling\">\n            <summary>\n            Determines if the sources need to be linked.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.Options\">\n            <summary>\n            Options to pass to the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.OutputFile\">\n            <summary>\n            The output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.ModuleDefinitionFile\">\n            <summary>\n            The module definition file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.Sources\">\n            <summary>\n            The list of files to combine into the output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.Symbols\">\n            <summary>\n            Symbols to add to the symbol table.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.IgnoreLibraries\">\n            <summary>\n            Names of default libraries to ignore.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.LibDirs\">\n            <summary>\n            The list of additional library directories to search.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>The filename of the external program.</value>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LibTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.LinkTask\">\n            <summary>\n            Links files using <c>link.exe</c>, Microsoft's Incremental Linker.\n            </summary>\n            <remarks>\n              <para>This task is intended for version 7.00.9466 of <c>link.exe</c>.</para>\n            </remarks>\n            <example>\n              <para>\n              Combine all object files in the current directory into <c>helloworld.exe</c>.\n              </para>\n              <code>\n                <![CDATA[\n            <link output=\"helloworld.exe\">\n                <sources>\n                    <include name=\"*.obj\" />\n                </sources>\n            </link>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.LinkTask.ExecuteTask\">\n            <summary>\n            Links the sources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.LinkTask.NeedsLinking\">\n            <summary>\n            Determines if the output needs linking.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.LinkTask.QuoteArgumentValue(System.String)\">\n            <summary>\n            Quotes an argument value and duplicates trailing backslahes.\n            </summary>\n            <param name=\"value\">The argument value to quote.</param>\n            <returns>\n            The quotes argument value.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.Options\">\n            <summary>\n            Options to pass to the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.Debug\">\n            <summary>\n            Create debugging information for the .exe file or DLL. The default is\n            <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.OutputFile\">\n            <summary>\n            The output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.ProgramDatabaseFile\">\n            <summary>\n            A user-specified name for the program database (PDB) that the linker \n            creates. The default file name for the PDB has the base name of the \n            <see cref=\"P:NAnt.VisualCpp.Tasks.LinkTask.OutputFile\"/> and the extension .pdb.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.ModuleDefinition\">\n            <summary>\n            The name of a module-definition file (.def) to be passed to the\n            linker.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.DelayLoadedDlls\">\n            <summary>\n            Specified DLLs for delay loading.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.Sources\">\n            <summary>\n            The list of files to combine into the output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.LibDirs\">\n            <summary>\n            The list of additional library directories to search.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.Modules\">\n            <summary>\n            Link the specified modules into this assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.EmbeddedResources\">\n            <summary>\n            Embed the specified resources into this assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.Symbols\">\n            <summary>\n            Symbols to add to the symbol table.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.IgnoreLibraries\">\n            <summary>\n            Names of libraries that you want the linker to ignore when it \n            resolves external references.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>The filename of the external program.</value>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.LinkTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.McTask\">\n            <summary>\n            Compiles messages using mc.exe, Microsoft's Win32 message compiler.\n            </summary>\n            <example>\n              <para>\n              Compile <c>text.mc</c> using the default options.\n              </para>\n              <code>\n                <![CDATA[\n            <mc mcfile=\"text.mc\"/>\n                ]]>\n              </code>\n              <para>\n              Compile <c>text.mc</c>, passing a path to store the header, the rc \n              file and some additonal options.\n              </para>\n              <code>\n                <![CDATA[\n            <mc mcfile=\"text.mc\" headerpath=\".\\build\" rcpath=\".\\build\" options=\"-v -c -u\"/>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.McTask.ExecuteTask\">\n            <summary>\n            Compiles the sources.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.McTask.NeedsCompiling(System.String)\">\n            <summary>\n            Determine if source files need re-building.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.Options\">\n            <summary>\n            Options to pass to the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.HeaderPath\">\n            <summary>\n            Path to store header file. The default is the project base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.RCPath\">\n            <summary>\n            Path to store RC file. The default is the project base directory.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.McFile\">\n            <summary>\n            Input filename.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.McTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.MidlTask\">\n            <summary>\n            This tasks allows you to run MIDL.exe.\n            </summary>\n            <remarks>\n            <para>\n            This task only supports a small subset of the MIDL.EXE command line \n            switches, but you can use the options element to specify any other\n            unsupported commands you want to specify.\n            </para>\n            </remarks>\n            <example>\n              <code>\n                <![CDATA[\n            <midl\n                env=\"win32\"\n                Oi=\"cf\"\n                tlb=\"${outputdir}\\TempAtl.tlb\"\n                header=\"${outputdir}\\TempAtl.h\"\n                iid=\"${outputdir}\\TempAtl_i.c\"\n                proxy=\"${outputdir}\\TempAtl_p.c\"\n                filename=\"TempAtl.idl\"\n            >\n                <defines>\n                    <define name=\"_DEBUG\"/>\n                    <define name=\"WIN32\" value=\"1\"/>\n                </defines>\n                <options>\n                    <option name=\"/mktyplib203\"/>\n                    <option name=\"/error\" value=\"allocation\"/>\n                </options>\n            </midl>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.MidlTask.ExecuteTask\">\n            <summary>\n            This is where the work is done.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.MidlTask.NeedsCompiling\">\n            <summary>\n            Check output files to see if we need rebuilding.\n            </summary>\n            <see langword=\"true\" /> if a rebuild is needed; otherwise, \n            <see langword=\"false\" />.\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.MidlTask.NeedsCompiling(System.IO.FileInfo)\">\n            <summary>\n            Check output files to see if we need rebuilding.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if a rebuild is needed; otherwise, \n            <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.MidlTask.WriteResponseFile(System.IO.TextWriter)\">\n            <summary>\n            Writes the response file for <c>midl.exe</c>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Acf\">\n            <summary>\n            The /acf switch allows the user to supply an\n            explicit ACF file name. The switch also\n            allows the use of different interface names in\n            the IDL and ACF files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Align\">\n            <summary>\n            The /align switch is functionally the same as the\n            MIDL /Zp option and is recognized by the MIDL compiler\n            solely for backward compatibility with MkTypLib.\n            </summary>\n            <remarks>The alignment value can be 1, 2, 4, or 8.</remarks>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.AppConfig\">\n            <summary>\n            The /app_config switch selects application-configuration\n            mode, which allows you to use some ACF keywords in the\n            IDL file. With this MIDL compiler switch, you can omit\n            the ACF and specify an interface in a single IDL file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Char\">\n            <summary>\n            The /char switch helps to ensure that the MIDL compiler\n            and C compiler operate together correctly for all char\n            and small types.\n            </summary>\n            <remarks>Can be one of signed | unsigned | ascii7 </remarks>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Client\">\n            <summary>\n            The /client switch directs the MIDL compiler to generate\n            client-side C source files for an RPC interface\n            </summary>\n            <remarks>can be one of stub | none</remarks>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.CStub\">\n            <summary>\n            The /cstub switch specifies the name of the client\n            stub file for an RPC interface.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.DllData\">\n            <summary>\n            Specifies the file name for the generated dlldata file for a proxy\n            DLL. The default file name Dlldata.c is used if \n            <see cref=\"P:NAnt.VisualCpp.Tasks.MidlTask.DllData\"/> is not specified.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Env\">\n            <summary>\n            The /env switch selects the\n            environment in which the application runs.\n            </summary>\n            <remarks>It can take the values win32 and win64</remarks>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Oi\">\n            <summary>\n            The /Oi switch directs the MIDL compiler to\n            use a fully-interpreted marshaling method.\n            The /Oic and /Oicf switches provide additional\n            performance enhancements.\n            </summary>\n            <remarks>\n            If you specify the Oi attribute, you must set it to\n            one of the values:\n            - Oi=\"\"\n            - Oi=\"c\"\n            - Oi=\"f\"\n            - Oi=\"cf\"\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Tlb\">\n            <summary>\n            Specifies a file name for the type library generated by the MIDL \n            compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Header\">\n            <summary>\n            Specifies the name of the header file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Iid\">\n            <summary>\n            Specifies the name of the interface identifier file for a COM \n            interface, overriding the default name obtained by adding _i.c \n            to the IDL file name.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Proxy\">\n            <summary>\n            Specifies the name of the interface proxy file for a COM interface.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Filename\">\n            <summary>\n            Name of .IDL file to process.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Options\">\n            <summary>\n            Additional options to pass to midl.exe.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Defines\">\n            <summary>\n            Macro definitions to pass to mdil.exe.\n            Each entry will generate a /D\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.Undefines\">\n            <summary>\n            Macro undefines (/U) to pass to mdil.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.IncludeDirs\">\n            <summary>\n            The list of directories in which to search for include files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.ProgramFileName\">\n            <summary>\n            Filename of program to execute\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.MidlTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Tasks.RcTask\">\n            <summary>\n            Compiles resources using <c>rc.exe</c>, Microsoft's Win32 resource \n            compiler.\n            </summary>\n            <example>\n              <para>\n              Compile <c>text.rc</c> to <c>text.res</c> using the default options.\n              </para>\n              <code>\n                <![CDATA[\n            <rc rcfile=\"text.rc\" output=\"text.res\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Compile <c>text.rc</c>, passing an additional option.\n              </para>\n              <code>\n                <![CDATA[\n            <rc rcfile=\"text.rc\" options=\"/r\"/>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.RcTask.ExecuteTask\">\n            <summary>\n            Compile the resource file\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.RcTask.NeedsCompiling\">\n            <summary>\n            Determines if the resource need compiling.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Tasks.RcTask.CheckResourceTimeStamp(System.String)\">\n            <summary>\n            Check if a resource file has been updated.\n            </summary>\n            <param name=\"filePath\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.Options\">\n            <summary>\n            Options to pass to the compiler.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.OutputFile\">\n            <summary>\n            Output file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.RcFile\">\n            <summary>\n            The resource file to compile.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.LangId\">\n            <summary>\n            Default language ID.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.IncludeDirs\">\n            <summary>\n            The list of directories in which to search for include files.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.Defines\">\n            <summary>\n            Macro definitions to pass to rc.exe.\n            Each entry will generate a /d\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.ProgramFileName\">\n            <summary>\n            Filename of program to execute\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Tasks.RcTask.ProgramArguments\">\n            <summary>\n            Arguments of program to execute\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.CharacterSet\">\n            <summary>\n            Defines the character sets that can be used by the C++ compiler.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Types.CharacterSet.NotSet\">\n            <summary>\n            Have the compiler determine the character set.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Types.CharacterSet.Unicode\">\n            <summary>\n            Unicode character set.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Types.CharacterSet.MultiByte\">\n            <summary>\n            Multi-byte character set.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.Library\">\n            <summary>\n            Represents a library.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.Library.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.Library.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> class with\n            the specified name.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Library.LibraryName\">\n            <summary>\n            The name of the library.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Library.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be processed;\n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Library.UnlessDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be skipped;\n            otherwise, processed. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.LibraryCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.#ctor(NAnt.VisualCpp.Types.LibraryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> class\n            with the specified <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.#ctor(NAnt.VisualCpp.Types.Library[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.Add(NAnt.VisualCpp.Types.Library)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.AddRange(NAnt.VisualCpp.Types.Library[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.AddRange(NAnt.VisualCpp.Types.LibraryCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.Contains(NAnt.VisualCpp.Types.Library)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.CopyTo(NAnt.VisualCpp.Types.Library[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.IndexOf(NAnt.VisualCpp.Types.Library)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.VisualCpp.Types.Library\"/>. If the <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.Insert(System.Int32,NAnt.VisualCpp.Types.Library)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.VisualCpp.Types.LibraryEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryCollection.Remove(NAnt.VisualCpp.Types.Library)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.LibraryCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.LibraryEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.VisualCpp.Types.Library\"/> elements of a <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryEnumerator.#ctor(NAnt.VisualCpp.Types.LibraryCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.LibraryEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.VisualCpp.Types.LibraryCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.LibraryEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.LibraryEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.Symbol\">\n            <summary>\n            Represents a symbol.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.Symbol.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.Symbol.#ctor(System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> class with\n            the specified name.\n            </summary>\n            <exception cref=\"T:System.ArgumentNullException\"><paramref name=\"name\"/> is <see langword=\"null\"/>.</exception>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Symbol.SymbolName\">\n            <summary>\n            The name of the symbol.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Symbol.IfDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be processed;\n            otherwise, skipped. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.Symbol.UnlessDefined\">\n            <summary>\n            If <see langword=\"true\" /> then the element will be skipped;\n            otherwise, processed. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.SymbolCollection\">\n            <summary>\n            Contains a collection of <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> elements.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.#ctor\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> class.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.#ctor(NAnt.VisualCpp.Types.SymbolCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> class\n            with the specified <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> instance.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.#ctor(NAnt.VisualCpp.Types.Symbol[])\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> class\n            with the specified array of <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> instances.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.Add(NAnt.VisualCpp.Types.Symbol)\">\n            <summary>\n            Adds a <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> to the end of the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> to be added to the end of the collection.</param> \n            <returns>The position into which the new element was inserted.</returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.AddRange(NAnt.VisualCpp.Types.Symbol[])\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> array to the end of the collection.\n            </summary>\n            <param name=\"items\">The array of <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> elements to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.AddRange(NAnt.VisualCpp.Types.SymbolCollection)\">\n            <summary>\n            Adds the elements of a <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> to the end of the collection.\n            </summary>\n            <param name=\"items\">The <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/> to be added to the end of the collection.</param> \n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.Contains(NAnt.VisualCpp.Types.Symbol)\">\n            <summary>\n            Determines whether a <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> is in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> to locate in the collection.</param> \n            <returns>\n            <see langword=\"true\"/> if <paramref name=\"item\"/> is found in the \n            collection; otherwise, <see langword=\"false\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.CopyTo(NAnt.VisualCpp.Types.Symbol[],System.Int32)\">\n            <summary>\n            Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        \n            </summary>\n            <param name=\"array\">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> \n            <param name=\"index\">The zero-based index in <paramref name=\"array\"/> at which copying begins.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.IndexOf(NAnt.VisualCpp.Types.Symbol)\">\n            <summary>\n            Retrieves the index of a specified <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> object in the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> object for which the index is returned.</param> \n            <returns>\n            The index of the specified <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/>. If the <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> is not currently a member of the collection, it returns -1.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.Insert(System.Int32,NAnt.VisualCpp.Types.Symbol)\">\n            <summary>\n            Inserts a <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> into the collection at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index at which <paramref name=\"item\"/> should be inserted.</param>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> to insert.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.GetEnumerator\">\n            <summary>\n            Returns an enumerator that can iterate through the collection.\n            </summary>\n            <returns>\n            A <see cref=\"T:NAnt.VisualCpp.Types.SymbolEnumerator\"/> for the entire collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolCollection.Remove(NAnt.VisualCpp.Types.Symbol)\">\n            <summary>\n            Removes a member from the collection.\n            </summary>\n            <param name=\"item\">The <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> to remove from the collection.</param>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.SymbolCollection.Item(System.Int32)\">\n            <summary>\n            Gets or sets the element at the specified index.\n            </summary>\n            <param name=\"index\">The zero-based index of the element to get or set.</param>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Types.SymbolEnumerator\">\n            <summary>\n            Enumerates the <see cref=\"T:NAnt.VisualCpp.Types.Symbol\"/> elements of a <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/>.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolEnumerator.#ctor(NAnt.VisualCpp.Types.SymbolCollection)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.VisualCpp.Types.SymbolEnumerator\"/> class\n            with the specified <see cref=\"T:NAnt.VisualCpp.Types.SymbolCollection\"/>.\n            </summary>\n            <param name=\"arguments\">The collection that should be enumerated.</param>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolEnumerator.MoveNext\">\n            <summary>\n            Advances the enumerator to the next element of the collection.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the enumerator was successfully advanced \n            to the next element; <see langword=\"false\" /> if the enumerator has \n            passed the end of the collection.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Types.SymbolEnumerator.Reset\">\n            <summary>\n            Sets the enumerator to its initial position, which is before the \n            first element in the collection.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.VisualCpp.Types.SymbolEnumerator.Current\">\n            <summary>\n            Gets the current element in the collection.\n            </summary>\n            <returns>\n            The current element in the collection.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Util.BackslashProcessingMethod\">\n            <summary>\n            Defines how to deal with backslashes in values of command line \n            arguments.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Util.BackslashProcessingMethod.None\">\n            <summary>\n            Does not perform any processing on backslashes.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Util.BackslashProcessingMethod.Duplicate\">\n            <summary>\n            Duplicates the trailing backslash.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Util.BackslashProcessingMethod.Fix\">\n            <summary>\n            Fixes the trailing backslash by replaces trailing double backslashes\n            with only one backslash and removing single trailing backslashes.\n            </summary>\n        </member>\n        <member name=\"F:NAnt.VisualCpp.Util.BackslashProcessingMethod.Clean\">\n            <summary>\n            Removes all the trailing backslashes.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VisualCpp.Util.ArgumentUtils\">\n            <summary>\n            Groups a set of useful <see cref=\"T:System.String\"/> manipulation methods for\n            command-line arguments.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Util.ArgumentUtils.ProcessTrailingBackslash(System.String,NAnt.VisualCpp.Util.BackslashProcessingMethod)\">\n            <summary>\n            Performs backslash processing on the specified value using a given\n            method.\n            </summary>\n            <param name=\"value\">The <see cref=\"T:System.String\"/> to process.</param>\n            <param name=\"processingMethod\">The <see cref=\"T:NAnt.VisualCpp.Util.BackslashProcessingMethod\"/> to use.</param>\n            <returns>\n            <paramref name=\"value\"/> with backslashes processed using the given\n            <see cref=\"T:NAnt.VisualCpp.Util.BackslashProcessingMethod\"/>.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Util.ArgumentUtils.DuplicateTrailingBackslash(System.String)\">\n            <summary>\n            Duplicates the trailing backslash.\n            </summary>\n            <param name=\"value\">The input string to check and duplicate the trailing backslash if necessary.</param>\n            <returns>The result string after being processed.</returns>\n            <remarks>\n            Also duplicates trailing backslash in quoted value.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Util.ArgumentUtils.FixTrailingBackslash(System.String)\">\n            <summary>\n            Fixes the trailing backslash. This function replaces the trailing double backslashes with\n            only one backslash. It also, removes the single trailing backslash.\n            </summary>\n            <param name=\"value\">The input string.</param>\n            <returns>The result string after being processed.</returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Util.ArgumentUtils.CleanTrailingBackslash(System.String)\">\n            <summary>\n            Removes all the trailing backslashes from the input.\n            </summary>\n            <param name=\"value\">The input string.</param>\n            <returns>The result string without trailing backslashes.</returns>\n        </member>\n        <member name=\"M:NAnt.VisualCpp.Util.ArgumentUtils.QuoteArgumentValue(System.String,NAnt.VisualCpp.Util.BackslashProcessingMethod)\">\n            <summary>\n            Quotes an argument value and processes backslashes using a given\n            <see cref=\"T:NAnt.VisualCpp.Util.BackslashProcessingMethod\"/>.\n            </summary>\n            <param name=\"value\">The argument value to quote.</param>\n            <param name=\"processingMethod\">The <see cref=\"T:NAnt.VisualCpp.Util.BackslashProcessingMethod\"/> to use.</param>\n            <returns>\n            The quoted argument value.\n            </returns>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.Win32Tasks.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.Win32Tasks</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.Win32.Functions.CygpathFunctions\">\n            <summary>\n            Groups a set of functions that convert Windows native filenames to \n            Cygwin POSIX-style pathnames and vice versa.\n            </summary>\n            <remarks>\n            It can be used when a Cygwin program needs to pass a file name to a \n            native Windows program, or expects to get a file name from a native \n            Windows program.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.#ctor(NAnt.Core.Project,NAnt.Core.PropertyDictionary)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Win32.Functions.CygpathFunctions\"/>\n            class with the specified <see cref=\"T:NAnt.Core.Project\"/> and properties.\n            </summary>\n            <param name=\"project\">The <see cref=\"T:NAnt.Core.Project\"/> in which the class is used.</param>\n            <param name=\"properties\">The set of properties to use for macro expansion.</param>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.GetDosPath(System.String)\">\n            <summary>\n            Gets the DOS (short) form of the specified path.\n            </summary>\n            <param name=\"path\">The path to convert.</param>\n            <returns>\n            The DOS (short) form of the specified path.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>cygpath</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> could not be converted to a short form.</exception>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.GetUnixPath(System.String)\">\n            <summary>\n            Gets the Unix form of the specified path.\n            </summary>\n            <param name=\"path\">The path to convert.</param>\n            <returns>\n            The Unix form of the specified path.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>cygpath</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> could not be converted to a Unix form.</exception>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.GetWindowsPath(System.String)\">\n            <summary>\n            Gets the Windows form of the specified path.\n            </summary>\n            <param name=\"path\">The path to convert.</param>\n            <returns>\n            The Windows form of the specified path.\n            </returns>\n            <exception cref=\"T:System.ComponentModel.Win32Exception\"><c>cygpath</c> could not be started.</exception>\n            <exception cref=\"T:System.ArgumentException\"><paramref name=\"path\"/> could not be converted to a Windows form.</exception>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.RunCygpathString(NAnt.Core.Types.Argument[])\">\n            <summary>\n            Runs cygpath with the specified arguments and returns the result \n            as a <see cref=\"T:System.String\"/>.\n            </summary>\n            <param name=\"args\">The arguments to pass to cygpath.</param>\n            <returns>\n            The result of running cygpath with the specified arguments.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Win32.Functions.CygpathFunctions.GetTask(System.IO.Stream)\">\n            <summary>\n            Factory method to return a new instance of ExecTask\n            </summary>\n            <param name=\"stream\"></param>\n            <returns></returns>\n        </member>\n        <member name=\"T:NAnt.Win32.Tasks.AxImpTask\">\n            <summary>\n            Generates a Windows Forms Control that wraps ActiveX Controls defined \n            in an OCX.\n            </summary>\n            <example>\n              <code>\n                <![CDATA[\n            <aximp ocx=\"MyControl.ocx\" output=\"MyFormsControl.dll\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.AxImpTask.ExecuteTask\">\n            <summary>\n            Import the ActiveX control.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.AxImpTask.NeedsCompiling\">\n            <summary>\n            Determines whether the assembly needs to be created again.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the assembly needs to be created again; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.OcxFile\">\n            <summary>\n            Filename of the .ocx file.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.OutputFile\">\n            <summary>\n            Filename of the generated assembly.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.PublicKeyFile\">\n            <summary>\n            Specifies the file containing the public key to use to sign the \n            resulting assembly.\n            </summary>\n            <value>\n            The file containing the public key to use to sign the resulting\n            assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.KeyFile\">\n            <summary>\n            Specifies the publisher's official public/private key pair with which \n            the resulting assembly should be signed with a strong name.\n            </summary>\n            <value>\n            The keyfile to use to sign the resulting assembly with a strong name.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.KeyContainer\">\n            <summary>\n            Specifies the key container in which the public/private key pair \n            should be found that should be used to sign the resulting assembly\n            with a strong name.\n            </summary>\n            <value>\n            The key container containing a public/private key pair that should\n            be used to sign the resulting assembly.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.DelaySign\">\n            <summary>\n            Specifies to sign the resulting control using delayed signing.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.GenerateSource\">\n            <summary>\n            Determines whether C# source code for the Windows Form wrapper should \n            be generated. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.RcwFile\">\n            <summary>\n            Assembly to use for Runtime Callable Wrapper rather than generating \n            new one [.NET 1.1 or higher].\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.SupportsRcw\">\n            <summary>\n            Indicates whether <c>aximp</c> supports using an existing Runtime\n            Callable Wrapper for a given target framework. The default is \n            <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.AxImpTask.ProgramArguments\">\n            <summary>\n            Gets the command-line arguments for the external program.\n            </summary>\n            <value>\n            The command-line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Win32.Tasks.ReadRegistryTask\">\n            <summary>\n            Reads a value or set of values from the Windows Registry into one or \n            more NAnt properties.\n            </summary>\n            <example>\n              <para>Read a single value from the registry.</para>\n              <code>\n                <![CDATA[\n            <readregistry property=\"sdkRoot\" key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRoot\" hive=\"LocalMachine\" />\n                ]]>\n              </code>\n              <para>Read all the registry values in a key.</para>\n              <code>\n                <![CDATA[\n            <readregistry prefix=\"dotNetFX\" key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRoot\" hive=\"LocalMachine\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.ReadRegistryTask.ExecuteTask\">\n            <summary>\n            read the specified registry value\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.ReadRegistryTask.LookupRegKey(System.String,Microsoft.Win32.RegistryHive[])\">\n            <summary>\n            Returns the hive for a given key.\n            </summary>\n            <param name=\"key\"></param>\n            <param name=\"registries\"></param>\n            <returns>\n            The hive for a given key.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.ReadRegistryTask.GetHiveKey(Microsoft.Win32.RegistryHive)\">\n            <summary>\n            Returns the key for a given registry hive.\n            </summary>\n            <param name=\"hive\">The registry hive to return the key for.</param>\n            <returns>\n            The key for a given registry hive.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.ReadRegistryTask.PropertyName\">\n            <summary>\n                <para>The property to set to the specified registry key value.</para>\n                <para>If this attribute is used then a single value will be read.</para>\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.ReadRegistryTask.PropertyPrefix\">\n            <summary>\n                <para>The prefix to use for the specified registry key values.</para>\n                <para>If this attribute is used then all registry values will be read and stored as properties with this prefix.</para>\n            </summary>\n            <example>\n                <para>Registry values a, b, c will be turned into prefixa, prefixb, prefixc named properties</para>\n            </example>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.ReadRegistryTask.RegistryKey\">\n            <summary>\n            The registry key to read, including the path.\n            </summary>\n            <example>\n            SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRoot\n            </example>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.ReadRegistryTask.RegistryHiveName\">\n            <summary>\n            Space separated list of registry hives to search for <see cref=\"P:NAnt.Win32.Tasks.ReadRegistryTask.RegistryKey\"/>.\n            For a list of possible values, see <see cref=\"T:Microsoft.Win32.RegistryHive\"/>. The \n            default is <see cref=\"F:Microsoft.Win32.RegistryHive.LocalMachine\"/>.\n            </summary>\n            <remarks>\n            <seealso cref=\"T:Microsoft.Win32.RegistryHive\"/>\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Win32.Tasks.RegAsmTask\">\n            <summary>\n            Registers an assembly, or set of assemblies for use from COM clients.\n            </summary>\n            <remarks>\n              <para>\n              Refer to the <see href=\"ms-help://MS.VSCC/MS.MSDNVS/cptools/html/cpgrfassemblyregistrationtoolregasmexe.htm\">Regasm</see> \n              documentation for more information on the regasm tool.\n              </para>\n            </remarks>\n            <example>\n              <para>\n              Register types in a single assembly.\n              </para>\n              <code>\n                <![CDATA[\n            <regasm assembly=\"myAssembly.dll\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Register types of an assembly and generate a type library containing\n              definitions of accessible types defined within the assembly.\n              </para>\n              <code>\n                <![CDATA[\n            <regasm assembly=\"myAssembly.dll\" typelib=\"myAssembly.tlb\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Register types of set of assemblies at once, while specifying a set\n              of reference assemblies.\n              </para>\n              <code>\n                <![CDATA[\n            <regasm codebase=\"true\">\n                <assemblies>\n                    <include name=\"OutlookAddin.dll\" />\n                    <include name=\"OfficeCoreAddin.dll\" />\n                </assemblies>\n                <references>\n                    <include name=\"CommonTypes.dll\" />\n                </references>\n            </regasm>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.RegAsmTask.PrepareProcess(System.Diagnostics.Process)\">\n            <summary>\n            Updates the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> of the specified \n            <see cref=\"T:System.Diagnostics.Process\"/>.\n            </summary>\n            <param name=\"process\">The <see cref=\"T:System.Diagnostics.Process\"/> of which the <see cref=\"T:System.Diagnostics.ProcessStartInfo\"/> should be updated.</param>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.RegAsmTask.ExecuteTask\">\n            <summary>\n            Registers or unregisters a single assembly, or a group of assemblies.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.AssemblyFile\">\n            <summary>\n            The name of the file to register. This is provided as an alternate \n            to using the task's <see cref=\"P:NAnt.Win32.Tasks.RegAsmTask.Assemblies\"/>.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.RegistryFile\">\n            <summary>\n            Registry file to export to instead of entering the types directly \n            into the registry.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.CodeBase\">\n            <summary>\n            Set the code base registry setting.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.Registered\">\n            <summary>\n            Only refer to already registered type libraries.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.TypeLib\">\n            <summary>\n            Export the assemblies to the specified type library and register it.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.Unregister\">\n            <summary>\n            Unregister the assembly. The default is <see langword=\"false\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.Assemblies\">\n            <summary>\n            The set of assemblies to register, or unregister.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.References\">\n            <summary>\n            The set of assembly references.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.BaseDirectory\">\n            <summary>\n            Gets the working directory for the application.\n            </summary>\n            <value>\n            The working directory for the application.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.ProgramArguments\">\n            <summary>\n            Gets the command line arguments for the external program.\n            </summary>\n            <value>\n            The command line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.RegAsmTask.ProgramFileName\">\n            <summary>\n            Gets the filename of the external program to start.\n            </summary>\n            <value>\n            The filename of the external program.\n            </value>\n            <remarks>\n            Override in derived classes to explicitly set the location of the \n            external tool.\n            </remarks>\n        </member>\n        <member name=\"T:NAnt.Win32.Tasks.TlbExpTask\">\n            <summary>\n            Exports a .NET assembly to a type library that can be used from unmanaged \n            code (wraps Microsoft's <c>tlbexp.exe</c>).\n            </summary>\n            <remarks>\n              <para>\n              <see href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryexportertlbexpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</see>\n              </para>\n            </remarks>\n            <example>\n              <para>Export <c>DotNetAssembly.dll</c> to <c>LegacyCOM.dll</c>.</para>\n              <code>\n                <![CDATA[\n            <tlbexp assembly=\"DotNetAssembly.dll\" output=\"LegacyCOM.dll\" />\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.TlbExpTask.ExecuteTask\">\n            <summary>\n            Exports the type library.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.TlbExpTask.NeedsCompiling\">\n            <summary>\n            Determines whether the assembly needs to be exported to a type \n            library again.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the assembly needs to be exported to a \n            type library; otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbExpTask.AssemblyFile\">\n            <summary>\n            Specifies the assembly for which to export a type library.\n            </summary>\n            <value>\n            The assembly for which to export a type library.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryexportertlbexpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbExpTask.OutputFile\">\n            <summary>\n            Specifies the name of the type library file to generate.\n            </summary>\n            <value>\n            The name of the type library file to generate.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryexportertlbexpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbExpTask.NamesFile\">\n            <summary>\n            Specifies the file used to determine capitalization of names in a \n            type library.\n            </summary>\n            <value>\n            The file used to determine capitalization of names in a type library.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryexportertlbexpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbExpTask.ProgramArguments\">\n            <summary>\n            Gets the command line arguments for the external program.\n            </summary>\n            <value>\n            The command line arguments for the external program.\n            </value>\n        </member>\n        <member name=\"T:NAnt.Win32.Tasks.TlbImpTask\">\n            <summary>\n            Imports a type library to a .NET assembly (wraps Microsoft's <c>tlbimp.exe</c>).\n            </summary>\n            <remarks>\n            <para>\n            This task lets you easily create interop assemblies.  By default, it will \n            not reimport if the underlying COM TypeLib or reference has not changed.\n            </para>\n            <para>\n            <see href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</see>\n            </para>\n            </remarks>\n            <example>\n              <para>Import <c>LegacyCOM.dll</c> to <c>DotNetAssembly.dll</c>.</para>\n              <code>\n                <![CDATA[\n            <tlbimp typelib=\"LegacyCOM.dll\" output=\"DotNetAssembly.dll\" />\n                ]]>\n              </code>\n            </example>\n            <example>\n              <para>\n              Generate an assembly named &quot;Interop.MSVidCtlLib.dll&quot; for the\n              MS Video Control 1.0 Type Library, transforming any [out, retval]\n              parameters of methods on dispinterfaces in the type library into \n              return values in the managed library.\n              </para>\n              <code>\n                <![CDATA[\n            <tlbimp typelib=\"msvidctl.dll\" output=\"Interop.MSVidCtlLib.dll\" transform=\"dispret\">\n                <references basedir=\"Interop\">\n                    <include name=\"Interop.TunerLib.dll\" />\n                </references>\n            </tlbimp>\n                ]]>\n              </code>\n            </example>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.TlbImpTask.ExecuteTask\">\n            <summary>\n            Imports the type library to a .NET assembly.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.TlbImpTask.ExtractTypeLibPath(System.String)\">\n            <summary>\n            Returns the path of the type library, removing the identifier of \n            the type library from the specified string.\n            </summary>\n            <param name=\"path\">The path from which to extract the path of the type library.</param>\n            <returns>\n            The path of the type library without the type library identifier.\n            </returns>\n            <remarks>\n            An example of a path which includes the identifier of the type \n            library (in this case &quot;2&quot;) is\n            <c>C:\\WINDOWS\\system32\\msvidctl.dll\\2</c>.\n            </remarks>\n        </member>\n        <member name=\"M:NAnt.Win32.Tasks.TlbImpTask.NeedsCompiling\">\n            <summary>\n            Determines whether the type library needs to be imported again.\n            </summary>\n            <returns>\n            <see langword=\"true\" /> if the type library needs to be imported; \n            otherwise, <see langword=\"false\" />.\n            </returns>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.OutputFile\">\n            <summary>\n            Specifies the name of the output file.\n            </summary>\n            <value>\n            The name of the output file.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.Namespace\">\n            <summary>\n            Specifies the namespace in which to produce the assembly.\n            </summary>\n            <value>\n            The namespace in which to produce the assembly.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.AsmVersion\">\n            <summary>\n            Specifies the version number of the assembly to produce.\n            </summary>\n            <remarks>\n            <value>\n            The version number of the assembly to produce.\n            </value>\n            <para>\n            The version number should be in the format major.minor.build.revision.\n            </para>\n            <para>\n            <a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a>\n            </para>\n            </remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.DelaySign\">\n            <summary>\n            Specifies whether the resulting assembly should be signed with a \n            strong name using delayed signing. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if the resulting assembly should be signed \n            with a strong name using delayed signing; otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.Primary\">\n            <summary>\n            Specifies whether a primary interop assembly should be produced for \n            the specified type library. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if a primary interop assembly should be \n            produced; otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.PublicKeyFile\">\n            <summary>\n            Specifies the file containing the public key to use to sign the \n            resulting assembly.\n            </summary>\n            <value>\n            The file containing the public key to use to sign the resulting\n            assembly.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.KeyFile\">\n            <summary>\n            Specifies the publisher's official public/private key pair with which \n            the resulting assembly should be signed with a strong name.\n            </summary>\n            <value>\n            The keyfile to use to sign the resulting assembly with a strong name.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.KeyContainer\">\n            <summary>\n            Specifies the key container in which the public/private key pair \n            should be found that should be used to sign the resulting assembly\n            with a strong name.\n            </summary>\n            <value>\n            The key container containing a public/private key pair that should\n            be used to sign the resulting assembly.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.References\">\n            <summary>\n            Specifies the assembly files to use to resolve references to types \n            defined outside the current type library. \n            </summary>\n            <value>\n            The assembly files to use to resolve references to types defined \n            outside the current type library.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.StrictRef\">\n            <summary>\n            Specifies whether a type library should not be imported if all \n            references within the current assembly or the reference assemblies \n            cannot be resolved. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if a type library should not be imported if \n            all references cannot be resolved; otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.SysArray\">\n            <summary>\n            Specifies whether to import a COM style SafeArray as a managed \n            <see cref=\"T:System.Array\"/> class type. The default is <see langword=\"false\"/>.\n            </summary>\n            <value>\n            <see langword=\"true\"/> if a COM style SafeArray should be imported \n            as a managed <see cref=\"T:System.Array\"/> class type; otherwise, \n            <see langword=\"false\"/>.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.Transform\">\n            <summary>\n            Specifies how to transform the metadata [.NET 1.1 or higher].\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.TypeLib\">\n            <summary>\n            Specifies the source type library that gets passed to the type \n            library importer.\n            </summary>\n            <value>\n            The source type library that gets passed to the type library \n            importer.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.Unsafe\">\n            <summary>\n            Specifies whether interfaces should be produced without .NET Framework \n            security checks. The default is <see langword=\"false\" />.\n            </summary>\n            <value>\n            <see langword=\"true\" /> if interfaces without .NET Framework security \n            checks should be produced; otherwise, <see langword=\"false\" />.\n            </value>\n            <remarks><a href=\"ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm\">See the Microsoft.NET Framework SDK documentation for details.</a></remarks>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.SupportsTransform\">\n            <summary>\n            Indicates whether <c>tlbimp</c> supports transforming metadata for\n            a given target framework. The default is <see langword=\"true\" />.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Win32.Tasks.TlbImpTask.ProgramArguments\">\n            <summary>\n            Gets the command line arguments for the external program.\n            </summary>\n            <value>\n            The command line arguments for the external program.\n            </value>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/NAnt.exe.config",
    "content": "<?xml version=\"1.0\"?>\n<configuration>\n    <!-- Leave this alone. Sets up configsectionhandler section -->\n    <configSections>\n        <section name=\"nant\" type=\"NAnt.Core.ConfigurationSection, NAnt.Core\" />\n        <section name=\"log4net\" type=\"System.Configuration.IgnoreSectionHandler\" />\n    </configSections>\n    <appSettings>\n        <!-- Used to indicate the location of the cache folder for shadow files -->\n        <add key=\"shadowfiles.path\" value=\"%temp%\\nunit20\\ShadowCopyCache\" />\n        <!-- Used to indicate that NAnt should shadow copy files in a cache folder near the executable -->\n        <add key=\"nant.shadowfiles\" value=\"False\" />\n        <!-- Used to indicate if cached files should be deleted when done running-->\n        <add key=\"nant.shadowfiles.cleanup\" value=\"False\" />\n        <!-- To enable internal log4net logging, uncomment the next line -->\n        <!-- <add key=\"log4net.Internal.Debug\" value=\"true\"/> -->\n    </appSettings>\n    <!-- nant config settings -->\n    <nant>\n        <frameworks>\n            <platform name=\"win32\" default=\"auto\">\n                <task-assemblies>\n                        <!-- include NAnt task assemblies -->\n                        <include name=\"*Tasks.dll\" />\n                        <!-- include NAnt test assemblies -->\n                        <include name=\"*Tests.dll\" />\n                        <!-- include framework-neutral assemblies -->\n                        <include name=\"extensions/common/neutral/**/*.dll\" />\n                        <!-- exclude Microsoft.NET specific task assembly -->\n                        <exclude name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- exclude Microsoft.NET specific test assembly -->\n                        <exclude name=\"NAnt.MSNet.Tests.dll\" />\n                </task-assemblies>\n                <framework \n                    name=\"net-1.0\"\n                    family=\"net\"\n                    version=\"1.0\"\n                    description=\"Microsoft .NET Framework 1.0\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v1.0.3705')}\"\n                    frameworkassemblydirectory=\"${path::combine(installRoot, 'v1.0.3705')}\"\n                    clrversion=\"1.0.3705\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/net/1.0\" />\n                            <directory name=\"lib/net/neutral\" />\n                            <directory name=\"lib/common/1.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v1.0.3705\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(installRoot, 'v1.0.3705')}\">\n                        <include name=\"Accessibility.dll\" />\n                        <include name=\"cscompmgd.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"Microsoft.Vsa.dll\" />\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"System.Configuration.Install.dll\" />\n                        <include name=\"System.Data.dll\" />\n                        <include name=\"System.Design.dll\" />\n                        <include name=\"System.DirectoryServices.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Drawing.Design.dll\" />\n                        <include name=\"System.Drawing.dll\" />\n                        <include name=\"System.EnterpriseServices.dll\" />\n                        <include name=\"System.Management.dll\" />\n                        <include name=\"System.Messaging.dll\" />\n                        <include name=\"System.Runtime.Remoting.dll\" />\n                        <include name=\"System.Runtime.Serialization.Formatters.Soap.dll\" />\n                        <include name=\"System.Security.dll\" />\n                        <include name=\"System.ServiceProcess.dll\" />\n                        <include name=\"System.Web.dll\" />\n                        <include name=\"System.Web.RegularExpressions.dll\" />\n                        <include name=\"System.Web.Services.dll\" />\n                        <include name=\"System.Windows.Forms.dll\" />\n                        <include name=\"System.XML.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 1.0 specific assemblies -->\n                        <include name=\"extensions/net/1.0/**/*.dll\" />\n                        <!-- include Microsoft.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include Microsoft.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 1.0 specific assemblies -->\n                        <include name=\"extensions/common/1.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                            if=\"${property::exists('sdkInstallRoot')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v1.0.3705')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRoot\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"vjc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                        </task>\n                        <task name=\"aximp\">\n                            <attribute name=\"supportsrcw\">false</attribute>\n                        </task>\n                        <task name=\"tlbimp\">\n                            <attribute name=\"supportstransform\">false</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"net-1.1\"\n                    family=\"net\"\n                    version=\"1.1\"\n                    description=\"Microsoft .NET Framework 1.1\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v1.1.4322')}\"\n                    frameworkassemblydirectory=\"${path::combine(installRoot, 'v1.1.4322')}\"\n                    clrversion=\"1.1.4322\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/net/1.1\" />\n                            <directory name=\"lib/net/neutral\" />\n                            <directory name=\"lib/common/1.1\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v1.1.4322\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(installRoot, 'v1.1.4322')}\">\n                        <include name=\"Accessibility.dll\" />\n                        <include name=\"cscompmgd.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"Microsoft.Vsa.dll\" />\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.Data.dll\" />\n                        <include name=\"System.Configuration.Install.dll\" />\n                        <include name=\"System.Data.dll\" />\n                        <include name=\"System.Data.OracleClient.dll\" />\n                        <include name=\"System.Design.dll\" />\n                        <include name=\"System.DirectoryServices.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Drawing.Design.dll\" />\n                        <include name=\"System.Drawing.dll\" />\n                        <include name=\"System.EnterpriseServices.dll\" />\n                        <include name=\"System.Management.dll\" />\n                        <include name=\"System.Messaging.dll\" />\n                        <include name=\"System.Runtime.Remoting.dll\" />\n                        <include name=\"System.Runtime.Serialization.Formatters.Soap.dll\" />\n                        <include name=\"System.Security.dll\" />\n                        <include name=\"System.ServiceProcess.dll\" />\n                        <include name=\"System.Web.dll\" />\n                        <include name=\"System.Web.Mobile.dll\" />\n                        <include name=\"System.Web.RegularExpressions.dll\" />\n                        <include name=\"System.Web.Services.dll\" />\n                        <include name=\"System.Windows.Forms.dll\" />\n                        <include name=\"System.XML.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 1.1 specific assemblies -->\n                        <include name=\"extensions/net/1.1/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 1.1 specific assemblies -->\n                        <include name=\"extensions/common/1.1/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                            if=\"${property::exists('sdkInstallRoot')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v1.1.4322')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry \n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry \n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRootv1.1\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"vjc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"net-2.0\"\n                    family=\"net\"\n                    version=\"2.0\"\n                    description=\"Microsoft .NET Framework 2.0\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v2.0.50727')}\"\n                    frameworkassemblydirectory=\"${path::combine(installRoot, 'v2.0.50727')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/net/2.0\" />\n                            <directory name=\"lib/net/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v2.0.50727\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(installRoot, 'v2.0.50727')}\">\n                        <include name=\"Accessibility.dll\" />\n                        <include name=\"cscompmgd.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"Microsoft.Build.Engine.dll\" />\n                        <include name=\"Microsoft.Build.Framework.dll\" />\n                        <include name=\"Microsoft.Build.Utilities.dll\" />\n                        <include name=\"Microsoft.Vsa.dll\" />\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.Data.dll\" />\n                        <include name=\"System.Configuration.dll\" />\n                        <include name=\"System.Configuration.Install.dll\" />\n                        <include name=\"System.Data.dll\" />\n                        <include name=\"System.Data.OracleClient.dll\" />\n                        <include name=\"System.Data.SqlXml.dll\" />\n                        <include name=\"System.Deployment.dll\" />\n                        <include name=\"System.Design.dll\" />\n                        <include name=\"System.DirectoryServices.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Drawing.Design.dll\" />\n                        <include name=\"System.Drawing.dll\" />\n                        <include name=\"System.EnterpriseServices.dll\" />\n                        <include name=\"System.Management.dll\" />\n                        <include name=\"System.Messaging.dll\" />\n                        <include name=\"System.Runtime.Remoting.dll\" />\n                        <include name=\"System.Runtime.Serialization.Formatters.Soap.dll\" />\n                        <include name=\"System.Security.dll\" />\n                        <include name=\"System.ServiceProcess.dll\" />\n                        <include name=\"System.Transactions.dll\" />\n                        <include name=\"System.Web.dll\" />\n                        <include name=\"System.Web.Mobile.dll\" />\n                        <include name=\"System.Web.RegularExpressions.dll\" />\n                        <include name=\"System.Web.Services.dll\" />\n                        <include name=\"System.Windows.Forms.dll\" />\n                        <include name=\"System.XML.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 2.0 specific assemblies -->\n                        <include name=\"extensions/net/2.0/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                            if=\"${property::exists('sdkInstallRoot')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v2.0.50727')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRootv2.0\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportsnostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"supportsplatform\">true</attribute>\n                        </task>\n                        <task name=\"vjc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"net-3.5\"\n                    family=\"net\"\n                    version=\"3.5\"\n                    description=\"Microsoft .NET Framework 3.5\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v3.5')}\"\n                    frameworkassemblydirectory=\"${path::combine(installRoot, 'v2.0.50727')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/net/2.0\" />\n                            <directory name=\"lib/net/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v2.0.50727\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(installRoot, 'v2.0.50727')}\">\n                        <include name=\"Accessibility.dll\" />\n                        <include name=\"cscompmgd.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"Microsoft.Build.Utilities.dll\" />\n                        <include name=\"Microsoft.Vsa.dll\" />\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.dll\" />\n                        <include name=\"Microsoft.VisualBasic.Compatibility.Data.dll\" />\n                        <include name=\"System.Configuration.dll\" />\n                        <include name=\"System.Configuration.Install.dll\" />\n                        <include name=\"System.Data.dll\" />\n                        <include name=\"System.Data.OracleClient.dll\" />\n                        <include name=\"System.Data.SqlXml.dll\" />\n                        <include name=\"System.Deployment.dll\" />\n                        <include name=\"System.Design.dll\" />\n                        <include name=\"System.DirectoryServices.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Drawing.Design.dll\" />\n                        <include name=\"System.Drawing.dll\" />\n                        <include name=\"System.EnterpriseServices.dll\" />\n                        <include name=\"System.Management.dll\" />\n                        <include name=\"System.Messaging.dll\" />\n                        <include name=\"System.Runtime.Remoting.dll\" />\n                        <include name=\"System.Runtime.Serialization.Formatters.Soap.dll\" />\n                        <include name=\"System.Security.dll\" />\n                        <include name=\"System.ServiceProcess.dll\" />\n                        <include name=\"System.Transactions.dll\" />\n                        <include name=\"System.Web.dll\" />\n                        <include name=\"System.Web.Mobile.dll\" />\n                        <include name=\"System.Web.RegularExpressions.dll\" />\n                        <include name=\"System.Web.Services.dll\" />\n                        <include name=\"System.Windows.Forms.dll\" />\n                        <include name=\"System.XML.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/v3.5\">\n                        <include name=\"Microsoft.Build.Engine.dll\" />\n                        <include name=\"Microsoft.Build.Framework.dll\" />\n                        <include name=\"System.AddIn.Contract.dll\" />\n                        <include name=\"System.AddIn.dll\" />\n                        <include name=\"System.Core.dll\" />\n                        <include name=\"System.Data.DataSetExtensions.dll\" />\n                        <include name=\"System.Data.Linq.dll\" />\n                        <include name=\"System.DirectoryServices.AccountManagement.dll\" />\n                        <include name=\"System.Management.Instrumentation.dll\" />\n                        <include name=\"System.Net.dll\" />\n                        <include name=\"System.ServiceModel.Web.dll\" />\n                        <include name=\"System.Web.Extensions.Design.dll\" />\n                        <include name=\"System.Web.Extensions.dll\" />\n                        <include name=\"System.Windows.Presentation.dll\" />\n                        <include name=\"System.WorkflowServices.dll\" />\n                        <include name=\"System.Xml.Linq.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${environment::get-folder-path('ProgramFiles')}/Reference Assemblies/Microsoft/Framework/v3.0\">\n                        <include name=\"System.IdentityModel.dll\" />\n                        <include name=\"System.IdentityModel.Selectors.dll\" />\n                        <include name=\"System.IO.Log.dll\" />\n                        <include name=\"System.Printing.dll\" />\n                        <include name=\"System.Runtime.Serialization.dll\" />\n                        <include name=\"System.ServiceModel.dll\" />\n                        <include name=\"System.Speech.dll\" />\n                        <include name=\"System.Workflow.Activities.dll\" />\n                        <include name=\"System.Workflow.ComponentModel.dll\" />\n                        <include name=\"System.Workflow.Runtime.dll\" />\n                        <include name=\"WindowsBase.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 2.0 specific assemblies -->\n                        <include name=\"extensions/net/2.0/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                            if=\"${property::exists('sdkInstallRoot')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v3.5')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v2.0.50727')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A\\WinSDKNetFxTools\\InstallationFolder\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1\\WinSDKNetFxTools\\InstallationFolder\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportsnostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"supportsplatform\">true</attribute>\n                        </task>\n                        <task name=\"vjc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"netcf-1.0\"\n                    family=\"netcf\"\n                    version=\"1.0\"\n                    description=\"Microsoft .NET Compact Framework 1.0\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'v1.0.5000\\bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v1.1.4322')}\"\n                    frameworkassemblydirectory=\"${path::combine(sdkInstallRoot, 'v1.0.5000\\Windows CE')}\"\n                    clrversion=\"1.1.4322\"\n                    clrtype=\"Compact\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v1.1.4322\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(sdkInstallRoot, 'v1.0.5000\\Windows CE')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- this is not a supported runtime framework -->\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'v1.0.5000\\bin')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v1.1.4322')}\" />\n                        <directory name=\"${path::combine(sdkInstallRoot.DesktopFramework, 'bin')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETCompactFramework\\sdkInstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot.DesktopFramework\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRootv1.1\"\n                            hive=\"LocalMachine\" />\n                        <fail if=\"${not directory::exists(sdkInstallRoot.DesktopFramework)}\">The .NET Framework 1.1 SDK is not installed.</fail>\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"noconfig\">true</attribute>\n                            <attribute name=\"nostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"exename\">cfresgen</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"netcf-2.0\"\n                    family=\"netcf\"\n                    version=\"2.0\"\n                    description=\"Microsoft .NET Compact Framework 2.0\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot.DesktopFramework, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v2.0.50727')}\"\n                    frameworkassemblydirectory=\"${path::combine(sdkInstallRoot, 'WindowsCE')}\"\n                    clrversion=\"2.0.0\"\n                    clrtype=\"Compact\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v2.0.50727\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(sdkInstallRoot, 'WindowsCE')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- this is not a supported runtime framework -->\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot.DesktopFramework, 'bin')}\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\InstallRoot\\\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot.DesktopFramework\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\sdkInstallRootv2.0\"\n                            hive=\"LocalMachine\" />\n                        <fail if=\"${not directory::exists(sdkInstallRoot.DesktopFramework)}\">The .NET Framework 2.0 SDK is not installed.</fail>\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"noconfig\">true</attribute>\n                            <attribute name=\"nostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"nostdlib\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportsnostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"silverlight-2.0\"\n                    family=\"silverlight\"\n                    version=\"2.0\"\n                    description=\"Microsoft Silverlight 2.0\"\n                    sdkdirectory=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                    frameworkdirectory=\"${path::combine(installRoot, 'v3.5')}\"\n                    frameworkassemblydirectory=\"${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/2.0.31005.0\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Browser\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <modes>\n                            <strict>\n                                <environment>\n                                    <variable name=\"COMPLUS_VERSION\" value=\"v2.0.50727\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/2.0.31005.0\">\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"System.Core.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Net.dll\" />\n                        <include name=\"System.Runtime.Serialization.dll\" />\n                        <include name=\"System.ServiceModel.dll\" />\n                        <include name=\"System.ServiceModel.Web.dll\" />\n                        <include name=\"System.Windows.Browser.dll\" />\n                        <include name=\"System.Windows.dll\" />\n                        <include name=\"System.Xml.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 2.0 specific assemblies -->\n                        <include name=\"extensions/net/2.0/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(sdkInstallRoot, 'bin')}\"\n                            if=\"${property::exists('sdkInstallRoot')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v3.5')}\" />\n                        <directory name=\"${path::combine(installRoot, 'v2.0.50727')}\" />\n                        <directory name=\"${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/2.0.31005.0\" />\n                    </tool-paths>\n                    <project>\n                        <readregistry\n                            property=\"installRoot\"\n                            key=\"SOFTWARE\\Microsoft\\.NETFramework\\InstallRoot\"\n                            hive=\"LocalMachine\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A\\WinSDKNetFxTools\\InstallationFolder\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                        <readregistry\n                            property=\"sdkInstallRoot\"\n                            key=\"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1\\WinSDKNetFxTools\\InstallationFolder\"\n                            hive=\"LocalMachine\"\n                            failonerror=\"false\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"noconfig\">true</attribute>\n                            <attribute name=\"nostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"nostdlib\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportsnostdlib\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportsplatform\">true</attribute>\n                            <attribute name=\"supportswarnaserrorlist\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"supportsplatform\">true</attribute>\n                        </task>\n                        <task name=\"vjc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"exename\">lc</attribute>\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"mono-1.0\"\n                    family=\"mono\"\n                    version=\"1.0\"\n                    description=\"Mono 1.0 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\"\n                    clrversion=\"1.1.4322\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/1.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/1.1\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${runtimeEngine}\" />\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </auto>\n                            <strict>\n                                <engine program=\"${runtimeEngine}\">\n                                    <arg value=\"--runtime=v1.1.4322\" />\n                                </engine>\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 1.0 specific assemblies -->\n                        <include name=\"extensions/mono/1.0/**/*.dll\" />\n                        <!-- include .NET 1.1 specific assemblies -->\n                        <include name=\"extensions/common/1.1/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${sdkInstallRoot}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <!-- quick and dirty check to see if pkg-config is available (and configured) -->\n                        <property name=\"pkgconfig.available\" value=\"${environment::variable-exists('PKG_CONFIG_PATH')}\" />\n                        <if test=\"${pkgconfig.available}\">\n                            <if test=\"${pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-pkg-config\" />\n                            </if>\n                            <if test=\"${not pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-registry\" />\n                            </if>\n                        </if>\n                        <if test=\"${not pkgconfig.available}\">\n                            <call target=\"configure-from-registry\" />\n                        </if>\n\n                        <!-- determine if we're dealing with a Mono 1.0.x release -->\n                        <if test=\"${version::parse(mono.version) &lt; version::parse('1.1')}\">\n                            <!-- \n                                in Mono 1.0.x, the framework tools are located \n                                in the <install root>\\lib directory\n                            -->\n                            <property name=\"toolDirectory\" value=\"${frameworkAssemblyDirectory}\" />\n                            <property name=\"runtimeEngine\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono.exe')}\" />\n                            <property name=\"resgen.tool\" value=\"monoresgen\" />\n                            <!-- in Mono 1.0.x, only mcs and mbas are located in <install root>\\lib\\mono\\<profile> -->\n                            <property name=\"csc.tool\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0/mcs.exe')}\" />\n                            <property name=\"mbas.tool\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0/mbas.exe')}\" />\n                            <!-- /doc is not supported in Mono 1.0.x -->\n                            <property name=\"csc.supportsdocgeneration\" value=\"false\" />\n\n                            <!-- \n                                Mono 1.0.1 installer incorrectly adds '\\mono' to \n                                \"MonoConfigDir\" registry value\n                            -->\n                            <if test=\"${string::ends-with(configDir, 'etc\\mono')}\">\n                                <property name=\"configDir\" value=\"${string::replace(configDir, 'etc\\mono', 'etc')}\" />\n                            </if>\n                        </if>\n\n                        <!-- determine if we're dealing with a Mono 1.1.x release or higher -->\n                        <if test=\"${version::parse(mono.version) >= version::parse('1.1')}\">\n                            <!-- \n                                in Mono 1.1.x (and higher ?), the framework tools \n                                are located in the <install root>\\lib\\mono\\<profile>\n                                directory\n                            -->\n                            <property name=\"toolDirectory\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\" />\n                            <property name=\"runtimeEngine\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono.exe')}\" />\n                            <!-- starting from Mono 1.1.9.2, mono.exe is located in the bin directory -->\n                            <if test=\"${not file::exists(runtimeEngine)}\">\n                                <property name=\"runtimeEngine\" value=\"${path::combine(sdkInstallRoot, 'bin/mono.exe')}\" />\n                            </if>\n                            <property name=\"resgen.tool\" value=\"resgen\" />\n                            <property name=\"csc.tool\" value=\"mcs\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"true\" />\n                            <property name=\"mbas.tool\" value=\"mbas\" />\n                        </if>\n\n                        <target name=\"configure-from-pkg-config\">\n                            <property name=\"mono.version\" value=\"${pkg-config::get-mod-version('mono')}\" />\n                            <property name=\"sdkInstallRoot\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}\" />\n                            <property name=\"frameworkAssemblyDirectory\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}\" />\n                            <property name=\"configDir\" value=\"${path::combine(sdkInstallRoot, 'etc')}/\" />\n                        </target>\n\n                        <target name=\"configure-from-registry\">\n                            <!-- \n                                first try using the DefaultCLR in HKLM\\Novell\\Mono, \n                                this is used by the Mono 1.0.1 installer (and later?)\n                            -->\n                            <readregistry\n                                property=\"mono.version\"\n                                key=\"SOFTWARE\\Novell\\Mono\\DefaultCLR\"\n                                hive=\"LocalMachine\" \n                                failonerror=\"false\" \n                            />\n                        \n                            <if test=\"${property::exists('mono.version')}\">\n                                <property name=\"monokey\" value=\"SOFTWARE\\Novell\\Mono\\${mono.version}\" />\n                            </if>\n                        \n                            <!-- \n                                if the DefaultCLR registry value does not exist in \n                                HKLM\\Novell\\Mono, then try the HKML\\Mono registry \n                                key as this was used for the Mono 1.0 installer\n                            -->\n                            <if test=\"${not property::exists('mono.version')}\">\n                                <readregistry\n                                    property=\"mono.version\"\n                                    key=\"SOFTWARE\\Mono\\DefaultCLR\"\n                                    hive=\"LocalMachine\" \n                                />\n                                <property name=\"monokey\" value=\"SOFTWARE\\Mono\\${mono.version}\" />\n                            </if>\n\n                            <readregistry\n                                property=\"sdkInstallRoot\"\n                                key=\"${monokey}\\SdkInstallRoot\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"frameworkAssemblyDirectory\"\n                                key=\"${monokey}\\FrameworkAssemblyDirectory\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"configDir\"\n                                key=\"${monokey}\\MonoConfigDir\"\n                                hive=\"LocalMachine\" />\n                        </target>\n                    </project>\n                    <properties>\n                    </properties>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">${csc.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">${csc.supportsdocgeneration}</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">${mbas.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"exename\">${resgen.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"mono-2.0\"\n                    family=\"mono\"\n                    version=\"2.0\"\n                    description=\"Mono 2.0 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/2.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${runtimeEngine}\" />\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </auto>\n                            <strict>\n                                <engine program=\"${runtimeEngine}\">\n                                    <arg value=\"--runtime=v2.0.50727\" />\n                                </engine>\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 2.0 specific assemblies -->\n                        <include name=\"extensions/mono/2.0/**/*.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\" />\n                        <!-- for compatibility with Mono 1.0.x -->\n                        <directory name=\"${frameworkAssemblyDirectory}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${sdkInstallRoot}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <!-- quick and dirty check to see if pkg-config is available (and configured) -->\n                        <property name=\"pkgconfig.available\" value=\"${environment::variable-exists('PKG_CONFIG_PATH')}\" />\n                        <if test=\"${pkgconfig.available}\">\n                            <if test=\"${pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-pkg-config\" />\n                            </if>\n                            <if test=\"${not pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-registry\" />\n                            </if>\n                        </if>\n                        <if test=\"${not pkgconfig.available}\">\n                            <call target=\"configure-from-registry\" />\n                        </if>\n\n                        <property name=\"resgen.supportsexternalfilereferences\" value=\"false\" />\n\n                        <!-- determine if we're dealing with a Mono 1.0.x release -->\n                        <if test=\"${version::parse(mono.version) &lt; version::parse('1.1')}\">\n                            <!-- \n                                in Mono 1.0.x, the framework tools are located \n                                in the <install root>\\lib directory, except for\n                                mbas and mcs\n                            -->\n                            <property name=\"toolDirectory\" value=\"${frameworkAssemblyDirectory}\" />\n                            <property name=\"runtimeEngine\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono.exe')}\" />\n                            <property name=\"resgen.tool\" value=\"monoresgen\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"false\" />\n\n                            <!-- \n                                Mono 1.0.1 installer incorrectly adds '\\mono' to \n                                \"MonoConfigDir\" registry value\n                            -->\n                            <if test=\"${string::ends-with(configDir, 'etc\\mono')}\">\n                                <property name=\"configDir\" value=\"${string::replace(configDir, 'etc\\mono', 'etc')}\" />\n                            </if>\n                        </if>\n\n                        <!-- determine if we're dealing with a Mono 1.1.x release or higher -->\n                        <if test=\"${version::parse(mono.version) >= version::parse('1.1')}\">\n                            <property name=\"toolDirectory\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\" />\n                            <property name=\"runtimeEngine\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono.exe')}\" />\n                            <!-- starting from Mono 1.1.9.2, mono.exe is located in the bin directory -->\n                            <if test=\"${not file::exists(runtimeEngine)}\">\n                                <property name=\"runtimeEngine\" value=\"${path::combine(sdkInstallRoot, 'bin/mono.exe')}\" />\n                            </if>\n                            <property name=\"csc.supportsdocgeneration\" value=\"true\" />\n                        </if>\n                        <!-- as from Mono 1.2.3.50, resgen supports the /usesourcepath option -->\n                        <if test=\"${version::parse(mono.version) >= version::parse('1.2.3.50')}\">\n                            <property name=\"resgen.supportsexternalfilereferences\" value=\"true\" />\n                        </if>\n\n                        <target name=\"configure-from-pkg-config\">\n                            <property name=\"mono.version\" value=\"${pkg-config::get-mod-version('mono')}\" />\n                            <property name=\"sdkInstallRoot\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}\" />\n                            <property name=\"frameworkAssemblyDirectory\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}\" />\n                            <property name=\"configDir\" value=\"${path::combine(sdkInstallRoot, 'etc')}/\" />\n                        </target>\n\n                        <target name=\"configure-from-registry\">\n                            <readregistry\n                                property=\"mono.version\"\n                                key=\"SOFTWARE\\Novell\\Mono\\DefaultCLR\"\n                                hive=\"LocalMachine\" \n                            />\n                            <property name=\"monokey\" value=\"SOFTWARE\\Novell\\Mono\\${mono.version}\" />\n\n                            <readregistry\n                                property=\"sdkInstallRoot\"\n                                key=\"${monokey}\\SdkInstallRoot\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"frameworkAssemblyDirectory\"\n                                key=\"${monokey}\\FrameworkAssemblyDirectory\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"configDir\"\n                                key=\"${monokey}\\MonoConfigDir\"\n                                hive=\"LocalMachine\" />\n                        </target>\n                    </project>\n                    <properties>\n                    </properties>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">gmcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">${csc.supportsdocgeneration}</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">strict</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">vbnc</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"exename\">${resgen.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">${resgen.supportsexternalfilereferences}</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"mono-3.5\"\n                    family=\"mono\"\n                    version=\"3.5\"\n                    description=\"Mono 3.5 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/2.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${runtimeEngine}\" />\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </auto>\n                            <strict>\n                                <engine program=\"${runtimeEngine}\">\n                                    <arg value=\"--runtime=v2.0.50727\" />\n                                </engine>\n                                <environment>\n                                    <variable name=\"PATH\" path=\"${path::combine(sdkInstallRoot, 'bin')};%PATH%\" />\n                                    <variable name=\"MONO_CFG_DIR\" path=\"${configDir};%MONO_CFG_DIR%\" />\n                                </environment>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'mono/3.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 2.0 specific assemblies -->\n                        <include name=\"extensions/mono/2.0/**/*.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}\" />\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\" />\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${sdkInstallRoot}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <!-- quick and dirty check to see if pkg-config is available (and configured) -->\n                        <property name=\"pkgconfig.available\" value=\"${environment::variable-exists('PKG_CONFIG_PATH')}\" />\n                        <if test=\"${pkgconfig.available}\">\n                            <if test=\"${pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-pkg-config\" />\n                            </if>\n                            <if test=\"${not pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-registry\" />\n                            </if>\n                        </if>\n                        <if test=\"${not pkgconfig.available}\">\n                            <call target=\"configure-from-registry\" />\n                        </if>\n\n                        <property name=\"toolDirectory\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}\" />\n                        <property name=\"runtimeEngine\" value=\"${path::combine(sdkInstallRoot, 'bin/mono.exe')}\" />\n\n                        <target name=\"configure-from-pkg-config\">\n                            <property name=\"mono.version\" value=\"${pkg-config::get-mod-version('mono')}\" />\n                            <property name=\"sdkInstallRoot\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}\" />\n                            <property name=\"frameworkAssemblyDirectory\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}\" />\n                            <property name=\"configDir\" value=\"${path::combine(sdkInstallRoot, 'etc')}/\" />\n                        </target>\n\n                        <target name=\"configure-from-registry\">\n                            <readregistry\n                                property=\"mono.version\"\n                                key=\"SOFTWARE\\Novell\\Mono\\DefaultCLR\"\n                                hive=\"LocalMachine\" \n                            />\n                            <property name=\"monokey\" value=\"SOFTWARE\\Novell\\Mono\\${mono.version}\" />\n                           \n                            <readregistry\n                                property=\"sdkInstallRoot\"\n                                key=\"${monokey}\\SdkInstallRoot\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"frameworkAssemblyDirectory\"\n                                key=\"${monokey}\\FrameworkAssemblyDirectory\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"configDir\"\n                                key=\"${monokey}\\MonoConfigDir\"\n                                hive=\"LocalMachine\" />\n                        </target>\n                    </project>\n                    <properties>\n                    </properties>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">gmcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"langversion\">linq</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">strict</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">vbnc</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"moonlight-2.0\" \n                    family=\"moonlight\"\n                    version=\"2.0\"\n                    description=\"Moonlight 2.0\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${toolDirectory}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Browser\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <modes>\n                            <auto>\n                                <engine program=\"${runtimeEngine}\">\n                                    <arg value=\"--runtime=moonlight\" />\n                                    <arg value=\"--security=temporary-smcs-hack\" />\n                                </engine>\n                            </auto>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(frameworkAssemblyDirectory, 'lib/mono/2.1')}\">\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"System.Core.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Net.dll\" />\n                        <include name=\"System.Runtime.Serialization.dll\" />\n                        <include name=\"System.ServiceModel.dll\" />\n                        <include name=\"System.ServiceModel.Web.dll\" />\n                        <include name=\"System.Windows.Browser.dll\" />\n                        <include name=\"System.Windows.dll\" />\n                        <include name=\"System.Xml.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 2.0 specific assemblies -->\n                        <include name=\"extensions/net/2.0/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}\" />\n                        <directory name=\"${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${sdkInstallRoot}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <!-- quick and dirty check to see if pkg-config is available (and configured) -->\n                        <property name=\"pkgconfig.available\" value=\"${environment::variable-exists('PKG_CONFIG_PATH')}\" />\n                        <if test=\"${pkgconfig.available}\">\n                            <if test=\"${pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-pkg-config\" />\n                            </if>\n                            <if test=\"${not pkg-config::exists('mono')}\">\n                                <call target=\"configure-from-registry\" />\n                            </if>\n                        </if>\n                        <if test=\"${not pkgconfig.available}\">\n                            <call target=\"configure-from-registry\" />\n                        </if>\n\n                        <property name=\"toolDirectory\" value=\"${path::combine(frameworkAssemblyDirectory, 'mono/2.1')}\" />\n                        <property name=\"runtimeEngine\" value=\"${path::combine(sdkInstallRoot, 'bin/mono.exe')}\" />\n\n                        <target name=\"configure-from-pkg-config\">\n                            <property name=\"mono.version\" value=\"${pkg-config::get-mod-version('mono')}\" />\n                            <property name=\"sdkInstallRoot\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}\" />\n                            <property name=\"frameworkAssemblyDirectory\" value=\"${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}\" />\n                            <property name=\"configDir\" value=\"${path::combine(sdkInstallRoot, 'etc')}/\" />\n                        </target>\n\n                        <target name=\"configure-from-registry\">\n                            <readregistry\n                                property=\"mono.version\"\n                                key=\"SOFTWARE\\Novell\\Mono\\DefaultCLR\"\n                                hive=\"LocalMachine\" \n                            />\n                            <property name=\"monokey\" value=\"SOFTWARE\\Novell\\Mono\\${mono.version}\" />\n                           \n                            <readregistry\n                                property=\"sdkInstallRoot\"\n                                key=\"${monokey}\\SdkInstallRoot\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"frameworkAssemblyDirectory\"\n                                key=\"${monokey}\\FrameworkAssemblyDirectory\"\n                                hive=\"LocalMachine\" />\n                            <readregistry\n                                property=\"configDir\"\n                                key=\"${monokey}\\MonoConfigDir\"\n                                hive=\"LocalMachine\" />\n                        </target>\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">smcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework \n                    name=\"sscli-1.0\"\n                    family=\"sscli\"\n                    version=\"1.0\"\n                    description=\"Microsoft Shared Source CLI 1.0\"\n                    sdkdirectory=\"C:\\sscli\\build\\v1.x86fstchk.rotor\\sdk\\bin\"\n                    frameworkdirectory=\"C:\\sscli\\build\\v1.x86fstchk.rotor\"\n                    frameworkassemblydirectory=\"C:\\sscli\\build\\v1.x86fstchk.rotor\"\n                    clrversion=\"1.0.3\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Microsoft\"\n                    >\n                    <runtime>\n                        <modes>\n                            <auto>\n                                <engine program=\"C:\\sscli\\build\\v1.x86fstchk.rotor\\clix.exe\" />\n                            </auto>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"C:\\sscli\\build\\v1.x86fstchk.rotor\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- this is not a supported runtime framework -->\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"C:\\sscli\\build\\v1.x86fstchk.rotor\\sdk\\bin\" />\n                        <directory name=\"C:\\sscli\\build\\v1.x86fstchk.rotor\" />\n                    </tool-paths>\n                    <project />\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"ildasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n            </platform>\n            <platform name=\"unix\" default=\"auto\">\n                <task-assemblies>\n                        <!-- include NAnt task assemblies -->\n                        <include name=\"*Tasks.dll\" />\n                        <!-- include NAnt test assemblies -->\n                        <include name=\"*Tests.dll\" />\n                        <!-- include framework-neutral assemblies -->\n                        <include name=\"extensions/common/neutral/**/*.dll\" />\n                        <!-- exclude Microsoft.NET specific task assembly -->\n                        <exclude name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- exclude Microsoft.NET specific test assembly -->\n                        <exclude name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- exclude win32 specific task assembly -->\n                        <exclude name=\"NAnt.Win32Tasks.dll\" />\n                        <!-- exclude win32 specific test assembly -->\n                        <exclude name=\"NAnt.Win32.Tests.dll\" />\n                </task-assemblies>\n                <framework \n                    name=\"mono-1.0\"\n                    family=\"mono\"\n                    version=\"1.0\"\n                    description=\"Mono 1.0 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(prefix, 'lib/mono/1.0')}\"\n                    clrversion=\"1.1.4322\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/1.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/1.1\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\" />\n                            </auto>\n                            <strict>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\">\n                                    <arg value=\"--runtime=v1.1.4322\" />\n                                </engine>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/1.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 1.0 specific assemblies -->\n                        <include name=\"extensions/mono/1.0/**/*.dll\" />\n                        <!-- include .NET 1.1 specific assemblies -->\n                        <include name=\"extensions/common/1.1/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${prefix}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <if test=\"${not pkg-config::exists('mono')}\">\n                            <fail>Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.</fail>\n                        </if>\n                        <property name=\"prefix\" value=\"${pkg-config::get-variable('mono', 'prefix')}\" />\n                        <if test=\"${not(pkg-config::is-atleast-version('mono', '1.1'))}\">\n                            <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'bin')}\" />\n                            <property name=\"resgen.tool\" value=\"monoresgen\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"false\" />\n                        </if>\n                        <if test=\"${pkg-config::is-atleast-version('mono', '1.1')}\">\n                            <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'lib/mono/1.0')}\" />\n                            <property name=\"resgen.tool\" value=\"resgen\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"true\" />\n                        </if>\n                    </project>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">${path::combine(prefix, 'lib/mono/1.0/mcs.exe')}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">${csc.supportsdocgeneration}</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">${path::combine(prefix, 'lib/mono/1.0/mbas.exe')}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"exename\">${resgen.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"mono-2.0\"\n                    family=\"mono\"\n                    version=\"2.0\"\n                    description=\"Mono 2.0 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(prefix, 'lib/mono/2.0')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/2.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\" />\n                            </auto>\n                            <strict>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\">\n                                    <arg value=\"--runtime=v2.0.50727\" />\n                                </engine>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/2.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 2.0 specific assemblies -->\n                        <include name=\"extensions/mono/2.0/**/*.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <directory name=\"${path::combine(prefix, 'lib/mono/1.0')}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${prefix}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <if test=\"${not pkg-config::exists('mono')}\">\n                            <fail>Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.</fail>\n                        </if>\n                        <property name=\"resgen.supportsexternalfilereferences\" value=\"false\" />\n                        <property name=\"prefix\" value=\"${pkg-config::get-variable('mono', 'prefix')}\" />\n                        <if test=\"${not(pkg-config::is-atleast-version('mono', '1.1'))}\">\n                            <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'bin')}\" />\n                            <property name=\"resgen.tool\" value=\"monoresgen\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"false\" />\n                        </if>\n                        <if test=\"${pkg-config::is-atleast-version('mono', '1.1')}\">\n                            <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'lib/mono/2.0')}\" />\n                            <property name=\"resgen.tool\" value=\"resgen\" />\n                            <property name=\"csc.supportsdocgeneration\" value=\"true\" />\n                        </if>\n                        <!-- as from Mono 1.2.3.50, resgen supports the /usesourcepath option -->\n                        <if test=\"${pkg-config::is-atleast-version('mono', '1.2.3.50')}\">\n                            <property name=\"resgen.supportsexternalfilereferences\" value=\"true\" />\n                        </if>\n                    </project>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">gmcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">${csc.supportsdocgeneration}</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">strict</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">vbnc</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"exename\">${resgen.tool}</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">${resgen.supportsexternalfilereferences}</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"mono-3.5\"\n                    family=\"mono\"\n                    version=\"3.5\"\n                    description=\"Mono 3.5 Profile\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${path::combine(prefix, 'lib/mono/2.0')}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Desktop\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <probing-paths>\n                            <directory name=\"lib/mono/2.0\" />\n                            <directory name=\"lib/mono/neutral\" />\n                            <directory name=\"lib/common/2.0\" />\n                            <directory name=\"lib/common/neutral\" />\n                        </probing-paths>\n                        <modes>\n                            <auto>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\" />\n                            </auto>\n                            <strict>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\">\n                                    <arg value=\"--runtime=v2.0.50727\" />\n                                </engine>\n                            </strict>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/3.5')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/3.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/2.0')}\">\n                        <include name=\"*.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include Mono version-neutral assemblies -->\n                        <include name=\"extensions/mono/neutral/**/*.dll\" />\n                        <!-- include Mono 2.0 specific assemblies -->\n                        <include name=\"extensions/mono/2.0/**/*.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <directory name=\"${path::combine(prefix, 'lib/mono/2.0')}\" />\n                        <directory name=\"${path::combine(prefix, 'lib/mono/1.0')}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${prefix}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <if test=\"${not pkg-config::exists('mono')}\">\n                            <fail>Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.</fail>\n                        </if>\n                        <property name=\"resgen.supportsexternalfilereferences\" value=\"false\" />\n                        <property name=\"prefix\" value=\"${pkg-config::get-variable('mono', 'prefix')}\" />\n                        <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'lib/mono/3.5')}\" />\n                    </project>\n                    <tasks>\n                        <task name=\"al\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">gmcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"langversion\">linq</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"jsc\">\n                            <attribute name=\"exename\">mjs</attribute>\n                            <attribute name=\"managed\">strict</attribute>\n                        </task>\n                        <task name=\"vbc\">\n                            <attribute name=\"exename\">vbnc</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                        <task name=\"ilasm\">\n                            <attribute name=\"managed\">true</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n                <framework\n                    name=\"moonlight-2.0\" \n                    family=\"moonlight\" \n                    version=\"2.0\"\n                    description=\"Moonlight 2.0\"\n                    sdkdirectory=\"${toolDirectory}\"\n                    frameworkdirectory=\"${toolDirectory}\"\n                    frameworkassemblydirectory=\"${toolDirectory}\"\n                    clrversion=\"2.0.50727\"\n                    clrtype=\"Browser\"\n                    vendor=\"Mono\"\n                    >\n                    <runtime>\n                        <modes>\n                            <auto>\n                                <engine program=\"${path::combine(prefix, 'bin/mono')}\">\n                                    <arg value=\"--runtime=moonlight\" />\n                                    <arg value=\"--security=temporary-smcs-hack\" />\n                                </engine>\n                            </auto>\n                        </modes>\n                    </runtime>\n                    <reference-assemblies basedir=\"${path::combine(prefix, 'lib/mono/2.1')}\">\n                        <include name=\"Microsoft.VisualBasic.dll\" />\n                        <include name=\"mscorlib.dll\" />\n                        <include name=\"System.Core.dll\" />\n                        <include name=\"System.dll\" />\n                        <include name=\"System.Net.dll\" />\n                        <include name=\"System.Runtime.Serialization.dll\" />\n                        <include name=\"System.ServiceModel.dll\" />\n                        <include name=\"System.ServiceModel.Web.dll\" />\n                        <include name=\"System.Windows.Browser.dll\" />\n                        <include name=\"System.Windows.dll\" />\n                        <include name=\"System.Xml.dll\" />\n                    </reference-assemblies>\n                    <task-assemblies>\n                        <!-- include MS.NET version-neutral assemblies -->\n                        <include name=\"extensions/net/neutral/**/*.dll\" />\n                        <!-- include MS.NET 2.0 specific assemblies -->\n                        <include name=\"extensions/net/2.0/**/*.dll\" />\n                        <!-- include MS.NET specific task assembly -->\n                        <include name=\"NAnt.MSNetTasks.dll\" />\n                        <!-- include MS.NET specific test assembly -->\n                        <include name=\"NAnt.MSNet.Tests.dll\" />\n                        <!-- include .NET 2.0 specific assemblies -->\n                        <include name=\"extensions/common/2.0/**/*.dll\" />\n                    </task-assemblies>\n                    <tool-paths>\n                        <directory name=\"${toolDirectory}\" />\n                        <directory name=\"${path::combine(prefix, 'lib/mono/2.0')}\" />\n                        <directory name=\"${path::combine(prefix, 'lib/mono/1.0')}\" />\n                        <!-- unmanaged tools -->\n                        <directory name=\"${prefix}/bin\" />\n                    </tool-paths>\n                    <project>\n                        <if test=\"${not pkg-config::exists('mono')}\">\n                            <fail>Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.</fail>\n                        </if>\n                        <property name=\"prefix\" value=\"${pkg-config::get-variable('mono', 'prefix')}\" />\n                        <property name=\"toolDirectory\" value=\"${path::combine(prefix, 'lib/mono/2.1')}\" />\n                    </project>\n                    <tasks>\n                        <task name=\"csc\">\n                            <attribute name=\"exename\">smcs</attribute>\n                            <attribute name=\"managed\">true</attribute>\n                            <attribute name=\"supportspackagereferences\">true</attribute>\n                            <attribute name=\"supportsnowarnlist\">true</attribute>\n                            <attribute name=\"supportsdocgeneration\">true</attribute>\n                            <attribute name=\"supportskeycontainer\">true</attribute>\n                            <attribute name=\"supportskeyfile\">true</attribute>\n                            <attribute name=\"supportsdelaysign\">true</attribute>\n                            <attribute name=\"supportslangversion\">true</attribute>\n                        </task>\n                        <task name=\"resgen\">\n                            <attribute name=\"supportsassemblyreferences\">true</attribute>\n                            <attribute name=\"supportsexternalfilereferences\">true</attribute>\n                        </task>\n                        <task name=\"delay-sign\">\n                            <attribute name=\"exename\">sn</attribute>\n                        </task>\n                        <task name=\"license\">\n                            <attribute name=\"hascommandlinecompiler\">false</attribute>\n                        </task>\n                    </tasks>\n                </framework>\n            </platform>\n        </frameworks>\n        <properties>\n            <!-- properties defined here are accessible to all build files -->\n            <!-- <property name=\"foo\" value = \"bar\" readonly=\"false\" /> -->\n        </properties>\n    </nant>\n    <!--\n        This section contains the log4net configuration settings.\n\n        By default, no messages will be logged to the log4net logging infrastructure.\n\n        To enable the internal logging, set the threshold attribute on the log4net element\n        to \"ALL\".\n\n        When internal logging is enabled, internal messages will be written to the \n        console.\n    -->\n    <log4net threshold=\"OFF\">\n        <appender name=\"ConsoleAppender\" type=\"log4net.Appender.ConsoleAppender\">\n            <layout type=\"log4net.Layout.PatternLayout\">\n                <param name=\"ConversionPattern\" value=\"[%c{2}:%m  - [%x] &lt;%X{auth}&gt;]%n\" />\n            </layout>\n        </appender>\n        <appender name=\"RollingLogFileAppender\" type=\"log4net.Appender.RollingFileAppender\">\n            <param name=\"File\" value=\"${APPDATA}\\\\NAnt\\\\NAnt.log\" />\n            <param name=\"AppendToFile\" value=\"true\" />\n            <param name=\"MaxSizeRollBackups\" value=\"2\" />\n            <param name=\"MaximumFileSize\" value=\"500KB\" />\n            <param name=\"RollingStyle\" value=\"Size\" />\n            <param name=\"StaticLogFileName\" value=\"true\" />\n            <layout type=\"log4net.Layout.PatternLayout\">\n                <param name=\"ConversionPattern\" value=\"[%c{2}:%m  - [%x] &lt;%X{auth}&gt;]%n\" />\n            </layout>\n        </appender>\n        <!-- Setup the root category, add the appenders and set the default level -->\n        <root>\n            <!-- Only log messages with severity ERROR (or higher) -->\n            <level value=\"ERROR\" />\n            <!-- Log messages to the console -->\n            <appender-ref ref=\"ConsoleAppender\" />\n            <!-- Uncomment the next line to enable logging messages to the NAnt.log file -->\n            <!-- <appender-ref ref=\"RollingLogFileAppender\" /> -->\n        </root>\n        <!-- Specify the priority for some specific categories -->\n        <!--\n        <logger name=\"NAnt.Core.TaskBuilderCollection\">\n            <level value=\"DEBUG\" />\n        </logger>\n        <logger name=\"NAnt\">\n            <level value=\"INFO\" />\n        </logger>\n        -->\n    </log4net>\n    <runtime>\n        <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n            <probing privatePath=\"lib\" />\n        </assemblyBinding>\n    </runtime>\n    <startup>\n        <!-- .NET Framework 2.0 -->\n        <supportedRuntime version=\"v2.0.50727\" />\n        <!-- .NET Framework 1.1 -->\n        <supportedRuntime version=\"v1.1.4322\" />\n        <!-- .NET Framework 1.0 -->\n        <supportedRuntime version=\"v1.0.3705\" />\n    </startup>\n</configuration>\n"
  },
  {
    "path": "tools/nant/NAnt.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.Console.ConsoleStub\">\n            <summary>\n            Stub used to created <see cref=\"T:System.AppDomain\"/> and launch real <c>ConsoleDriver</c> \n            class in Core assembly.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Console.ConsoleStub.Main(System.String[])\">\n            <summary>\n            Entry point for executable\n            </summary>\n            <param name=\"args\">Command Line arguments</param>\n            <returns>The result of the real execution</returns>\n        </member>\n        <member name=\"M:NAnt.Console.ConsoleStub.ConstructPrivateBinPath(NAnt.Console.ConsoleStub.Framework,System.String)\">\n            <summary>\n            Constructs the privatebinpath.\n            </summary>\n            <remarks>\n              <para>\n              For the common version dir, we do not use the framework version\n              as defined in the NAnt configuration file but the CLR version\n              since the assemblies in that directory are not specific to a \n              certain family and the framwork version might differ between\n              families (eg. mono 1.0 == .NET 1.1).\n              </para>\n            </remarks>\n            <param name=\"runtimeFramework\">The runtime framework.</param>\n            <param name=\"baseDir\">The base directory of the domain.</param>\n            <returns>\n            The privatebinpath.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.Console.ConsoleStub.GetRelativePath(System.String,System.String)\">\n            <summary>\n            Given an absolute directory and an absolute file name, returns a \n            relative file name.\n            </summary>\n            <param name=\"basePath\">An absolute directory.</param>\n            <param name=\"absolutePath\">An absolute file name.</param>\n            <returns>\n            A relative file name for the given absolute file name.\n            </returns>\n        </member>\n        <member name=\"T:NAnt.Console.ConsoleStub.HelperArguments\">\n            <summary>\n            Helper class for invoking the application entry point in NAnt.Core\n            and passing the command-line arguments.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.Console.ConsoleStub.HelperArguments.#ctor(System.String[],System.String)\">\n            <summary>\n            Initializes a new instance of the <see cref=\"T:NAnt.Console.ConsoleStub.HelperArguments\"/>\n            class with the specified command-line arguments.\n            </summary>\n            <param name=\"args\">The commandline arguments passed to NAnt.exe.</param>\n            <param name=\"probePaths\">Directories relative to the base directory of the AppDomain to probe for missing assembly references.</param>\n        </member>\n        <member name=\"M:NAnt.Console.ConsoleStub.HelperArguments.CallConsoleRunner\">\n            <summary>\n            Invokes the application entry point in NAnt.Core.\n            </summary>\n        </member>\n        <member name=\"P:NAnt.Console.ConsoleStub.HelperArguments.ExitCode\">\n            <summary>\n            Gets the status that the build process returned when it exited.\n            </summary>\n            <value>\n            The code that the build process specified when it terminated.\n            </value>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nant/extensions/common/2.0/NAnt.MSBuild.xml",
    "content": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>NAnt.MSBuild</name>\n    </assembly>\n    <members>\n        <member name=\"T:NAnt.MSBuild.Functions.MSBuildFunctions\">\n            <summary>\n            Functions to return information for MSBuild system.\n            </summary>\n        </member>\n        <member name=\"M:NAnt.MSBuild.Functions.MSBuildFunctions.#ctor(NAnt.Core.Project,NAnt.Core.PropertyDictionary)\">\n            <exclude/>\n        </member>\n        <member name=\"M:NAnt.MSBuild.Functions.MSBuildFunctions.IsMsbuildProject(System.String)\">\n            <summary>\n            Test whether project is VS2005 project and could be built using &lt;msbuild&gt;\n            </summary>\n            <param name=\"project\">The name or path of the project file (csproj, vbproj, ...).</param>\n            <returns>\n            True, if it is msbuild project, False otherwise.\n            </returns>\n        </member>\n        <member name=\"M:NAnt.MSBuild.NAntLogger.Initialize(Microsoft.Build.Framework.IEventSource)\">\n            <summary>\n            Initialize is guaranteed to be called by MSBuild at the start of the build\n            before any events are raised.\n            </summary>\n        </member>\n        <member name=\"T:NAnt.VSNet.WhidbeySolution\">\n            <summary>\n            Analyses Microsoft Visual Studio .NET 2005 (Whidbey) solution files.\n            </summary>\n        </member>\n    </members>\n</doc>\n"
  },
  {
    "path": "tools/nunit/nunit-console.exe.config",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<configuration>\n\t<!--\n     Application settings for NUnit-console.exe. Do NOT put settings\n\t for use by your tests here.\n\t-->\n\t<appSettings>\n\t<!--\n\t Specify the location to be used by .NET for the cache\n\t-->\n    <add key=\"shadowfiles.path\" value=\"%temp%\\nunit20\\ShadowCopyCache\" /> \n\t</appSettings>\n\n  <!-- Set the level for tracing NUnit itself -->\n  <!-- 0=Off 1=Error 2=Warning 3=Info 4=Debug -->\n  <system.diagnostics>\n\t  <switches>\n      <add name=\"NTrace\" value=\"0\" />\n\t  </switches>\n\t</system.diagnostics>\n\n  <runtime>\n    <!-- We need this so test exceptions don't crash NUnit -->\n    <legacyUnhandledExceptionPolicy enabled=\"1\" />\n\n    <!-- Look for addins in the addins directory for now -->\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <probing privatePath=\"lib;addins\"/>\n   </assemblyBinding>\n\n   <!--\n    The following <assemblyBinding> section allows running nunit under \n    .NET 1.0 by redirecting assemblies. The appliesTo attribute\n    causes the section to be ignored except under .NET 1.0\n    on a machine with only the .NET version 1.0 runtime installed.\n    If application and its tests were built for .NET 1.1 you will\n    also need to redirect system assemblies in the test config file,\n    which controls loading of the tests.\n   -->\n   <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\"\n\t\t\tappliesTo=\"v1.0.3705\">\n\n      <dependentAssembly> \n        <assemblyIdentity name=\"System\" \n                          publicKeyToken=\"b77a5c561934e089\" \n                          culture=\"neutral\"/>\n        <bindingRedirect  oldVersion=\"1.0.5000.0\" \n                          newVersion=\"1.0.3300.0\"/>\n      </dependentAssembly>\n\n      <dependentAssembly> \n        <assemblyIdentity name=\"System.Data\" \n                          publicKeyToken=\"b77a5c561934e089\" \n                          culture=\"neutral\"/>\n        <bindingRedirect  oldVersion=\"1.0.5000.0\" \n                          newVersion=\"1.0.3300.0\"/>\n      </dependentAssembly>\n\n      <dependentAssembly> \n        <assemblyIdentity name=\"System.Drawing\" \n                          publicKeyToken=\"b03f5f7f11d50a3a\" \n                          culture=\"neutral\"/>\n        <bindingRedirect  oldVersion=\"1.0.5000.0\" \n                          newVersion=\"1.0.3300.0\"/>\n      </dependentAssembly>\n\n      <dependentAssembly> \n        <assemblyIdentity name=\"System.Windows.Forms\" \n                          publicKeyToken=\"b77a5c561934e089\" \n                          culture=\"neutral\"/>\n        <bindingRedirect  oldVersion=\"1.0.5000.0\" \n                          newVersion=\"1.0.3300.0\"/>\n      </dependentAssembly>\n\n      <dependentAssembly> \n        <assemblyIdentity name=\"System.Xml\" \n                          publicKeyToken=\"b77a5c561934e089\" \n                          culture=\"neutral\"/>\n        <bindingRedirect  oldVersion=\"1.0.5000.0\" \n                          newVersion=\"1.0.3300.0\"/>\n      </dependentAssembly>\n\n    </assemblyBinding>\n\n  </runtime>\n  \n</configuration>"
  },
  {
    "path": "version.txt",
    "content": "0.3.0.0"
  }
]